[Mesa-dev] [PATCH v13 05/36] dri: add queryDmaBufFormats and queryDmaBufModifiers to DRIimage

Jason Ekstrand jason at jlekstrand.net
Fri May 19 18:14:19 UTC 2017


On Fri, May 19, 2017 at 2:37 AM, Daniel Stone <daniels at collabora.com> wrote:

> From: Varad Gautam <varad.gautam at collabora.com>
>
> these allow querying the driver for supported dmabuf formats and
> modifiers.
>
> v2: move to __DRIimageExtension version 16.
> v3: return GLBoolean for error reporting, document params better.
>
> Signed-off-by: Varad Gautam <varad.gautam at collabora.com>
> Reviewed-by: Daniel Stone <daniels at collabora.com>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  include/GL/internal/dri_interface.h | 42 ++++++++++++++++++++++++++++++
> ++++++-
>  1 file changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/include/GL/internal/dri_interface.h
> b/include/GL/internal/dri_interface.h
> index 53b95dd93d..37bd48b0b6 100644
> --- a/include/GL/internal/dri_interface.h
> +++ b/include/GL/internal/dri_interface.h
> @@ -1137,7 +1137,7 @@ struct __DRIdri2ExtensionRec {
>   * extensions.
>   */
>  #define __DRI_IMAGE "DRI_IMAGE"
> -#define __DRI_IMAGE_VERSION 15
> +#define __DRI_IMAGE_VERSION 16
>

Do we really need to bump the extension version twice in one patch series?
Seems like we could just as easily merge this into patch 3.  Not that it
matters...


>
>  /**
>   * These formats correspond to the similarly named MESA_FORMAT_*
> @@ -1513,6 +1513,46 @@ struct __DRIimageExtensionRec {
>                                            enum __DRIChromaSiting
> vert_siting,
>                                            unsigned *error,
>                                            void *loaderPrivate);
> +
> +   /*
> +    * dmabuf format query to support EGL_EXT_image_dma_buf_import_
> modifiers.
> +    *
> +    * \param max      Maximum number of formats that can be accomodated
> into
> +    *                 \param formats. If zero, no formats are returned -
> +    *                 instead, the driver returns the total number of
> +    *                 supported dmabuf formats in \param count.
> +    * \param formats  Buffer to fill formats into.
> +    * \param count    Count of formats returned, or, total number of
> +    *                 supported formats in case \param max is zero.
> +    *
> +    * Returns true on success.
> +    *
> +    * \since 16
> +    */
> +   GLboolean (*queryDmaBufFormats)(__DRIscreen *screen, int max, int
> *formats,
> +                              int *count);
> +
> +   /*
> +    * dmabuf format modifier query for a given format to support
> +    * EGL_EXT_image_dma_buf_import_modifiers.
> +    *
> +    * \param fourcc    The format to query modifiers for. If this format
> +    *                  is not supported by the driver, return false.
> +    * \param max       Maximum number of modifiers that can be
> accomodated in
> +    *                  \param modifiers. If zero, no modifiers are
> returned -
> +    *                  instead, the driver returns the total number of
> +    *                  modifiers for \param format in \param count.
> +    * \param modifiers Buffer to fill modifiers into.
> +    * \param count     Count of the modifiers returned, or, total number
> of
> +    *                  supported modifiers for \param fourcc in case
> +    *                  \param max is zero.
> +    *
> +    * Returns true upon success.
> +    *
> +    * \since 16
> +    */
> +   GLboolean (*queryDmaBufModifiers)(__DRIscreen *screen, int fourcc,
> int max,
> +                                uint64_t *modifiers, int *count);
>  };
>
>
> --
> 2.13.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170519/167bc5e7/attachment.html>


More information about the mesa-dev mailing list