gbm: add GBM_FORMAT_GR1616 and RG1616

Only GR1616 has a corresponding DRI format.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13501>
This commit is contained in:
Manuel Stoeckl 2021-10-22 23:24:24 -04:00 committed by Marge Bot
parent 759eaf517a
commit 2c61d89d36
3 changed files with 11 additions and 0 deletions

View File

@ -538,6 +538,11 @@ static const struct gbm_dri_visual gbm_dri_visuals_table[] = {
{ 0, 8, -1, -1 },
{ 8, 8, 0, 0 },
},
{
GBM_FORMAT_GR1616, __DRI_IMAGE_FORMAT_GR1616,
{ 0, 16, -1, -1 },
{ 16, 16, 0, 0 },
},
{
GBM_FORMAT_ARGB1555, __DRI_IMAGE_FORMAT_ARGB1555,
{ 10, 5, 0, 11 },

View File

@ -251,6 +251,8 @@ gbm_bo_get_bpp(struct gbm_bo *bo)
case GBM_FORMAT_RGB888:
case GBM_FORMAT_BGR888:
return 24;
case GBM_FORMAT_RG1616:
case GBM_FORMAT_GR1616:
case GBM_FORMAT_XRGB8888:
case GBM_FORMAT_XBGR8888:
case GBM_FORMAT_RGBX8888:

View File

@ -100,6 +100,10 @@ enum gbm_bo_format {
/* 16 bpp RG */
#define GBM_FORMAT_GR88 __gbm_fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */
/* 32 bpp RG */
#define GBM_FORMAT_RG1616 __gbm_fourcc_code('R', 'G', '3', '2') /* [31:0] R:G 16:16 little endian */
#define GBM_FORMAT_GR1616 __gbm_fourcc_code('G', 'R', '3', '2') /* [31:0] G:R 16:16 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 */