[PATCH v2 2/5] drm/fourcc: Add tile width and height to drm_format_info
Daniel Vetter
daniel at ffwll.ch
Wed Aug 22 19:52:40 UTC 2018
On Tue, Aug 21, 2018 at 07:30:01PM +0100, Alexandru Gheorghe wrote:
> Add two new fields(tile_w and tile_h) to drm_format_info, which
> represent the horizontal and vertical sizes of a tile in tiled
> formats.
> This fields will be used by the next patch to add support in drm
> core for handling framebuffer restrictions and to correctly handle
> source cropping.
>
> Additionally, since I was touching drm_format_info table I decided to
> break the lines to the 80 characters limit, they were already getting
> out of hand, but let's not focus on that, I don't have any problem
> going back to the original line sizes or style them other way, if
> someone wants me to.
>
> Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe at arm.com>
> ---
> drivers/gpu/drm/drm_fourcc.c | 352 +++++++++++++++++++++++++++--------
> include/drm/drm_fourcc.h | 4 +
> 2 files changed, 281 insertions(+), 75 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index 18bb960e9943..f55cd93ba2d0 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
> @@ -105,81 +105,283 @@ EXPORT_SYMBOL(drm_get_format_name);
> const struct drm_format_info *__drm_format_info(u32 format)
> {
> static const struct drm_format_info formats[] = {
> - { .format = DRM_FORMAT_C8, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_RGB332, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_BGR233, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_XRGB4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_XBGR4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_RGBX4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_BGRX4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_ARGB4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_ABGR4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_RGBA4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_BGRA4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_XRGB1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_XBGR1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_RGBX5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_BGRX5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_ARGB1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_ABGR1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_RGBA5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_BGRA5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_RGB565, .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_BGR565, .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_RGB888, .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_BGR888, .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_XRGB8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_XBGR8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_RGBX8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_BGRX8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_RGB565_A8, .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_BGR565_A8, .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_XRGB2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_XBGR2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_RGBX1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_BGRX1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
> - { .format = DRM_FORMAT_ARGB2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_ABGR2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_RGBA1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_BGRA1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_ARGB8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_ABGR8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_RGBA8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_BGRA8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_RGB888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_BGR888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_XRGB8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_XBGR8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_RGBX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_BGRX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
> - { .format = DRM_FORMAT_YUV410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4, .is_yuv = true },
> - { .format = DRM_FORMAT_YVU410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4, .is_yuv = true },
> - { .format = DRM_FORMAT_YUV411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_YVU411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_YUV420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2, .is_yuv = true },
> - { .format = DRM_FORMAT_YVU420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2, .is_yuv = true },
> - { .format = DRM_FORMAT_YUV422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_YVU422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_YUV444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_YVU444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_NV12, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true },
> - { .format = DRM_FORMAT_NV21, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true },
> - { .format = DRM_FORMAT_NV16, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_NV61, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_NV24, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_NV42, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_YUYV, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_YVYU, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true },
> - { .format = DRM_FORMAT_XYUV8888, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_XVYU2101010, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
> - { .format = DRM_FORMAT_Y0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true },
> - { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true },
> - { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true },
> - { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true },
> - { .format = DRM_FORMAT_P010, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true },
> + { .format = DRM_FORMAT_C8,
> + .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_RGB332,
> + .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_BGR233,
> + .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_XRGB4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_XBGR4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_RGBX4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_BGRX4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_ARGB4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_ABGR4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_RGBA4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_BGRA4444,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_XRGB1555,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_XBGR1555,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_RGBX5551,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_BGRX5551,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, },
> + { .format = DRM_FORMAT_ARGB1555,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_ABGR1555,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_RGBA5551,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_BGRA5551,
> + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_RGB565,
> + .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_BGR565,
> + .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_RGB888,
> + .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_BGR888,
> + .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_XRGB8888,
> + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_XBGR8888,
> + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_RGBX8888,
> + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_BGRX8888,
> + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_RGB565_A8,
> + .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_BGR565_A8,
> + .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_XRGB2101010,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_XBGR2101010,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_RGBX1010102,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_BGRX1010102,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 },
> + { .format = DRM_FORMAT_ARGB2101010,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_ABGR2101010,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_RGBA1010102,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_BGRA1010102,
> + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_ARGB8888,
> + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_ABGR8888,
> + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_RGBA8888,
> + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_BGRA8888,
> + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_RGB888_A8,
> + .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_BGR888_A8,
> + .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_XRGB8888_A8,
> + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_XBGR8888_A8,
> + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_RGBX8888_A8,
> + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_BGRX8888_A8,
> + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true },
> + { .format = DRM_FORMAT_YUV410,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 4, .vsub = 4, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YVU410,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 4, .vsub = 4, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YUV411,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 4, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YVU411,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 4, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YUV420,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YVU420,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YUV422,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YVU422,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YUV444,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YVU444,
> + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_NV12,
> + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 },
> + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_NV21,
> + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 },
> + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_NV16,
> + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_NV61,
> + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_NV24,
> + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_NV42,
> + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YUYV,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_YVYU,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_UYVY,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_VYUY,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_AYUV,
> + .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .has_alpha = true, .is_yuv = true },
> + { .format = DRM_FORMAT_XYUV8888,
> + .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_XVYU2101010,
> + .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 },
> + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_Y0L0,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2,
> + .has_alpha = true, .is_yuv = true },
> + { .format = DRM_FORMAT_X0L0,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_Y0L2,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2,
> + .has_alpha = true, .is_yuv = true },
> + { .format = DRM_FORMAT_X0L2,
> + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 },
> + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2,
> + .is_yuv = true },
> + { .format = DRM_FORMAT_P010,
> + .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 },
> + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1,
> + .is_yuv = true },
> };
>
> unsigned int i;
> diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
> index f9c15845f465..41681cf2b140 100644
> --- a/include/drm/drm_fourcc.h
> +++ b/include/drm/drm_fourcc.h
> @@ -38,6 +38,8 @@ struct drm_mode_fb_cmd2;
> * @cpp: Number of bytes per pixel (per plane)
> * @hsub: Horizontal chroma subsampling factor
> * @vsub: Vertical chroma subsampling factor
> + * @tile_w: Width of a tile in pixels, for non-tiled formats this should be 1
> + * @tile_h: Height of a tile in pixels, for non-tiled formats this should be 1
I think switching to inline struct members would be good. Also I think we
need more details here about the units. Is this in pixels or in bytes?
Also would be good to be really clear in how tiles related to cpp. Or
should we want to redefine cpp as characters_per_tile?
I also think that we should encode that "0 means 1", simply for a more
compact table.
-Daniel
> * @has_alpha: Does the format embeds an alpha component?
> * @is_yuv: Is it a YUV format?
> */
> @@ -48,6 +50,8 @@ struct drm_format_info {
> u8 cpp[3];
> u8 hsub;
> u8 vsub;
> + u8 tile_w;
> + u8 tile_h;
> bool has_alpha;
> bool is_yuv;
> };
> --
> 2.18.0
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the dri-devel
mailing list