dri: Remove old createImageWithModifiers

Everyone can use createImageWithModifiers2, which is now just called
createImageWithModifiers.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30245>
This commit is contained in:
Daniel Stone
2024-05-15 15:45:18 +01:00
committed by Marge Bot
parent 3bfd157483
commit 60cb420996
5 changed files with 18 additions and 60 deletions

View File

@@ -1350,22 +1350,10 @@ dri2_create_image(__DRIscreen *_screen,
static __DRIimage * static __DRIimage *
dri2_create_image_with_modifiers(__DRIscreen *dri_screen, dri2_create_image_with_modifiers(__DRIscreen *dri_screen,
int width, int height, int format, int width, int height, int format,
const uint64_t *modifiers, const uint64_t *modifiers,
const unsigned count, const unsigned count, unsigned int use,
void *loaderPrivate) void *loaderPrivate)
{
return dri2_create_image_common(dri_screen, width, height, format,
__DRI_IMAGE_USE_SHARE, modifiers, count,
loaderPrivate);
}
static __DRIimage *
dri2_create_image_with_modifiers2(__DRIscreen *dri_screen,
int width, int height, int format,
const uint64_t *modifiers,
const unsigned count, unsigned int use,
void *loaderPrivate)
{ {
return dri2_create_image_common(dri_screen, width, height, format, use, return dri2_create_image_common(dri_screen, width, height, format, use,
modifiers, count, loaderPrivate); modifiers, count, loaderPrivate);
@@ -2054,7 +2042,6 @@ static const __DRIimageExtension dri2ImageExtensionTempl = {
.queryDmaBufFormats = NULL, .queryDmaBufFormats = NULL,
.queryDmaBufModifiers = NULL, .queryDmaBufModifiers = NULL,
.queryDmaBufFormatModifierAttribs = NULL, .queryDmaBufFormatModifierAttribs = NULL,
.createImageWithModifiers2 = NULL,
.queryCompressionRates = NULL, .queryCompressionRates = NULL,
.queryCompressionModifiers = NULL, .queryCompressionModifiers = NULL,
}; };
@@ -2083,7 +2070,6 @@ const __DRIimageExtension driVkImageExtension = {
.queryDmaBufFormats = dri2_query_dma_buf_formats, .queryDmaBufFormats = dri2_query_dma_buf_formats,
.queryDmaBufModifiers = dri2_query_dma_buf_modifiers, .queryDmaBufModifiers = dri2_query_dma_buf_modifiers,
.queryDmaBufFormatModifierAttribs = dri2_query_dma_buf_format_modifier_attribs, .queryDmaBufFormatModifierAttribs = dri2_query_dma_buf_format_modifier_attribs,
.createImageWithModifiers2 = dri2_create_image_with_modifiers2,
}; };
const __DRIimageExtension driVkImageExtensionSw = { const __DRIimageExtension driVkImageExtensionSw = {
@@ -2337,8 +2323,6 @@ dri2_init_screen_extensions(struct dri_screen *screen,
if (pscreen->resource_create_with_modifiers) { if (pscreen->resource_create_with_modifiers) {
screen->image_extension.createImageWithModifiers = screen->image_extension.createImageWithModifiers =
dri2_create_image_with_modifiers; dri2_create_image_with_modifiers;
screen->image_extension.createImageWithModifiers2 =
dri2_create_image_with_modifiers2;
} }
if (pscreen->get_param(pscreen, PIPE_CAP_NATIVE_FENCE_FD)) { if (pscreen->get_param(pscreen, PIPE_CAP_NATIVE_FENCE_FD)) {

View File

@@ -1556,30 +1556,6 @@ struct __DRIimageExtensionRec {
*/ */
void (*unmapImage)(__DRIcontext *context, __DRIimage *image, void *data); void (*unmapImage)(__DRIcontext *context, __DRIimage *image, void *data);
/**
* Creates an image with implementation's favorite modifiers.
*
* This acts like createImage except there is a list of modifiers passed in
* which the implementation may selectively use to create the DRIimage. The
* result should be the implementation selects one modifier (perhaps it would
* hold on to a few and later pick).
*
* The created image should be destroyed with destroyImage().
*
* Returns the new DRIimage. The chosen modifier can be obtained later on
* and passed back to things like the kernel's AddFB2 interface.
*
* \sa __DRIimageRec::createImage
*
* \since 14
*/
__DRIimage *(*createImageWithModifiers)(__DRIscreen *screen,
int width, int height, int format,
const uint64_t *modifiers,
const unsigned int modifier_count,
void *loaderPrivate);
/* /*
* Like createImageFromDmaBufs, with fewer options. * Like createImageFromDmaBufs, with fewer options.
* *
@@ -1697,8 +1673,6 @@ struct __DRIimageExtensionRec {
* Creates an image with implementation's favorite modifiers and the * Creates an image with implementation's favorite modifiers and the
* provided usage flags. * provided usage flags.
* *
* This acts like createImageWithModifiers except usage is also specified.
*
* The created image should be destroyed with destroyImage(). * The created image should be destroyed with destroyImage().
* *
* Returns the new DRIimage. The chosen modifier can be obtained later on * Returns the new DRIimage. The chosen modifier can be obtained later on
@@ -1708,12 +1682,12 @@ struct __DRIimageExtensionRec {
* *
* \since 19 * \since 19
*/ */
__DRIimage *(*createImageWithModifiers2)(__DRIscreen *screen, __DRIimage *(*createImageWithModifiers)(__DRIscreen *screen,
int width, int height, int format, int width, int height, int format,
const uint64_t *modifiers, const uint64_t *modifiers,
const unsigned int modifier_count, const unsigned int modifier_count,
unsigned int use, unsigned int use,
void *loaderPrivate); void *loaderPrivate);
/** /**
* Set an in-fence-fd on the image. If a fence-fd is already set * Set an in-fence-fd on the image. If a fence-fd is already set

View File

@@ -981,7 +981,7 @@ gbm_dri_bo_create(struct gbm_device *gbm,
/* Gallium drivers requires shared in order to get the handle/stride */ /* Gallium drivers requires shared in order to get the handle/stride */
dri_use |= __DRI_IMAGE_USE_SHARE; dri_use |= __DRI_IMAGE_USE_SHARE;
if (modifiers && !dri->image->createImageWithModifiers2) { if (modifiers && !dri->image->createImageWithModifiers) {
errno = ENOSYS; errno = ENOSYS;
goto failed; goto failed;
} }
@@ -1166,7 +1166,7 @@ gbm_dri_surface_create(struct gbm_device *gbm,
struct gbm_dri_device *dri = gbm_dri_device(gbm); struct gbm_dri_device *dri = gbm_dri_device(gbm);
struct gbm_dri_surface *surf; struct gbm_dri_surface *surf;
if (modifiers && !dri->image->createImageWithModifiers2) { if (modifiers && !dri->image->createImageWithModifiers) {
errno = ENOSYS; errno = ENOSYS;
return NULL; return NULL;
} }

View File

@@ -1463,7 +1463,7 @@ dri3_alloc_render_buffer(struct loader_dri3_drawable *draw, unsigned int format,
#ifdef HAVE_DRI3_MODIFIERS #ifdef HAVE_DRI3_MODIFIERS
if (draw->multiplanes_available && if (draw->multiplanes_available &&
draw->ext->image->queryDmaBufModifiers && draw->ext->image->queryDmaBufModifiers &&
draw->ext->image->createImageWithModifiers2) { draw->ext->image->createImageWithModifiers) {
xcb_dri3_get_supported_modifiers_cookie_t mod_cookie; xcb_dri3_get_supported_modifiers_cookie_t mod_cookie;
xcb_dri3_get_supported_modifiers_reply_t *mod_reply; xcb_dri3_get_supported_modifiers_reply_t *mod_reply;
xcb_generic_error_t *error = NULL; xcb_generic_error_t *error = NULL;

View File

@@ -38,7 +38,7 @@ __DRIimage *loader_dri_create_image(__DRIscreen *screen,
unsigned int modifiers_count, unsigned int modifiers_count,
void *loaderPrivate) void *loaderPrivate)
{ {
if (modifiers && modifiers_count > 0 && image->createImageWithModifiers2) { if (modifiers && modifiers_count > 0 && image->createImageWithModifiers) {
bool has_valid_modifier = false; bool has_valid_modifier = false;
int i; int i;
@@ -57,10 +57,10 @@ __DRIimage *loader_dri_create_image(__DRIscreen *screen,
if (!has_valid_modifier) if (!has_valid_modifier)
return NULL; return NULL;
return image->createImageWithModifiers2(screen, width, height, return image->createImageWithModifiers(screen, width, height,
dri_format, modifiers, dri_format, modifiers,
modifiers_count, dri_usage, modifiers_count, dri_usage,
loaderPrivate); loaderPrivate);
} }
/* No modifier given or fallback to the legacy createImage allowed */ /* No modifier given or fallback to the legacy createImage allowed */