[Mesa-dev] [PATCH] gbm: add missing R8 and GR88 formats

Rob Clark robdclark at gmail.com
Mon Sep 5 13:54:25 UTC 2016


On Mon, Sep 5, 2016 at 6:50 AM, Eric Engestrom
<eric.engestrom at imgtec.com> wrote:
> On Sat, Sep 03, 2016 at 08:52:07AM -0400, Rob Clark wrote:
>> Signed-off-by: Rob Clark <robdclark at gmail.com>
>
> Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>
>
>> ---
>> I would have added RG88 except we seem to have no corresponding
>> __DRI_IMAGE_FORMAT_RG88
>>
>>  src/gbm/backends/dri/gbm_dri.c | 6 ++++++
>>  src/gbm/main/gbm.h             | 6 ++++++
>>  2 files changed, 12 insertions(+)
>>
>> diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c
>> index bd0f348..6295b4f 100644
>> --- a/src/gbm/backends/dri/gbm_dri.c
>> +++ b/src/gbm/backends/dri/gbm_dri.c
>> @@ -869,6 +869,12 @@ gbm_dri_bo_create(struct gbm_device *gbm,
>>     bo->base.base.format = format;
>>
>>     switch (format) {
>> +   case GBM_FORMAT_R8:
>> +      dri_format =__DRI_IMAGE_FORMAT_R8;
>
> nit: missing space after `=` (although to be fair,
>      __DRI_IMAGE_FORMAT_RGB565 is missing it too)

oh, whoops.. I guess easy to miss with things that start with "__".
Thanks for pointing that out, I've fixed it up locally

BR,
-R

>> +      break;
>> +   case GBM_FORMAT_GR88:
>> +      dri_format = __DRI_IMAGE_FORMAT_GR88;
>> +      break;
>>     case GBM_FORMAT_RGB565:
>>        dri_format =__DRI_IMAGE_FORMAT_RGB565;
>>        break;
>> diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h
>> index 293cae6..59daaa1 100644
>> --- a/src/gbm/main/gbm.h
>> +++ b/src/gbm/main/gbm.h
>> @@ -85,6 +85,12 @@ enum gbm_bo_format {
>>  /* color index */
>>  #define GBM_FORMAT_C8                __gbm_fourcc_code('C', '8', ' ', ' ') /* [7:0] C */
>>
>> +/* 8 bpp Red */
>> +#define GBM_FORMAT_R8                __gbm_fourcc_code('R', '8', ' ', ' ') /* [7:0] R */
>> +
>> +/* 16 bpp RG */
>> +#define GBM_FORMAT_GR88              __gbm_fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */
>> +
>>  /* 8 bpp RGB */
>>  #define GBM_FORMAT_RGB332    __gbm_fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */
>>  #define GBM_FORMAT_BGR233    __gbm_fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */
>> --
>> 2.7.4


More information about the mesa-dev mailing list