dri: add createImageWithModifiers2 interface

With the addition of createImageWithModifiers usage flags were
dropped, as it was believed at the time that modifers will be a
full replacement for the usage flags. This has turned out to be
untrue, as modifiers are not able to describe buffer placement.

Add a new version of the interface, that allows to specifiy
use flags in addition to the modifier.

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 2020-12-14 18:32:47 +01:00 committed by Marge Bot
parent 8fd5b16efc
commit afd8b2f498
1 changed files with 23 additions and 1 deletions

View File

@ -1328,7 +1328,7 @@ struct __DRIdri2ExtensionRec {
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
#define __DRI_IMAGE_VERSION 18
#define __DRI_IMAGE_VERSION 19
/**
* These formats correspond to the similarly named MESA_FORMAT_*
@ -1803,6 +1803,28 @@ struct __DRIimageExtensionRec {
uint32_t flags,
unsigned *error,
void *loaderPrivate);
/**
* Creates an image with implementation's favorite modifiers and the
* provided usage flags.
*
* This acts like createImageWithModifiers except usage is also specified.
*
* 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 19
*/
__DRIimage *(*createImageWithModifiers2)(__DRIscreen *screen,
int width, int height, int format,
const uint64_t *modifiers,
const unsigned int modifier_count,
unsigned int use,
void *loaderPrivate);
};