i965: implement createImageWithModifiers2

This implements __DRIimageExtension version 19.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8106>
This commit is contained in:
Simon Ser 2019-12-22 21:49:10 +01:00 committed by Marge Bot
parent 23b0112ce1
commit 8eba1ac329

View file

@ -731,11 +731,6 @@ brw_create_image_common(__DRIscreen *dri_screen,
uint64_t modifier = DRM_FORMAT_MOD_INVALID;
bool ok;
/* Callers of this may specify a modifier, or a dri usage, but not both. The
* newer modifier interface deprecates the older usage flags.
*/
assert(!(use && count));
if (use & __DRI_IMAGE_USE_CURSOR) {
if (width != 64 || height != 64)
return NULL;
@ -916,6 +911,17 @@ brw_create_image_with_modifiers(__DRIscreen *dri_screen,
modifiers, count, loaderPrivate);
}
static __DRIimage *
brw_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 brw_create_image_common(dri_screen, width, height, format, use,
modifiers, count, loaderPrivate);
}
static GLboolean
brw_query_image(__DRIimage *image, int attrib, int *value)
{
@ -1511,7 +1517,7 @@ brw_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
}
static const __DRIimageExtension brwImageExtension = {
.base = { __DRI_IMAGE, 16 },
.base = { __DRI_IMAGE, 19 },
.createImageFromName = brw_create_image_from_name,
.createImageFromRenderbuffer = brw_create_image_from_renderbuffer,
@ -1534,6 +1540,7 @@ static const __DRIimageExtension brwImageExtension = {
.queryDmaBufFormats = brw_query_dma_buf_formats,
.queryDmaBufModifiers = brw_query_dma_buf_modifiers,
.queryDmaBufFormatModifierAttribs = brw_query_format_modifier_attribs,
.createImageWithModifiers2 = brw_create_image_with_modifiers2,
};
static int