[Mesa-dev] [PATCH 1/2] gbm: Introduce a helper function for printing GBM format names.

Daniel Stone daniel at fooishbar.org
Tue Nov 6 14:05:45 UTC 2018


Hi,

On Tue, 6 Nov 2018 at 13:11, Eric Engestrom <eric.engestrom at intel.com> wrote:
> On Friday, 2018-11-02 14:40:49 -0700, Eric Anholt wrote:
> > +GBM_EXPORT char *
> > +gbm_format_get_name(uint32_t gbm_format, struct gbm_format_name_desc *desc)
> > +{
>
> Actually, This won't work with the two GBM_BO_FORMAT_{X,A}RGB8888; you
> should add them as a special case here, something like:
>
>   if (gbm_format == GBM_BO_FORMAT_XRGB8888)
>      return "XRGB8888";
>
>   if (gbm_format == GBM_BO_FORMAT_ARGB8888)
>      return "ARGB8888";
>
> followed by your desc->name code.

Perhaps better would be to just lift gbm_format_canonicalize() from
src/gbm/backends/dri/gbm_dri.c and use it at function entry.

Cheers,
Daniel


More information about the mesa-dev mailing list