Skip to contentSkip to conversation

Add XYUV format support

PATCH Superseded Stanislav Lisovskiy 4 participants 10 messages Aug 29, 2018 – Aug 31, 2018

Subsystems (3)

v7 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v7 cover Add XYUV format support

Introduced new XYUV scan-in format for framebuffer and added support for it to i915 driver.

Stanislav Lisovskiy (2):
drm: Introduce new DRM_FORMAT_XYUV
drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

 drivers/gpu/drm/drm_fourcc.c         | 1 +
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_sprite.c  | 1 +
 include/uapi/drm/drm_fourcc.h        | 1 +
 4 files changed, 11 insertions(+)
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH v7 1/2 drm: Introduce new DRM_FORMAT_XYUV

v5: This is YUV444 packed format same as AYUV, but without alpha,
as supported by i915.

v6: Removed unneeded initializer for new XYUV format.

v7: Added is_yuv field initialization according to latest
drm_fourcc format structure initialization changes.

---
 drivers/gpu/drm/drm_fourcc.c  | 1 +
 include/uapi/drm/drm_fourcc.h | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/drm_fourcc.c +1 -0
index 35c1e2742c27..2ad09c7ecebc 100644
@@ -173,6 +173,7 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .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_XYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +1 -0
index 2ed46e9ae16a..5ba5b1473342 100644
@@ -148,6 +148,7 @@ extern "C" {
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
 
 #define DRM_FORMAT_AYUV		fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_XYUV		fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
 
 /*
  * 2 plane RGB + A
Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v7 2/2 drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

In reply to Stanislav Lisovskiy

PLANE_CTL_FORMAT_AYUV is already supported, according to hardware specification.

v2: Edited commit message, removed redundant whitespaces.

v3: Fixed fallthrough logic for the format switch cases.

v4: Yet again fixed fallthrough logic, to reuse code from other case
labels.

v5: Started to use XYUV instead of AYUV, as we don't use alpha.

v6: Removed unneeded initializer for new XYUV format.

v7: Added scaling support for DRM_FORMAT_XYUV

---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_sprite.c  | 1 +
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +8 -0
index 30fdfd1a3037..3c96fa3a2b61 100644
@@ -86,6 +86,7 @@ static const uint32_t skl_primary_formats[] = {
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_XYUV,
 };
 
 static const uint32_t skl_pri_planar_formats[] = {
@@ -102,6 +103,7 @@ static const uint32_t skl_pri_planar_formats[] = {
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
 	DRM_FORMAT_NV12,
+	DRM_FORMAT_XYUV,
 };
 
 static const uint64_t skl_format_modifiers_noccs[] = {
@@ -3501,6 +3503,8 @@ static u32 skl_plane_ctl_format(uint32_t pixel_format)
 		return PLANE_CTL_FORMAT_XRGB_2101010;
 	case DRM_FORMAT_XBGR2101010:
 		return PLANE_CTL_ORDER_RGBX | PLANE_CTL_FORMAT_XRGB_2101010;
+	case DRM_FORMAT_XYUV:
+		return PLANE_CTL_FORMAT_AYUV;
 	case DRM_FORMAT_YUYV:
 		return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YUYV;
 	case DRM_FORMAT_YVYU:
@@ -4959,6 +4963,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		break;
 	default:
 		DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported scaling format 0x%x\n",
@@ -13399,6 +13404,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 
 	switch (format) {
+
 	case DRM_FORMAT_XRGB8888:
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
@@ -13414,6 +13420,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
 		/* fall through */
@@ -14540,6 +14547,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
 			goto err;
 		}
 		break;
+	case DRM_FORMAT_XYUV:
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_YVYU:
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index c286dda625e4..2ac9471974c2 100644
@@ -1420,6 +1420,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
 		/* fall through */
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

Re: [Intel-gfx] [PATCH v7 2/2] drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

Quoted 35 lines · Stanislav Lisovskiy

PLANE_CTL_FORMAT_AYUV is already supported, according to hardware specification.

v2: Edited commit message, removed redundant whitespaces.

v3: Fixed fallthrough logic for the format switch cases.

v4: Yet again fixed fallthrough logic, to reuse code from other case
labels.

v5: Started to use XYUV instead of AYUV, as we don't use alpha.

v6: Removed unneeded initializer for new XYUV format.

v7: Added scaling support for DRM_FORMAT_XYUV

---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_sprite.c  | 1 +
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 30fdfd1a3037..3c96fa3a2b61 100644
@@ -86,6 +86,7 @@ static const uint32_t skl_primary_formats[] = {
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_XYUV,
 };
 
 static const uint32_t skl_pri_planar_formats[] = {

drivers/gpu/drm/i915/intel_display.c static const uint32_t skl_pri_planar_formats[] = { · line 106

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -102,6 +103,7 @@ static const uint32_t skl_pri_planar_formats[] = {
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
 	DRM_FORMAT_NV12,
+	DRM_FORMAT_XYUV,

I would keep the NV12 at the end so that the arrays are easier to compare visually.

drivers/gpu/drm/i915/intel_display.c static u32 skl_plane_ctl_format(uint32_t pixel_format) · line 3507

Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
 };
 
 static const uint64_t skl_format_modifiers_noccs[] = {
@@ -3501,6 +3503,8 @@ static u32 skl_plane_ctl_format(uint32_t pixel_format)
 		return PLANE_CTL_FORMAT_XRGB_2101010;
 	case DRM_FORMAT_XBGR2101010:
 		return PLANE_CTL_ORDER_RGBX | PLANE_CTL_FORMAT_XRGB_2101010;
+	case DRM_FORMAT_XYUV:
+		return PLANE_CTL_FORMAT_AYUV;

We should probably rename that define to XYUV as well since it doesn't support per-pixel alpha.

Since you've only implemented this for skl+ you chould mention that in the commit msg. IVB+ support should be equally trivial to implement (wink wink).

Quoted 12 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_YUYV:
 		return PLANE_CTL_FORMAT_YUV422 | PLANE_CTL_YUV422_YUYV;
 	case DRM_FORMAT_YVYU:
@@ -4959,6 +4963,7 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		break;
 	default:
 		DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported scaling format 0x%x\n",

drivers/gpu/drm/i915/intel_display.c static bool skl_plane_format_mod_supported(struct drm_plane *_plane, · line 13407

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -13399,6 +13404,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 
 	switch (format) {
+

Bogus whitespace.

Quoted 12 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_XRGB8888:
 	case DRM_FORMAT_XBGR8888:
 	case DRM_FORMAT_ARGB8888:
@@ -13414,6 +13420,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
 		/* fall through */

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, · line 14550

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -14540,6 +14547,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
 			goto err;
 		}
 		break;
+	case DRM_FORMAT_XYUV:

That's not the right spot if we want the platform checks to match your choice of skl+.

Quoted 22 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_YVYU:
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index c286dda625e4..2ac9471974c2 100644
@@ -1420,6 +1420,7 @@ static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
 		/* fall through */
Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Re: [PATCH v7 2/2] drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

Quoted 12 lines · Ville Syrjälä
Quoted 11 lines · Stanislav Lisovskiy

PLANE_CTL_FORMAT_AYUV is already supported, according to hardware specification.

v2: Edited commit message, removed redundant whitespaces.

v3: Fixed fallthrough logic for the format switch cases.

v4: Yet again fixed fallthrough logic, to reuse code from other case
labels.

Quoted 5 lines
Quoted 5 lines

v5: Started to use XYUV instead of AYUV, as we don't use alpha.

v6: Removed unneeded initializer for new XYUV format.

v7: Added scaling support for DRM_FORMAT_XYUV

I don't see yuv formats in skl_format_to_fourcc(), any idea why?

Also, shouldn't plane_color_ctl_alpha() be updated?

Quoted 116 lines
Quoted 21 lines
---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_sprite.c  | 1 +
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 30fdfd1a3037..3c96fa3a2b61 100644
@@ -86,6 +86,7 @@ static const uint32_t skl_primary_formats[] = {
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_XYUV,
 };
 
 static const uint32_t skl_pri_planar_formats[] = {

drivers/gpu/drm/i915/intel_display.c static const uint32_t skl_pri_planar_formats[] · line 107

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -102,6 +103,7 @@ static const uint32_t skl_pri_planar_formats[]
 = {
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
 	DRM_FORMAT_NV12,
+	DRM_FORMAT_XYUV,

I would keep the NV12 at the end so that the arrays are easier to compare visually.

drivers/gpu/drm/i915/intel_display.c static u32 skl_plane_ctl_format(uint32_t · line 3509

Quoted 11 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 };
 

static const uint64_t skl_format_modifiers_noccs[] = {

drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -3501,6 +3503,8 @@ static u32 skl_plane_ctl_format(uint32_t
 pixel_format)
 		return PLANE_CTL_FORMAT_XRGB_2101010;
 	case DRM_FORMAT_XBGR2101010:
 		return PLANE_CTL_ORDER_RGBX |
 PLANE_CTL_FORMAT_XRGB_2101010;
+	case DRM_FORMAT_XYUV:
+		return PLANE_CTL_FORMAT_AYUV;

We should probably rename that define to XYUV as well since it doesn't
support per-pixel alpha.

Since you've only implemented this for skl+ you chould mention that in the commit msg. IVB+ support should be equally trivial to implement (wink wink).

Quoted 15 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:

return PLANE_CTL_FORMAT_YUV422 |
PLANE_CTL_YUV422_YUYV;

drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_YVYU:
@@ -4959,6 +4963,7 @@ static int skl_update_scaler_plane(struct
 intel_crtc_state *crtc_state,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		break;
 	default:

DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported
scaling format 0x%x\n",

drivers/gpu/drm/i915/intel_display.c static bool · line 13408

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -13399,6 +13404,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 
 	switch (format) {
+

Bogus whitespace.

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_XRGB8888:
 	case DRM_FORMAT_XBGR8888:
drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_ARGB8888:
@@ -13414,6 +13420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
drivers/gpu/drm/i915/intel_display.c +0 -0
 		/* fall through */

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct · line 14551

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -14540,6 +14547,7 @@ static int intel_framebuffer_init(struct
 intel_framebuffer *intel_fb,
 			goto err;
 		}
 		break;
+	case DRM_FORMAT_XYUV:

That's not the right spot if we want the platform checks to match your
choice of skl+.

Quoted 20 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_UYVY:
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YVYU:
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index c286dda625e4..2ac9471974c2 100644
@@ -1420,6 +1420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;

/* fall through */

Signature · 1 line
2.17.0
Quoted 6 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

Re: [PATCH v7 2/2] drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

Quoted 15 lines · Dhinakaran Pandiyan
Quoted 13 lines · Ville Syrjälä
Quoted 11 lines · Stanislav Lisovskiy

PLANE_CTL_FORMAT_AYUV is already supported, according to hardware specification.

v2: Edited commit message, removed redundant whitespaces.

v3: Fixed fallthrough logic for the format switch cases.

v4: Yet again fixed fallthrough logic, to reuse code from other case
labels.

Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

v5: Started to use XYUV instead of AYUV, as we don't use alpha.

v6: Removed unneeded initializer for new XYUV format.

v7: Added scaling support for DRM_FORMAT_XYUV

I don't see yuv formats in skl_format_to_fourcc(), any idea why?

Good point. I guess would be nice idea to add at least XYUV there now. I can add rest of the formats with a separate patch afterwards.

Quoted 2 lines

Also, shouldn't plane_color_ctl_alpha() be updated?

I guess not, as we don't support alpha in that case.

Quoted 125 lines
Quoted 125 lines
Quoted 25 lines
Quoted 1 line
---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_sprite.c  | 1 +
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 30fdfd1a3037..3c96fa3a2b61 100644
@@ -86,6 +86,7 @@ static const uint32_t skl_primary_formats[] = {
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_XYUV,
 };
 
 static const uint32_t skl_pri_planar_formats[] = {
@@ -102,6 +103,7 @@ static const uint32_t

skl_pri_planar_formats[]
= {

drivers/gpu/drm/i915/intel_display.c static const uint32_t skl_pri_planar_formats[] = { · line 106

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
 	DRM_FORMAT_NV12,
+	DRM_FORMAT_XYUV,

I would keep the NV12 at the end so that the arrays are easier to compare visually.

drivers/gpu/drm/i915/intel_display.c static u32 skl_plane_ctl_format(uint32_t · line 3509

Quoted 11 lines

};

static const uint64_t skl_format_modifiers_noccs[] = {

drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -3501,6 +3503,8 @@ static u32 skl_plane_ctl_format(uint32_t
 pixel_format)
 		return PLANE_CTL_FORMAT_XRGB_2101010;
 	case DRM_FORMAT_XBGR2101010:
 		return PLANE_CTL_ORDER_RGBX |
 PLANE_CTL_FORMAT_XRGB_2101010;
+	case DRM_FORMAT_XYUV:
+		return PLANE_CTL_FORMAT_AYUV;

We should probably rename that define to XYUV as well since it doesn't
support per-pixel alpha.

Since you've only implemented this for skl+ you chould mention that in the commit msg. IVB+ support should be equally trivial to implement (wink wink).

Quoted 15 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:

return PLANE_CTL_FORMAT_YUV422 |
PLANE_CTL_YUV422_YUYV;

drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_YVYU:
@@ -4959,6 +4963,7 @@ static int skl_update_scaler_plane(struct
 intel_crtc_state *crtc_state,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		break;
 	default:

DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported
scaling format 0x%x\n",

drivers/gpu/drm/i915/intel_display.c static bool · line 13408

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -13399,6 +13404,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 
 	switch (format) {
+

Bogus whitespace.

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_XRGB8888:
 	case DRM_FORMAT_XBGR8888:
drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_ARGB8888:
@@ -13414,6 +13420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
drivers/gpu/drm/i915/intel_display.c +0 -0
 		/* fall through */

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct · line 14551

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -14540,6 +14547,7 @@ static int intel_framebuffer_init(struct
 intel_framebuffer *intel_fb,
 			goto err;
 		}
 		break;
+	case DRM_FORMAT_XYUV:

That's not the right spot if we want the platform checks to match your
choice of skl+.

Quoted 24 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_UYVY:
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YVYU:
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index c286dda625e4..2ac9471974c2 100644
@@ -1420,6 +1420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;

/* fall through */

Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Best Regards,

Lisovskiy Stanislav
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

Re: [PATCH v7 2/2] drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

Quoted 11 lines · Stanislav
Quoted 10 lines · Dhinakaran Pandiyan
Quoted 8 lines · Ville Syrjälä
Quoted 6 lines · Stanislav Lisovskiy

PLANE_CTL_FORMAT_AYUV is already supported, according to hardware
specification.

v2: Edited commit message, removed redundant whitespaces.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

v3: Fixed fallthrough logic for the format switch cases.

v4: Yet again fixed fallthrough logic, to reuse code from other case
labels.

v5: Started to use XYUV instead of AYUV, as we don't use alpha.

Curious what the reason is. Is it because the hardware does not support alpha with this format?

Quoted 10 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

v6: Removed unneeded initializer for new XYUV format.

v7: Added scaling support for DRM_FORMAT_XYUV

I don't see yuv formats in skl_format_to_fourcc(), any idea why?

Good point. I guess would be nice idea to add at least XYUV there now.
I can add rest of the formats with a separate patch afterwards.

Wonder if the expectation is BIOS not use yuv formats. Ville?

Quoted 5 lines
Quoted 3 lines

Also, shouldn't plane_color_ctl_alpha() be updated?

I guess not, as we don't support alpha in that case.

Right, the default case should take care of setting PLANE_CTL_ALPHA_DISABLE. I misread it.

Quoted 125 lines
Quoted 125 lines
Quoted 125 lines
Quoted 29 lines

om

Quoted 1 line
---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_sprite.c  | 1 +
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 30fdfd1a3037..3c96fa3a2b61 100644
@@ -86,6 +86,7 @@ static const uint32_t skl_primary_formats[] =
 {
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_XYUV,
 };
 

static const uint32_t skl_pri_planar_formats[] = {

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -102,6 +103,7 @@ static const uint32_t

skl_pri_planar_formats[]
= {

drivers/gpu/drm/i915/intel_display.c static const uint32_t skl_pri_planar_formats[] = { · line 106

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
 	DRM_FORMAT_NV12,
+	DRM_FORMAT_XYUV,

I would keep the NV12 at the end so that the arrays are easier to compare visually.

drivers/gpu/drm/i915/intel_display.c static u32 skl_plane_ctl_format(uint32_t · line 3509

Quoted 11 lines

};

static const uint64_t skl_format_modifiers_noccs[] = {

drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -3501,6 +3503,8 @@ static u32 skl_plane_ctl_format(uint32_t
 pixel_format)
 		return PLANE_CTL_FORMAT_XRGB_2101010;
 	case DRM_FORMAT_XBGR2101010:
 		return PLANE_CTL_ORDER_RGBX |
 PLANE_CTL_FORMAT_XRGB_2101010;
+	case DRM_FORMAT_XYUV:
+		return PLANE_CTL_FORMAT_AYUV;

We should probably rename that define to XYUV as well since it doesn't
support per-pixel alpha.

Since you've only implemented this for skl+ you chould mention that
in the commit msg. IVB+ support should be equally trivial to implement (wink wink).

Quoted 15 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:

return PLANE_CTL_FORMAT_YUV422 |
PLANE_CTL_YUV422_YUYV;

drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_YVYU:
@@ -4959,6 +4963,7 @@ static int skl_update_scaler_plane(struct
 intel_crtc_state *crtc_state,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		break;
 	default:

DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d unsupported
scaling format 0x%x\n",

drivers/gpu/drm/i915/intel_display.c static bool · line 13408

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -13399,6 +13404,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 
 	switch (format) {
+

Bogus whitespace.

Quoted 15 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_XRGB8888:
 	case DRM_FORMAT_XBGR8888:
drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_ARGB8888:
@@ -13414,6 +13420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
drivers/gpu/drm/i915/intel_display.c +0 -0
 		/* fall through */
@@ -14540,6 +14547,7 @@ static int

intel_framebuffer_init(struct
intel_framebuffer *intel_fb,

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, · line 14550

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
 			goto err;
 		}
 		break;
+	case DRM_FORMAT_XYUV:

That's not the right spot if we want the platform checks to match your
choice of skl+.

Quoted 20 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_YVYU:
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index c286dda625e4..2ac9471974c2 100644
@@ -1420,6 +1420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;

/* fall through */

Signature · 1 line
2.17.0
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 3 lines
Best Regards,

Lisovskiy Stanislav

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

Re: [Intel-gfx] [PATCH v7 2/2] drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

Quoted 19 lines · Dhinakaran Pandiyan
Quoted 18 lines · Stanislav
Quoted 17 lines · Dhinakaran Pandiyan
Quoted 15 lines · Ville Syrjälä
Quoted 13 lines · Stanislav Lisovskiy

PLANE_CTL_FORMAT_AYUV is already supported, according to hardware
specification.

v2: Edited commit message, removed redundant whitespaces.

v3: Fixed fallthrough logic for the format switch cases.

v4: Yet again fixed fallthrough logic, to reuse code from other
case
labels.

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

v5: Started to use XYUV instead of AYUV, as we don't use alpha.

Curious what the reason is. Is it because the hardware does not support
alpha with this format?

As I understood yes, this is a hardware limitation.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines

v6: Removed unneeded initializer for new XYUV format.

v7: Added scaling support for DRM_FORMAT_XYUV

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

I don't see yuv formats in skl_format_to_fourcc(), any idea why?

Good point. I guess would be nice idea to add at least XYUV there now.
I can add rest of the formats with a separate patch afterwards.

Wonder if the expectation is BIOS not use yuv formats. Ville?

I talked to Ville yesterday, I think that was basically what he said.

Quoted 153 lines
Quoted 6 lines
Quoted 4 lines

Also, shouldn't plane_color_ctl_alpha() be updated?

I guess not, as we don't support alpha in that case.

Right, the default case should take care of setting PLANE_CTL_ALPHA_DISABLE. I misread it.

Quoted 143 lines
Quoted 138 lines
Quoted 138 lines
Quoted 31 lines

.c
om

Quoted 1 line
---
 drivers/gpu/drm/i915/intel_display.c | 8 ++++++++
 drivers/gpu/drm/i915/intel_sprite.c  | 1 +
 2 files changed, 9 insertions(+)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 30fdfd1a3037..3c96fa3a2b61 100644
@@ -86,6 +86,7 @@ static const uint32_t skl_primary_formats[]

=
{

drivers/gpu/drm/i915/intel_display.c +1 -0
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
+	DRM_FORMAT_XYUV,
 };
 
 static const uint32_t skl_pri_planar_formats[] = {
@@ -102,6 +103,7 @@ static const uint32_t

skl_pri_planar_formats[]
= {

drivers/gpu/drm/i915/intel_display.c static const uint32_t skl_pri_planar_formats[] = { · line 106

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
 	DRM_FORMAT_NV12,
+	DRM_FORMAT_XYUV,

I would keep the NV12 at the end so that the arrays are easier to
compare visually.

drivers/gpu/drm/i915/intel_display.c static u32 skl_plane_ctl_format(uint32_t pixel_format) · line 3507

Quoted 12 lines

};

static const uint64_t skl_format_modifiers_noccs[] = {

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -3501,6 +3503,8 @@ static u32

skl_plane_ctl_format(uint32_t
pixel_format)

drivers/gpu/drm/i915/intel_display.c +0 -0
 		return PLANE_CTL_FORMAT_XRGB_2101010;
 	case DRM_FORMAT_XBGR2101010:
 		return PLANE_CTL_ORDER_RGBX |

PLANE_CTL_FORMAT_XRGB_2101010;

drivers/gpu/drm/i915/intel_display.c +2 -0
+	case DRM_FORMAT_XYUV:
+		return PLANE_CTL_FORMAT_AYUV;

We should probably rename that define to XYUV as well since it doesn't
support per-pixel alpha.

Since you've only implemented this for skl+ you chould mention that
in the commit msg. IVB+ support should be equally trivial to implement (wink wink).

Quoted 17 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:
 		return PLANE_CTL_FORMAT_YUV422 |

PLANE_CTL_YUV422_YUYV;

drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YVYU:
@@ -4959,6 +4963,7 @@ static int

skl_update_scaler_plane(struct
intel_crtc_state *crtc_state,

drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		break;
 	default:
 		DRM_DEBUG_KMS("[PLANE:%d:%s] FB:%d

unsupported
scaling format 0x%x\n",

drivers/gpu/drm/i915/intel_display.c static bool · line 13408

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -13399,6 +13404,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 
 	switch (format) {
+

Bogus whitespace.

Quoted 15 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_XRGB8888:
 	case DRM_FORMAT_XBGR8888:
drivers/gpu/drm/i915/intel_display.c +1 -0
 	case DRM_FORMAT_ARGB8888:
@@ -13414,6 +13420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;
drivers/gpu/drm/i915/intel_display.c +0 -0
 		/* fall through */
@@ -14540,6 +14547,7 @@ static int

intel_framebuffer_init(struct
intel_framebuffer *intel_fb,

drivers/gpu/drm/i915/intel_display.c static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, · line 14550

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
 			goto err;
 		}
 		break;
+	case DRM_FORMAT_XYUV:

That's not the right spot if we want the platform checks to match
your
choice of skl+.

Quoted 24 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	case DRM_FORMAT_YUYV:
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_YVYU:
drivers/gpu/drm/i915/intel_sprite.c +1 -0
index c286dda625e4..2ac9471974c2 100644
@@ -1420,6 +1420,7 @@ static bool
 skl_plane_format_mod_supported(struct drm_plane *_plane,
 	case DRM_FORMAT_UYVY:
 	case DRM_FORMAT_VYUY:
 	case DRM_FORMAT_NV12:
+	case DRM_FORMAT_XYUV:
 		if (modifier == I915_FORMAT_MOD_Yf_TILED)
 			return true;

/* fall through */

Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Best Regards,

Lisovskiy Stanislav
Signature · 7 lines
Best Regards,

Lisovskiy Stanislav
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

Re: [PATCH v7 2/2] drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support.

Quoted 37 lines · Stanislav
Quoted 19 lines · Dhinakaran Pandiyan
Quoted 18 lines · Stanislav
Quoted 17 lines · Dhinakaran Pandiyan
Quoted 15 lines · Ville Syrjälä
Quoted 13 lines · Stanislav Lisovskiy

PLANE_CTL_FORMAT_AYUV is already supported, according to hardware
specification.

v2: Edited commit message, removed redundant whitespaces.

v3: Fixed fallthrough logic for the format switch cases.

v4: Yet again fixed fallthrough logic, to reuse code from other
case
labels.

Quoted 6 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

v5: Started to use XYUV instead of AYUV, as we don't use alpha.

Curious what the reason is. Is it because the hardware does not support
alpha with this format?

As I understood yes, this is a hardware limitation.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

v6: Removed unneeded initializer for new XYUV format.

v7: Added scaling support for DRM_FORMAT_XYUV

I don't see yuv formats in skl_format_to_fourcc(), any idea why?

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Good point. I guess would be nice idea to add at least XYUV there now.
I can add rest of the formats with a separate patch afterwards.

Wonder if the expectation is BIOS not use yuv formats. Ville?

I talked to Ville yesterday, I think that was basically what he said.

Yes. Although I have this dream of full plane state readout (which we could then use for verification purposes at least), so adding the missing formats there would be a decent idea.

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

✗ Fi.CI.CHECKPATCH: warning for Add XYUV format support (rev3)

In reply to Stanislav Lisovskiy
== Series Details ==

== Series Details ==

Series: Add XYUV format support (rev3)
URL : https://patchwork.freedesktop.org/series/48007/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
015d06e009fe drm: Introduce new DRM_FORMAT_XYUV
-:24: WARNING:LONG_LINE: line over 100 characters
#24: FILE: drivers/gpu/drm/drm_fourcc.c:176:
+		{ .format = DRM_FORMAT_XYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },

-:36: WARNING:LONG_LINE_COMMENT: line over 100 characters #36: FILE: include/uapi/drm/drm_fourcc.h:151:
+#define DRM_FORMAT_XYUV fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */

total: 0 errors, 2 warnings, 0 checks, 14 lines checked d3957b3d5c70 drm/i915: Adding YUV444 packed format(DRM_FORMAT_XYUV) support. -:66: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #66: FILE: drivers/gpu/drm/i915/intel_display.c:13406:
switch (format) {
+

total: 0 errors, 0 warnings, 1 checks, 57 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx