diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index e21c9302483..bb49d36a08b 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -934,7 +934,6 @@ dri2CreateScreen(int screen, struct glx_display * priv, bool driver_name_is_infe psp->waitForSBC = NULL; psp->setSwapInterval = NULL; psp->getSwapInterval = NULL; - psp->getBufferAge = NULL; psp->bindTexImage = dri2_bind_tex_image; psp->getDrawableMSC = dri2DrawableGetMSC; diff --git a/src/glx/dri3_glx.c b/src/glx/dri3_glx.c index 66890f6de7f..41c3ece3d0b 100644 --- a/src/glx/dri3_glx.c +++ b/src/glx/dri3_glx.c @@ -566,7 +566,9 @@ dri3_swap_buffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, flags, NULL, 0, false); } -static int +int +dri3_get_buffer_age(__GLXDRIdrawable *pdraw); +int dri3_get_buffer_age(__GLXDRIdrawable *pdraw) { struct dri3_drawable *priv = (struct dri3_drawable *)pdraw; @@ -813,8 +815,6 @@ dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_in psp->copySubBuffer = dri3_copy_sub_buffer; - psp->getBufferAge = dri3_get_buffer_age; - if (dri2GalliumConfigQuerys(psc->driScreenRenderGPU, "glx_extension_override", &tmp) == 0) __glXParseExtensionOverride(&psc->base, tmp); diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index b15a39aa40b..3f39fcd8801 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -489,7 +489,9 @@ drisw_bind_tex_image(__GLXDRIdrawable *base, } } -static int +int +kopper_get_buffer_age(__GLXDRIdrawable *pdraw); +int kopper_get_buffer_age(__GLXDRIdrawable *pdraw) { struct drisw_drawable *pdp = (struct drisw_drawable *) pdraw; @@ -885,7 +887,6 @@ driswCreateScreen(int screen, struct glx_display *priv, enum glx_driver glx_driv psp->copySubBuffer = drisw_copy_sub_buffer; if (psc->kopper) { - psp->getBufferAge = kopper_get_buffer_age; psp->setSwapInterval = driswKopperSetSwapInterval; psp->getSwapInterval = kopperGetSwapInterval; psp->maxSwapInterval = 1; diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index 9d16c0a581e..3e402dbe0be 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -202,6 +202,14 @@ DestroyDRIDrawable(Display *dpy, GLXDrawable drawable) #endif } +/* TODO: delete these after more refactoring */ +#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) +int +dri3_get_buffer_age(__GLXDRIdrawable *pdraw); +int +kopper_get_buffer_age(__GLXDRIdrawable *pdraw); +#endif + /** * Get a drawable's attribute. * @@ -278,8 +286,10 @@ __glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable, psc = pdraw->psc; - if (psc->driScreen->getBufferAge != NULL) - *value = psc->driScreen->getBufferAge(pdraw); + if (psc->display->driver == GLX_DRIVER_DRI3) + *value = dri3_get_buffer_age(pdraw); + else if (psc->display->driver == GLX_DRIVER_ZINK_YES) + *value = kopper_get_buffer_age(pdraw); return 1; } diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index dbb8ff54288..0a80d9ffffa 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -112,7 +112,6 @@ struct __GLXDRIscreenRec { int64_t *msc, int64_t *sbc); int (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval); int (*getSwapInterval)(__GLXDRIdrawable *pdraw); - int (*getBufferAge)(__GLXDRIdrawable *pdraw); void (*bindTexImage)(__GLXDRIdrawable *pdraw, int buffer, const int *attribs); int maxSwapInterval;