drivers/dri/common: A few dri2 functions are not actually DRI2 specific
This just renames them so that they can be used with the DRI3 extension without causing too much confusion. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
ea1f7d2894
commit
f66a6c5fe7
|
@ -763,6 +763,40 @@ struct __DRIswrastExtensionRec {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Common DRI function definitions, shared among DRI2 and Image extensions
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef __DRIscreen *
|
||||||
|
(*__DRIcreateNewScreen2Func)(int screen, int fd,
|
||||||
|
const __DRIextension **extensions,
|
||||||
|
const __DRIextension **driver_extensions,
|
||||||
|
const __DRIconfig ***driver_configs,
|
||||||
|
void *loaderPrivate);
|
||||||
|
|
||||||
|
typedef __DRIdrawable *
|
||||||
|
(*__DRIcreateNewDrawableFunc)(__DRIscreen *screen,
|
||||||
|
const __DRIconfig *config,
|
||||||
|
void *loaderPrivate);
|
||||||
|
|
||||||
|
typedef __DRIcontext *
|
||||||
|
(*__DRIcreateNewContextFunc)(__DRIscreen *screen,
|
||||||
|
const __DRIconfig *config,
|
||||||
|
__DRIcontext *shared,
|
||||||
|
void *loaderPrivate);
|
||||||
|
|
||||||
|
typedef __DRIcontext *
|
||||||
|
(*__DRIcreateContextAttribsFunc)(__DRIscreen *screen,
|
||||||
|
int api,
|
||||||
|
const __DRIconfig *config,
|
||||||
|
__DRIcontext *shared,
|
||||||
|
unsigned num_attribs,
|
||||||
|
const uint32_t *attribs,
|
||||||
|
unsigned *error,
|
||||||
|
void *loaderPrivate);
|
||||||
|
|
||||||
|
typedef unsigned int
|
||||||
|
(*__DRIgetAPIMaskFunc)(__DRIscreen *screen);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DRI2 Loader extension.
|
* DRI2 Loader extension.
|
||||||
*/
|
*/
|
||||||
|
@ -910,17 +944,11 @@ struct __DRIdri2ExtensionRec {
|
||||||
const __DRIconfig ***driver_configs,
|
const __DRIconfig ***driver_configs,
|
||||||
void *loaderPrivate);
|
void *loaderPrivate);
|
||||||
|
|
||||||
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
|
__DRIcreateNewDrawableFunc createNewDrawable;
|
||||||
const __DRIconfig *config,
|
__DRIcreateNewContextFunc createNewContext;
|
||||||
void *loaderPrivate);
|
|
||||||
|
|
||||||
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
|
|
||||||
const __DRIconfig *config,
|
|
||||||
__DRIcontext *shared,
|
|
||||||
void *loaderPrivate);
|
|
||||||
|
|
||||||
/* Since version 2 */
|
/* Since version 2 */
|
||||||
unsigned int (*getAPIMask)(__DRIscreen *screen);
|
__DRIgetAPIMaskFunc getAPIMask;
|
||||||
|
|
||||||
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
|
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
|
||||||
int api,
|
int api,
|
||||||
|
@ -943,25 +971,14 @@ struct __DRIdri2ExtensionRec {
|
||||||
*
|
*
|
||||||
* \sa __DRIswrastExtensionRec::createContextAttribs
|
* \sa __DRIswrastExtensionRec::createContextAttribs
|
||||||
*/
|
*/
|
||||||
__DRIcontext *(*createContextAttribs)(__DRIscreen *screen,
|
__DRIcreateContextAttribsFunc createContextAttribs;
|
||||||
int api,
|
|
||||||
const __DRIconfig *config,
|
|
||||||
__DRIcontext *shared,
|
|
||||||
unsigned num_attribs,
|
|
||||||
const uint32_t *attribs,
|
|
||||||
unsigned *error,
|
|
||||||
void *loaderPrivate);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* createNewScreen with the driver's extension list passed in.
|
* createNewScreen with the driver's extension list passed in.
|
||||||
*
|
*
|
||||||
* \since version 4
|
* \since version 4
|
||||||
*/
|
*/
|
||||||
__DRIscreen *(*createNewScreen2)(int screen, int fd,
|
__DRIcreateNewScreen2Func createNewScreen2;
|
||||||
const __DRIextension **loader_extensions,
|
|
||||||
const __DRIextension **driver_extensions,
|
|
||||||
const __DRIconfig ***driver_configs,
|
|
||||||
void *loaderPrivate);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -106,10 +106,10 @@ const struct __DriverAPIRec *globalDriverAPI = &driDriverAPI;
|
||||||
* Display.
|
* Display.
|
||||||
*/
|
*/
|
||||||
static __DRIscreen *
|
static __DRIscreen *
|
||||||
dri2CreateNewScreen2(int scrn, int fd,
|
driCreateNewScreen2(int scrn, int fd,
|
||||||
const __DRIextension **extensions,
|
const __DRIextension **extensions,
|
||||||
const __DRIextension **driver_extensions,
|
const __DRIextension **driver_extensions,
|
||||||
const __DRIconfig ***driver_configs, void *data)
|
const __DRIconfig ***driver_configs, void *data)
|
||||||
{
|
{
|
||||||
static const __DRIextension *emptyExtensionList[] = { NULL };
|
static const __DRIextension *emptyExtensionList[] = { NULL };
|
||||||
__DRIscreen *psp;
|
__DRIscreen *psp;
|
||||||
|
@ -190,7 +190,7 @@ dri2CreateNewScreen(int scrn, int fd,
|
||||||
const __DRIextension **extensions,
|
const __DRIextension **extensions,
|
||||||
const __DRIconfig ***driver_configs, void *data)
|
const __DRIconfig ***driver_configs, void *data)
|
||||||
{
|
{
|
||||||
return dri2CreateNewScreen2(scrn, fd, extensions, NULL,
|
return driCreateNewScreen2(scrn, fd, extensions, NULL,
|
||||||
driver_configs, data);
|
driver_configs, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ static __DRIscreen *
|
||||||
driSWRastCreateNewScreen(int scrn, const __DRIextension **extensions,
|
driSWRastCreateNewScreen(int scrn, const __DRIextension **extensions,
|
||||||
const __DRIconfig ***driver_configs, void *data)
|
const __DRIconfig ***driver_configs, void *data)
|
||||||
{
|
{
|
||||||
return dri2CreateNewScreen2(scrn, -1, extensions, NULL,
|
return driCreateNewScreen2(scrn, -1, extensions, NULL,
|
||||||
driver_configs, data);
|
driver_configs, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ driSWRastCreateNewScreen2(int scrn, const __DRIextension **extensions,
|
||||||
const __DRIextension **driver_extensions,
|
const __DRIextension **driver_extensions,
|
||||||
const __DRIconfig ***driver_configs, void *data)
|
const __DRIconfig ***driver_configs, void *data)
|
||||||
{
|
{
|
||||||
return dri2CreateNewScreen2(scrn, -1, extensions, driver_extensions,
|
return driCreateNewScreen2(scrn, -1, extensions, driver_extensions,
|
||||||
driver_configs, data);
|
driver_configs, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,13 +291,13 @@ validate_context_version(__DRIscreen *screen,
|
||||||
/*@{*/
|
/*@{*/
|
||||||
|
|
||||||
static __DRIcontext *
|
static __DRIcontext *
|
||||||
dri2CreateContextAttribs(__DRIscreen *screen, int api,
|
driCreateContextAttribs(__DRIscreen *screen, int api,
|
||||||
const __DRIconfig *config,
|
const __DRIconfig *config,
|
||||||
__DRIcontext *shared,
|
__DRIcontext *shared,
|
||||||
unsigned num_attribs,
|
unsigned num_attribs,
|
||||||
const uint32_t *attribs,
|
const uint32_t *attribs,
|
||||||
unsigned *error,
|
unsigned *error,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
__DRIcontext *context;
|
__DRIcontext *context;
|
||||||
const struct gl_config *modes = (config != NULL) ? &config->modes : NULL;
|
const struct gl_config *modes = (config != NULL) ? &config->modes : NULL;
|
||||||
|
@ -447,22 +447,22 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
|
||||||
}
|
}
|
||||||
|
|
||||||
static __DRIcontext *
|
static __DRIcontext *
|
||||||
dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
|
driCreateNewContextForAPI(__DRIscreen *screen, int api,
|
||||||
const __DRIconfig *config,
|
const __DRIconfig *config,
|
||||||
__DRIcontext *shared, void *data)
|
__DRIcontext *shared, void *data)
|
||||||
{
|
{
|
||||||
unsigned error;
|
unsigned error;
|
||||||
|
|
||||||
return dri2CreateContextAttribs(screen, api, config, shared, 0, NULL,
|
return driCreateContextAttribs(screen, api, config, shared, 0, NULL,
|
||||||
&error, data);
|
&error, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static __DRIcontext *
|
static __DRIcontext *
|
||||||
dri2CreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
|
driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config,
|
||||||
__DRIcontext *shared, void *data)
|
__DRIcontext *shared, void *data)
|
||||||
{
|
{
|
||||||
return dri2CreateNewContextForAPI(screen, __DRI_API_OPENGL,
|
return driCreateNewContextForAPI(screen, __DRI_API_OPENGL,
|
||||||
config, shared, data);
|
config, shared, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -614,9 +614,9 @@ static void dri_put_drawable(__DRIdrawable *pdp)
|
||||||
}
|
}
|
||||||
|
|
||||||
static __DRIdrawable *
|
static __DRIdrawable *
|
||||||
dri2CreateNewDrawable(__DRIscreen *screen,
|
driCreateNewDrawable(__DRIscreen *screen,
|
||||||
const __DRIconfig *config,
|
const __DRIconfig *config,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
__DRIdrawable *pdraw;
|
__DRIdrawable *pdraw;
|
||||||
|
|
||||||
|
@ -703,7 +703,7 @@ dri2ConfigQueryf(__DRIscreen *screen, const char *var, GLfloat *val)
|
||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
dri2GetAPIMask(__DRIscreen *screen)
|
driGetAPIMask(__DRIscreen *screen)
|
||||||
{
|
{
|
||||||
return screen->api_mask;
|
return screen->api_mask;
|
||||||
}
|
}
|
||||||
|
@ -734,7 +734,7 @@ const __DRIcoreExtension driCoreExtension = {
|
||||||
.createNewDrawable = NULL,
|
.createNewDrawable = NULL,
|
||||||
.destroyDrawable = driDestroyDrawable,
|
.destroyDrawable = driDestroyDrawable,
|
||||||
.swapBuffers = driSwapBuffers, /* swrast */
|
.swapBuffers = driSwapBuffers, /* swrast */
|
||||||
.createNewContext = dri2CreateNewContext, /* swrast */
|
.createNewContext = driCreateNewContext, /* swrast */
|
||||||
.copyContext = driCopyContext,
|
.copyContext = driCopyContext,
|
||||||
.destroyContext = driDestroyContext,
|
.destroyContext = driDestroyContext,
|
||||||
.bindContext = driBindContext,
|
.bindContext = driBindContext,
|
||||||
|
@ -746,22 +746,22 @@ const __DRIdri2Extension driDRI2Extension = {
|
||||||
.base = { __DRI_DRI2, 4 },
|
.base = { __DRI_DRI2, 4 },
|
||||||
|
|
||||||
.createNewScreen = dri2CreateNewScreen,
|
.createNewScreen = dri2CreateNewScreen,
|
||||||
.createNewDrawable = dri2CreateNewDrawable,
|
.createNewDrawable = driCreateNewDrawable,
|
||||||
.createNewContext = dri2CreateNewContext,
|
.createNewContext = driCreateNewContext,
|
||||||
.getAPIMask = dri2GetAPIMask,
|
.getAPIMask = driGetAPIMask,
|
||||||
.createNewContextForAPI = dri2CreateNewContextForAPI,
|
.createNewContextForAPI = driCreateNewContextForAPI,
|
||||||
.allocateBuffer = dri2AllocateBuffer,
|
.allocateBuffer = dri2AllocateBuffer,
|
||||||
.releaseBuffer = dri2ReleaseBuffer,
|
.releaseBuffer = dri2ReleaseBuffer,
|
||||||
.createContextAttribs = dri2CreateContextAttribs,
|
.createContextAttribs = driCreateContextAttribs,
|
||||||
.createNewScreen2 = dri2CreateNewScreen2,
|
.createNewScreen2 = driCreateNewScreen2,
|
||||||
};
|
};
|
||||||
|
|
||||||
const __DRIswrastExtension driSWRastExtension = {
|
const __DRIswrastExtension driSWRastExtension = {
|
||||||
{ __DRI_SWRAST, 4 },
|
{ __DRI_SWRAST, 4 },
|
||||||
driSWRastCreateNewScreen,
|
driSWRastCreateNewScreen,
|
||||||
dri2CreateNewDrawable,
|
driCreateNewDrawable,
|
||||||
dri2CreateNewContextForAPI,
|
driCreateNewContextForAPI,
|
||||||
dri2CreateContextAttribs,
|
driCreateContextAttribs,
|
||||||
driSWRastCreateNewScreen2,
|
driSWRastCreateNewScreen2,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue