diff --git a/src/gallium/frontends/dri/dri_screen.c b/src/gallium/frontends/dri/dri_screen.c index 6235fd84ba6..1f1748896e5 100644 --- a/src/gallium/frontends/dri/dri_screen.c +++ b/src/gallium/frontends/dri/dri_screen.c @@ -646,16 +646,14 @@ dri_init_screen(struct dri_screen *screen, if (pscreen->caps.device_protected_context) screen->has_protected_context = true; screen->has_reset_status_query = pscreen->caps.device_reset_status_query; - + screen->has_multibuffer = has_multibuffer; #ifdef HAVE_LIBDRM - if (has_multibuffer) { - int dmabuf_caps = pscreen->caps.dmabuf; - if (dmabuf_caps & DRM_PRIME_CAP_IMPORT) - screen->dmabuf_import = true; - if (screen->dmabuf_import && dmabuf_caps & DRM_PRIME_CAP_EXPORT) - screen->has_dmabuf = true; - } + unsigned dmabuf_caps = pscreen->caps.dmabuf; + if (dmabuf_caps & DRM_PRIME_CAP_IMPORT) + screen->dmabuf_import = true; + if (screen->dmabuf_import && dmabuf_caps & DRM_PRIME_CAP_EXPORT) + screen->has_dmabuf = true; #endif return dri_fill_in_modes(screen); diff --git a/src/gallium/frontends/dri/dri_screen.h b/src/gallium/frontends/dri/dri_screen.h index bdb64ddf9dd..b01fcb46f48 100644 --- a/src/gallium/frontends/dri/dri_screen.h +++ b/src/gallium/frontends/dri/dri_screen.h @@ -92,6 +92,7 @@ struct dri_screen bool throttle; bool dmabuf_import; + bool has_multibuffer; struct st_config_options options; diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index 99916e231d7..9593064a6f6 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -158,7 +158,7 @@ kopper_get_pixmap_buffer(struct dri_drawable *drawable, #ifndef GLX_USE_APPLE drawable->image = loader_dri3_get_pixmap_buffer(conn, pixmap, screen, - fourcc, drawable->screen->dmabuf_import, &width, &height, drawable); + fourcc, drawable->screen->has_multibuffer, &width, &height, drawable); #else drawable->image = NULL; #endif