dri: don't call modifier interfaces when modifiers_count is 0

The wayland EGL platform sets the modifier count to 0 in some cases
to signal that modifiers should not be used, even if a list of modifiers
is present. The loader_dri_create_image helper didn't handle this case
properly and called the modifierful driver interface with a 0 modifier
count, leading to the obvious outcome of the driver being unable to
allocate an image.

Fixes: cb9ae4273d ("dri: add loader_dri_create_image helper")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10903>
This commit is contained in:
Lucas Stach 2021-05-20 18:07:12 +02:00 committed by Marge Bot
parent 8b180ab98b
commit 77fcf70082
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ __DRIimage *loader_dri_create_image(__DRIscreen *screen,
unsigned int modifiers_count,
void *loaderPrivate)
{
if (modifiers &&
if (modifiers && modifiers_count > 0 &&
image->base.version > 14 && image->createImageWithModifiers) {
bool has_valid_modifier = false;
int i;