drm/fourcc: Add AXBXGXRX106106106106 format
Subsystems (2)
PATCH 1/1 drm/fourcc: Add AXBXGXRX106106106106 format
Add ABGR format with 10-bit components packed in 64-bit per pixel. This format can be used to handle VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 on little-endian architectures.
--- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 7 +++++++ 2 files changed, 8 insertions(+)
drivers/gpu/drm/drm_fourcc.c +1 -0
@@ -202,6 +202,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 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 },
include/uapi/drm/drm_fourcc.h +7 -0
@@ -155,6 +155,13 @@ extern "C" {#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H')/* [63:0] A:R:G:B 16:16:16:16 little endian */ #define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H')/* [63:0] A:B:G:R 16:16:16:16 little endian */ +/* +* RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits +* of unused padding per component: +* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian +*/ +#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') +/* packed YCbCr */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V')/* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U')/* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */
Signature · 1 line
2.17.1
Quoted 7 lines · Matteo Franchin
Add ABGR format with 10-bit components packed in 64-bit per pixel. This format can be used to handle
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16on little-endian architectures.Signed-off-by Matteo Franchin <[email protected]>
So is this essentially 16 bit, with the lowest 6 bits in each channel ignored? What exactly is this used for where the full 16bit format doesn't work?
-Daniel
Quoted 38 lines
--- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 7 +++++++ 2 files changed, 8 insertions(+)drivers/gpu/drm/drm_fourcc.c +1
-0@@ -202,6 +202,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 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 },include/uapi/drm/drm_fourcc.h +7
-1@@ -155,6 +155,13 @@ extern "C" {#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H')/* [63:0] A:R:G:B 16:16:16:16 little endian */ #define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H')/* [63:0] A:B:G:R 16:16:16:16 little endian */ +/* +* RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits +* of unused padding per component: +* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian +*/ +#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') +/* packed YCbCr */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V')/* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U')/* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ --2.17.1
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel,
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Matteo Franchin
Add ABGR format with 10-bit components packed in 64-bit per pixel. This format can be used to handle
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16on little-endian architectures.
Quoted 5 lines
Quoted 1 line
Signed-off-by Matteo Franchin <[email protected]>So is this essentially 16 bit, with the lowest 6 bits in each channel ignored? What exactly is this used for where the full 16bit format doesn't work?
If you are asking why we don't add a 16-bit format, instead (e.g. DRM_FORMAT_ABGR16161616) the answer is that this is really a 10-bit
format: only the 10 MSBs are preserved.
We'd be uncomfortable to add support for a 16-bit format and just ignore the lowest 6 bits.
Thanks,
Matteo
Quoted 27 lines
-Daniel
Quoted 25 lines
--- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 7 +++++++ 2 files changed, 8 insertions(+)drivers/gpu/drm/drm_fourcc.c +1
-0@@ -202,6 +202,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 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 },include/uapi/drm/drm_fourcc.h +0
-0@@ -155,6 +155,13 @@ extern "C" {#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H')/* [63:0] A:R:G:B 16:16:16:16 little endian */ #define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H')/* [63:0] A:B:G:R 16:16:16:16 little endian */
Quoted 23 lines
Quoted 13 lines
include/uapi/drm/drm_fourcc.h +7
-1+/* +* RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits +* of unused padding per component: +* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian +*/ +#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') +/* packed YCbCr */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V')/* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U')/* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ --2.17.1
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 28 lines · Matteo Franchin
Add ABGR format with 10-bit components packed in 64-bit per pixel. This format can be used to handle
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16on little-endian architectures.Signed-off-by Matteo Franchin <[email protected]>--- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 7 +++++++ 2 files changed, 8 insertions(+)drivers/gpu/drm/drm_fourcc.c +1
-0@@ -202,6 +202,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 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 },include/uapi/drm/drm_fourcc.h +0
-0
include/uapi/drm/drm_fourcc.h extern "C" { · line 161
Quoted 7 lines
include/uapi/drm/drm_fourcc.h +4
-0@@ -155,6 +155,13 @@ extern "C" {#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H')/* [63:0] A:R:G:B 16:16:16:16 little endian */ #define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H')/* [63:0] A:B:G:R 16:16:16:16 little endian */ +/* +* RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits +* of unused padding per component: +* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian
I think we usually put that last bit at the end of the fourcc define. In theory it makes grepping a bit nicer. The exceptions are all planar formats where each plane can have different component packing.
Quoted 13 lines
include/uapi/drm/drm_fourcc.h +3
-0+*/ +#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') +/* packed YCbCr */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V')/* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U')/* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 2 lines
Ville Syrjälä Intel
Hi Ville,
Quoted 32 lines · Ville Syrj�l�
Quoted 31 lines · Matteo Franchin
Add ABGR format with 10-bit components packed in 64-bit per pixel. This format can be used to handle
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16on little-endian architectures.Signed-off-by Matteo Franchin <[email protected]>--- drivers/gpu/drm/drm_fourcc.c | 1 + include/uapi/drm/drm_fourcc.h | 7 +++++++ 2 files changed, 8 insertions(+)drivers/gpu/drm/drm_fourcc.c +1
-0@@ -202,6 +202,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 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 },include/uapi/drm/drm_fourcc.h +0
-0@@ -155,6 +155,13 @@ extern "C" {#define DRM_FORMAT_ARGB16161616F fourcc_code('A', 'R', '4', 'H')/* [63:0] A:R:G:B 16:16:16:16 little endian */ #define DRM_FORMAT_ABGR16161616F fourcc_code('A', 'B', '4', 'H')/* [63:0] A:B:G:R 16:16:16:16 little endian */
Quoted 8 lines
include/uapi/drm/drm_fourcc.h extern "C" { · line 161
Quoted 4 lines
include/uapi/drm/drm_fourcc.h +4
-0+/* +* RGBA format with 10-bit components packed in 64-bit per pixel, with 6 bits +* of unused padding per component: +* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian I think we usually put that last bit at the end of the fourcc define. In theory it makes grepping a bit nicer. The exceptions are all planar formats where each plane can have different component packing.
Makes sense, I'll change the patch as suggested.
Thanks,
Matteo
Quoted 10 lines
Quoted 10 lines
include/uapi/drm/drm_fourcc.h +3
-0+*/ +#define DRM_FORMAT_AXBXGXRX106106106106 fourcc_code('A', 'B', '1', '0') +/* packed YCbCr */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V')/* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U')/* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ Signature · 1 line
2.17.1
Quoted 12 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 6 lines
Ville Syrj�l� Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Matteo Franchin
Add ABGR format with 10-bit components packed in 64-bit per pixel. This format can be used to handle
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16on little-endian architectures.
trivial note:
drivers/gpu/drm/drm_fourcc.c
Quoted 1 line
drivers/gpu/drm/drm_fourcc.c +0
-0
[]
drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 205
Quoted 5 lines
drivers/gpu/drm/drm_fourcc.c +1
-0@@ -202,6 +202,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
My is to separate this into 2 lines so every
column including .depth on still visually aligns.
+ { .format = DRM_FORMAT_AXBXGXRX106106106106,
+ .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Joe,
Thanks for looking at this.
Quoted 19 lines · Joe Perches
Quoted 4 lines · Matteo Franchin
Add ABGR format with 10-bit components packed in 64-bit per pixel. This format can be used to handle
VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16on little-endian architectures.trivial note:
drivers/gpu/drm/drm_fourcc.c
Quoted 1 line
drivers/gpu/drm/drm_fourcc.c +0
-0[]
drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 205
Quoted 5 lines
drivers/gpu/drm/drm_fourcc.c +1
-0@@ -202,6 +202,7 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_XBGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1 }, { .format = DRM_FORMAT_ARGB16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, { .format = DRM_FORMAT_ABGR16161616F, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, + { .format = DRM_FORMAT_AXBXGXRX106106106106, .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },My is to separate this into 2 lines so every
column including .depth on still visually aligns.
Review
Quoted 2 lines
(quoted diff) +2
-0+ { .format = DRM_FORMAT_AXBXGXRX106106106106, + .depth = 0, .num_planes = 1, .cpp = { 8, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
I think this would make grepping less useful though? Do others care about that?
Quoted 6 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel