[Mesa-dev] [PATCH 1/3] egl/wayland: Ignore invalid modifiers

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 24 11:46:57 UTC 2017


On 24 July 2017 at 12:22, Daniel Stone <daniel at fooishbar.org> wrote:
> Hi Emil,
>
> On 24 July 2017 at 12:18, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> On 21 July 2017 at 14:34, Daniel Stone <daniels at collabora.com> wrote:
>>> @@ -370,6 +370,9 @@ get_back_bo(struct dri2_egl_surface *dri2_surf)
>>>        return -1;
>>>     }
>>>
>>> +   if (num_modifiers == 0)
>>> +      modifiers = NULL;
>>> +
>> AFAICT this hunk is not needed - modifiers is accessed only when
>> num_modifiers is non-zero.
>
> It's divergent inside Gallium, where resource_create_with_modifiers
> will be called rather than resource_create if modifiers != NULL.
>
Excuse my ignorance, I must be having a really stupid moment.
What does Gallium has to do here?

Having a skim trough gallium - there's two ways we can get into
resource_create_with_modifiers.
 - createImage - dri2_create_image explicitly passes zero to both
storage and count
 - createImageWithModifiers - cannot be called since num_modifiers being zero

Thanks
Emil


More information about the mesa-dev mailing list