drisw: probe kms if fd is passed

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16949>
This commit is contained in:
Mike Blumenkrantz 2022-06-09 11:03:13 -04:00 committed by Marge Bot
parent 7a9617b869
commit c24d8ba316
1 changed files with 7 additions and 2 deletions

View File

@ -526,7 +526,7 @@ drisw_init_screen(__DRIscreen * sPriv)
return NULL;
screen->sPriv = sPriv;
screen->fd = -1;
screen->fd = sPriv->fd;
screen->swrast_no_present = debug_get_option_swrast_no_present();
@ -537,7 +537,12 @@ drisw_init_screen(__DRIscreen * sPriv)
lf = &drisw_shm_lf;
}
if (pipe_loader_sw_probe_dri(&screen->dev, lf)) {
bool success = false;
if (screen->fd != -1)
success = pipe_loader_sw_probe_kms(&screen->dev, screen->fd);
if (!success)
success = pipe_loader_sw_probe_dri(&screen->dev, lf);
if (success) {
pscreen = pipe_loader_create_screen(screen->dev);
dri_init_options(screen);
}