loader/dri: hook up createImageWithModifiers2

Call into the new modifiers with usage createImage variant when available
to provide the DRI implementation with more context about the allocation.

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:
Lucas Stach 2020-12-15 14:59:21 +01:00 committed by Marge Bot
parent 8eba1ac329
commit c03e79d783
1 changed files with 9 additions and 3 deletions

View File

@ -57,9 +57,15 @@ __DRIimage *loader_dri_create_image(__DRIscreen *screen,
if (!has_valid_modifier)
return NULL;
return image->createImageWithModifiers(screen, width, height,
dri_format, modifiers,
modifiers_count, loaderPrivate);
if (image->base.version >= 19 && image->createImageWithModifiers2)
return image->createImageWithModifiers2(screen, width, height,
dri_format, modifiers,
modifiers_count, dri_usage,
loaderPrivate);
else
return image->createImageWithModifiers(screen, width, height,
dri_format, modifiers,
modifiers_count, loaderPrivate);
}
/* No modifier given or fallback to the legacy createImage allowed */