dri: guard dmabuf support by loader's dmabuf support

this is sort of already implicit through checks elsewhere

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30619>
This commit is contained in:
Mike Blumenkrantz
2024-08-01 08:49:53 -04:00
committed by Marge Bot
parent 764e17eb03
commit 140ebeaad4
3 changed files with 12 additions and 8 deletions
+9 -6
View File
@@ -618,7 +618,8 @@ dri_set_background_context(struct st_context *st,
const __DRIconfig **
dri_init_screen(struct dri_screen *screen,
struct pipe_screen *pscreen)
struct pipe_screen *pscreen,
bool has_multibuffer)
{
screen->base.screen = pscreen;
screen->base.get_egl_image = dri_get_egl_image;
@@ -650,11 +651,13 @@ dri_init_screen(struct dri_screen *screen,
#ifdef HAVE_LIBDRM
int dmabuf_caps = pscreen->get_param(pscreen, PIPE_CAP_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;
if (has_multibuffer) {
int dmabuf_caps = pscreen->get_param(pscreen, PIPE_CAP_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);
+2 -1
View File
@@ -207,7 +207,8 @@ dri_init_options(struct dri_screen *screen);
const __DRIconfig **
dri_init_screen(struct dri_screen *screen,
struct pipe_screen *pscreen);
struct pipe_screen *pscreen,
bool has_multibuffer);
void
dri_release_screen(struct dri_screen * screen);
+1 -1
View File
@@ -153,7 +153,7 @@ driCreateNewScreen3(int scrn, int fd,
dri_destroy_screen(screen);
return NULL;
}
*driver_configs = dri_init_screen(screen, pscreen);
*driver_configs = dri_init_screen(screen, pscreen, has_multibuffer);
if (*driver_configs == NULL) {
dri_destroy_screen(screen);
return NULL;