mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-26 12:28:12 +02:00
glx: delete __GLXDRIdisplay
this is useless now Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30375>
This commit is contained in:
parent
78abf0d145
commit
0d78711cfb
8 changed files with 112 additions and 121 deletions
|
|
@ -56,8 +56,6 @@
|
||||||
|
|
||||||
struct dri2_display
|
struct dri2_display
|
||||||
{
|
{
|
||||||
__GLXDRIdisplay base;
|
|
||||||
|
|
||||||
__glxHashTable *dri2Hash;
|
__glxHashTable *dri2Hash;
|
||||||
|
|
||||||
const __DRIextension *loader_extensions[5];
|
const __DRIextension *loader_extensions[5];
|
||||||
|
|
@ -148,11 +146,11 @@ dri2_unbind_context(struct glx_context *context)
|
||||||
|
|
||||||
static struct glx_context *
|
static struct glx_context *
|
||||||
dri2_create_context_attribs(struct glx_screen *base,
|
dri2_create_context_attribs(struct glx_screen *base,
|
||||||
struct glx_config *config_base,
|
struct glx_config *config_base,
|
||||||
struct glx_context *shareList,
|
struct glx_context *shareList,
|
||||||
unsigned num_attribs,
|
unsigned num_attribs,
|
||||||
const uint32_t *attribs,
|
const uint32_t *attribs,
|
||||||
unsigned *error)
|
unsigned *error)
|
||||||
{
|
{
|
||||||
struct glx_context *pcp = NULL;
|
struct glx_context *pcp = NULL;
|
||||||
struct dri2_screen *psc = (struct dri2_screen *) base;
|
struct dri2_screen *psc = (struct dri2_screen *) base;
|
||||||
|
|
@ -238,13 +236,13 @@ dri2_create_context_attribs(struct glx_screen *base,
|
||||||
|
|
||||||
pcp->driContext =
|
pcp->driContext =
|
||||||
psc->dri2->createContextAttribs(psc->driScreen,
|
psc->dri2->createContextAttribs(psc->driScreen,
|
||||||
dca.api,
|
dca.api,
|
||||||
config ? config->driConfig : NULL,
|
config ? config->driConfig : NULL,
|
||||||
shared,
|
shared,
|
||||||
num_ctx_attribs / 2,
|
num_ctx_attribs / 2,
|
||||||
ctx_attribs,
|
ctx_attribs,
|
||||||
error,
|
error,
|
||||||
pcp);
|
pcp);
|
||||||
|
|
||||||
*error = dri_context_error_to_glx_error(*error);
|
*error = dri_context_error_to_glx_error(*error);
|
||||||
|
|
||||||
|
|
@ -344,7 +342,7 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dri2DrawableGetMSC(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
|
dri2DrawableGetMSC(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
|
||||||
int64_t *ust, int64_t *msc, int64_t *sbc)
|
int64_t *ust, int64_t *msc, int64_t *sbc)
|
||||||
{
|
{
|
||||||
xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
|
xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
|
||||||
xcb_dri2_get_msc_cookie_t get_msc_cookie;
|
xcb_dri2_get_msc_cookie_t get_msc_cookie;
|
||||||
|
|
@ -366,7 +364,7 @@ dri2DrawableGetMSC(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dri2WaitForMSC(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
dri2WaitForMSC(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
||||||
int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc)
|
int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc)
|
||||||
{
|
{
|
||||||
xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
|
xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
|
||||||
xcb_dri2_wait_msc_cookie_t wait_msc_cookie;
|
xcb_dri2_wait_msc_cookie_t wait_msc_cookie;
|
||||||
|
|
@ -398,7 +396,7 @@ dri2WaitForMSC(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dri2WaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
|
dri2WaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
|
||||||
int64_t *msc, int64_t *sbc)
|
int64_t *msc, int64_t *sbc)
|
||||||
{
|
{
|
||||||
xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
|
xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
|
||||||
xcb_dri2_wait_sbc_cookie_t wait_sbc_cookie;
|
xcb_dri2_wait_sbc_cookie_t wait_sbc_cookie;
|
||||||
|
|
@ -439,8 +437,8 @@ dri2GetCurrentContext()
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
dri2Throttle(struct dri2_screen *psc,
|
dri2Throttle(struct dri2_screen *psc,
|
||||||
struct dri2_drawable *draw,
|
struct dri2_drawable *draw,
|
||||||
enum __DRI2throttleReason reason)
|
enum __DRI2throttleReason reason)
|
||||||
{
|
{
|
||||||
if (psc->throttle) {
|
if (psc->throttle) {
|
||||||
__DRIcontext *ctx = dri2GetCurrentContext();
|
__DRIcontext *ctx = dri2GetCurrentContext();
|
||||||
|
|
@ -477,8 +475,8 @@ dri2Flush(struct dri2_screen *psc,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
__dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y,
|
__dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
enum __DRI2throttleReason reason, Bool flush)
|
enum __DRI2throttleReason reason, Bool flush)
|
||||||
{
|
{
|
||||||
struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
|
struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
|
||||||
struct dri2_screen *psc = (struct dri2_screen *) pdraw->psc;
|
struct dri2_screen *psc = (struct dri2_screen *) pdraw->psc;
|
||||||
|
|
@ -510,17 +508,17 @@ __dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y,
|
||||||
*/
|
*/
|
||||||
if (priv->have_fake_front)
|
if (priv->have_fake_front)
|
||||||
DRI2CopyRegion(psc->base.dpy, pdraw->xDrawable, region,
|
DRI2CopyRegion(psc->base.dpy, pdraw->xDrawable, region,
|
||||||
DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
|
DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
|
||||||
|
|
||||||
XFixesDestroyRegion(psc->base.dpy, region);
|
XFixesDestroyRegion(psc->base.dpy, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y,
|
dri2CopySubBuffer(__GLXDRIdrawable *pdraw, int x, int y,
|
||||||
int width, int height, Bool flush)
|
int width, int height, Bool flush)
|
||||||
{
|
{
|
||||||
__dri2CopySubBuffer(pdraw, x, y, width, height,
|
__dri2CopySubBuffer(pdraw, x, y, width, height,
|
||||||
__DRI2_THROTTLE_COPYSUBBUFFER, flush);
|
__DRI2_THROTTLE_COPYSUBBUFFER, flush);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -705,7 +703,7 @@ dri2XcbSwapBuffers(Display *dpy,
|
||||||
|
|
||||||
static int64_t
|
static int64_t
|
||||||
dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
||||||
int64_t remainder, Bool flush)
|
int64_t remainder, Bool flush)
|
||||||
{
|
{
|
||||||
struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
|
struct dri2_drawable *priv = (struct dri2_drawable *) pdraw;
|
||||||
struct dri2_screen *psc = (struct dri2_screen *) priv->base.psc;
|
struct dri2_screen *psc = (struct dri2_screen *) priv->base.psc;
|
||||||
|
|
@ -713,7 +711,7 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
|
||||||
|
|
||||||
/* Check we have the right attachments */
|
/* Check we have the right attachments */
|
||||||
if (!priv->have_back)
|
if (!priv->have_back)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
__DRIcontext *ctx = dri2GetCurrentContext();
|
__DRIcontext *ctx = dri2GetCurrentContext();
|
||||||
unsigned flags = __DRI2_FLUSH_DRAWABLE;
|
unsigned flags = __DRI2_FLUSH_DRAWABLE;
|
||||||
|
|
@ -826,7 +824,7 @@ dri2InvalidateBuffers(Display *dpy, XID drawable)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dri2_bind_tex_image(__GLXDRIdrawable *base,
|
dri2_bind_tex_image(__GLXDRIdrawable *base,
|
||||||
int buffer, const int *attrib_list)
|
int buffer, const int *attrib_list)
|
||||||
{
|
{
|
||||||
struct glx_context *gc = __glXGetCurrentContext();
|
struct glx_context *gc = __glXGetCurrentContext();
|
||||||
struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
|
struct dri2_drawable *pdraw = (struct dri2_drawable *) base;
|
||||||
|
|
@ -836,16 +834,16 @@ dri2_bind_tex_image(__GLXDRIdrawable *base,
|
||||||
psc = (struct dri2_screen *) base->psc;
|
psc = (struct dri2_screen *) base->psc;
|
||||||
|
|
||||||
if (psc->texBuffer->base.version >= 2 &&
|
if (psc->texBuffer->base.version >= 2 &&
|
||||||
psc->texBuffer->setTexBuffer2 != NULL) {
|
psc->texBuffer->setTexBuffer2 != NULL) {
|
||||||
psc->texBuffer->setTexBuffer2(gc->driContext,
|
psc->texBuffer->setTexBuffer2(gc->driContext,
|
||||||
pdraw->base.textureTarget,
|
pdraw->base.textureTarget,
|
||||||
pdraw->base.textureFormat,
|
pdraw->base.textureFormat,
|
||||||
pdraw->driDrawable);
|
pdraw->driDrawable);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
psc->texBuffer->setTexBuffer(gc->driContext,
|
psc->texBuffer->setTexBuffer(gc->driContext,
|
||||||
pdraw->base.textureTarget,
|
pdraw->base.textureTarget,
|
||||||
pdraw->driDrawable);
|
pdraw->driDrawable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -971,7 +969,7 @@ static const struct glx_screen_vtable dri2_screen_vtable = {
|
||||||
.get_driver_name = dri2_get_driver_name,
|
.get_driver_name = dri2_get_driver_name,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct glx_screen *
|
struct glx_screen *
|
||||||
dri2CreateScreen(int screen, struct glx_display * priv, bool driver_name_is_inferred)
|
dri2CreateScreen(int screen, struct glx_display * priv, bool driver_name_is_inferred)
|
||||||
{
|
{
|
||||||
const __DRIconfig **driver_configs;
|
const __DRIconfig **driver_configs;
|
||||||
|
|
@ -996,7 +994,7 @@ dri2CreateScreen(int screen, struct glx_display * priv, bool driver_name_is_infe
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DRI2Connect(priv->dpy, RootWindow(priv->dpy, screen),
|
if (!DRI2Connect(priv->dpy, RootWindow(priv->dpy, screen),
|
||||||
&driverName, &deviceName)) {
|
&driverName, &deviceName)) {
|
||||||
glx_screen_cleanup(&psc->base);
|
glx_screen_cleanup(&psc->base);
|
||||||
free(psc);
|
free(psc);
|
||||||
InfoMessageF("screen %d does not appear to be DRI2 capable\n", screen);
|
InfoMessageF("screen %d does not appear to be DRI2 capable\n", screen);
|
||||||
|
|
@ -1159,7 +1157,7 @@ handle_error:
|
||||||
|
|
||||||
/* Called from __glXFreeDisplayPrivate.
|
/* Called from __glXFreeDisplayPrivate.
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
dri2DestroyDisplay(__GLXDRIdisplay * dpy)
|
dri2DestroyDisplay(__GLXDRIdisplay * dpy)
|
||||||
{
|
{
|
||||||
struct dri2_display *pdp = (struct dri2_display *) dpy;
|
struct dri2_display *pdp = (struct dri2_display *) dpy;
|
||||||
|
|
@ -1206,9 +1204,6 @@ dri2CreateDisplay(Display * dpy)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdp->base.destroyDisplay = dri2DestroyDisplay;
|
|
||||||
pdp->base.createScreen = dri2CreateScreen;
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
pdp->loader_extensions[i++] = &dri2LoaderExtension.base;
|
pdp->loader_extensions[i++] = &dri2LoaderExtension.base;
|
||||||
pdp->loader_extensions[i++] = &dri2UseInvalidate.base;
|
pdp->loader_extensions[i++] = &dri2UseInvalidate.base;
|
||||||
|
|
@ -1221,7 +1216,7 @@ dri2CreateDisplay(Display * dpy)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &pdp->base;
|
return (void*)pdp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GLX_DIRECT_RENDERING */
|
#endif /* GLX_DIRECT_RENDERING */
|
||||||
|
|
|
||||||
|
|
@ -789,7 +789,7 @@ static const struct glx_screen_vtable dri3_screen_vtable = {
|
||||||
* Initializes the driver for the screen and sets up our structures
|
* Initializes the driver for the screen and sets up our structures
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct glx_screen *
|
struct glx_screen *
|
||||||
dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_inferred)
|
dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_inferred)
|
||||||
{
|
{
|
||||||
xcb_connection_t *c = XGetXCBConnection(priv->dpy);
|
xcb_connection_t *c = XGetXCBConnection(priv->dpy);
|
||||||
|
|
@ -1045,7 +1045,7 @@ handle_error:
|
||||||
*
|
*
|
||||||
* Called from __glXFreeDisplayPrivate.
|
* Called from __glXFreeDisplayPrivate.
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
dri3_destroy_display(__GLXDRIdisplay * dpy)
|
dri3_destroy_display(__GLXDRIdisplay * dpy)
|
||||||
{
|
{
|
||||||
free(dpy);
|
free(dpy);
|
||||||
|
|
@ -1072,12 +1072,9 @@ dri3_create_display(Display * dpy)
|
||||||
return NULL;
|
return NULL;
|
||||||
pdp->has_multibuffer = has_multibuffer;
|
pdp->has_multibuffer = has_multibuffer;
|
||||||
|
|
||||||
pdp->base.destroyDisplay = dri3_destroy_display;
|
|
||||||
pdp->base.createScreen = dri3_create_screen;
|
|
||||||
|
|
||||||
pdp->loader_extensions = loader_extensions;
|
pdp->loader_extensions = loader_extensions;
|
||||||
|
|
||||||
return &pdp->base;
|
return (void*)pdp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GLX_DIRECT_RENDERING */
|
#endif /* GLX_DIRECT_RENDERING */
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,6 @@
|
||||||
|
|
||||||
struct dri3_display
|
struct dri3_display
|
||||||
{
|
{
|
||||||
__GLXDRIdisplay base;
|
|
||||||
|
|
||||||
const __DRIextension **loader_extensions;
|
const __DRIextension **loader_extensions;
|
||||||
int has_multibuffer;
|
int has_multibuffer;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1055,7 +1055,7 @@ driswCreateScreenDriver(int screen, struct glx_display *priv,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct glx_screen *
|
struct glx_screen *
|
||||||
driswCreateScreen(int screen, struct glx_display *priv, bool driver_name_is_inferred)
|
driswCreateScreen(int screen, struct glx_display *priv, bool driver_name_is_inferred)
|
||||||
{
|
{
|
||||||
const struct drisw_display *pdpyp = (struct drisw_display *)priv->driswDisplay;
|
const struct drisw_display *pdpyp = (struct drisw_display *)priv->driswDisplay;
|
||||||
|
|
@ -1068,7 +1068,7 @@ driswCreateScreen(int screen, struct glx_display *priv, bool driver_name_is_infe
|
||||||
|
|
||||||
/* Called from __glXFreeDisplayPrivate.
|
/* Called from __glXFreeDisplayPrivate.
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
driswDestroyDisplay(__GLXDRIdisplay * dpy)
|
driswDestroyDisplay(__GLXDRIdisplay * dpy)
|
||||||
{
|
{
|
||||||
free(dpy);
|
free(dpy);
|
||||||
|
|
@ -1088,11 +1088,9 @@ driswCreateDisplay(Display * dpy, enum try_zink zink)
|
||||||
if (pdpyp == NULL)
|
if (pdpyp == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
pdpyp->base.destroyDisplay = driswDestroyDisplay;
|
|
||||||
pdpyp->base.createScreen = driswCreateScreen;
|
|
||||||
pdpyp->zink = zink;
|
pdpyp->zink = zink;
|
||||||
|
|
||||||
return &pdpyp->base;
|
return (void*)pdpyp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* GLX_DIRECT_RENDERING */
|
#endif /* GLX_DIRECT_RENDERING */
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
struct drisw_display
|
struct drisw_display
|
||||||
{
|
{
|
||||||
__GLXDRIdisplay base;
|
|
||||||
enum try_zink zink;
|
enum try_zink zink;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
struct driwindows_display
|
struct driwindows_display
|
||||||
{
|
{
|
||||||
__GLXDRIdisplay base;
|
|
||||||
int event_base;
|
int event_base;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -561,9 +560,6 @@ driwindowsCreateDisplay(Display * dpy)
|
||||||
if (pdpyp == NULL)
|
if (pdpyp == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
pdpyp->base.destroyDisplay = driwindowsDestroyDisplay;
|
|
||||||
pdpyp->base.createScreen = driwindowsCreateScreen;
|
|
||||||
|
|
||||||
pdpyp->event_base = eventBase;
|
pdpyp->event_base = eventBase;
|
||||||
|
|
||||||
return &pdpyp->base;
|
return &pdpyp->base;
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ struct glx_context;
|
||||||
#ifdef GLX_DIRECT_RENDERING
|
#ifdef GLX_DIRECT_RENDERING
|
||||||
|
|
||||||
extern void DRI_glXUseXFont(struct glx_context *ctx,
|
extern void DRI_glXUseXFont(struct glx_context *ctx,
|
||||||
Font font, int first, int count, int listbase);
|
Font font, int first, int count, int listbase);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -74,43 +74,33 @@ extern void DRI_glXUseXFont(struct glx_context *ctx,
|
||||||
* Display dependent methods. This structure is initialized during the
|
* Display dependent methods. This structure is initialized during the
|
||||||
* \c driCreateDisplay call.
|
* \c driCreateDisplay call.
|
||||||
*/
|
*/
|
||||||
typedef struct __GLXDRIdisplayRec __GLXDRIdisplay;
|
typedef struct __GLXDRIdisplay __GLXDRIdisplay;
|
||||||
typedef struct __GLXDRIscreenRec __GLXDRIscreen;
|
typedef struct __GLXDRIscreenRec __GLXDRIscreen;
|
||||||
typedef struct __GLXDRIdrawableRec __GLXDRIdrawable;
|
typedef struct __GLXDRIdrawableRec __GLXDRIdrawable;
|
||||||
|
|
||||||
#define GLX_LOADER_USE_ZINK ((struct glx_screen *)(uintptr_t)-1)
|
#define GLX_LOADER_USE_ZINK ((struct glx_screen *)(uintptr_t)-1)
|
||||||
|
|
||||||
struct __GLXDRIdisplayRec
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Method to destroy the private DRI display data.
|
|
||||||
*/
|
|
||||||
void (*destroyDisplay) (__GLXDRIdisplay * display);
|
|
||||||
|
|
||||||
struct glx_screen *(*createScreen)(int screen, struct glx_display * priv, bool driver_name_is_inferred);
|
|
||||||
};
|
|
||||||
|
|
||||||
struct __GLXDRIscreenRec {
|
struct __GLXDRIscreenRec {
|
||||||
|
|
||||||
void (*destroyScreen)(struct glx_screen *psc);
|
void (*destroyScreen)(struct glx_screen *psc);
|
||||||
|
|
||||||
__GLXDRIdrawable *(*createDrawable)(struct glx_screen *psc,
|
__GLXDRIdrawable *(*createDrawable)(struct glx_screen *psc,
|
||||||
XID drawable,
|
XID drawable,
|
||||||
GLXDrawable glxDrawable,
|
GLXDrawable glxDrawable,
|
||||||
int type,
|
int type,
|
||||||
struct glx_config *config);
|
struct glx_config *config);
|
||||||
|
|
||||||
int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc,
|
int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc,
|
||||||
int64_t divisor, int64_t remainder, Bool flush);
|
int64_t divisor, int64_t remainder, Bool flush);
|
||||||
void (*copySubBuffer)(__GLXDRIdrawable *pdraw,
|
void (*copySubBuffer)(__GLXDRIdrawable *pdraw,
|
||||||
int x, int y, int width, int height, Bool flush);
|
int x, int y, int width, int height, Bool flush);
|
||||||
int (*getDrawableMSC)(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
|
int (*getDrawableMSC)(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
|
||||||
int64_t *ust, int64_t *msc, int64_t *sbc);
|
int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||||
int (*waitForMSC)(__GLXDRIdrawable *pdraw, int64_t target_msc,
|
int (*waitForMSC)(__GLXDRIdrawable *pdraw, int64_t target_msc,
|
||||||
int64_t divisor, int64_t remainder, int64_t *ust,
|
int64_t divisor, int64_t remainder, int64_t *ust,
|
||||||
int64_t *msc, int64_t *sbc);
|
int64_t *msc, int64_t *sbc);
|
||||||
int (*waitForSBC)(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
|
int (*waitForSBC)(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
|
||||||
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);
|
int (*getBufferAge)(__GLXDRIdrawable *pdraw);
|
||||||
|
|
@ -148,6 +138,24 @@ extern __GLXDRIdisplay *dri2CreateDisplay(Display * dpy);
|
||||||
extern __GLXDRIdisplay *dri3_create_display(Display * dpy);
|
extern __GLXDRIdisplay *dri3_create_display(Display * dpy);
|
||||||
extern __GLXDRIdisplay *driwindowsCreateDisplay(Display * dpy);
|
extern __GLXDRIdisplay *driwindowsCreateDisplay(Display * dpy);
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
|
||||||
|
#ifdef HAVE_DRI3
|
||||||
|
struct glx_screen *dri3_create_screen(int screen, struct glx_display * priv, bool driver_name_is_inferred);
|
||||||
|
void dri3_destroy_display(__GLXDRIdisplay * dpy);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct glx_screen *dri2CreateScreen(int screen, struct glx_display * priv, bool driver_name_is_inferred);
|
||||||
|
void dri2DestroyDisplay(__GLXDRIdisplay * dpy);
|
||||||
|
|
||||||
|
struct glx_screen *driswCreateScreen(int screen, struct glx_display *priv, bool driver_name_is_inferred);
|
||||||
|
void driswDestroyDisplay(__GLXDRIdisplay * dpy);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GLX_USE_WINDOWSGL
|
||||||
|
struct glx_screen *driwindowsCreateScreen(int screen, struct glx_display *priv, bool driver_name_is_inferred);
|
||||||
|
void driwindowsDestroyDisplay(__GLXDRIdisplay * dpy);
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
|
|
@ -418,7 +426,7 @@ struct glx_context
|
||||||
|
|
||||||
extern Bool
|
extern Bool
|
||||||
glx_context_init(struct glx_context *gc,
|
glx_context_init(struct glx_context *gc,
|
||||||
struct glx_screen *psc, struct glx_config *fbconfig);
|
struct glx_screen *psc, struct glx_config *fbconfig);
|
||||||
|
|
||||||
#define __glXSetError(gc,code) \
|
#define __glXSetError(gc,code) \
|
||||||
if (!(gc)->error) { \
|
if (!(gc)->error) { \
|
||||||
|
|
@ -459,9 +467,9 @@ glx_context_init(struct glx_context *gc,
|
||||||
*/
|
*/
|
||||||
struct glx_screen_vtable {
|
struct glx_screen_vtable {
|
||||||
struct glx_context *(*create_context)(struct glx_screen *psc,
|
struct glx_context *(*create_context)(struct glx_screen *psc,
|
||||||
struct glx_config *config,
|
struct glx_config *config,
|
||||||
struct glx_context *shareList,
|
struct glx_context *shareList,
|
||||||
int renderType);
|
int renderType);
|
||||||
|
|
||||||
/* The error outparameter abuses the fact that the only possible errors are
|
/* The error outparameter abuses the fact that the only possible errors are
|
||||||
* GLXBadContext (0), GLXBadFBConfig (9), GLXBadProfileARB (13), BadValue
|
* GLXBadContext (0), GLXBadFBConfig (9), GLXBadProfileARB (13), BadValue
|
||||||
|
|
@ -469,11 +477,11 @@ struct glx_screen_vtable {
|
||||||
* use them directly rather than try to offset or use a sign convention.
|
* use them directly rather than try to offset or use a sign convention.
|
||||||
*/
|
*/
|
||||||
struct glx_context *(*create_context_attribs)(struct glx_screen *psc,
|
struct glx_context *(*create_context_attribs)(struct glx_screen *psc,
|
||||||
struct glx_config *config,
|
struct glx_config *config,
|
||||||
struct glx_context *shareList,
|
struct glx_context *shareList,
|
||||||
unsigned num_attrib,
|
unsigned num_attrib,
|
||||||
const uint32_t *attribs,
|
const uint32_t *attribs,
|
||||||
unsigned *error);
|
unsigned *error);
|
||||||
int (*query_renderer_integer)(struct glx_screen *psc,
|
int (*query_renderer_integer)(struct glx_screen *psc,
|
||||||
int attribute,
|
int attribute,
|
||||||
unsigned int *value);
|
unsigned int *value);
|
||||||
|
|
@ -609,7 +617,7 @@ struct glx_drawable {
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
glx_screen_init(struct glx_screen *psc,
|
glx_screen_init(struct glx_screen *psc,
|
||||||
int screen, struct glx_display * priv);
|
int screen, struct glx_display * priv);
|
||||||
extern void
|
extern void
|
||||||
glx_screen_cleanup(struct glx_screen *psc);
|
glx_screen_cleanup(struct glx_screen *psc);
|
||||||
|
|
||||||
|
|
@ -735,7 +743,7 @@ extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
|
||||||
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
|
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
__glxGetMscRate(struct glx_screen *psc,
|
__glxGetMscRate(struct glx_screen *psc,
|
||||||
int32_t * numerator, int32_t * denominator);
|
int32_t * numerator, int32_t * denominator);
|
||||||
|
|
||||||
/* So that dri2.c:DRI2WireToEvent() can access
|
/* So that dri2.c:DRI2WireToEvent() can access
|
||||||
* glx_info->codes->first_event */
|
* glx_info->codes->first_event */
|
||||||
|
|
@ -753,8 +761,8 @@ applegl_create_screen(int screen, struct glx_display * priv);
|
||||||
|
|
||||||
extern struct glx_context *
|
extern struct glx_context *
|
||||||
applegl_create_context(struct glx_screen *psc,
|
applegl_create_context(struct glx_screen *psc,
|
||||||
struct glx_config *mode,
|
struct glx_config *mode,
|
||||||
struct glx_context *shareList, int renderType);
|
struct glx_context *shareList, int renderType);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
applegl_create_display(struct glx_display *display);
|
applegl_create_display(struct glx_display *display);
|
||||||
|
|
@ -769,7 +777,7 @@ extern Bool validate_renderType_against_config(const struct glx_config *config,
|
||||||
|
|
||||||
extern struct glx_drawable *GetGLXDrawable(Display *dpy, GLXDrawable drawable);
|
extern struct glx_drawable *GetGLXDrawable(Display *dpy, GLXDrawable drawable);
|
||||||
extern int InitGLXDrawable(Display *dpy, struct glx_drawable *glxDraw,
|
extern int InitGLXDrawable(Display *dpy, struct glx_drawable *glxDraw,
|
||||||
XID xDrawable, GLXDrawable drawable);
|
XID xDrawable, GLXDrawable drawable);
|
||||||
extern void DestroyGLXDrawable(Display *dpy, GLXDrawable drawable);
|
extern void DestroyGLXDrawable(Display *dpy, GLXDrawable drawable);
|
||||||
|
|
||||||
extern struct glx_context dummyContext;
|
extern struct glx_context dummyContext;
|
||||||
|
|
@ -778,8 +786,8 @@ extern struct glx_screen *
|
||||||
indirect_create_screen(int screen, struct glx_display * priv);
|
indirect_create_screen(int screen, struct glx_display * priv);
|
||||||
extern struct glx_context *
|
extern struct glx_context *
|
||||||
indirect_create_context(struct glx_screen *psc,
|
indirect_create_context(struct glx_screen *psc,
|
||||||
struct glx_config *mode,
|
struct glx_config *mode,
|
||||||
struct glx_context *shareList, int renderType);
|
struct glx_context *shareList, int renderType);
|
||||||
extern struct glx_context *
|
extern struct glx_context *
|
||||||
indirect_create_context_attribs(struct glx_screen *base,
|
indirect_create_context_attribs(struct glx_screen *base,
|
||||||
struct glx_config *config_base,
|
struct glx_config *config_base,
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
#include <xcb/glx.h>
|
#include <xcb/glx.h>
|
||||||
|
|
||||||
#define __GLX_MIN_CONFIG_PROPS 18
|
#define __GLX_MIN_CONFIG_PROPS 18
|
||||||
#define __GLX_EXT_CONFIG_PROPS 32
|
#define __GLX_EXT_CONFIG_PROPS 32
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Since we send all non-core visual properties as token, value pairs,
|
** Since we send all non-core visual properties as token, value pairs,
|
||||||
|
|
@ -152,7 +152,7 @@ __glXWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
|
||||||
struct glx_drawable *glxDraw = GetGLXDrawable(dpy, awire->drawable);
|
struct glx_drawable *glxDraw = GetGLXDrawable(dpy, awire->drawable);
|
||||||
|
|
||||||
if (!glxDraw)
|
if (!glxDraw)
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
|
aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
|
||||||
aevent->send_event = (awire->type & 0x80) != 0;
|
aevent->send_event = (awire->type & 0x80) != 0;
|
||||||
|
|
@ -234,7 +234,7 @@ FreeScreenConfigs(struct glx_display * priv)
|
||||||
if (psc->driScreen) {
|
if (psc->driScreen) {
|
||||||
psc->driScreen->destroyScreen(psc);
|
psc->driScreen->destroyScreen(psc);
|
||||||
} else {
|
} else {
|
||||||
free(psc);
|
free(psc);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
free(psc);
|
free(psc);
|
||||||
|
|
@ -282,22 +282,22 @@ glx_display_free(struct glx_display *priv)
|
||||||
|
|
||||||
/* Free the direct rendering per display data */
|
/* Free the direct rendering per display data */
|
||||||
if (priv->driswDisplay)
|
if (priv->driswDisplay)
|
||||||
priv->driswDisplay->destroyDisplay(priv->driswDisplay);
|
driswDestroyDisplay(priv->driswDisplay);
|
||||||
priv->driswDisplay = NULL;
|
priv->driswDisplay = NULL;
|
||||||
|
|
||||||
#if defined (GLX_USE_DRM)
|
#if defined (GLX_USE_DRM)
|
||||||
if (priv->dri2Display)
|
if (priv->dri2Display)
|
||||||
priv->dri2Display->destroyDisplay(priv->dri2Display);
|
dri2DestroyDisplay(priv->dri2Display);
|
||||||
priv->dri2Display = NULL;
|
priv->dri2Display = NULL;
|
||||||
|
|
||||||
if (priv->dri3Display)
|
if (priv->dri3Display)
|
||||||
priv->dri3Display->destroyDisplay(priv->dri3Display);
|
dri3_destroy_display(priv->dri3Display);
|
||||||
priv->dri3Display = NULL;
|
priv->dri3Display = NULL;
|
||||||
#endif /* GLX_USE_DRM */
|
#endif /* GLX_USE_DRM */
|
||||||
|
|
||||||
#if defined(GLX_USE_WINDOWSGL)
|
#if defined(GLX_USE_WINDOWSGL)
|
||||||
if (priv->windowsdriDisplay)
|
if (priv->windowsdriDisplay)
|
||||||
priv->windowsdriDisplay->destroyDisplay(priv->windowsdriDisplay);
|
driwindowsDestroyDisplay(priv->windowsdriDisplay);
|
||||||
priv->windowsdriDisplay = NULL;
|
priv->windowsdriDisplay = NULL;
|
||||||
#endif /* GLX_USE_WINDOWSGL */
|
#endif /* GLX_USE_WINDOWSGL */
|
||||||
|
|
||||||
|
|
@ -316,7 +316,7 @@ __glXCloseDisplay(Display * dpy, XExtCodes * codes)
|
||||||
for (priv = glx_displays; priv; prev = &priv->next, priv = priv->next) {
|
for (priv = glx_displays; priv; prev = &priv->next, priv = priv->next) {
|
||||||
if (priv->dpy == dpy) {
|
if (priv->dpy == dpy) {
|
||||||
*prev = priv->next;
|
*prev = priv->next;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_XUnlockMutex(_Xglobal_lock);
|
_XUnlockMutex(_Xglobal_lock);
|
||||||
|
|
@ -661,7 +661,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops,
|
||||||
|
|
||||||
static GLboolean
|
static GLboolean
|
||||||
getVisualConfigs(struct glx_screen *psc,
|
getVisualConfigs(struct glx_screen *psc,
|
||||||
struct glx_display *priv, int screen)
|
struct glx_display *priv, int screen)
|
||||||
{
|
{
|
||||||
xGLXGetVisualConfigsReq *req;
|
xGLXGetVisualConfigsReq *req;
|
||||||
xGLXGetVisualConfigsReply reply;
|
xGLXGetVisualConfigsReply reply;
|
||||||
|
|
@ -724,7 +724,7 @@ getFBConfigs(struct glx_screen *psc, struct glx_display *priv, int screen)
|
||||||
|
|
||||||
_X_HIDDEN Bool
|
_X_HIDDEN Bool
|
||||||
glx_screen_init(struct glx_screen *psc,
|
glx_screen_init(struct glx_screen *psc,
|
||||||
int screen, struct glx_display * priv)
|
int screen, struct glx_display * priv)
|
||||||
{
|
{
|
||||||
/* Initialize per screen dynamic client GLX extensions */
|
/* Initialize per screen dynamic client GLX extensions */
|
||||||
psc->ext_list_first_time = GL_TRUE;
|
psc->ext_list_first_time = GL_TRUE;
|
||||||
|
|
@ -783,25 +783,25 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv, Bool zink,
|
||||||
#if defined(GLX_USE_DRM)
|
#if defined(GLX_USE_DRM)
|
||||||
#if defined(HAVE_DRI3)
|
#if defined(HAVE_DRI3)
|
||||||
if (priv->dri3Display)
|
if (priv->dri3Display)
|
||||||
psc = priv->dri3Display->createScreen(i, priv, driver_name_is_inferred);
|
psc = dri3_create_screen(i, priv, driver_name_is_inferred);
|
||||||
#endif /* HAVE_DRI3 */
|
#endif /* HAVE_DRI3 */
|
||||||
#if defined(HAVE_X11_DRI2)
|
#if defined(HAVE_X11_DRI2)
|
||||||
if (psc == NULL && priv->dri2Display)
|
if (psc == NULL && priv->dri2Display)
|
||||||
psc = priv->dri2Display->createScreen(i, priv, driver_name_is_inferred);
|
psc = dri2CreateScreen(i, priv, driver_name_is_inferred);
|
||||||
#endif /* GLX_USE_DRM */
|
#endif /* GLX_USE_DRM */
|
||||||
|
|
||||||
#ifdef GLX_USE_WINDOWSGL
|
#ifdef GLX_USE_WINDOWSGL
|
||||||
if (psc == NULL && priv->windowsdriDisplay)
|
if (psc == NULL && priv->windowsdriDisplay)
|
||||||
psc = priv->windowsdriDisplay->createScreen(i, priv, driver_name_is_inferred);
|
psc = driwindowsCreateScreen(i, priv, driver_name_is_inferred);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((psc == GLX_LOADER_USE_ZINK || psc == NULL) && priv->driswDisplay)
|
if ((psc == GLX_LOADER_USE_ZINK || psc == NULL) && priv->driswDisplay)
|
||||||
psc = priv->driswDisplay->createScreen(i, priv, psc == GLX_LOADER_USE_ZINK ? false : driver_name_is_inferred);
|
psc = driswCreateScreen(i, priv, psc == GLX_LOADER_USE_ZINK ? false : driver_name_is_inferred);
|
||||||
#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */
|
#endif /* GLX_DIRECT_RENDERING && !GLX_USE_APPLEGL */
|
||||||
|
|
||||||
#if defined(GLX_USE_APPLE)
|
#if defined(GLX_USE_APPLE)
|
||||||
if (psc == NULL && priv->driswDisplay) {
|
if (psc == NULL && priv->driswDisplay) {
|
||||||
psc = priv->driswDisplay->createScreen(i, priv);
|
psc = driswCreateScreen(i, priv);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -844,8 +844,8 @@ __glXInitialize(Display * dpy)
|
||||||
|
|
||||||
for (dpyPriv = glx_displays; dpyPriv; dpyPriv = dpyPriv->next) {
|
for (dpyPriv = glx_displays; dpyPriv; dpyPriv = dpyPriv->next) {
|
||||||
if (dpyPriv->dpy == dpy) {
|
if (dpyPriv->dpy == dpy) {
|
||||||
_XUnlockMutex(_Xglobal_lock);
|
_XUnlockMutex(_Xglobal_lock);
|
||||||
return dpyPriv;
|
return dpyPriv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -867,7 +867,7 @@ __glXInitialize(Display * dpy)
|
||||||
|
|
||||||
/* This GLX implementation requires GLX 1.3 */
|
/* This GLX implementation requires GLX 1.3 */
|
||||||
if (!QueryVersion(dpy, dpyPriv->codes.major_opcode,
|
if (!QueryVersion(dpy, dpyPriv->codes.major_opcode,
|
||||||
&majorVersion, &dpyPriv->minorVersion)
|
&majorVersion, &dpyPriv->minorVersion)
|
||||||
|| (majorVersion != 1)
|
|| (majorVersion != 1)
|
||||||
|| (majorVersion == 1 && dpyPriv->minorVersion < 3)) {
|
|| (majorVersion == 1 && dpyPriv->minorVersion < 3)) {
|
||||||
free(dpyPriv);
|
free(dpyPriv);
|
||||||
|
|
@ -951,7 +951,7 @@ __glXInitialize(Display * dpy)
|
||||||
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
|
#if defined(GLX_DIRECT_RENDERING) && (!defined(GLX_USE_APPLEGL) || defined(GLX_USE_APPLE))
|
||||||
if (try_zink) {
|
if (try_zink) {
|
||||||
free(dpyPriv->screens);
|
free(dpyPriv->screens);
|
||||||
dpyPriv->driswDisplay->destroyDisplay(dpyPriv->driswDisplay);
|
driswDestroyDisplay(dpyPriv->driswDisplay);
|
||||||
dpyPriv->driswDisplay = driswCreateDisplay(dpy, TRY_ZINK_NO);
|
dpyPriv->driswDisplay = driswCreateDisplay(dpy, TRY_ZINK_NO);
|
||||||
fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv, False, true);
|
fail = !AllocAndFetchScreenConfigs(dpy, dpyPriv, False, true);
|
||||||
}
|
}
|
||||||
|
|
@ -970,9 +970,9 @@ __glXInitialize(Display * dpy)
|
||||||
|
|
||||||
for (d = glx_displays; d; d = d->next) {
|
for (d = glx_displays; d; d = d->next) {
|
||||||
if (d->dpy == dpy) {
|
if (d->dpy == dpy) {
|
||||||
_XUnlockMutex(_Xglobal_lock);
|
_XUnlockMutex(_Xglobal_lock);
|
||||||
glx_display_free(dpyPriv);
|
glx_display_free(dpyPriv);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue