kopper: move pixmap param for drawable creation to info struct

no functional changes

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24075>
This commit is contained in:
Mike Blumenkrantz
2023-07-27 08:24:48 -04:00
committed by Marge Bot
parent 7100ef4566
commit 6b0f8973c9
4 changed files with 16 additions and 6 deletions

View File

@@ -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);

View File

@@ -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)

View File

@@ -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);
}

View File

@@ -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);