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 – Apr 13, 2020

Subsystems (3)

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v5 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. Enabling the plane property for the planes for GLK & ICL+ platforms.

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

V3: Refined the condition check to handle GLK & ICL+ HDR planes
Also added BT2020 handling in glk_plane_color_ctl.

V4: Combine If-else into single If

V5: Drop the checking for HDR planes and enable YCBCR_BT2020
for platforms GLK & ICL+.

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display.c | 12 +++++++++---
 drivers/gpu/drm/i915/display/intel_sprite.c  |  9 +++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +9 -3
index 70ec301fe6e3..f2dfa61a49fa 100644
@@ -4808,11 +4808,17 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
 	plane_color_ctl |= glk_plane_color_ctl_alpha(plane_state);
 
 	if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) {
-		if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
+		switch (plane_state->hw.color_encoding) {
+		case DRM_COLOR_YCBCR_BT709:
 			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709;
-		else
+			break;
+		case DRM_COLOR_YCBCR_BT2020:
+			plane_color_ctl |=
+					PLANE_COLOR_CSC_MODE_YUV2020_TO_RGB2020;
+			break;
+		default:
 			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV601_TO_RGB709;
-
+		}
 		if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
 			plane_color_ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;
 	} else if (fb->format->is_yuv) {
drivers/gpu/drm/i915/display/intel_sprite.c +7 -2
index deda351719db..0072525046a1 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,13 @@ 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))
+		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

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Add Plane color encoding support for YCBCR_BT2020 (rev4)

== Series Details ==

== Series Details ==

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

== Summary ==

CI Bug Log - changes from CI_DRM_8277 -> Patchwork_17254
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/index.html

Known issues
------------

Here are the changes found in Patchwork_17254 that come from known issues:

### IGT changes ###

#### Possible fixes ####

* igt@gem_exec_suspend@basic-s4-devices:
- fi-tgl-y: [FAIL][1] ([i915#1158]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/fi-tgl-y/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/fi-tgl-y/igt@[email protected]

[i915#1158]: https://gitlab.freedesktop.org/drm/intel/issues/1158

Participating hosts (52 -> 47)
------------------------------

Additional (1): fi-kbl-7560u
Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_8277 -> Patchwork_17254

CI-20190529: 20190529
CI_DRM_8277: f7d56913e1668f3a269db391189a7888a4b22570 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5581: ab0620e555119ec55f12ba9ab9e6e9246d407648 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17254: 5242e025d754e381e9299aac90078dd14b29011e @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

5242e025d754 drm/i915: Add Plane color encoding support for YCBCR_BT2020

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

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

In reply to Kishore Kadiyala
== Series Details ==

== Series Details ==

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

== Summary ==

CI Bug Log - changes from CI_DRM_8277_full -> Patchwork_17254_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_17254_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_17254_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_17254_full:

### IGT changes ###

#### Possible regressions ####

* igt@gem_softpin@noreloc-s3:
- shard-iclb: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-iclb5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-iclb3/igt@[email protected]

#### Suppressed ####

The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.

* {igt@sysfs_heartbeat_interval@mixed@vecs0}:
- shard-skl: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-skl10/igt@sysfs_heartbeat_interval@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-skl5/igt@sysfs_heartbeat_interval@[email protected]

Known issues
------------

Here are the changes found in Patchwork_17254_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gen9_exec_parse@allowed-all:
- shard-glk: [PASS][5] -> [DMESG-WARN][6] ([i915#716])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-glk5/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-glk2/igt@[email protected]
- shard-kbl: [PASS][7] -> [DMESG-WARN][8] ([i915#716])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-kbl7/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-kbl1/igt@[email protected]

* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [PASS][9] -> [DMESG-WARN][10] ([i915#180]) +2 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-kbl6/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-kbl7/igt@[email protected]
- shard-apl: [PASS][11] -> [DMESG-WARN][12] ([i915#180])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-apl8/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-apl4/igt@[email protected]

* igt@kms_flip@plain-flip-ts-check:
- shard-skl: [PASS][13] -> [FAIL][14] ([i915#34])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-skl8/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-skl8/igt@[email protected]

* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [PASS][15] -> [SKIP][16] ([fdo#109441]) +4 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-iclb4/igt@kms_psr@psr2_primary_mmap_cpu.html

* igt@kms_setmode@basic:
- shard-apl: [PASS][17] -> [FAIL][18] ([i915#31])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-apl3/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-apl8/igt@[email protected]

#### Possible fixes ####

* igt@kms_busy@basic-flip-pipe-a:
- shard-kbl: [INCOMPLETE][19] -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-kbl7/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-kbl3/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-64x21-onscreen:
- shard-skl: [FAIL][21] ([i915#54]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-skl6/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-skl7/igt@[email protected]

* igt@kms_hdr@bpc-switch:
- shard-skl: [FAIL][23] ([i915#1188]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-skl2/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-skl10/igt@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-kbl: [DMESG-WARN][25] ([i915#180]) -> [PASS][26] +3 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-kbl1/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-kbl2/igt@[email protected]

* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-apl: [DMESG-WARN][27] ([i915#180]) -> [PASS][28] +2 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-apl4/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-apl2/igt@[email protected]

* igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
- shard-skl: [FAIL][29] ([fdo#108145] / [i915#265]) -> [PASS][30] +1 similar issue
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-skl7/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-skl5/igt@[email protected]

* igt@kms_psr@psr2_sprite_plane_move:
- shard-iclb: [SKIP][31] ([fdo#109441]) -> [PASS][32] +3 similar issues
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-iclb4/igt@kms_psr@psr2_sprite_plane_move.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html

* {igt@perf@blocking-parameterized}:
- shard-iclb: [FAIL][33] ([i915#1542]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-iclb7/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-iclb7/igt@[email protected]

#### Warnings ####

* igt@i915_pm_rpm@modeset-lpsp-stress:
- shard-snb: [SKIP][35] ([fdo#109271]) -> [INCOMPLETE][36] ([i915#82])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-snb4/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-snb4/igt@[email protected]

* igt@kms_fbcon_fbt@fbc-suspend:
- shard-kbl: [DMESG-FAIL][37] ([i915#180] / [i915#95]) -> [FAIL][38] ([i915#93] / [i915#95])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-kbl7/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-kbl1/igt@[email protected]

* igt@kms_psr2_su@page_flip:
- shard-iclb: [FAIL][39] ([i915#608]) -> [SKIP][40] ([fdo#109642] / [fdo#111068])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-iclb2/igt@kms_psr2_su@page_flip.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-iclb4/igt@kms_psr2_su@page_flip.html

* igt@runner@aborted:
- shard-kbl: [FAIL][41] ([i915#1423] / [i915#92]) -> ([FAIL][42], [FAIL][43]) ([i915#1423] / [i915#716] / [i915#92])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8277/shard-kbl3/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-kbl1/igt@[email protected]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/shard-kbl6/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1423]: https://gitlab.freedesktop.org/drm/intel/issues/1423
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#34]: https://gitlab.freedesktop.org/drm/intel/issues/34
[i915#54]: https://gitlab.freedesktop.org/drm/intel/issues/54
[i915#608]: https://gitlab.freedesktop.org/drm/intel/issues/608
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#82]: https://gitlab.freedesktop.org/drm/intel/issues/82
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#93]: https://gitlab.freedesktop.org/drm/intel/issues/93
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (10 -> 10)
------------------------------

No changes in participating hosts

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_8277 -> Patchwork_17254

CI-20190529: 20190529
CI_DRM_8277: f7d56913e1668f3a269db391189a7888a4b22570 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5581: ab0620e555119ec55f12ba9ab9e6e9246d407648 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17254: 5242e025d754e381e9299aac90078dd14b29011e @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17254/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v5 1/1
#3 lore raw
In reply to Kishore Kadiyala
Quoted 18 lines

-----Original Message-----
From: Kadiyala, Kishore <[email protected]>
Sent: Wednesday, April 8, 2020 7:52 PM
To: [email protected]
Cc: Kadiyala, Kishore <[email protected]>; Ville Syrjala <[email protected]>; Shankar, Uma <[email protected]>; Nikula, Jani <[email protected]>
Subject: [PATCH v5] 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.
Enabling the plane property for the planes for GLK & ICL+ platforms.

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

Quoted 7 lines

V3: Refined the condition check to handle GLK & ICL+ HDR planes
Also added BT2020 handling in glk_plane_color_ctl.

V4: Combine If-else into single If

V5: Drop the checking for HDR planes and enable YCBCR_BT2020
for platforms GLK & ICL+.

Looks Good to me.

Quoted 76 lines
Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display.c | 12 +++++++++---
drivers/gpu/drm/i915/display/intel_sprite.c  |  9 +++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +8 -2
index 70ec301fe6e3..f2dfa61a49fa 100644
@@ -4808,11 +4808,17 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state
 *crtc_state,
 	plane_color_ctl |= glk_plane_color_ctl_alpha(plane_state);
 
 	if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) {
-		if (plane_state->hw.color_encoding ==
 DRM_COLOR_YCBCR_BT709)
+		switch (plane_state->hw.color_encoding) {
+		case DRM_COLOR_YCBCR_BT709:
 			plane_color_ctl |=
 PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709;
-		else
+			break;
+		case DRM_COLOR_YCBCR_BT2020:
+			plane_color_ctl |=
+
 	PLANE_COLOR_CSC_MODE_YUV2020_TO_RGB2020;
+			break;
+		default:
 			plane_color_ctl |=

PLANE_COLOR_CSC_MODE_YUV601_TO_RGB709;

drivers/gpu/drm/i915/display/intel_display.c +1 -1
-
+		}
 		if (plane_state->hw.color_range ==

DRM_COLOR_YCBCR_FULL_RANGE)
plane_color_ctl |=
PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;

drivers/gpu/drm/i915/display/intel_display.c +0 -0
 	} else if (fb->format->is_yuv) {
drivers/gpu/drm/i915/display/intel_sprite.c +1 -0
index deda351719db..0072525046a1 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 +7 -2
 	int num_formats;
@@ -3105,9 +3106,13 @@ 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))
+		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) |

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

2.17.1

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

#4 lore raw
In reply to Kishore Kadiyala
Quoted 34 lines · Kishore Kadiyala

Currently the plane property doesn't have support for YCBCR_BT2020, which enables the corresponding color conversion mode on plane CSC. Enabling the plane property for the planes for GLK & ICL+ platforms.

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

V3: Refined the condition check to handle GLK & ICL+ HDR planes
Also added BT2020 handling in glk_plane_color_ctl.

V4: Combine If-else into single If

V5: Drop the checking for HDR planes and enable YCBCR_BT2020
for platforms GLK & ICL+.

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display.c | 12 +++++++++---
 drivers/gpu/drm/i915/display/intel_sprite.c  |  9 +++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +1 -1
index 70ec301fe6e3..f2dfa61a49fa 100644
@@ -4808,11 +4808,17 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
 	plane_color_ctl |= glk_plane_color_ctl_alpha(plane_state);
 
 	if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) {
-		if (plane_state->hw.color_encoding == DRM_COLOR_YCBCR_BT709)
+		switch (plane_state->hw.color_encoding) {

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state, · line 4820

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_display.c +7 -1
+		case DRM_COLOR_YCBCR_BT709:
 			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709;
-		else
+			break;
+		case DRM_COLOR_YCBCR_BT2020:
+			plane_color_ctl |=
+					PLANE_COLOR_CSC_MODE_YUV2020_TO_RGB2020;
+			break;
+		default:
 			plane_color_ctl |= PLANE_COLOR_CSC_MODE_YUV601_TO_RGB709;

IIRC the spec has been fixed in the meantime, so as a followup can you rename this to YUV601_TO_RGB601?

Quoted 35 lines
drivers/gpu/drm/i915/display/intel_display.c +1 -1
-
+		}
 		if (plane_state->hw.color_range == DRM_COLOR_YCBCR_FULL_RANGE)
 			plane_color_ctl |= PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;
 	} else if (fb->format->is_yuv) {
drivers/gpu/drm/i915/display/intel_sprite.c +7 -2
index deda351719db..0072525046a1 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,13 @@ 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))
+		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 · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 58 lines

-----Original Message-----
From: Ville Syrjälä <[email protected]>
Sent: Thursday, April 9, 2020 10:43 PM
To: Kadiyala, Kishore <[email protected]>
Cc: [email protected]; Shankar, Uma <[email protected]>; Nikula, Jani <[email protected]>
Subject: Re: [PATCH v5] drm/i915: Add Plane color encoding support for YCBCR_BT2020

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct

Quoted 30 lines · Kishore Kadiyala

Currently the plane property doesn't have support for YCBCR_BT2020, which enables the corresponding color conversion mode on plane CSC. Enabling the plane property for the planes for GLK & ICL+ platforms.

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

V3: Refined the condition check to handle GLK & ICL+ HDR planes
Also added BT2020 handling in glk_plane_color_ctl.

V4: Combine If-else into single If

V5: Drop the checking for HDR planes and enable YCBCR_BT2020
for platforms GLK & ICL+.

Cc Ville Syrjala <[email protected]>
Cc Uma Shankar <[email protected]>
Cc Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display.c | 12 +++++++++---
drivers/gpu/drm/i915/display/intel_sprite.c  |  9 +++++++--
 2 files changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +0 -0
index 70ec301fe6e3..f2dfa61a49fa 100644
@@ -4808,11 +4808,17 @@ u32 glk_plane_color_ctl(const struct

intel_crtc_state *crtc_state,

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_display.c +0 -1
 	plane_color_ctl |= glk_plane_color_ctl_alpha(plane_state);
 
 	if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) {
-		if (plane_state->hw.color_encoding ==

DRM_COLOR_YCBCR_BT709)

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,

Quoted 3 lines
drivers/gpu/drm/i915/display/intel_display.c +2 -0
+		switch (plane_state->hw.color_encoding) {
+		case DRM_COLOR_YCBCR_BT709:
 			plane_color_ctl |=

PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709;

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,

Quoted 5 lines
drivers/gpu/drm/i915/display/intel_display.c +4 -1
-		else
+			break;
+		case DRM_COLOR_YCBCR_BT2020:
+			plane_color_ctl |=
+
	PLANE_COLOR_CSC_MODE_YUV2020_TO_RGB2020;
Quoted 7 lines

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,

Quoted 3 lines
drivers/gpu/drm/i915/display/intel_display.c +2 -0
+			break;
+		default:
 			plane_color_ctl |=

PLANE_COLOR_CSC_MODE_YUV601_TO_RGB709;

IIRC the spec has been fixed in the meantime, so as a followup can you rename this to YUV601_TO_RGB601?

Sure Ville

Thanks,
Kishore

Quoted 39 lines

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,

Quoted 3 lines
drivers/gpu/drm/i915/display/intel_display.c +1 -1
-
+		}
 		if (plane_state->hw.color_range ==

DRM_COLOR_YCBCR_FULL_RANGE)

drivers/gpu/drm/i915/display/intel_display.c u32 glk_plane_color_ctl(const struct · line 4823

Quoted 1 line
drivers/gpu/drm/i915/display/intel_display.c +0 -0
 			plane_color_ctl |=

PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE;

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

Quoted 7 lines
drivers/gpu/drm/i915/display/intel_display.c +0 -0
 	} else if (fb->format->is_yuv) {
drivers/gpu/drm/i915/display/intel_sprite.c +0 -0
index deda351719db..0072525046a1 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,13 @@ skl_universal_plane_create(struct

drm_i915_private *dev_priv,

Quoted 4 lines
drivers/gpu/drm/i915/display/intel_sprite.c +1 -0
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
+	supported_csc = BIT(DRM_COLOR_YCBCR_BT601) |

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

Quoted 10 lines
drivers/gpu/drm/i915/display/intel_sprite.c +6 -2
+BIT(DRM_COLOR_YCBCR_BT709);
+
+	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
+		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 8 lines

BIT(DRM_COLOR_YCBCR_FULL_RANGE),

Quoted 3 lines

DRM_COLOR_YCBCR_BT709,
--
2.17.1

--
Ville Syrjälä
Intel

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