dri: Move driCopySubBufferExtension into drisw

drisw is the only consumer so rename things to make it a bit more
obvious.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16377>
This commit is contained in:
Adam Jackson 2022-05-06 10:49:04 -04:00 committed by Marge Bot
parent abb0ea31ca
commit 6c546ece69
3 changed files with 17 additions and 18 deletions

View File

@ -1029,19 +1029,3 @@ const __DRIimageDriverExtension driImageDriverExtension = {
.getAPIMask = driGetAPIMask,
.createContextAttribs = driCreateContextAttribs,
};
/* swrast copy sub buffer entrypoint. */
static void driCopySubBuffer(__DRIdrawable *pdp, int x, int y,
int w, int h)
{
assert(pdp->driScreenPriv->swrast_loader);
pdp->driScreenPriv->driver->CopySubBuffer(pdp, x, y, w, h);
}
/* for swrast only */
const __DRIcopySubBufferExtension driCopySubBufferExtension = {
.base = { __DRI_COPY_SUB_BUFFER, 1 },
.copySubBuffer = driCopySubBuffer,
};

View File

@ -72,7 +72,6 @@ extern const __DRIswrastExtension driSWRastExtension;
extern const __DRIdri2Extension driDRI2Extension;
extern const __DRIdri2Extension swkmsDRI2Extension;
extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
extern const __DRI2flushControlExtension dri2FlushControlExtension;
/**

View File

@ -614,11 +614,27 @@ static const struct __DRIDriverVtableExtensionRec galliumsw_vtable = {
.vtable = &galliumsw_driver_api,
};
/* swrast copy sub buffer entrypoint. */
static void driswCopySubBuffer(__DRIdrawable *pdp, int x, int y,
int w, int h)
{
assert(pdp->driScreenPriv->swrast_loader);
pdp->driScreenPriv->driver->CopySubBuffer(pdp, x, y, w, h);
}
/* for swrast only */
const __DRIcopySubBufferExtension driSWCopySubBufferExtension = {
.base = { __DRI_COPY_SUB_BUFFER, 1 },
.copySubBuffer = driswCopySubBuffer,
};
/* This is the table of extensions that the loader will dlsym() for. */
const __DRIextension *galliumsw_driver_extensions[] = {
&driCoreExtension.base,
&driSWRastExtension.base,
&driCopySubBufferExtension.base,
&driSWCopySubBufferExtension.base,
&gallium_config_options.base,
&galliumsw_vtable.base,
NULL