* conjunction with the core extension.
*/
#define __DRI_SWRAST "DRI_SWRast"
-#define __DRI_SWRAST_VERSION 3
+#define __DRI_SWRAST_VERSION 4
struct __DRIswrastExtensionRec {
__DRIextension base;
const uint32_t *attribs,
unsigned *error,
void *loaderPrivate);
+
+ /**
+ * createNewScreen() with the driver extensions passed in.
+ *
+ * \since version 4
+ */
+ __DRIscreen *(*createNewScreen2)(int screen,
+ const __DRIextension **loader_extensions,
+ const __DRIextension **driver_extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
+
};
/**
* constructors for DRI2.
*/
#define __DRI_DRI2 "DRI_DRI2"
-#define __DRI_DRI2_VERSION 3
+#define __DRI_DRI2_VERSION 4
#define __DRI_API_OPENGL 0 /**< OpenGL compatibility profile */
#define __DRI_API_GLES 1 /**< OpenGL ES 1.x */
const uint32_t *attribs,
unsigned *error,
void *loaderPrivate);
+
+ /**
+ * createNewScreen with the driver's extension list passed in.
+ *
+ * \since version 4
+ */
+ __DRIscreen *(*createNewScreen2)(int screen, int fd,
+ const __DRIextension **loader_extensions,
+ const __DRIextension **driver_extensions,
+ const __DRIconfig ***driver_configs,
+ void *loaderPrivate);
};
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
+ dri2_dpy->driver_extensions = extensions;
return EGL_TRUE;
}
dlclose(dri2_dpy->driver);
return EGL_FALSE;
}
+ dri2_dpy->driver_extensions = extensions;
return EGL_TRUE;
}
dri2_dpy = disp->DriverData;
if (dri2_dpy->dri2) {
- dri2_dpy->dri_screen =
- dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd, dri2_dpy->extensions,
- &dri2_dpy->driver_configs, disp);
+ if (dri2_dpy->dri2->base.version >= 4) {
+ dri2_dpy->dri_screen =
+ dri2_dpy->dri2->createNewScreen2(0, dri2_dpy->fd,
+ dri2_dpy->extensions,
+ dri2_dpy->driver_extensions,
+ &dri2_dpy->driver_configs, disp);
+ } else {
+ dri2_dpy->dri_screen =
+ dri2_dpy->dri2->createNewScreen(0, dri2_dpy->fd,
+ dri2_dpy->extensions,
+ &dri2_dpy->driver_configs, disp);
+ }
} else {
assert(dri2_dpy->swrast);
- dri2_dpy->dri_screen =
- dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
- &dri2_dpy->driver_configs, disp);
+ if (dri2_dpy->swrast->base.version >= 4) {
+ dri2_dpy->dri_screen =
+ dri2_dpy->swrast->createNewScreen2(0, dri2_dpy->extensions,
+ dri2_dpy->driver_extensions,
+ &dri2_dpy->driver_configs, disp);
+ } else {
+ dri2_dpy->dri_screen =
+ dri2_dpy->swrast->createNewScreen(0, dri2_dpy->extensions,
+ &dri2_dpy->driver_configs, disp);
+ }
}
if (dri2_dpy->dri_screen == NULL) {
__DRIdri2LoaderExtension dri2_loader_extension;
__DRIswrastLoaderExtension swrast_loader_extension;
const __DRIextension *extensions[4];
+ const __DRIextension **driver_extensions;
#ifdef HAVE_X11_PLATFORM
xcb_connection_t *conn;
dlclose(dri->driver);
return -1;
}
-
+ dri->driver_extensions = extensions;
if (dri_bind_extensions(dri, gbm_dri_device_extensions, extensions) < 0) {
dlclose(dri->driver);
if (dri->dri2 == NULL)
return -1;
- dri->screen = dri->dri2->createNewScreen(0, dri->base.base.fd,
- dri->extensions,
- &dri->driver_configs, dri);
+ if (dri->dri2->base.version >= 4) {
+ dri->screen = dri->dri2->createNewScreen2(0, dri->base.base.fd,
+ dri->extensions,
+ dri->driver_extensions,
+ &dri->driver_configs, dri);
+ } else {
+ dri->screen = dri->dri2->createNewScreen(0, dri->base.base.fd,
+ dri->extensions,
+ &dri->driver_configs, dri);
+ }
if (dri->screen == NULL)
return -1;
const __DRIconfig **driver_configs;
const __DRIextension *extensions[4];
+ const __DRIextension **driver_extensions;
__DRIimage *(*lookup_image)(__DRIscreen *screen, void *image, void *data);
void *lookup_user_data;
goto handle_error;
}
-
- /* If the server does not support the protocol for
- * DRI2GetBuffersWithFormat, don't supply that interface to the driver.
- */
- psc->driScreen =
- psc->dri2->createNewScreen(screen, psc->fd,
- (const __DRIextension **)
- &pdp->loader_extensions[0],
- &driver_configs, psc);
+ if (psc->dri2->base.version >= 4) {
+ psc->driScreen =
+ psc->dri2->createNewScreen2(screen, psc->fd,
+ (const __DRIextension **)
+ &pdp->loader_extensions[0],
+ extensions,
+ &driver_configs, psc);
+ } else {
+ psc->driScreen =
+ psc->dri2->createNewScreen(screen, psc->fd,
+ (const __DRIextension **)
+ &pdp->loader_extensions[0],
+ &driver_configs, psc);
+ }
if (psc->driScreen == NULL) {
ErrorMessageF("failed to create dri screen\n");
goto handle_error;
}
- psc->driScreen =
- psc->swrast->createNewScreen(screen, loader_extensions,
- &driver_configs, psc);
+ if (psc->swrast->base.version >= 4) {
+ psc->driScreen =
+ psc->swrast->createNewScreen2(screen, loader_extensions,
+ extensions,
+ &driver_configs, psc);
+ } else {
+ psc->driScreen =
+ psc->swrast->createNewScreen(screen, loader_extensions,
+ &driver_configs, psc);
+ }
if (psc->driScreen == NULL) {
ErrorMessageF("failed to create dri screen\n");
goto handle_error;
* Display.
*/
static __DRIscreen *
-dri2CreateNewScreen(int scrn, int fd,
- const __DRIextension **extensions,
- const __DRIconfig ***driver_configs, void *data)
+dri2CreateNewScreen2(int scrn, int fd,
+ const __DRIextension **extensions,
+ const __DRIextension **driver_extensions,
+ const __DRIconfig ***driver_configs, void *data)
{
static const __DRIextension *emptyExtensionList[] = { NULL };
__DRIscreen *psp;
return psp;
}
+static __DRIscreen *
+dri2CreateNewScreen(int scrn, int fd,
+ const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs, void *data)
+{
+ return dri2CreateNewScreen2(scrn, fd, extensions, NULL,
+ driver_configs, data);
+}
+
/** swrast driver createNewScreen entrypoint. */
static __DRIscreen *
-driCreateNewScreen(int scrn, const __DRIextension **extensions,
- const __DRIconfig ***driver_configs, void *data)
+driSWRastCreateNewScreen(int scrn, const __DRIextension **extensions,
+ const __DRIconfig ***driver_configs, void *data)
+{
+ return dri2CreateNewScreen2(scrn, -1, extensions, NULL,
+ driver_configs, data);
+}
+
+static __DRIscreen *
+driSWRastCreateNewScreen2(int scrn, const __DRIextension **extensions,
+ const __DRIextension **driver_extensions,
+ const __DRIconfig ***driver_configs, void *data)
{
- return dri2CreateNewScreen(scrn, -1, extensions, driver_configs, data);
+ return dri2CreateNewScreen2(scrn, -1, extensions, driver_extensions,
+ driver_configs, data);
}
/**
/** DRI2 interface */
const __DRIdri2Extension driDRI2Extension = {
- .base = { __DRI_DRI2, 3 },
+ .base = { __DRI_DRI2, 4 },
.createNewScreen = dri2CreateNewScreen,
.createNewDrawable = dri2CreateNewDrawable,
.createNewContextForAPI = dri2CreateNewContextForAPI,
.allocateBuffer = dri2AllocateBuffer,
.releaseBuffer = dri2ReleaseBuffer,
- .createContextAttribs = dri2CreateContextAttribs
+ .createContextAttribs = dri2CreateContextAttribs,
+ .createNewScreen2 = dri2CreateNewScreen2,
};
const __DRIswrastExtension driSWRastExtension = {
- { __DRI_SWRAST, __DRI_SWRAST_VERSION },
- driCreateNewScreen,
+ { __DRI_SWRAST, 4 },
+ driSWRastCreateNewScreen,
dri2CreateNewDrawable,
dri2CreateNewContextForAPI,
- dri2CreateContextAttribs
+ dri2CreateContextAttribs,
+ driSWRastCreateNewScreen2,
};
const __DRI2configQueryExtension dri2ConfigQueryExtension = {