[Mesa-dev] [PATCH] st/dri: don't expose modifiers in EGL if the driver doesn't implement them
Daniel Stone
daniel at fooishbar.org
Wed Sep 27 15:00:49 UTC 2017
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.
Cheers,
Daniel
More information about the mesa-dev
mailing list