[Mesa-dev] [PATCH v3] gallium: introduce dmabuf format and modifier querying

Lucas Stach l.stach at pengutronix.de
Fri Apr 28 11:02:53 UTC 2017


Am Mittwoch, den 26.04.2017, 17:49 +0530 schrieb Varad Gautam:
> allows drivers to be queried for supported formats and format
> modifiers for EGL_EXT_image_dma_buf_import_modifiers. drivers that
> implement format/modifier queries must advertise these under
> PIPE_CAP_QUERY_DMABUF_ATTRIBS.
> 
> v2: rebase to master.
> v3: drivers must return false on query failure.
> 
> Signed-off-by: Varad Gautam <varad.gautam at collabora.com>
> ---
One more note.

[...]
> +
> +   /**
> +    * Get driver-supported drm_fourcc formats.
> +    * If \p max is 0, the total number of supported formats is returned
> +    * in \p count, with no modification to \p formats. Otherwise, \p formats
> +    * is filled with upto \p max supported format codes. Returns false on
> +    * failure.
> +    */
> +   boolean (*query_dmabuf_formats)(struct pipe_screen *screen, int max,
> +                                   int *formats, int *count);

Do we even need this? How is a dmabuf different from any other resource?
Shouldn't we just check for supported formats using the existing
is_format_supported() driver entry point (possibly with bindings set to
both sampler and render_target)?

Passing the raw drm_fourcc values here seems like a layering violation,
as those are usually handled at the st/dri level.

Regards,
Lucas

> +   /**
> +    * Get supported modifiers for a format.
> +    * If \p max is 0, the total number of supported modifiers for the supplied
> +    * format is returned in \p count, with no modification to \p modifiers.
> +    * Otherwise, \p modifiers is filled with upto \p max supported modifier
> +    * codes. Returns false when \p format is not supported by the driver.
> +    */
> +   boolean (*query_dmabuf_modifiers)(struct pipe_screen *screen,
> +                                     enum pipe_format format, int max,
> +                                     uint64_t *modifiers, int *count);
>  };
>  
> 




More information about the mesa-dev mailing list