Skip to contentSkip to conversation

drm/i915: Add Plane color encoding support for YCBCR_BT2020

PATCH Superseded Kishore Kadiyala 4 participants 6 messages Apr 8, 2020

Subsystems (3)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm/i915: Add Plane color encoding support for YCBCR_BT2020

Currently the plane property doesn't have support for YCBCR_BT2020, which enables the corresponding color conversion mode on plane CSC. This propery setting is confined only to HDR Planes as there is limitation in SDR Planes.

V2: Enabling support for YCBCT_BT2020 for HDR planes on
platforms GLK & ICL

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_sprite.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_sprite.c +8 -2
index deda351719db..4c25d90d16ce 100644
@@ -3031,6 +3031,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
 	struct intel_plane *plane;
 	enum drm_plane_type plane_type;
 	unsigned int supported_rotations;
+	unsigned int supported_csc;
 	const u64 *modifiers;
 	const u32 *formats;
 	int num_formats;
@@ -3105,9 +3106,14 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
+	supported_csc = BIT(DRM_COLOR_YCBCR_BT601) | BIT(DRM_COLOR_YCBCR_BT709);
+
+	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv) &&
+					(icl_is_hdr_plane(dev_priv, plane_id)))
+		supported_csc |= BIT(DRM_COLOR_YCBCR_BT2020);
+
 	drm_plane_create_color_properties(&plane->base,
-					  BIT(DRM_COLOR_YCBCR_BT601) |
-					  BIT(DRM_COLOR_YCBCR_BT709),
+					  supported_csc,
 					  BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
 					  BIT(DRM_COLOR_YCBCR_FULL_RANGE),
 					  DRM_COLOR_YCBCR_BT709,
Signature · 6 lines
2.17.1

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

-----Original Message-----
From: Kadiyala, Kishore <[email protected]>
Sent: Wednesday, April 8, 2020 2:18 PM
To: [email protected]
Cc: Kadiyala, Kishore <[email protected]>; Ville Syrjala <[email protected]>; Shankar, Uma <[email protected]>
Subject: [PATCH v2] drm/i915: Add Plane color encoding support for YCBCR_BT2020

Quoted 4 lines

Currently the plane property doesn't have support for YCBCR_BT2020, which enables the corresponding color conversion mode on plane CSC.
This propery setting is confined only to HDR Planes as there is limitation in SDR Planes.

Append that this restriction is for ICL+

Quoted 25 lines

V2: Enabling support for YCBCT_BT2020 for HDR planes on
platforms GLK & ICL

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_sprite.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_sprite.c +1 -0
index deda351719db..4c25d90d16ce 100644
@@ -3031,6 +3031,7 @@ skl_universal_plane_create(struct drm_i915_private
 *dev_priv,
 	struct intel_plane *plane;
 	enum drm_plane_type plane_type;
 	unsigned int supported_rotations;
+	unsigned int supported_csc;
 	const u64 *modifiers;
 	const u32 *formats;
drivers/gpu/drm/i915/display/intel_sprite.c +0 -0
 	int num_formats;

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private · line 3114

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_sprite.c +5 -0
@@ -3105,9 +3106,14 @@ skl_universal_plane_create(struct drm_i915_private
 *dev_priv,
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
+	supported_csc = BIT(DRM_COLOR_YCBCR_BT601) |
+BIT(DRM_COLOR_YCBCR_BT709);
+
+	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv) &&
+					(icl_is_hdr_plane(dev_priv, plane_id)))

Refine this condition to enable for all GLK planes and restrict this only to bottom 3 HDR planes for ICL. Will be good to mention a comment as well that ICL SDR planes have some issues with BT2020 conversion, hence not enabling it on those planes for ICL.

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private *dev_priv, · line 3116

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_sprite.c +3 -2
+		supported_csc |= BIT(DRM_COLOR_YCBCR_BT2020);
+
 	drm_plane_create_color_properties(&plane->base,
-					  BIT(DRM_COLOR_YCBCR_BT601) |
-					  BIT(DRM_COLOR_YCBCR_BT709),
+					  supported_csc,

Handle the BT2020 format in glk_plane_color_ctl as well for GLK.

Quoted 5 lines

BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |

drivers/gpu/drm/i915/display/intel_sprite.c +0 -1
 					  BIT(DRM_COLOR_YCBCR_FULL_RANGE),
 					  DRM_COLOR_YCBCR_BT709,
--

2.17.1

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

#2 lore raw
Quoted 58 lines

-----Original Message-----
From: Shankar, Uma <[email protected]>
Sent: Wednesday, April 8, 2020 2:21 PM
To: Kadiyala, Kishore <[email protected]>; intel- [email protected]
Cc: Ville Syrjala <[email protected]>
Subject: RE: [PATCH v2] drm/i915: Add Plane color encoding support for YCBCR_BT2020

Quoted 9 lines

-----Original Message-----
From: Kadiyala, Kishore <[email protected]>
Sent: Wednesday, April 8, 2020 2:18 PM
To: [email protected]
Cc: Kadiyala, Kishore <[email protected]>; Ville Syrjala <[email protected]>; Shankar, Uma <[email protected]>
Subject: [PATCH v2] drm/i915: Add Plane color encoding support for YCBCR_BT2020

Quoted 4 lines

Currently the plane property doesn't have support for YCBCR_BT2020, which enables the corresponding color conversion mode on plane CSC. This propery setting is confined only to HDR Planes as there is limitation in SDR Planes.

Append that this restriction is for ICL+

Quoted 29 lines

V2: Enabling support for YCBCT_BT2020 for HDR planes on
platforms GLK & ICL

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_sprite.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_sprite.c +1 -0
index deda351719db..4c25d90d16ce 100644
@@ -3031,6 +3031,7 @@ skl_universal_plane_create(struct
 drm_i915_private *dev_priv,
 	struct intel_plane *plane;
 	enum drm_plane_type plane_type;
 	unsigned int supported_rotations;
+	unsigned int supported_csc;
 	const u64 *modifiers;
 	const u32 *formats;
drivers/gpu/drm/i915/display/intel_sprite.c +0 -0
 	int num_formats;
@@ -3105,9 +3106,14 @@ skl_universal_plane_create(struct
 drm_i915_private *dev_priv,
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
Quoted 11 lines

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private *dev_priv, · line 3112

Quoted 5 lines
drivers/gpu/drm/i915/display/intel_sprite.c +5 -0
+	supported_csc = BIT(DRM_COLOR_YCBCR_BT601) |
+BIT(DRM_COLOR_YCBCR_BT709);
+
+	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv) &&
+					(icl_is_hdr_plane(dev_priv, plane_id)))

Refine this condition to enable for all GLK planes and restrict this only to bottom 3 HDR planes for ICL. Will be good to mention a comment as well that ICL SDR planes have some issues with BT2020 conversion, hence not enabling it on those planes for ICL.

Sure Uma , will do the changes

Quoted 9 lines

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private *dev_priv, · line 3116

Quoted 6 lines
drivers/gpu/drm/i915/display/intel_sprite.c +3 -2
+		supported_csc |= BIT(DRM_COLOR_YCBCR_BT2020);
+
 	drm_plane_create_color_properties(&plane->base,
-					  BIT(DRM_COLOR_YCBCR_BT601) |
-					  BIT(DRM_COLOR_YCBCR_BT709),
+					  supported_csc,

Handle the BT2020 format in glk_plane_color_ctl as well for GLK.

Ok Uma, will fix

Quoted 6 lines
Quoted 2 lines

BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |

BIT(DRM_COLOR_YCBCR_FULL_RANGE),

Quoted 3 lines

DRM_COLOR_YCBCR_BT709,
--
2.17.1

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

maintainer
#3 lore raw
In reply to Kishore Kadiyala
Quoted 27 lines · Kishore Kadiyala

Currently the plane property doesn't have support for YCBCR_BT2020, which enables the corresponding color conversion mode on plane CSC. This propery setting is confined only to HDR Planes as there is limitation in SDR Planes.

V2: Enabling support for YCBCT_BT2020 for HDR planes on
platforms GLK & ICL

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_sprite.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_sprite.c +1 -0
index deda351719db..4c25d90d16ce 100644
@@ -3031,6 +3031,7 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
 	struct intel_plane *plane;
 	enum drm_plane_type plane_type;
 	unsigned int supported_rotations;
+	unsigned int supported_csc;
 	const u64 *modifiers;
 	const u32 *formats;
 	int num_formats;

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private *dev_priv, · line 3112

Quoted 7 lines
drivers/gpu/drm/i915/display/intel_sprite.c +4 -0
@@ -3105,9 +3106,14 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
+	supported_csc = BIT(DRM_COLOR_YCBCR_BT601) | BIT(DRM_COLOR_YCBCR_BT709);
+
+	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv) &&
+					(icl_is_hdr_plane(dev_priv, plane_id)))

This is incorrect and/or misleading in so many levels.

First, the precedence means this is

	(gen >= 10 || (is_glk && icl_is_hdr_plane))

Second, it's odd to have an icl_ prefixed function used only on glk.

Third, icl_is_hdr_plane() internally has gen >= 11. So the right hand part of the || is always false.

Fourth, there's no point in wrapping the icl_is_hdr_plane() in parens.

Fifth, does this really apply to gen 10 cnl?

BR,
Jani.

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_sprite.c +3 -2
+		supported_csc |= BIT(DRM_COLOR_YCBCR_BT2020);
+
 	drm_plane_create_color_properties(&plane->base,
-					  BIT(DRM_COLOR_YCBCR_BT601) |
-					  BIT(DRM_COLOR_YCBCR_BT709),
+					  supported_csc,
 					  BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
 					  BIT(DRM_COLOR_YCBCR_FULL_RANGE),
 					  DRM_COLOR_YCBCR_BT709,
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 57 lines

-----Original Message-----
From: Jani Nikula <[email protected]>
Sent: Wednesday, April 8, 2020 3:24 PM
To: Kadiyala, Kishore <[email protected]>; intel- [email protected]
Cc: Kadiyala, Kishore <[email protected]>
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Add Plane color encoding support for YCBCR_BT2020

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private

Quoted 20 lines · Kishore Kadiyala

Currently the plane property doesn't have support for YCBCR_BT2020, which enables the corresponding color conversion mode on plane CSC. This propery setting is confined only to HDR Planes as there is limitation in SDR Planes.

V2: Enabling support for YCBCT_BT2020 for HDR planes on
platforms GLK & ICL

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_sprite.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_sprite.c +0 -0
index deda351719db..4c25d90d16ce 100644
@@ -3031,6 +3031,7 @@ skl_universal_plane_create(struct drm_i915_private

*dev_priv,

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_sprite.c +1 -0
 	struct intel_plane *plane;
 	enum drm_plane_type plane_type;
 	unsigned int supported_rotations;
+	unsigned int supported_csc;
 	const u64 *modifiers;
 	const u32 *formats;
 	int num_formats;
@@ -3105,9 +3106,14 @@ skl_universal_plane_create(struct

drm_i915_private *dev_priv,

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private *dev_priv, · line 3112

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_sprite.c +5 -0
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
+	supported_csc = BIT(DRM_COLOR_YCBCR_BT601) |
+BIT(DRM_COLOR_YCBCR_BT709);
+
+	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv) &&
+					(icl_is_hdr_plane(dev_priv, plane_id)))

This is incorrect and/or misleading in so many levels.

First, the precedence means this is

	(gen >= 10 || (is_glk && icl_is_hdr_plane))
Quoted 8 lines

Second, it's odd to have an icl_ prefixed function used only on glk.

Third, icl_is_hdr_plane() internally has gen >= 11. So the right hand part of the || is always false.

Fourth, there's no point in wrapping the icl_is_hdr_plane() in parens.

Fifth, does this really apply to gen 10 cnl?

Agree Jani, could have been avoided
Will send updated patch

Thanks,
Kishore

Quoted 14 lines

BR,
Jani.

drivers/gpu/drm/i915/display/intel_sprite.c skl_universal_plane_create(struct drm_i915_private *dev_priv,

Quoted 7 lines
drivers/gpu/drm/i915/display/intel_sprite.c +3 -2
+		supported_csc |= BIT(DRM_COLOR_YCBCR_BT2020);
+
 	drm_plane_create_color_properties(&plane->base,
-					  BIT(DRM_COLOR_YCBCR_BT601) |
-					  BIT(DRM_COLOR_YCBCR_BT709),
+					  supported_csc,
 

BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |

Quoted 1 line
Quoted 5 lines

BIT(DRM_COLOR_YCBCR_FULL_RANGE),

Quoted 1 line

DRM_COLOR_YCBCR_BT709,

--
Jani Nikula, Intel Open Source Graphics Center

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

#5 lore raw

[Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Add Plane color encoding support for YCBCR_BT2020

In reply to Kishore Kadiyala
== Series Details ==

== Series Details ==

Series: drm/i915: Add Plane color encoding support for YCBCR_BT2020
URL : https://patchwork.freedesktop.org/series/75660/
State : failure

== Summary ==

CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
CHK include/generated/compile.h
CC [M] drivers/gpu/drm/i915/display/intel_sprite.o
drivers/gpu/drm/i915/display/intel_sprite.c: In function ‘skl_universal_plane_create’:
drivers/gpu/drm/i915/display/intel_sprite.c:3111:59: error: suggest parentheses around ‘&&’ within ‘||’ [-Werror=parentheses]
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv) &&
cc1: all warnings being treated as errors
scripts/Makefile.build:267: recipe for target 'drivers/gpu/drm/i915/display/intel_sprite.o' failed make[4]: *** [drivers/gpu/drm/i915/display/intel_sprite.o] Error 1
scripts/Makefile.build:505: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:505: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:505: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1683: recipe for target 'drivers' failed
make: *** [drivers] Error 2

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