[Mesa-dev] [PATCH] st/dri: don't expose modifiers in EGL if the driver doesn't implement them

Emil Velikov emil.l.velikov at gmail.com
Wed Sep 27 16:22:07 UTC 2017


On 27 September 2017 at 16:00, Daniel Stone <daniel at fooishbar.org> wrote:
> Hi Marek,
>
> On 27 September 2017 at 15:55, Marek Olšák <maraeo at gmail.com> wrote:
>>     if (dmabuf_ret && dmabuf_ret->val.val_bool) {
>>        uint64_t cap;
>>
>>        if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, &cap) == 0 &&
>>            (cap & DRM_PRIME_CAP_IMPORT)) {
>>           dri2ImageExtension.createImageFromFds = dri2_from_fds;
>>           dri2ImageExtension.createImageFromDmaBufs = dri2_from_dma_bufs;
>>           dri2ImageExtension.createImageFromDmaBufs2 = dri2_from_dma_bufs2;
>>           dri2ImageExtension.queryDmaBufFormats = dri2_query_dma_buf_formats;
>> -         dri2ImageExtension.queryDmaBufModifiers =
>> -                                    dri2_query_dma_buf_modifiers;
>> +         if (pscreen->query_dmabuf_modifiers) {
>> +            dri2ImageExtension.queryDmaBufModifiers =
>> +                                       dri2_query_dma_buf_modifiers;
>> +         }
>
> This should also not expose queryDmaBufFormats, since that is also
> part of EGL_EXT_image_dma_buf_import_modifiers, which is pretty
> useless without modifiers.
>
True, it's useless. Suggestion makes the code a bit confusing though.
After all EGL already checks that all the entry points are present
before advertising the extension.

Either way, I think we want this in stable, right?
Emil


More information about the mesa-dev mailing list