From 6b0f8973c990d6bbb3e6fd994d6eeee9b59f9ac2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 27 Jul 2023 08:24:48 -0400 Subject: [PATCH] kopper: move pixmap param for drawable creation to info struct no functional changes Reviewed-by: Adam Jackson Part-of: --- include/kopper_interface.h | 7 ++++++- src/egl/drivers/dri2/egl_dri2.c | 6 ++++-- src/gallium/frontends/dri/kopper.c | 4 ++-- src/glx/drisw_glx.c | 5 ++++- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/kopper_interface.h b/include/kopper_interface.h index 261d1222ec8..4c8dcc9b51a 100644 --- a/include/kopper_interface.h +++ b/include/kopper_interface.h @@ -39,6 +39,7 @@ typedef struct __DRIkopperExtensionRec __DRIkopperExtension; typedef struct __DRIkopperLoaderExtensionRec __DRIkopperLoaderExtension; +typedef struct __DRIkopperDrawableInfoRec __DRIkopperDrawableInfo; /** * This extension defines the core GL-atop-VK functionality. This is used by the @@ -48,6 +49,10 @@ typedef struct __DRIkopperLoaderExtensionRec __DRIkopperLoaderExtension; #define __DRI_KOPPER "DRI_Kopper" #define __DRI_KOPPER_VERSION 1 +struct __DRIkopperDrawableInfoRec { + int is_pixmap; +}; + struct __DRIkopperExtensionRec { __DRIextension base; @@ -60,7 +65,7 @@ struct __DRIkopperExtensionRec { __DRIdrawable *(*createNewDrawable)(__DRIscreen *screen, const __DRIconfig *config, void *loaderPrivate, - int pixmap); + __DRIkopperDrawableInfo *info); /* flags is a set of __DRI2_FLUSH_* flags */ int64_t (*swapBuffers)(__DRIdrawable *draw, uint32_t flush_flags); void (*setSwapInterval)(__DRIdrawable *drawable, int interval); diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index e326215e523..56680bd5d48 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1595,8 +1595,10 @@ dri2_create_drawable(struct dri2_egl_display *dri2_dpy, if (dri2_dpy->kopper) { dri2_surf->dri_drawable = dri2_dpy->kopper->createNewDrawable( dri2_dpy->dri_screen_render_gpu, config, loaderPrivate, - dri2_surf->base.Type == EGL_PBUFFER_BIT || - dri2_surf->base.Type == EGL_PIXMAP_BIT); + &(__DRIkopperDrawableInfo){ + .is_pixmap = dri2_surf->base.Type == EGL_PBUFFER_BIT || + dri2_surf->base.Type == EGL_PIXMAP_BIT, + }); } else { __DRIcreateNewDrawableFunc createNewDrawable; if (dri2_dpy->image_driver) diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index 514be0e3bcc..401e31112a5 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -893,13 +893,13 @@ static __DRIdrawable * kopperCreateNewDrawable(__DRIscreen *psp, const __DRIconfig *config, void *data, - int is_pixmap) + __DRIkopperDrawableInfo *info) { assert(data != NULL); struct dri_screen *screen = dri_screen(psp); struct dri_drawable *drawable = - screen->create_drawable(screen, &config->modes, is_pixmap, data); + screen->create_drawable(screen, &config->modes, info->is_pixmap, data); return opaque_dri_drawable(drawable); } diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 7dd41eb8746..7d9821cb0c5 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -726,7 +726,10 @@ driswCreateDrawable(struct glx_screen *base, XID xDrawable, /* Create a new drawable */ if (kopper) { pdp->driDrawable = - kopper->createNewDrawable(psc->driScreen, config->driConfig, pdp, !(type & GLX_WINDOW_BIT)); + kopper->createNewDrawable(psc->driScreen, config->driConfig, pdp, + &(__DRIkopperDrawableInfo){ + .is_pixmap = !(type & GLX_WINDOW_BIT), + }); pdp->swapInterval = dri_get_initial_swap_interval(psc->driScreen, psc->config); psc->kopper->setSwapInterval(pdp->driDrawable, pdp->swapInterval);