gallium: Do not call to pipe_loader_sw_probe_kms when not present
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17784>
This commit is contained in:
parent
34572042c7
commit
98fa0c3351
|
@ -157,6 +157,7 @@ bool
|
|||
pipe_loader_vk_probe_dri(struct pipe_loader_device **devs,
|
||||
const struct drisw_loader_funcs *drisw_lf);
|
||||
|
||||
#ifdef HAVE_PIPE_LOADER_KMS
|
||||
/**
|
||||
* Initialize a kms backed sw device given an fd.
|
||||
*
|
||||
|
@ -169,6 +170,7 @@ pipe_loader_vk_probe_dri(struct pipe_loader_device **devs,
|
|||
*/
|
||||
bool
|
||||
pipe_loader_sw_probe_kms(struct pipe_loader_device **devs, int fd);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Initialize a null sw device.
|
||||
|
|
|
@ -2528,10 +2528,12 @@ dri_swrast_kms_init_screen(__DRIscreen * sPriv)
|
|||
|
||||
sPriv->driverPrivate = (void *)screen;
|
||||
|
||||
#ifdef HAVE_PIPE_LOADER_KMS
|
||||
if (pipe_loader_sw_probe_kms(&screen->dev, screen->fd)) {
|
||||
pscreen = pipe_loader_create_screen(screen->dev);
|
||||
dri_init_options(screen);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!pscreen)
|
||||
goto release_pipe;
|
||||
|
|
|
@ -538,8 +538,10 @@ drisw_init_screen(__DRIscreen * sPriv)
|
|||
}
|
||||
|
||||
bool success = false;
|
||||
#ifdef HAVE_PIPE_LOADER_KMS
|
||||
if (screen->fd != -1)
|
||||
success = pipe_loader_sw_probe_kms(&screen->dev, screen->fd);
|
||||
#endif
|
||||
if (!success)
|
||||
success = pipe_loader_sw_probe_dri(&screen->dev, lf);
|
||||
if (success) {
|
||||
|
|
Loading…
Reference in New Issue