display: Add color matrix kCscYuv2Rgb709FR
Add color matrix kCscYuv2Rgb709FR for conversion of YUV to
RGB(Full_Range) in ViG pipe when color primary of video layer
buffer is BT709_Full_Range.
CRs-Fixed: 2850969
Change-Id: Id5cefc73cbd6d4d9fdab0af46f12250fe2401b77
diff --git a/libdrmutils/drm_interface.h b/libdrmutils/drm_interface.h
index 24bbc61..364b4f7 100644
--- a/libdrmutils/drm_interface.h
+++ b/libdrmutils/drm_interface.h
@@ -1062,6 +1062,7 @@
kCscYuv2Rgb601L,
kCscYuv2Rgb601FR,
kCscYuv2Rgb709L,
+ kCscYuv2Rgb709FR,
kCscYuv2Rgb2020L,
kCscYuv2Rgb2020FR,
kCscTypeMax,
diff --git a/sde-drm/drm_plane.cpp b/sde-drm/drm_plane.cpp
index 859de6c..66b2373 100644
--- a/sde-drm/drm_plane.cpp
+++ b/sde-drm/drm_plane.cpp
@@ -136,6 +136,17 @@
{ 0x40, 0x3ac, 0x40, 0x3c0, 0x40, 0x3c0,},
{ 0x0, 0x3ff, 0x0, 0x3ff, 0x0, 0x3ff,},
},
+ [kCscYuv2Rgb709FR] = {
+ {
+ 0x100000000, 0x0, 0x193000000,
+ 0x100000000, 0x7fd0000000, 0x7f88000000,
+ 0x100000000, 0x1db000000, 0x0,
+ },
+ { 0x0, 0xfe00, 0xfe00,},
+ { 0x0, 0x0, 0x0, },
+ { 0x0, 0x3ff, 0x0, 0x3ff, 0x0, 0x3ff,},
+ { 0x0, 0x3ff, 0x0, 0x3ff, 0x0, 0x3ff,},
+ },
[kCscYuv2Rgb2020L] = {
{
0x12b000000, 0x0, 0x1af000000,
diff --git a/sdm/libs/dal/hw_device_drm.cpp b/sdm/libs/dal/hw_device_drm.cpp
index c0447ca..0b3ff42 100644
--- a/sdm/libs/dal/hw_device_drm.cpp
+++ b/sdm/libs/dal/hw_device_drm.cpp
@@ -2013,7 +2013,8 @@
DRMCscType::kCscYuv2Rgb601FR : DRMCscType::kCscYuv2Rgb601L);
break;
case ColorPrimaries_BT709_5:
- *type = DRMCscType::kCscYuv2Rgb709L;
+ *type = ((input_buffer.color_metadata.range == Range_Full) ?
+ DRMCscType::kCscYuv2Rgb709FR : DRMCscType::kCscYuv2Rgb709L);
break;
case ColorPrimaries_BT2020:
*type = ((input_buffer.color_metadata.range == Range_Full) ?