glx: flatten out getBufferAge a bit
more flattening to come 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:

committed by
Marge Bot

parent
1908794023
commit
476b4581d9
@@ -934,7 +934,6 @@ dri2CreateScreen(int screen, struct glx_display * priv, bool driver_name_is_infe
|
|||||||
psp->waitForSBC = NULL;
|
psp->waitForSBC = NULL;
|
||||||
psp->setSwapInterval = NULL;
|
psp->setSwapInterval = NULL;
|
||||||
psp->getSwapInterval = NULL;
|
psp->getSwapInterval = NULL;
|
||||||
psp->getBufferAge = NULL;
|
|
||||||
psp->bindTexImage = dri2_bind_tex_image;
|
psp->bindTexImage = dri2_bind_tex_image;
|
||||||
|
|
||||||
psp->getDrawableMSC = dri2DrawableGetMSC;
|
psp->getDrawableMSC = dri2DrawableGetMSC;
|
||||||
|
@@ -566,7 +566,9 @@ dri3_swap_buffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
|||||||
flags, NULL, 0, false);
|
flags, NULL, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
int
|
||||||
|
dri3_get_buffer_age(__GLXDRIdrawable *pdraw);
|
||||||
|
int
|
||||||
dri3_get_buffer_age(__GLXDRIdrawable *pdraw)
|
dri3_get_buffer_age(__GLXDRIdrawable *pdraw)
|
||||||
{
|
{
|
||||||
struct dri3_drawable *priv = (struct dri3_drawable *)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->copySubBuffer = dri3_copy_sub_buffer;
|
||||||
|
|
||||||
psp->getBufferAge = dri3_get_buffer_age;
|
|
||||||
|
|
||||||
if (dri2GalliumConfigQuerys(psc->driScreenRenderGPU, "glx_extension_override",
|
if (dri2GalliumConfigQuerys(psc->driScreenRenderGPU, "glx_extension_override",
|
||||||
&tmp) == 0)
|
&tmp) == 0)
|
||||||
__glXParseExtensionOverride(&psc->base, tmp);
|
__glXParseExtensionOverride(&psc->base, tmp);
|
||||||
|
@@ -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)
|
kopper_get_buffer_age(__GLXDRIdrawable *pdraw)
|
||||||
{
|
{
|
||||||
struct drisw_drawable *pdp = (struct drisw_drawable *) 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;
|
psp->copySubBuffer = drisw_copy_sub_buffer;
|
||||||
|
|
||||||
if (psc->kopper) {
|
if (psc->kopper) {
|
||||||
psp->getBufferAge = kopper_get_buffer_age;
|
|
||||||
psp->setSwapInterval = driswKopperSetSwapInterval;
|
psp->setSwapInterval = driswKopperSetSwapInterval;
|
||||||
psp->getSwapInterval = kopperGetSwapInterval;
|
psp->getSwapInterval = kopperGetSwapInterval;
|
||||||
psp->maxSwapInterval = 1;
|
psp->maxSwapInterval = 1;
|
||||||
|
@@ -202,6 +202,14 @@ DestroyDRIDrawable(Display *dpy, GLXDrawable drawable)
|
|||||||
#endif
|
#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.
|
* Get a drawable's attribute.
|
||||||
*
|
*
|
||||||
@@ -278,8 +286,10 @@ __glXGetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
|||||||
|
|
||||||
psc = pdraw->psc;
|
psc = pdraw->psc;
|
||||||
|
|
||||||
if (psc->driScreen->getBufferAge != NULL)
|
if (psc->display->driver == GLX_DRIVER_DRI3)
|
||||||
*value = psc->driScreen->getBufferAge(pdraw);
|
*value = dri3_get_buffer_age(pdraw);
|
||||||
|
else if (psc->display->driver == GLX_DRIVER_ZINK_YES)
|
||||||
|
*value = kopper_get_buffer_age(pdraw);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,6 @@ struct __GLXDRIscreenRec {
|
|||||||
int64_t *msc, int64_t *sbc);
|
int64_t *msc, int64_t *sbc);
|
||||||
int (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval);
|
int (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval);
|
||||||
int (*getSwapInterval)(__GLXDRIdrawable *pdraw);
|
int (*getSwapInterval)(__GLXDRIdrawable *pdraw);
|
||||||
int (*getBufferAge)(__GLXDRIdrawable *pdraw);
|
|
||||||
void (*bindTexImage)(__GLXDRIdrawable *pdraw, int buffer, const int *attribs);
|
void (*bindTexImage)(__GLXDRIdrawable *pdraw, int buffer, const int *attribs);
|
||||||
|
|
||||||
int maxSwapInterval;
|
int maxSwapInterval;
|
||||||
|
Reference in New Issue
Block a user