* [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-01-23 22:40 ` Abhinav Kumar
0 siblings, 0 replies; 34+ messages in thread
From: Abhinav Kumar @ 2020-01-23 22:40 UTC (permalink / raw)
To: dri-devel
Cc: Uma Shankar, linux-arm-msm, robdclark, seanpaul, nganji, aravindh,
adelva, Abhinav Kumar
From: Uma Shankar <uma.shankar@intel.com>
CEA 861.3 spec adds colorimetry data block for HDMI.
Parsing the block to get the colorimetry data from
panel.
This was posted by Uma Shankar at
https://patchwork.kernel.org/patch/10861327/
Modified by Abhinav Kumar:
- Use macros to distinguish the bit fields for clarity
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
---
drivers/gpu/drm/drm_edid.c | 54 +++++++++++++++++++++++++++++++++++++++++++++
include/drm/drm_connector.h | 3 +++
include/drm/drm_edid.h | 11 +++++++++
3 files changed, 68 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 99769d6..148bfa4 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3136,6 +3136,7 @@ static int drm_cvt_modes(struct drm_connector *connector,
#define VIDEO_BLOCK 0x02
#define VENDOR_BLOCK 0x03
#define SPEAKER_BLOCK 0x04
+#define COLORIMETRY_DATA_BLOCK 0x5
#define HDR_STATIC_METADATA_BLOCK 0x6
#define USE_EXTENDED_TAG 0x07
#define EXT_VIDEO_CAPABILITY_BLOCK 0x00
@@ -4199,6 +4200,57 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
mode->clock = clock;
}
+static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
+{
+ if (cea_db_tag(db) != USE_EXTENDED_TAG)
+ return false;
+
+ if (db[1] != COLORIMETRY_DATA_BLOCK)
+ return false;
+
+ if (cea_db_payload_len(db) < 2)
+ return false;
+
+ return true;
+}
+
+static void
+drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
+{
+ struct drm_hdmi_info *info = &connector->display_info.hdmi;
+
+ /* As per CEA 861-G spec */
+ /* Byte 3 Bit 0: xvYCC_601 */
+ if (db[2] & BIT(0))
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
+ /* Byte 3 Bit 1: xvYCC_709 */
+ if (db[2] & BIT(1))
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
+ /* Byte 3 Bit 2: sYCC_601 */
+ if (db[2] & BIT(2))
+ info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
+ /* Byte 3 Bit 3: ADBYCC_601 */
+ if (db[2] & BIT(3))
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
+ /* Byte 3 Bit 4: ADB_RGB */
+ if (db[2] & BIT(4))
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
+ /* Byte 3 Bit 5: BT2020_CYCC */
+ if (db[2] & BIT(5))
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
+ /* Byte 3 Bit 6: BT2020_YCC */
+ if (db[2] & BIT(6))
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
+ /* Byte 3 Bit 7: BT2020_RGB */
+ if (db[2] & BIT(7))
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
+ /* Byte 4 Bit 7: DCI-P3 */
+ if (db[3] & BIT(7))
+ info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
+
+ DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
+}
+
static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
{
if (cea_db_tag(db) != USE_EXTENDED_TAG)
@@ -4877,6 +4929,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
drm_parse_vcdb(connector, db);
if (cea_db_is_hdmi_hdr_metadata_block(db))
drm_parse_hdr_metadata_block(connector, db);
+ if (cea_db_is_hdmi_colorimetry_data_block(db))
+ drm_parse_colorimetry_data_block(connector, db);
}
}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 2219109..a996ee3 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -207,6 +207,9 @@ struct drm_hdmi_info {
/** @y420_dc_modes: bitmap of deep color support index */
u8 y420_dc_modes;
+
+ /* @colorimetry: bitmap of supported colorimetry modes */
+ u16 colorimetry;
};
/**
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index f0b03d4..6168c1c 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -224,6 +224,17 @@ struct detailed_timing {
DRM_EDID_YCBCR420_DC_36 | \
DRM_EDID_YCBCR420_DC_30)
+/* Supported Colorimetry from colorimetry data block */
+#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
+#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
+#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
+#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
+#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
+#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
+#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
+#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
+#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
+
/* ELD Header Block */
#define DRM_ELD_HEADER_BLOCK_SIZE 4
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-01-23 22:40 ` Abhinav Kumar
0 siblings, 0 replies; 34+ messages in thread
From: Abhinav Kumar @ 2020-01-23 22:40 UTC (permalink / raw)
To: dri-devel
Cc: adelva, linux-arm-msm, Abhinav Kumar, seanpaul, aravindh,
Uma Shankar
From: Uma Shankar <uma.shankar@intel.com>
CEA 861.3 spec adds colorimetry data block for HDMI.
Parsing the block to get the colorimetry data from
panel.
This was posted by Uma Shankar at
https://patchwork.kernel.org/patch/10861327/
Modified by Abhinav Kumar:
- Use macros to distinguish the bit fields for clarity
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
---
drivers/gpu/drm/drm_edid.c | 54 +++++++++++++++++++++++++++++++++++++++++++++
include/drm/drm_connector.h | 3 +++
include/drm/drm_edid.h | 11 +++++++++
3 files changed, 68 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 99769d6..148bfa4 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3136,6 +3136,7 @@ static int drm_cvt_modes(struct drm_connector *connector,
#define VIDEO_BLOCK 0x02
#define VENDOR_BLOCK 0x03
#define SPEAKER_BLOCK 0x04
+#define COLORIMETRY_DATA_BLOCK 0x5
#define HDR_STATIC_METADATA_BLOCK 0x6
#define USE_EXTENDED_TAG 0x07
#define EXT_VIDEO_CAPABILITY_BLOCK 0x00
@@ -4199,6 +4200,57 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
mode->clock = clock;
}
+static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
+{
+ if (cea_db_tag(db) != USE_EXTENDED_TAG)
+ return false;
+
+ if (db[1] != COLORIMETRY_DATA_BLOCK)
+ return false;
+
+ if (cea_db_payload_len(db) < 2)
+ return false;
+
+ return true;
+}
+
+static void
+drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
+{
+ struct drm_hdmi_info *info = &connector->display_info.hdmi;
+
+ /* As per CEA 861-G spec */
+ /* Byte 3 Bit 0: xvYCC_601 */
+ if (db[2] & BIT(0))
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
+ /* Byte 3 Bit 1: xvYCC_709 */
+ if (db[2] & BIT(1))
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
+ /* Byte 3 Bit 2: sYCC_601 */
+ if (db[2] & BIT(2))
+ info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
+ /* Byte 3 Bit 3: ADBYCC_601 */
+ if (db[2] & BIT(3))
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
+ /* Byte 3 Bit 4: ADB_RGB */
+ if (db[2] & BIT(4))
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
+ /* Byte 3 Bit 5: BT2020_CYCC */
+ if (db[2] & BIT(5))
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
+ /* Byte 3 Bit 6: BT2020_YCC */
+ if (db[2] & BIT(6))
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
+ /* Byte 3 Bit 7: BT2020_RGB */
+ if (db[2] & BIT(7))
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
+ /* Byte 4 Bit 7: DCI-P3 */
+ if (db[3] & BIT(7))
+ info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
+
+ DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
+}
+
static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
{
if (cea_db_tag(db) != USE_EXTENDED_TAG)
@@ -4877,6 +4929,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
drm_parse_vcdb(connector, db);
if (cea_db_is_hdmi_hdr_metadata_block(db))
drm_parse_hdr_metadata_block(connector, db);
+ if (cea_db_is_hdmi_colorimetry_data_block(db))
+ drm_parse_colorimetry_data_block(connector, db);
}
}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 2219109..a996ee3 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -207,6 +207,9 @@ struct drm_hdmi_info {
/** @y420_dc_modes: bitmap of deep color support index */
u8 y420_dc_modes;
+
+ /* @colorimetry: bitmap of supported colorimetry modes */
+ u16 colorimetry;
};
/**
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index f0b03d4..6168c1c 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -224,6 +224,17 @@ struct detailed_timing {
DRM_EDID_YCBCR420_DC_36 | \
DRM_EDID_YCBCR420_DC_30)
+/* Supported Colorimetry from colorimetry data block */
+#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
+#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
+#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
+#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
+#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
+#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
+#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
+#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
+#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
+
/* ELD Header Block */
#define DRM_ELD_HEADER_BLOCK_SIZE 4
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-01-23 22:40 ` Abhinav Kumar
@ 2020-01-24 14:36 ` Ville Syrjälä
-1 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-01-24 14:36 UTC (permalink / raw)
To: Abhinav Kumar
Cc: dri-devel, adelva, linux-arm-msm, seanpaul, aravindh, Uma Shankar
On Thu, Jan 23, 2020 at 02:40:45PM -0800, Abhinav Kumar wrote:
> From: Uma Shankar <uma.shankar@intel.com>
>
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
Why?
>
> This was posted by Uma Shankar at
> https://patchwork.kernel.org/patch/10861327/
>
> Modified by Abhinav Kumar:
> - Use macros to distinguish the bit fields for clarity
>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
> ---
> drivers/gpu/drm/drm_edid.c | 54 +++++++++++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 11 +++++++++
> 3 files changed, 68 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 99769d6..148bfa4 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3136,6 +3136,7 @@ static int drm_cvt_modes(struct drm_connector *connector,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4199,6 +4200,57 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + /* As per CEA 861-G spec */
> + /* Byte 3 Bit 0: xvYCC_601 */
> + if (db[2] & BIT(0))
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + /* Byte 3 Bit 1: xvYCC_709 */
> + if (db[2] & BIT(1))
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + /* Byte 3 Bit 2: sYCC_601 */
> + if (db[2] & BIT(2))
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + /* Byte 3 Bit 3: ADBYCC_601 */
> + if (db[2] & BIT(3))
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + /* Byte 3 Bit 4: ADB_RGB */
> + if (db[2] & BIT(4))
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + /* Byte 3 Bit 5: BT2020_CYCC */
> + if (db[2] & BIT(5))
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + /* Byte 3 Bit 6: BT2020_YCC */
> + if (db[2] & BIT(6))
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + /* Byte 3 Bit 7: BT2020_RGB */
> + if (db[2] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4877,6 +4929,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 2219109..a996ee3 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index f0b03d4..6168c1c 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -224,6 +224,17 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/* Supported Colorimetry from colorimetry data block */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-01-24 14:36 ` Ville Syrjälä
0 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-01-24 14:36 UTC (permalink / raw)
To: Abhinav Kumar
Cc: adelva, linux-arm-msm, dri-devel, Uma Shankar, seanpaul, aravindh
On Thu, Jan 23, 2020 at 02:40:45PM -0800, Abhinav Kumar wrote:
> From: Uma Shankar <uma.shankar@intel.com>
>
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
Why?
>
> This was posted by Uma Shankar at
> https://patchwork.kernel.org/patch/10861327/
>
> Modified by Abhinav Kumar:
> - Use macros to distinguish the bit fields for clarity
>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
> ---
> drivers/gpu/drm/drm_edid.c | 54 +++++++++++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 11 +++++++++
> 3 files changed, 68 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 99769d6..148bfa4 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3136,6 +3136,7 @@ static int drm_cvt_modes(struct drm_connector *connector,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4199,6 +4200,57 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + /* As per CEA 861-G spec */
> + /* Byte 3 Bit 0: xvYCC_601 */
> + if (db[2] & BIT(0))
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + /* Byte 3 Bit 1: xvYCC_709 */
> + if (db[2] & BIT(1))
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + /* Byte 3 Bit 2: sYCC_601 */
> + if (db[2] & BIT(2))
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + /* Byte 3 Bit 3: ADBYCC_601 */
> + if (db[2] & BIT(3))
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + /* Byte 3 Bit 4: ADB_RGB */
> + if (db[2] & BIT(4))
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + /* Byte 3 Bit 5: BT2020_CYCC */
> + if (db[2] & BIT(5))
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + /* Byte 3 Bit 6: BT2020_YCC */
> + if (db[2] & BIT(6))
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + /* Byte 3 Bit 7: BT2020_RGB */
> + if (db[2] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4877,6 +4929,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index 2219109..a996ee3 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index f0b03d4..6168c1c 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -224,6 +224,17 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/* Supported Colorimetry from colorimetry data block */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-01-24 14:36 ` Ville Syrjälä
@ 2020-01-24 20:43 ` abhinavk
-1 siblings, 0 replies; 34+ messages in thread
From: abhinavk @ 2020-01-24 20:43 UTC (permalink / raw)
To: Ville Syrjälä
Cc: dri-devel, adelva, linux-arm-msm, seanpaul, aravindh, Uma Shankar,
nganji
Hi Ville
On 2020-01-24 06:36, Ville Syrjälä wrote:
> On Thu, Jan 23, 2020 at 02:40:45PM -0800, Abhinav Kumar wrote:
>> From: Uma Shankar <uma.shankar@intel.com>
>>
>> CEA 861.3 spec adds colorimetry data block for HDMI.
>> Parsing the block to get the colorimetry data from
>> panel.
>
> Why?
[Abhinav] The display driver for MSM chipsets still replies on the
drm_edid.c for the parsing of
CEA extension blocks. Primarily we are using this information to know
the supported colorspaces of the sink
(BT2020/DCI-P3) for use-cases such as HDR. The parts of the MSM display
driver which use this block shall be posted
upstream a little bit later when our changes are ready to be posted.
Hence we would like drm_edid.c to be capable of parsing this block.
Thanks.
>
>>
>> This was posted by Uma Shankar at
>> https://patchwork.kernel.org/patch/10861327/
>>
>> Modified by Abhinav Kumar:
>> - Use macros to distinguish the bit fields for clarity
>>
>> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
>> Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
>> ---
>> drivers/gpu/drm/drm_edid.c | 54
>> +++++++++++++++++++++++++++++++++++++++++++++
>> include/drm/drm_connector.h | 3 +++
>> include/drm/drm_edid.h | 11 +++++++++
>> 3 files changed, 68 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 99769d6..148bfa4 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3136,6 +3136,7 @@ static int drm_cvt_modes(struct drm_connector
>> *connector,
>> #define VIDEO_BLOCK 0x02
>> #define VENDOR_BLOCK 0x03
>> #define SPEAKER_BLOCK 0x04
>> +#define COLORIMETRY_DATA_BLOCK 0x5
>> #define HDR_STATIC_METADATA_BLOCK 0x6
>> #define USE_EXTENDED_TAG 0x07
>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>> @@ -4199,6 +4200,57 @@ static void
>> fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector,
>> const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + /* As per CEA 861-G spec */
>> + /* Byte 3 Bit 0: xvYCC_601 */
>> + if (db[2] & BIT(0))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>> + /* Byte 3 Bit 1: xvYCC_709 */
>> + if (db[2] & BIT(1))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>> + /* Byte 3 Bit 2: sYCC_601 */
>> + if (db[2] & BIT(2))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>> + /* Byte 3 Bit 3: ADBYCC_601 */
>> + if (db[2] & BIT(3))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>> + /* Byte 3 Bit 4: ADB_RGB */
>> + if (db[2] & BIT(4))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>> + /* Byte 3 Bit 5: BT2020_CYCC */
>> + if (db[2] & BIT(5))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>> + /* Byte 3 Bit 6: BT2020_YCC */
>> + if (db[2] & BIT(6))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>> + /* Byte 3 Bit 7: BT2020_RGB */
>> + if (db[2] & BIT(7))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>> + /* Byte 4 Bit 7: DCI-P3 */
>> + if (db[3] & BIT(7))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>> +
>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>> +}
>> +
>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>> {
>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> @@ -4877,6 +4929,8 @@ static void drm_parse_cea_ext(struct
>> drm_connector *connector,
>> drm_parse_vcdb(connector, db);
>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>> drm_parse_hdr_metadata_block(connector, db);
>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>> + drm_parse_colorimetry_data_block(connector, db);
>> }
>> }
>>
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index 2219109..a996ee3 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>
>> /** @y420_dc_modes: bitmap of deep color support index */
>> u8 y420_dc_modes;
>> +
>> + /* @colorimetry: bitmap of supported colorimetry modes */
>> + u16 colorimetry;
>> };
>>
>> /**
>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>> index f0b03d4..6168c1c 100644
>> --- a/include/drm/drm_edid.h
>> +++ b/include/drm/drm_edid.h
>> @@ -224,6 +224,17 @@ struct detailed_timing {
>> DRM_EDID_YCBCR420_DC_36 | \
>> DRM_EDID_YCBCR420_DC_30)
>>
>> +/* Supported Colorimetry from colorimetry data block */
>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>> +
>> /* ELD Header Block */
>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
>> Forum,
>> a Linux Foundation Collaborative Project
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-01-24 20:43 ` abhinavk
0 siblings, 0 replies; 34+ messages in thread
From: abhinavk @ 2020-01-24 20:43 UTC (permalink / raw)
To: Ville Syrjälä
Cc: adelva, linux-arm-msm, dri-devel, Uma Shankar, seanpaul, aravindh
Hi Ville
On 2020-01-24 06:36, Ville Syrjälä wrote:
> On Thu, Jan 23, 2020 at 02:40:45PM -0800, Abhinav Kumar wrote:
>> From: Uma Shankar <uma.shankar@intel.com>
>>
>> CEA 861.3 spec adds colorimetry data block for HDMI.
>> Parsing the block to get the colorimetry data from
>> panel.
>
> Why?
[Abhinav] The display driver for MSM chipsets still replies on the
drm_edid.c for the parsing of
CEA extension blocks. Primarily we are using this information to know
the supported colorspaces of the sink
(BT2020/DCI-P3) for use-cases such as HDR. The parts of the MSM display
driver which use this block shall be posted
upstream a little bit later when our changes are ready to be posted.
Hence we would like drm_edid.c to be capable of parsing this block.
Thanks.
>
>>
>> This was posted by Uma Shankar at
>> https://patchwork.kernel.org/patch/10861327/
>>
>> Modified by Abhinav Kumar:
>> - Use macros to distinguish the bit fields for clarity
>>
>> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
>> Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
>> ---
>> drivers/gpu/drm/drm_edid.c | 54
>> +++++++++++++++++++++++++++++++++++++++++++++
>> include/drm/drm_connector.h | 3 +++
>> include/drm/drm_edid.h | 11 +++++++++
>> 3 files changed, 68 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 99769d6..148bfa4 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3136,6 +3136,7 @@ static int drm_cvt_modes(struct drm_connector
>> *connector,
>> #define VIDEO_BLOCK 0x02
>> #define VENDOR_BLOCK 0x03
>> #define SPEAKER_BLOCK 0x04
>> +#define COLORIMETRY_DATA_BLOCK 0x5
>> #define HDR_STATIC_METADATA_BLOCK 0x6
>> #define USE_EXTENDED_TAG 0x07
>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>> @@ -4199,6 +4200,57 @@ static void
>> fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector,
>> const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + /* As per CEA 861-G spec */
>> + /* Byte 3 Bit 0: xvYCC_601 */
>> + if (db[2] & BIT(0))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>> + /* Byte 3 Bit 1: xvYCC_709 */
>> + if (db[2] & BIT(1))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>> + /* Byte 3 Bit 2: sYCC_601 */
>> + if (db[2] & BIT(2))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>> + /* Byte 3 Bit 3: ADBYCC_601 */
>> + if (db[2] & BIT(3))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>> + /* Byte 3 Bit 4: ADB_RGB */
>> + if (db[2] & BIT(4))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>> + /* Byte 3 Bit 5: BT2020_CYCC */
>> + if (db[2] & BIT(5))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>> + /* Byte 3 Bit 6: BT2020_YCC */
>> + if (db[2] & BIT(6))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>> + /* Byte 3 Bit 7: BT2020_RGB */
>> + if (db[2] & BIT(7))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>> + /* Byte 4 Bit 7: DCI-P3 */
>> + if (db[3] & BIT(7))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>> +
>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>> +}
>> +
>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>> {
>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> @@ -4877,6 +4929,8 @@ static void drm_parse_cea_ext(struct
>> drm_connector *connector,
>> drm_parse_vcdb(connector, db);
>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>> drm_parse_hdr_metadata_block(connector, db);
>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>> + drm_parse_colorimetry_data_block(connector, db);
>> }
>> }
>>
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index 2219109..a996ee3 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>
>> /** @y420_dc_modes: bitmap of deep color support index */
>> u8 y420_dc_modes;
>> +
>> + /* @colorimetry: bitmap of supported colorimetry modes */
>> + u16 colorimetry;
>> };
>>
>> /**
>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>> index f0b03d4..6168c1c 100644
>> --- a/include/drm/drm_edid.h
>> +++ b/include/drm/drm_edid.h
>> @@ -224,6 +224,17 @@ struct detailed_timing {
>> DRM_EDID_YCBCR420_DC_36 | \
>> DRM_EDID_YCBCR420_DC_30)
>>
>> +/* Supported Colorimetry from colorimetry data block */
>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>> +
>> /* ELD Header Block */
>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
>> Forum,
>> a Linux Foundation Collaborative Project
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-01-23 22:40 ` Abhinav Kumar
@ 2020-01-27 18:46 ` Stephen Boyd
-1 siblings, 0 replies; 34+ messages in thread
From: Stephen Boyd @ 2020-01-27 18:46 UTC (permalink / raw)
To: Abhinav Kumar, dri-devel
Cc: Uma Shankar, linux-arm-msm, robdclark, seanpaul, nganji, aravindh,
adelva, Abhinav Kumar
Quoting Abhinav Kumar (2020-01-23 14:40:45)
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 99769d6..148bfa4 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4199,6 +4200,57 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + /* As per CEA 861-G spec */
> + /* Byte 3 Bit 0: xvYCC_601 */
> + if (db[2] & BIT(0))
Why not use the defines added in drm_edid.h in this patch? Then the
comments can be removed because the code would look like
if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-01-27 18:46 ` Stephen Boyd
0 siblings, 0 replies; 34+ messages in thread
From: Stephen Boyd @ 2020-01-27 18:46 UTC (permalink / raw)
To: Abhinav Kumar, dri-devel
Cc: adelva, linux-arm-msm, Abhinav Kumar, seanpaul, aravindh,
Uma Shankar
Quoting Abhinav Kumar (2020-01-23 14:40:45)
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 99769d6..148bfa4 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -4199,6 +4200,57 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + /* As per CEA 861-G spec */
> + /* Byte 3 Bit 0: xvYCC_601 */
> + if (db[2] & BIT(0))
Why not use the defines added in drm_edid.h in this patch? Then the
comments can be removed because the code would look like
if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-01-27 18:46 ` Stephen Boyd
@ 2020-01-27 20:42 ` abhinavk
-1 siblings, 0 replies; 34+ messages in thread
From: abhinavk @ 2020-01-27 20:42 UTC (permalink / raw)
To: Stephen Boyd
Cc: dri-devel, Uma Shankar, linux-arm-msm, robdclark, seanpaul,
nganji, aravindh, adelva, linux-arm-msm-owner
Hi Stephen
On 2020-01-27 10:46, Stephen Boyd wrote:
> Quoting Abhinav Kumar (2020-01-23 14:40:45)
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 99769d6..148bfa4 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -4199,6 +4200,57 @@ static void
>> fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector,
>> const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + /* As per CEA 861-G spec */
>> + /* Byte 3 Bit 0: xvYCC_601 */
>> + if (db[2] & BIT(0))
>
> Why not use the defines added in drm_edid.h in this patch? Then the
> comments can be removed because the code would look like
>
> if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
[Abhinav] Sure, will make the change and upload a v2
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-01-27 20:42 ` abhinavk
0 siblings, 0 replies; 34+ messages in thread
From: abhinavk @ 2020-01-27 20:42 UTC (permalink / raw)
To: Stephen Boyd
Cc: adelva, linux-arm-msm, dri-devel, linux-arm-msm-owner, seanpaul,
aravindh, Uma Shankar
Hi Stephen
On 2020-01-27 10:46, Stephen Boyd wrote:
> Quoting Abhinav Kumar (2020-01-23 14:40:45)
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 99769d6..148bfa4 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -4199,6 +4200,57 @@ static void
>> fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector,
>> const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + /* As per CEA 861-G spec */
>> + /* Byte 3 Bit 0: xvYCC_601 */
>> + if (db[2] & BIT(0))
>
> Why not use the defines added in drm_edid.h in this patch? Then the
> comments can be removed because the code would look like
>
> if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
[Abhinav] Sure, will make the change and upload a v2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-26 14:23 ` Algea Cao
0 siblings, 0 replies; 34+ messages in thread
From: Algea Cao @ 2020-08-26 14:23 UTC (permalink / raw)
To: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
Cc: Algea Cao
CEA 861.3 spec adds colorimetry data block for HDMI.
Parsing the block to get the colorimetry data from
panel.
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
---
drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
include/drm/drm_connector.h | 3 +++
include/drm/drm_edid.h | 14 ++++++++++++
3 files changed, 62 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 31496b6cfc56..67e607c04492 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
#define VIDEO_BLOCK 0x02
#define VENDOR_BLOCK 0x03
#define SPEAKER_BLOCK 0x04
+#define COLORIMETRY_DATA_BLOCK 0x5
#define HDR_STATIC_METADATA_BLOCK 0x6
#define USE_EXTENDED_TAG 0x07
#define EXT_VIDEO_CAPABILITY_BLOCK 0x00
@@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
mode->clock = clock;
}
+static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
+{
+ if (cea_db_tag(db) != USE_EXTENDED_TAG)
+ return false;
+
+ if (db[1] != COLORIMETRY_DATA_BLOCK)
+ return false;
+
+ if (cea_db_payload_len(db) < 2)
+ return false;
+
+ return true;
+}
+
+static void
+drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
+{
+ struct drm_hdmi_info *info = &connector->display_info.hdmi;
+
+ if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
+ if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
+ /* Byte 4 Bit 7: DCI-P3 */
+ if (db[3] & BIT(7))
+ info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
+
+ DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
+}
+
static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
{
if (cea_db_tag(db) != USE_EXTENDED_TAG)
@@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
drm_parse_vcdb(connector, db);
if (cea_db_is_hdmi_hdr_metadata_block(db))
drm_parse_hdr_metadata_block(connector, db);
+ if (cea_db_is_hdmi_colorimetry_data_block(db))
+ drm_parse_colorimetry_data_block(connector, db);
}
}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index af145608b5ed..d599c3b9e881 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -207,6 +207,9 @@ struct drm_hdmi_info {
/** @y420_dc_modes: bitmap of deep color support index */
u8 y420_dc_modes;
+
+ /* @colorimetry: bitmap of supported colorimetry modes */
+ u16 colorimetry;
};
/**
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index cfa4f5af49af..98fa78c2f82d 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -229,6 +229,20 @@ struct detailed_timing {
DRM_EDID_YCBCR420_DC_36 | \
DRM_EDID_YCBCR420_DC_30)
+/*
+ * Supported Colorimetry from colorimetry data block
+ * as per CEA 861-G spec
+ */
+#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
+#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
+#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
+#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
+#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
+#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
+#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
+#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
+#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
+
/* ELD Header Block */
#define DRM_ELD_HEADER_BLOCK_SIZE 4
--
2.25.1
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-26 14:23 ` Algea Cao
0 siblings, 0 replies; 34+ messages in thread
From: Algea Cao @ 2020-08-26 14:23 UTC (permalink / raw)
To: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
Cc: Algea Cao
CEA 861.3 spec adds colorimetry data block for HDMI.
Parsing the block to get the colorimetry data from
panel.
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
---
drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
include/drm/drm_connector.h | 3 +++
include/drm/drm_edid.h | 14 ++++++++++++
3 files changed, 62 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 31496b6cfc56..67e607c04492 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
#define VIDEO_BLOCK 0x02
#define VENDOR_BLOCK 0x03
#define SPEAKER_BLOCK 0x04
+#define COLORIMETRY_DATA_BLOCK 0x5
#define HDR_STATIC_METADATA_BLOCK 0x6
#define USE_EXTENDED_TAG 0x07
#define EXT_VIDEO_CAPABILITY_BLOCK 0x00
@@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
mode->clock = clock;
}
+static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
+{
+ if (cea_db_tag(db) != USE_EXTENDED_TAG)
+ return false;
+
+ if (db[1] != COLORIMETRY_DATA_BLOCK)
+ return false;
+
+ if (cea_db_payload_len(db) < 2)
+ return false;
+
+ return true;
+}
+
+static void
+drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
+{
+ struct drm_hdmi_info *info = &connector->display_info.hdmi;
+
+ if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
+ if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
+ /* Byte 4 Bit 7: DCI-P3 */
+ if (db[3] & BIT(7))
+ info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
+
+ DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
+}
+
static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
{
if (cea_db_tag(db) != USE_EXTENDED_TAG)
@@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
drm_parse_vcdb(connector, db);
if (cea_db_is_hdmi_hdr_metadata_block(db))
drm_parse_hdr_metadata_block(connector, db);
+ if (cea_db_is_hdmi_colorimetry_data_block(db))
+ drm_parse_colorimetry_data_block(connector, db);
}
}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index af145608b5ed..d599c3b9e881 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -207,6 +207,9 @@ struct drm_hdmi_info {
/** @y420_dc_modes: bitmap of deep color support index */
u8 y420_dc_modes;
+
+ /* @colorimetry: bitmap of supported colorimetry modes */
+ u16 colorimetry;
};
/**
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index cfa4f5af49af..98fa78c2f82d 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -229,6 +229,20 @@ struct detailed_timing {
DRM_EDID_YCBCR420_DC_36 | \
DRM_EDID_YCBCR420_DC_30)
+/*
+ * Supported Colorimetry from colorimetry data block
+ * as per CEA 861-G spec
+ */
+#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
+#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
+#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
+#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
+#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
+#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
+#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
+#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
+#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
+
/* ELD Header Block */
#define DRM_ELD_HEADER_BLOCK_SIZE 4
--
2.25.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-26 14:23 ` Algea Cao
0 siblings, 0 replies; 34+ messages in thread
From: Algea Cao @ 2020-08-26 14:23 UTC (permalink / raw)
To: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
Cc: Algea Cao
CEA 861.3 spec adds colorimetry data block for HDMI.
Parsing the block to get the colorimetry data from
panel.
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
---
drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
include/drm/drm_connector.h | 3 +++
include/drm/drm_edid.h | 14 ++++++++++++
3 files changed, 62 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 31496b6cfc56..67e607c04492 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
#define VIDEO_BLOCK 0x02
#define VENDOR_BLOCK 0x03
#define SPEAKER_BLOCK 0x04
+#define COLORIMETRY_DATA_BLOCK 0x5
#define HDR_STATIC_METADATA_BLOCK 0x6
#define USE_EXTENDED_TAG 0x07
#define EXT_VIDEO_CAPABILITY_BLOCK 0x00
@@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
mode->clock = clock;
}
+static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
+{
+ if (cea_db_tag(db) != USE_EXTENDED_TAG)
+ return false;
+
+ if (db[1] != COLORIMETRY_DATA_BLOCK)
+ return false;
+
+ if (cea_db_payload_len(db) < 2)
+ return false;
+
+ return true;
+}
+
+static void
+drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
+{
+ struct drm_hdmi_info *info = &connector->display_info.hdmi;
+
+ if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
+ info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
+ if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
+ if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
+ info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
+ if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
+ info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
+ /* Byte 4 Bit 7: DCI-P3 */
+ if (db[3] & BIT(7))
+ info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
+
+ DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
+}
+
static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
{
if (cea_db_tag(db) != USE_EXTENDED_TAG)
@@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
drm_parse_vcdb(connector, db);
if (cea_db_is_hdmi_hdr_metadata_block(db))
drm_parse_hdr_metadata_block(connector, db);
+ if (cea_db_is_hdmi_colorimetry_data_block(db))
+ drm_parse_colorimetry_data_block(connector, db);
}
}
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index af145608b5ed..d599c3b9e881 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -207,6 +207,9 @@ struct drm_hdmi_info {
/** @y420_dc_modes: bitmap of deep color support index */
u8 y420_dc_modes;
+
+ /* @colorimetry: bitmap of supported colorimetry modes */
+ u16 colorimetry;
};
/**
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index cfa4f5af49af..98fa78c2f82d 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -229,6 +229,20 @@ struct detailed_timing {
DRM_EDID_YCBCR420_DC_36 | \
DRM_EDID_YCBCR420_DC_30)
+/*
+ * Supported Colorimetry from colorimetry data block
+ * as per CEA 861-G spec
+ */
+#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
+#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
+#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
+#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
+#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
+#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
+#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
+#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
+#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
+
/* ELD Header Block */
#define DRM_ELD_HEADER_BLOCK_SIZE 4
--
2.25.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID)
2020-08-26 14:23 ` Algea Cao
(?)
@ 2020-08-27 7:34 ` Pekka Paalanen
-1 siblings, 0 replies; 34+ messages in thread
From: Pekka Paalanen @ 2020-08-27 7:34 UTC (permalink / raw)
To: Algea Cao
Cc: daniel, airlied, maarten.lankhorst, linux-kernel, dri-devel,
linux-rockchip, mripard, tzimmermann
[-- Attachment #1.1: Type: text/plain, Size: 4917 bytes --]
On Wed, 26 Aug 2020 22:23:28 +0800
Algea Cao <algea.cao@rock-chips.com> wrote:
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
>
> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> ---
>
> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 14 ++++++++++++
> 3 files changed, 62 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 31496b6cfc56..67e607c04492 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
Hi,
taking a tangent here, printing bitfields as hex is hard to read. How
about using something like nvkm_snprintbf()? Of course not literally
that function since it's Nouveau internal, but as an end user I would be
happy to see DRM core or the kernel generics have similar functionality
that actually decodes the bits and prints their proper names.
Does such facility not exist yet?
Thanks,
pq
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index af145608b5ed..d599c3b9e881 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index cfa4f5af49af..98fa78c2f82d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -229,6 +229,20 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/*
> + * Supported Colorimetry from colorimetry data block
> + * as per CEA 861-G spec
> + */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 34+ messages in thread
* Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID)
@ 2020-08-27 7:34 ` Pekka Paalanen
0 siblings, 0 replies; 34+ messages in thread
From: Pekka Paalanen @ 2020-08-27 7:34 UTC (permalink / raw)
To: Algea Cao; +Cc: airlied, linux-kernel, dri-devel, linux-rockchip, tzimmermann
[-- Attachment #1.1: Type: text/plain, Size: 4917 bytes --]
On Wed, 26 Aug 2020 22:23:28 +0800
Algea Cao <algea.cao@rock-chips.com> wrote:
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
>
> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> ---
>
> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 14 ++++++++++++
> 3 files changed, 62 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 31496b6cfc56..67e607c04492 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
Hi,
taking a tangent here, printing bitfields as hex is hard to read. How
about using something like nvkm_snprintbf()? Of course not literally
that function since it's Nouveau internal, but as an end user I would be
happy to see DRM core or the kernel generics have similar functionality
that actually decodes the bits and prints their proper names.
Does such facility not exist yet?
Thanks,
pq
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index af145608b5ed..d599c3b9e881 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index cfa4f5af49af..98fa78c2f82d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -229,6 +229,20 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/*
> + * Supported Colorimetry from colorimetry data block
> + * as per CEA 861-G spec
> + */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID)
@ 2020-08-27 7:34 ` Pekka Paalanen
0 siblings, 0 replies; 34+ messages in thread
From: Pekka Paalanen @ 2020-08-27 7:34 UTC (permalink / raw)
To: Algea Cao
Cc: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
[-- Attachment #1: Type: text/plain, Size: 4917 bytes --]
On Wed, 26 Aug 2020 22:23:28 +0800
Algea Cao <algea.cao@rock-chips.com> wrote:
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
>
> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> ---
>
> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 14 ++++++++++++
> 3 files changed, 62 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 31496b6cfc56..67e607c04492 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
Hi,
taking a tangent here, printing bitfields as hex is hard to read. How
about using something like nvkm_snprintbf()? Of course not literally
that function since it's Nouveau internal, but as an end user I would be
happy to see DRM core or the kernel generics have similar functionality
that actually decodes the bits and prints their proper names.
Does such facility not exist yet?
Thanks,
pq
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index af145608b5ed..d599c3b9e881 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index cfa4f5af49af..98fa78c2f82d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -229,6 +229,20 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/*
> + * Supported Colorimetry from colorimetry data block
> + * as per CEA 861-G spec
> + */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-08-26 14:23 ` Algea Cao
(?)
@ 2020-08-27 10:57 ` Ville Syrjälä
-1 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-08-27 10:57 UTC (permalink / raw)
To: Algea Cao
Cc: daniel, airlied, maarten.lankhorst, linux-kernel, dri-devel,
linux-rockchip, mripard, tzimmermann
On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
And what exactly do you want to do with that data?
>
> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> ---
>
> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 14 ++++++++++++
> 3 files changed, 62 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 31496b6cfc56..67e607c04492 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index af145608b5ed..d599c3b9e881 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index cfa4f5af49af..98fa78c2f82d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -229,6 +229,20 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/*
> + * Supported Colorimetry from colorimetry data block
> + * as per CEA 861-G spec
> + */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
> --
> 2.25.1
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-27 10:57 ` Ville Syrjälä
0 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-08-27 10:57 UTC (permalink / raw)
To: Algea Cao; +Cc: airlied, linux-kernel, dri-devel, linux-rockchip, tzimmermann
On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
And what exactly do you want to do with that data?
>
> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> ---
>
> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 14 ++++++++++++
> 3 files changed, 62 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 31496b6cfc56..67e607c04492 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index af145608b5ed..d599c3b9e881 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index cfa4f5af49af..98fa78c2f82d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -229,6 +229,20 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/*
> + * Supported Colorimetry from colorimetry data block
> + * as per CEA 861-G spec
> + */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
> --
> 2.25.1
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-27 10:57 ` Ville Syrjälä
0 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-08-27 10:57 UTC (permalink / raw)
To: Algea Cao
Cc: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> CEA 861.3 spec adds colorimetry data block for HDMI.
> Parsing the block to get the colorimetry data from
> panel.
And what exactly do you want to do with that data?
>
> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> ---
>
> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> include/drm/drm_connector.h | 3 +++
> include/drm/drm_edid.h | 14 ++++++++++++
> 3 files changed, 62 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 31496b6cfc56..67e607c04492 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> #define VIDEO_BLOCK 0x02
> #define VENDOR_BLOCK 0x03
> #define SPEAKER_BLOCK 0x04
> +#define COLORIMETRY_DATA_BLOCK 0x5
> #define HDR_STATIC_METADATA_BLOCK 0x6
> #define USE_EXTENDED_TAG 0x07
> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> mode->clock = clock;
> }
>
> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> +{
> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> + return false;
> +
> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> + return false;
> +
> + if (cea_db_payload_len(db) < 2)
> + return false;
> +
> + return true;
> +}
> +
> +static void
> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> +{
> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> +
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> + /* Byte 4 Bit 7: DCI-P3 */
> + if (db[3] & BIT(7))
> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> +
> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> +}
> +
> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> {
> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> drm_parse_vcdb(connector, db);
> if (cea_db_is_hdmi_hdr_metadata_block(db))
> drm_parse_hdr_metadata_block(connector, db);
> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> + drm_parse_colorimetry_data_block(connector, db);
> }
> }
>
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index af145608b5ed..d599c3b9e881 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>
> /** @y420_dc_modes: bitmap of deep color support index */
> u8 y420_dc_modes;
> +
> + /* @colorimetry: bitmap of supported colorimetry modes */
> + u16 colorimetry;
> };
>
> /**
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index cfa4f5af49af..98fa78c2f82d 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -229,6 +229,20 @@ struct detailed_timing {
> DRM_EDID_YCBCR420_DC_36 | \
> DRM_EDID_YCBCR420_DC_30)
>
> +/*
> + * Supported Colorimetry from colorimetry data block
> + * as per CEA 861-G spec
> + */
> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> +
> /* ELD Header Block */
> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>
> --
> 2.25.1
>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-08-27 10:57 ` Ville Syrjälä
(?)
@ 2020-08-28 1:07 ` crj
-1 siblings, 0 replies; 34+ messages in thread
From: crj @ 2020-08-28 1:07 UTC (permalink / raw)
To: Ville Syrjälä
Cc: daniel, airlied, maarten.lankhorst, linux-kernel, dri-devel,
linux-rockchip, mripard, tzimmermann
Hi Ville Syrjälä,
在 2020/8/27 18:57, Ville Syrjälä 写道:
> On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
>> CEA 861.3 spec adds colorimetry data block for HDMI.
>> Parsing the block to get the colorimetry data from
>> panel.
> And what exactly do you want to do with that data?
We can get colorimetry data block from edid then support
HDMI colorimetry such as BT2020.
>> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
>> ---
>>
>> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
>> include/drm/drm_connector.h | 3 +++
>> include/drm/drm_edid.h | 14 ++++++++++++
>> 3 files changed, 62 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 31496b6cfc56..67e607c04492 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
>> #define VIDEO_BLOCK 0x02
>> #define VENDOR_BLOCK 0x03
>> #define SPEAKER_BLOCK 0x04
>> +#define COLORIMETRY_DATA_BLOCK 0x5
>> #define HDR_STATIC_METADATA_BLOCK 0x6
>> #define USE_EXTENDED_TAG 0x07
>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>> + /* Byte 4 Bit 7: DCI-P3 */
>> + if (db[3] & BIT(7))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>> +
>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>> +}
>> +
>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>> {
>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>> drm_parse_vcdb(connector, db);
>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>> drm_parse_hdr_metadata_block(connector, db);
>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>> + drm_parse_colorimetry_data_block(connector, db);
>> }
>> }
>>
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index af145608b5ed..d599c3b9e881 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>
>> /** @y420_dc_modes: bitmap of deep color support index */
>> u8 y420_dc_modes;
>> +
>> + /* @colorimetry: bitmap of supported colorimetry modes */
>> + u16 colorimetry;
>> };
>>
>> /**
>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>> index cfa4f5af49af..98fa78c2f82d 100644
>> --- a/include/drm/drm_edid.h
>> +++ b/include/drm/drm_edid.h
>> @@ -229,6 +229,20 @@ struct detailed_timing {
>> DRM_EDID_YCBCR420_DC_36 | \
>> DRM_EDID_YCBCR420_DC_30)
>>
>> +/*
>> + * Supported Colorimetry from colorimetry data block
>> + * as per CEA 861-G spec
>> + */
>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>> +
>> /* ELD Header Block */
>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>
>> --
>> 2.25.1
>>
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-28 1:07 ` crj
0 siblings, 0 replies; 34+ messages in thread
From: crj @ 2020-08-28 1:07 UTC (permalink / raw)
To: Ville Syrjälä
Cc: airlied, linux-kernel, dri-devel, linux-rockchip, tzimmermann
Hi Ville Syrjälä,
在 2020/8/27 18:57, Ville Syrjälä 写道:
> On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
>> CEA 861.3 spec adds colorimetry data block for HDMI.
>> Parsing the block to get the colorimetry data from
>> panel.
> And what exactly do you want to do with that data?
We can get colorimetry data block from edid then support
HDMI colorimetry such as BT2020.
>> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
>> ---
>>
>> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
>> include/drm/drm_connector.h | 3 +++
>> include/drm/drm_edid.h | 14 ++++++++++++
>> 3 files changed, 62 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 31496b6cfc56..67e607c04492 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
>> #define VIDEO_BLOCK 0x02
>> #define VENDOR_BLOCK 0x03
>> #define SPEAKER_BLOCK 0x04
>> +#define COLORIMETRY_DATA_BLOCK 0x5
>> #define HDR_STATIC_METADATA_BLOCK 0x6
>> #define USE_EXTENDED_TAG 0x07
>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>> + /* Byte 4 Bit 7: DCI-P3 */
>> + if (db[3] & BIT(7))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>> +
>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>> +}
>> +
>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>> {
>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>> drm_parse_vcdb(connector, db);
>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>> drm_parse_hdr_metadata_block(connector, db);
>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>> + drm_parse_colorimetry_data_block(connector, db);
>> }
>> }
>>
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index af145608b5ed..d599c3b9e881 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>
>> /** @y420_dc_modes: bitmap of deep color support index */
>> u8 y420_dc_modes;
>> +
>> + /* @colorimetry: bitmap of supported colorimetry modes */
>> + u16 colorimetry;
>> };
>>
>> /**
>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>> index cfa4f5af49af..98fa78c2f82d 100644
>> --- a/include/drm/drm_edid.h
>> +++ b/include/drm/drm_edid.h
>> @@ -229,6 +229,20 @@ struct detailed_timing {
>> DRM_EDID_YCBCR420_DC_36 | \
>> DRM_EDID_YCBCR420_DC_30)
>>
>> +/*
>> + * Supported Colorimetry from colorimetry data block
>> + * as per CEA 861-G spec
>> + */
>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>> +
>> /* ELD Header Block */
>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>
>> --
>> 2.25.1
>>
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-28 1:07 ` crj
0 siblings, 0 replies; 34+ messages in thread
From: crj @ 2020-08-28 1:07 UTC (permalink / raw)
To: Ville Syrjälä
Cc: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
Hi Ville Syrjälä,
在 2020/8/27 18:57, Ville Syrjälä 写道:
> On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
>> CEA 861.3 spec adds colorimetry data block for HDMI.
>> Parsing the block to get the colorimetry data from
>> panel.
> And what exactly do you want to do with that data?
We can get colorimetry data block from edid then support
HDMI colorimetry such as BT2020.
>> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
>> ---
>>
>> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
>> include/drm/drm_connector.h | 3 +++
>> include/drm/drm_edid.h | 14 ++++++++++++
>> 3 files changed, 62 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>> index 31496b6cfc56..67e607c04492 100644
>> --- a/drivers/gpu/drm/drm_edid.c
>> +++ b/drivers/gpu/drm/drm_edid.c
>> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
>> #define VIDEO_BLOCK 0x02
>> #define VENDOR_BLOCK 0x03
>> #define SPEAKER_BLOCK 0x04
>> +#define COLORIMETRY_DATA_BLOCK 0x5
>> #define HDR_STATIC_METADATA_BLOCK 0x6
>> #define USE_EXTENDED_TAG 0x07
>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>> mode->clock = clock;
>> }
>>
>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>> +{
>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> + return false;
>> +
>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>> + return false;
>> +
>> + if (cea_db_payload_len(db) < 2)
>> + return false;
>> +
>> + return true;
>> +}
>> +
>> +static void
>> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
>> +{
>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>> +
>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>> + /* Byte 4 Bit 7: DCI-P3 */
>> + if (db[3] & BIT(7))
>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>> +
>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>> +}
>> +
>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>> {
>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>> drm_parse_vcdb(connector, db);
>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>> drm_parse_hdr_metadata_block(connector, db);
>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>> + drm_parse_colorimetry_data_block(connector, db);
>> }
>> }
>>
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index af145608b5ed..d599c3b9e881 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>
>> /** @y420_dc_modes: bitmap of deep color support index */
>> u8 y420_dc_modes;
>> +
>> + /* @colorimetry: bitmap of supported colorimetry modes */
>> + u16 colorimetry;
>> };
>>
>> /**
>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>> index cfa4f5af49af..98fa78c2f82d 100644
>> --- a/include/drm/drm_edid.h
>> +++ b/include/drm/drm_edid.h
>> @@ -229,6 +229,20 @@ struct detailed_timing {
>> DRM_EDID_YCBCR420_DC_36 | \
>> DRM_EDID_YCBCR420_DC_30)
>>
>> +/*
>> + * Supported Colorimetry from colorimetry data block
>> + * as per CEA 861-G spec
>> + */
>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>> +
>> /* ELD Header Block */
>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>
>> --
>> 2.25.1
>>
>>
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID)
2020-08-27 7:34 ` Pekka Paalanen
(?)
@ 2020-08-28 4:58 ` Joe Perches
-1 siblings, 0 replies; 34+ messages in thread
From: Joe Perches @ 2020-08-28 4:58 UTC (permalink / raw)
To: Pekka Paalanen, Algea Cao
Cc: daniel, airlied, maarten.lankhorst, linux-kernel, dri-devel,
linux-rockchip, mripard, tzimmermann
On Thu, 2020-08-27 at 10:34 +0300, Pekka Paalanen wrote:
> On Wed, 26 Aug 2020 22:23:28 +0800
> Algea Cao <algea.cao@rock-chips.com> wrote:
>
> > CEA 861.3 spec adds colorimetry data block for HDMI.
> > Parsing the block to get the colorimetry data from
> > panel.
If flags are int, I could imagine another %p<foo> extension
where %*p<foo> is used like:
printk("flags: %*p<foo>n", flags, bitstrings)
where flags is:
BIT(0)
BIT(1)
...
BIT(last)
and
char *bitstrings[] = {
"bit 0 description",
"bit 1 description",
...
"last bit description"
};
Or define YA struct with 2 entries as the struct members
and use that.
struct foo {
unsigned long flags,
char ** descriptions,
};
struct foo bar = {.flags = <flags> .descriptions = bitstrings};
printk("flags: %p<foo>\n, &bar);
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID)
@ 2020-08-28 4:58 ` Joe Perches
0 siblings, 0 replies; 34+ messages in thread
From: Joe Perches @ 2020-08-28 4:58 UTC (permalink / raw)
To: Pekka Paalanen, Algea Cao
Cc: airlied, linux-kernel, dri-devel, linux-rockchip, tzimmermann
On Thu, 2020-08-27 at 10:34 +0300, Pekka Paalanen wrote:
> On Wed, 26 Aug 2020 22:23:28 +0800
> Algea Cao <algea.cao@rock-chips.com> wrote:
>
> > CEA 861.3 spec adds colorimetry data block for HDMI.
> > Parsing the block to get the colorimetry data from
> > panel.
If flags are int, I could imagine another %p<foo> extension
where %*p<foo> is used like:
printk("flags: %*p<foo>n", flags, bitstrings)
where flags is:
BIT(0)
BIT(1)
...
BIT(last)
and
char *bitstrings[] = {
"bit 0 description",
"bit 1 description",
...
"last bit description"
};
Or define YA struct with 2 entries as the struct members
and use that.
struct foo {
unsigned long flags,
char ** descriptions,
};
struct foo bar = {.flags = <flags> .descriptions = bitstrings};
printk("flags: %p<foo>\n, &bar);
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID)
@ 2020-08-28 4:58 ` Joe Perches
0 siblings, 0 replies; 34+ messages in thread
From: Joe Perches @ 2020-08-28 4:58 UTC (permalink / raw)
To: Pekka Paalanen, Algea Cao
Cc: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
On Thu, 2020-08-27 at 10:34 +0300, Pekka Paalanen wrote:
> On Wed, 26 Aug 2020 22:23:28 +0800
> Algea Cao <algea.cao@rock-chips.com> wrote:
>
> > CEA 861.3 spec adds colorimetry data block for HDMI.
> > Parsing the block to get the colorimetry data from
> > panel.
If flags are int, I could imagine another %p<foo> extension
where %*p<foo> is used like:
printk("flags: %*p<foo>n", flags, bitstrings)
where flags is:
BIT(0)
BIT(1)
...
BIT(last)
and
char *bitstrings[] = {
"bit 0 description",
"bit 1 description",
...
"last bit description"
};
Or define YA struct with 2 entries as the struct members
and use that.
struct foo {
unsigned long flags,
char ** descriptions,
};
struct foo bar = {.flags = <flags> .descriptions = bitstrings};
printk("flags: %p<foo>\n, &bar);
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-08-28 1:07 ` crj
(?)
@ 2020-08-31 19:53 ` Ville Syrjälä
-1 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-08-31 19:53 UTC (permalink / raw)
To: crj
Cc: daniel, airlied, maarten.lankhorst, linux-kernel, dri-devel,
linux-rockchip, mripard, tzimmermann
On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
> Hi Ville Syrjälä,
>
> 在 2020/8/27 18:57, Ville Syrjälä 写道:
> > On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> >> CEA 861.3 spec adds colorimetry data block for HDMI.
> >> Parsing the block to get the colorimetry data from
> >> panel.
> > And what exactly do you want to do with that data?
>
>
> We can get colorimetry data block from edid then support
>
> HDMI colorimetry such as BT2020.
But what do you want to do with it? The patch does nothing
functional.
>
> >> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> >> ---
> >>
> >> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> >> include/drm/drm_connector.h | 3 +++
> >> include/drm/drm_edid.h | 14 ++++++++++++
> >> 3 files changed, 62 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >> index 31496b6cfc56..67e607c04492 100644
> >> --- a/drivers/gpu/drm/drm_edid.c
> >> +++ b/drivers/gpu/drm/drm_edid.c
> >> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> >> #define VIDEO_BLOCK 0x02
> >> #define VENDOR_BLOCK 0x03
> >> #define SPEAKER_BLOCK 0x04
> >> +#define COLORIMETRY_DATA_BLOCK 0x5
> >> #define HDR_STATIC_METADATA_BLOCK 0x6
> >> #define USE_EXTENDED_TAG 0x07
> >> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> >> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> >> mode->clock = clock;
> >> }
> >>
> >> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> >> +{
> >> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> >> + return false;
> >> +
> >> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> >> + return false;
> >> +
> >> + if (cea_db_payload_len(db) < 2)
> >> + return false;
> >> +
> >> + return true;
> >> +}
> >> +
> >> +static void
> >> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> >> +{
> >> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> >> +
> >> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> >> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> >> + /* Byte 4 Bit 7: DCI-P3 */
> >> + if (db[3] & BIT(7))
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> >> +
> >> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> >> +}
> >> +
> >> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> >> {
> >> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> >> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> >> drm_parse_vcdb(connector, db);
> >> if (cea_db_is_hdmi_hdr_metadata_block(db))
> >> drm_parse_hdr_metadata_block(connector, db);
> >> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> >> + drm_parse_colorimetry_data_block(connector, db);
> >> }
> >> }
> >>
> >> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> >> index af145608b5ed..d599c3b9e881 100644
> >> --- a/include/drm/drm_connector.h
> >> +++ b/include/drm/drm_connector.h
> >> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
> >>
> >> /** @y420_dc_modes: bitmap of deep color support index */
> >> u8 y420_dc_modes;
> >> +
> >> + /* @colorimetry: bitmap of supported colorimetry modes */
> >> + u16 colorimetry;
> >> };
> >>
> >> /**
> >> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> >> index cfa4f5af49af..98fa78c2f82d 100644
> >> --- a/include/drm/drm_edid.h
> >> +++ b/include/drm/drm_edid.h
> >> @@ -229,6 +229,20 @@ struct detailed_timing {
> >> DRM_EDID_YCBCR420_DC_36 | \
> >> DRM_EDID_YCBCR420_DC_30)
> >>
> >> +/*
> >> + * Supported Colorimetry from colorimetry data block
> >> + * as per CEA 861-G spec
> >> + */
> >> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> >> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> >> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> >> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> >> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> >> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> >> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> >> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> >> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> >> +
> >> /* ELD Header Block */
> >> #define DRM_ELD_HEADER_BLOCK_SIZE 4
> >>
> >> --
> >> 2.25.1
> >>
> >>
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Ville Syrjälä
Intel
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-31 19:53 ` Ville Syrjälä
0 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-08-31 19:53 UTC (permalink / raw)
To: crj; +Cc: airlied, linux-kernel, dri-devel, linux-rockchip, tzimmermann
On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
> Hi Ville Syrjälä,
>
> 在 2020/8/27 18:57, Ville Syrjälä 写道:
> > On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> >> CEA 861.3 spec adds colorimetry data block for HDMI.
> >> Parsing the block to get the colorimetry data from
> >> panel.
> > And what exactly do you want to do with that data?
>
>
> We can get colorimetry data block from edid then support
>
> HDMI colorimetry such as BT2020.
But what do you want to do with it? The patch does nothing
functional.
>
> >> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> >> ---
> >>
> >> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> >> include/drm/drm_connector.h | 3 +++
> >> include/drm/drm_edid.h | 14 ++++++++++++
> >> 3 files changed, 62 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >> index 31496b6cfc56..67e607c04492 100644
> >> --- a/drivers/gpu/drm/drm_edid.c
> >> +++ b/drivers/gpu/drm/drm_edid.c
> >> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> >> #define VIDEO_BLOCK 0x02
> >> #define VENDOR_BLOCK 0x03
> >> #define SPEAKER_BLOCK 0x04
> >> +#define COLORIMETRY_DATA_BLOCK 0x5
> >> #define HDR_STATIC_METADATA_BLOCK 0x6
> >> #define USE_EXTENDED_TAG 0x07
> >> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> >> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> >> mode->clock = clock;
> >> }
> >>
> >> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> >> +{
> >> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> >> + return false;
> >> +
> >> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> >> + return false;
> >> +
> >> + if (cea_db_payload_len(db) < 2)
> >> + return false;
> >> +
> >> + return true;
> >> +}
> >> +
> >> +static void
> >> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> >> +{
> >> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> >> +
> >> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> >> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> >> + /* Byte 4 Bit 7: DCI-P3 */
> >> + if (db[3] & BIT(7))
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> >> +
> >> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> >> +}
> >> +
> >> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> >> {
> >> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> >> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> >> drm_parse_vcdb(connector, db);
> >> if (cea_db_is_hdmi_hdr_metadata_block(db))
> >> drm_parse_hdr_metadata_block(connector, db);
> >> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> >> + drm_parse_colorimetry_data_block(connector, db);
> >> }
> >> }
> >>
> >> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> >> index af145608b5ed..d599c3b9e881 100644
> >> --- a/include/drm/drm_connector.h
> >> +++ b/include/drm/drm_connector.h
> >> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
> >>
> >> /** @y420_dc_modes: bitmap of deep color support index */
> >> u8 y420_dc_modes;
> >> +
> >> + /* @colorimetry: bitmap of supported colorimetry modes */
> >> + u16 colorimetry;
> >> };
> >>
> >> /**
> >> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> >> index cfa4f5af49af..98fa78c2f82d 100644
> >> --- a/include/drm/drm_edid.h
> >> +++ b/include/drm/drm_edid.h
> >> @@ -229,6 +229,20 @@ struct detailed_timing {
> >> DRM_EDID_YCBCR420_DC_36 | \
> >> DRM_EDID_YCBCR420_DC_30)
> >>
> >> +/*
> >> + * Supported Colorimetry from colorimetry data block
> >> + * as per CEA 861-G spec
> >> + */
> >> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> >> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> >> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> >> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> >> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> >> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> >> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> >> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> >> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> >> +
> >> /* ELD Header Block */
> >> #define DRM_ELD_HEADER_BLOCK_SIZE 4
> >>
> >> --
> >> 2.25.1
> >>
> >>
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-08-31 19:53 ` Ville Syrjälä
0 siblings, 0 replies; 34+ messages in thread
From: Ville Syrjälä @ 2020-08-31 19:53 UTC (permalink / raw)
To: crj
Cc: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
> Hi Ville Syrjälä,
>
> 在 2020/8/27 18:57, Ville Syrjälä 写道:
> > On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> >> CEA 861.3 spec adds colorimetry data block for HDMI.
> >> Parsing the block to get the colorimetry data from
> >> panel.
> > And what exactly do you want to do with that data?
>
>
> We can get colorimetry data block from edid then support
>
> HDMI colorimetry such as BT2020.
But what do you want to do with it? The patch does nothing
functional.
>
> >> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> >> ---
> >>
> >> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> >> include/drm/drm_connector.h | 3 +++
> >> include/drm/drm_edid.h | 14 ++++++++++++
> >> 3 files changed, 62 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> >> index 31496b6cfc56..67e607c04492 100644
> >> --- a/drivers/gpu/drm/drm_edid.c
> >> +++ b/drivers/gpu/drm/drm_edid.c
> >> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> >> #define VIDEO_BLOCK 0x02
> >> #define VENDOR_BLOCK 0x03
> >> #define SPEAKER_BLOCK 0x04
> >> +#define COLORIMETRY_DATA_BLOCK 0x5
> >> #define HDR_STATIC_METADATA_BLOCK 0x6
> >> #define USE_EXTENDED_TAG 0x07
> >> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> >> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> >> mode->clock = clock;
> >> }
> >>
> >> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> >> +{
> >> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> >> + return false;
> >> +
> >> + if (db[1] != COLORIMETRY_DATA_BLOCK)
> >> + return false;
> >> +
> >> + if (cea_db_payload_len(db) < 2)
> >> + return false;
> >> +
> >> + return true;
> >> +}
> >> +
> >> +static void
> >> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> >> +{
> >> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> >> +
> >> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> >> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> >> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> >> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> >> + /* Byte 4 Bit 7: DCI-P3 */
> >> + if (db[3] & BIT(7))
> >> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> >> +
> >> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> >> +}
> >> +
> >> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> >> {
> >> if (cea_db_tag(db) != USE_EXTENDED_TAG)
> >> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> >> drm_parse_vcdb(connector, db);
> >> if (cea_db_is_hdmi_hdr_metadata_block(db))
> >> drm_parse_hdr_metadata_block(connector, db);
> >> + if (cea_db_is_hdmi_colorimetry_data_block(db))
> >> + drm_parse_colorimetry_data_block(connector, db);
> >> }
> >> }
> >>
> >> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> >> index af145608b5ed..d599c3b9e881 100644
> >> --- a/include/drm/drm_connector.h
> >> +++ b/include/drm/drm_connector.h
> >> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
> >>
> >> /** @y420_dc_modes: bitmap of deep color support index */
> >> u8 y420_dc_modes;
> >> +
> >> + /* @colorimetry: bitmap of supported colorimetry modes */
> >> + u16 colorimetry;
> >> };
> >>
> >> /**
> >> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> >> index cfa4f5af49af..98fa78c2f82d 100644
> >> --- a/include/drm/drm_edid.h
> >> +++ b/include/drm/drm_edid.h
> >> @@ -229,6 +229,20 @@ struct detailed_timing {
> >> DRM_EDID_YCBCR420_DC_36 | \
> >> DRM_EDID_YCBCR420_DC_30)
> >>
> >> +/*
> >> + * Supported Colorimetry from colorimetry data block
> >> + * as per CEA 861-G spec
> >> + */
> >> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> >> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> >> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> >> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> >> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> >> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> >> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> >> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> >> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> >> +
> >> /* ELD Header Block */
> >> #define DRM_ELD_HEADER_BLOCK_SIZE 4
> >>
> >> --
> >> 2.25.1
> >>
> >>
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
--
Ville Syrjälä
Intel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-08-31 19:53 ` Ville Syrjälä
(?)
@ 2020-09-01 7:30 ` crj
-1 siblings, 0 replies; 34+ messages in thread
From: crj @ 2020-09-01 7:30 UTC (permalink / raw)
To: Ville Syrjälä
Cc: daniel, airlied, maarten.lankhorst, linux-kernel, dri-devel,
linux-rockchip, mripard, tzimmermann
Hi,
在 2020/9/1 3:53, Ville Syrjälä 写道:
> On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
>> Hi Ville Syrjälä,
>>
>> 在 2020/8/27 18:57, Ville Syrjälä 写道:
>>> On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
>>>> CEA 861.3 spec adds colorimetry data block for HDMI.
>>>> Parsing the block to get the colorimetry data from
>>>> panel.
>>> And what exactly do you want to do with that data?
>>
>> We can get colorimetry data block from edid then support
>>
>> HDMI colorimetry such as BT2020.
> But what do you want to do with it? The patch does nothing
> functional.
If we want to output BT2020 in HDMI driver, we can know whether TV
support BT2020
via connector->display_info.hdmi.colorimetry. If TV don't support
BT2020, HDMI shouldn't
ouput in BT2020.
>>>> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
>>>> ---
>>>>
>>>> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
>>>> include/drm/drm_connector.h | 3 +++
>>>> include/drm/drm_edid.h | 14 ++++++++++++
>>>> 3 files changed, 62 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>>> index 31496b6cfc56..67e607c04492 100644
>>>> --- a/drivers/gpu/drm/drm_edid.c
>>>> +++ b/drivers/gpu/drm/drm_edid.c
>>>> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
>>>> #define VIDEO_BLOCK 0x02
>>>> #define VENDOR_BLOCK 0x03
>>>> #define SPEAKER_BLOCK 0x04
>>>> +#define COLORIMETRY_DATA_BLOCK 0x5
>>>> #define HDR_STATIC_METADATA_BLOCK 0x6
>>>> #define USE_EXTENDED_TAG 0x07
>>>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>>>> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>>>> mode->clock = clock;
>>>> }
>>>>
>>>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>>>> +{
>>>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>>>> + return false;
>>>> +
>>>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>>>> + return false;
>>>> +
>>>> + if (cea_db_payload_len(db) < 2)
>>>> + return false;
>>>> +
>>>> + return true;
>>>> +}
>>>> +
>>>> +static void
>>>> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
>>>> +{
>>>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>>>> +
>>>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>>>> + /* Byte 4 Bit 7: DCI-P3 */
>>>> + if (db[3] & BIT(7))
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>>>> +
>>>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>>>> +}
>>>> +
>>>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>>>> {
>>>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>>>> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>>>> drm_parse_vcdb(connector, db);
>>>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>>>> drm_parse_hdr_metadata_block(connector, db);
>>>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>>>> + drm_parse_colorimetry_data_block(connector, db);
>>>> }
>>>> }
>>>>
>>>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>>>> index af145608b5ed..d599c3b9e881 100644
>>>> --- a/include/drm/drm_connector.h
>>>> +++ b/include/drm/drm_connector.h
>>>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>>>
>>>> /** @y420_dc_modes: bitmap of deep color support index */
>>>> u8 y420_dc_modes;
>>>> +
>>>> + /* @colorimetry: bitmap of supported colorimetry modes */
>>>> + u16 colorimetry;
>>>> };
>>>>
>>>> /**
>>>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>>>> index cfa4f5af49af..98fa78c2f82d 100644
>>>> --- a/include/drm/drm_edid.h
>>>> +++ b/include/drm/drm_edid.h
>>>> @@ -229,6 +229,20 @@ struct detailed_timing {
>>>> DRM_EDID_YCBCR420_DC_36 | \
>>>> DRM_EDID_YCBCR420_DC_30)
>>>>
>>>> +/*
>>>> + * Supported Colorimetry from colorimetry data block
>>>> + * as per CEA 861-G spec
>>>> + */
>>>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>>>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>>>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>>>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>>>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>>>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>>>> +
>>>> /* ELD Header Block */
>>>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>>>
>>>> --
>>>> 2.25.1
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-09-01 7:30 ` crj
0 siblings, 0 replies; 34+ messages in thread
From: crj @ 2020-09-01 7:30 UTC (permalink / raw)
To: Ville Syrjälä
Cc: airlied, linux-kernel, dri-devel, linux-rockchip, tzimmermann
Hi,
在 2020/9/1 3:53, Ville Syrjälä 写道:
> On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
>> Hi Ville Syrjälä,
>>
>> 在 2020/8/27 18:57, Ville Syrjälä 写道:
>>> On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
>>>> CEA 861.3 spec adds colorimetry data block for HDMI.
>>>> Parsing the block to get the colorimetry data from
>>>> panel.
>>> And what exactly do you want to do with that data?
>>
>> We can get colorimetry data block from edid then support
>>
>> HDMI colorimetry such as BT2020.
> But what do you want to do with it? The patch does nothing
> functional.
If we want to output BT2020 in HDMI driver, we can know whether TV
support BT2020
via connector->display_info.hdmi.colorimetry. If TV don't support
BT2020, HDMI shouldn't
ouput in BT2020.
>>>> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
>>>> ---
>>>>
>>>> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
>>>> include/drm/drm_connector.h | 3 +++
>>>> include/drm/drm_edid.h | 14 ++++++++++++
>>>> 3 files changed, 62 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>>> index 31496b6cfc56..67e607c04492 100644
>>>> --- a/drivers/gpu/drm/drm_edid.c
>>>> +++ b/drivers/gpu/drm/drm_edid.c
>>>> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
>>>> #define VIDEO_BLOCK 0x02
>>>> #define VENDOR_BLOCK 0x03
>>>> #define SPEAKER_BLOCK 0x04
>>>> +#define COLORIMETRY_DATA_BLOCK 0x5
>>>> #define HDR_STATIC_METADATA_BLOCK 0x6
>>>> #define USE_EXTENDED_TAG 0x07
>>>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>>>> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>>>> mode->clock = clock;
>>>> }
>>>>
>>>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>>>> +{
>>>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>>>> + return false;
>>>> +
>>>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>>>> + return false;
>>>> +
>>>> + if (cea_db_payload_len(db) < 2)
>>>> + return false;
>>>> +
>>>> + return true;
>>>> +}
>>>> +
>>>> +static void
>>>> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
>>>> +{
>>>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>>>> +
>>>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>>>> + /* Byte 4 Bit 7: DCI-P3 */
>>>> + if (db[3] & BIT(7))
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>>>> +
>>>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>>>> +}
>>>> +
>>>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>>>> {
>>>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>>>> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>>>> drm_parse_vcdb(connector, db);
>>>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>>>> drm_parse_hdr_metadata_block(connector, db);
>>>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>>>> + drm_parse_colorimetry_data_block(connector, db);
>>>> }
>>>> }
>>>>
>>>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>>>> index af145608b5ed..d599c3b9e881 100644
>>>> --- a/include/drm/drm_connector.h
>>>> +++ b/include/drm/drm_connector.h
>>>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>>>
>>>> /** @y420_dc_modes: bitmap of deep color support index */
>>>> u8 y420_dc_modes;
>>>> +
>>>> + /* @colorimetry: bitmap of supported colorimetry modes */
>>>> + u16 colorimetry;
>>>> };
>>>>
>>>> /**
>>>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>>>> index cfa4f5af49af..98fa78c2f82d 100644
>>>> --- a/include/drm/drm_edid.h
>>>> +++ b/include/drm/drm_edid.h
>>>> @@ -229,6 +229,20 @@ struct detailed_timing {
>>>> DRM_EDID_YCBCR420_DC_36 | \
>>>> DRM_EDID_YCBCR420_DC_30)
>>>>
>>>> +/*
>>>> + * Supported Colorimetry from colorimetry data block
>>>> + * as per CEA 861-G spec
>>>> + */
>>>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>>>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>>>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>>>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>>>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>>>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>>>> +
>>>> /* ELD Header Block */
>>>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>>>
>>>> --
>>>> 2.25.1
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-09-01 7:30 ` crj
0 siblings, 0 replies; 34+ messages in thread
From: crj @ 2020-09-01 7:30 UTC (permalink / raw)
To: Ville Syrjälä
Cc: mripard, tzimmermann, linux-kernel, airlied, dri-devel,
maarten.lankhorst, daniel, linux-rockchip
Hi,
在 2020/9/1 3:53, Ville Syrjälä 写道:
> On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
>> Hi Ville Syrjälä,
>>
>> 在 2020/8/27 18:57, Ville Syrjälä 写道:
>>> On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
>>>> CEA 861.3 spec adds colorimetry data block for HDMI.
>>>> Parsing the block to get the colorimetry data from
>>>> panel.
>>> And what exactly do you want to do with that data?
>>
>> We can get colorimetry data block from edid then support
>>
>> HDMI colorimetry such as BT2020.
> But what do you want to do with it? The patch does nothing
> functional.
If we want to output BT2020 in HDMI driver, we can know whether TV
support BT2020
via connector->display_info.hdmi.colorimetry. If TV don't support
BT2020, HDMI shouldn't
ouput in BT2020.
>>>> Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
>>>> ---
>>>>
>>>> drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
>>>> include/drm/drm_connector.h | 3 +++
>>>> include/drm/drm_edid.h | 14 ++++++++++++
>>>> 3 files changed, 62 insertions(+)
>>>>
>>>> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
>>>> index 31496b6cfc56..67e607c04492 100644
>>>> --- a/drivers/gpu/drm/drm_edid.c
>>>> +++ b/drivers/gpu/drm/drm_edid.c
>>>> @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
>>>> #define VIDEO_BLOCK 0x02
>>>> #define VENDOR_BLOCK 0x03
>>>> #define SPEAKER_BLOCK 0x04
>>>> +#define COLORIMETRY_DATA_BLOCK 0x5
>>>> #define HDR_STATIC_METADATA_BLOCK 0x6
>>>> #define USE_EXTENDED_TAG 0x07
>>>> #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
>>>> @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
>>>> mode->clock = clock;
>>>> }
>>>>
>>>> +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
>>>> +{
>>>> + if (cea_db_tag(db) != USE_EXTENDED_TAG)
>>>> + return false;
>>>> +
>>>> + if (db[1] != COLORIMETRY_DATA_BLOCK)
>>>> + return false;
>>>> +
>>>> + if (cea_db_payload_len(db) < 2)
>>>> + return false;
>>>> +
>>>> + return true;
>>>> +}
>>>> +
>>>> +static void
>>>> +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
>>>> +{
>>>> + struct drm_hdmi_info *info = &connector->display_info.hdmi;
>>>> +
>>>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
>>>> + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
>>>> + /* Byte 4 Bit 7: DCI-P3 */
>>>> + if (db[3] & BIT(7))
>>>> + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
>>>> +
>>>> + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
>>>> +}
>>>> +
>>>> static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
>>>> {
>>>> if (cea_db_tag(db) != USE_EXTENDED_TAG)
>>>> @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
>>>> drm_parse_vcdb(connector, db);
>>>> if (cea_db_is_hdmi_hdr_metadata_block(db))
>>>> drm_parse_hdr_metadata_block(connector, db);
>>>> + if (cea_db_is_hdmi_colorimetry_data_block(db))
>>>> + drm_parse_colorimetry_data_block(connector, db);
>>>> }
>>>> }
>>>>
>>>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>>>> index af145608b5ed..d599c3b9e881 100644
>>>> --- a/include/drm/drm_connector.h
>>>> +++ b/include/drm/drm_connector.h
>>>> @@ -207,6 +207,9 @@ struct drm_hdmi_info {
>>>>
>>>> /** @y420_dc_modes: bitmap of deep color support index */
>>>> u8 y420_dc_modes;
>>>> +
>>>> + /* @colorimetry: bitmap of supported colorimetry modes */
>>>> + u16 colorimetry;
>>>> };
>>>>
>>>> /**
>>>> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
>>>> index cfa4f5af49af..98fa78c2f82d 100644
>>>> --- a/include/drm/drm_edid.h
>>>> +++ b/include/drm/drm_edid.h
>>>> @@ -229,6 +229,20 @@ struct detailed_timing {
>>>> DRM_EDID_YCBCR420_DC_36 | \
>>>> DRM_EDID_YCBCR420_DC_30)
>>>>
>>>> +/*
>>>> + * Supported Colorimetry from colorimetry data block
>>>> + * as per CEA 861-G spec
>>>> + */
>>>> +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
>>>> +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
>>>> +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
>>>> +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
>>>> +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
>>>> +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
>>>> +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
>>>> +
>>>> /* ELD Header Block */
>>>> #define DRM_ELD_HEADER_BLOCK_SIZE 4
>>>>
>>>> --
>>>> 2.25.1
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
2020-09-01 7:30 ` crj
(?)
@ 2020-09-01 13:17 ` Daniel Vetter
-1 siblings, 0 replies; 34+ messages in thread
From: Daniel Vetter @ 2020-09-01 13:17 UTC (permalink / raw)
To: crj
Cc: daniel, airlied, maarten.lankhorst, linux-kernel, dri-devel,
linux-rockchip, mripard, tzimmermann, Ville Syrjälä
On Tue, Sep 01, 2020 at 03:30:17PM +0800, crj wrote:
> Hi,
>
> 在 2020/9/1 3:53, Ville Syrjälä 写道:
> > On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
> > > Hi Ville Syrjälä,
> > >
> > > 在 2020/8/27 18:57, Ville Syrjälä 写道:
> > > > On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> > > > > CEA 861.3 spec adds colorimetry data block for HDMI.
> > > > > Parsing the block to get the colorimetry data from
> > > > > panel.
> > > > And what exactly do you want to do with that data?
> > >
> > > We can get colorimetry data block from edid then support
> > >
> > > HDMI colorimetry such as BT2020.
> > But what do you want to do with it? The patch does nothing
> > functional.
>
> If we want to output BT2020 in HDMI driver, we can know whether TV support
> BT2020
>
> via connector->display_info.hdmi.colorimetry. If TV don't support BT2020,
> HDMI shouldn't
>
> ouput in BT2020.
You need to include these driver patches in your series, not just the core
changes. We don't review/merge just core enabling patches, we need an
entire functional slice.
-Daniel
>
> > > > > Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> > > > > ---
> > > > >
> > > > > drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> > > > > include/drm/drm_connector.h | 3 +++
> > > > > include/drm/drm_edid.h | 14 ++++++++++++
> > > > > 3 files changed, 62 insertions(+)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > > > index 31496b6cfc56..67e607c04492 100644
> > > > > --- a/drivers/gpu/drm/drm_edid.c
> > > > > +++ b/drivers/gpu/drm/drm_edid.c
> > > > > @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> > > > > #define VIDEO_BLOCK 0x02
> > > > > #define VENDOR_BLOCK 0x03
> > > > > #define SPEAKER_BLOCK 0x04
> > > > > +#define COLORIMETRY_DATA_BLOCK 0x5
> > > > > #define HDR_STATIC_METADATA_BLOCK 0x6
> > > > > #define USE_EXTENDED_TAG 0x07
> > > > > #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> > > > > @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> > > > > mode->clock = clock;
> > > > > }
> > > > > +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> > > > > +{
> > > > > + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> > > > > + return false;
> > > > > +
> > > > > + if (db[1] != COLORIMETRY_DATA_BLOCK)
> > > > > + return false;
> > > > > +
> > > > > + if (cea_db_payload_len(db) < 2)
> > > > > + return false;
> > > > > +
> > > > > + return true;
> > > > > +}
> > > > > +
> > > > > +static void
> > > > > +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> > > > > +{
> > > > > + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> > > > > +
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> > > > > + /* Byte 4 Bit 7: DCI-P3 */
> > > > > + if (db[3] & BIT(7))
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> > > > > +
> > > > > + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> > > > > +}
> > > > > +
> > > > > static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> > > > > {
> > > > > if (cea_db_tag(db) != USE_EXTENDED_TAG)
> > > > > @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> > > > > drm_parse_vcdb(connector, db);
> > > > > if (cea_db_is_hdmi_hdr_metadata_block(db))
> > > > > drm_parse_hdr_metadata_block(connector, db);
> > > > > + if (cea_db_is_hdmi_colorimetry_data_block(db))
> > > > > + drm_parse_colorimetry_data_block(connector, db);
> > > > > }
> > > > > }
> > > > > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > > > > index af145608b5ed..d599c3b9e881 100644
> > > > > --- a/include/drm/drm_connector.h
> > > > > +++ b/include/drm/drm_connector.h
> > > > > @@ -207,6 +207,9 @@ struct drm_hdmi_info {
> > > > > /** @y420_dc_modes: bitmap of deep color support index */
> > > > > u8 y420_dc_modes;
> > > > > +
> > > > > + /* @colorimetry: bitmap of supported colorimetry modes */
> > > > > + u16 colorimetry;
> > > > > };
> > > > > /**
> > > > > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> > > > > index cfa4f5af49af..98fa78c2f82d 100644
> > > > > --- a/include/drm/drm_edid.h
> > > > > +++ b/include/drm/drm_edid.h
> > > > > @@ -229,6 +229,20 @@ struct detailed_timing {
> > > > > DRM_EDID_YCBCR420_DC_36 | \
> > > > > DRM_EDID_YCBCR420_DC_30)
> > > > > +/*
> > > > > + * Supported Colorimetry from colorimetry data block
> > > > > + * as per CEA 861-G spec
> > > > > + */
> > > > > +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> > > > > +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> > > > > +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> > > > > +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> > > > > +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> > > > > +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> > > > > +
> > > > > /* ELD Header Block */
> > > > > #define DRM_ELD_HEADER_BLOCK_SIZE 4
> > > > > --
> > > > > 2.25.1
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > dri-devel mailing list
> > > > > dri-devel@lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-09-01 13:17 ` Daniel Vetter
0 siblings, 0 replies; 34+ messages in thread
From: Daniel Vetter @ 2020-09-01 13:17 UTC (permalink / raw)
To: crj; +Cc: airlied, linux-kernel, dri-devel, linux-rockchip, tzimmermann
On Tue, Sep 01, 2020 at 03:30:17PM +0800, crj wrote:
> Hi,
>
> 在 2020/9/1 3:53, Ville Syrjälä 写道:
> > On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
> > > Hi Ville Syrjälä,
> > >
> > > 在 2020/8/27 18:57, Ville Syrjälä 写道:
> > > > On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> > > > > CEA 861.3 spec adds colorimetry data block for HDMI.
> > > > > Parsing the block to get the colorimetry data from
> > > > > panel.
> > > > And what exactly do you want to do with that data?
> > >
> > > We can get colorimetry data block from edid then support
> > >
> > > HDMI colorimetry such as BT2020.
> > But what do you want to do with it? The patch does nothing
> > functional.
>
> If we want to output BT2020 in HDMI driver, we can know whether TV support
> BT2020
>
> via connector->display_info.hdmi.colorimetry. If TV don't support BT2020,
> HDMI shouldn't
>
> ouput in BT2020.
You need to include these driver patches in your series, not just the core
changes. We don't review/merge just core enabling patches, we need an
entire functional slice.
-Daniel
>
> > > > > Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> > > > > ---
> > > > >
> > > > > drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> > > > > include/drm/drm_connector.h | 3 +++
> > > > > include/drm/drm_edid.h | 14 ++++++++++++
> > > > > 3 files changed, 62 insertions(+)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > > > index 31496b6cfc56..67e607c04492 100644
> > > > > --- a/drivers/gpu/drm/drm_edid.c
> > > > > +++ b/drivers/gpu/drm/drm_edid.c
> > > > > @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> > > > > #define VIDEO_BLOCK 0x02
> > > > > #define VENDOR_BLOCK 0x03
> > > > > #define SPEAKER_BLOCK 0x04
> > > > > +#define COLORIMETRY_DATA_BLOCK 0x5
> > > > > #define HDR_STATIC_METADATA_BLOCK 0x6
> > > > > #define USE_EXTENDED_TAG 0x07
> > > > > #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> > > > > @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> > > > > mode->clock = clock;
> > > > > }
> > > > > +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> > > > > +{
> > > > > + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> > > > > + return false;
> > > > > +
> > > > > + if (db[1] != COLORIMETRY_DATA_BLOCK)
> > > > > + return false;
> > > > > +
> > > > > + if (cea_db_payload_len(db) < 2)
> > > > > + return false;
> > > > > +
> > > > > + return true;
> > > > > +}
> > > > > +
> > > > > +static void
> > > > > +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> > > > > +{
> > > > > + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> > > > > +
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> > > > > + /* Byte 4 Bit 7: DCI-P3 */
> > > > > + if (db[3] & BIT(7))
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> > > > > +
> > > > > + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> > > > > +}
> > > > > +
> > > > > static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> > > > > {
> > > > > if (cea_db_tag(db) != USE_EXTENDED_TAG)
> > > > > @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> > > > > drm_parse_vcdb(connector, db);
> > > > > if (cea_db_is_hdmi_hdr_metadata_block(db))
> > > > > drm_parse_hdr_metadata_block(connector, db);
> > > > > + if (cea_db_is_hdmi_colorimetry_data_block(db))
> > > > > + drm_parse_colorimetry_data_block(connector, db);
> > > > > }
> > > > > }
> > > > > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > > > > index af145608b5ed..d599c3b9e881 100644
> > > > > --- a/include/drm/drm_connector.h
> > > > > +++ b/include/drm/drm_connector.h
> > > > > @@ -207,6 +207,9 @@ struct drm_hdmi_info {
> > > > > /** @y420_dc_modes: bitmap of deep color support index */
> > > > > u8 y420_dc_modes;
> > > > > +
> > > > > + /* @colorimetry: bitmap of supported colorimetry modes */
> > > > > + u16 colorimetry;
> > > > > };
> > > > > /**
> > > > > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> > > > > index cfa4f5af49af..98fa78c2f82d 100644
> > > > > --- a/include/drm/drm_edid.h
> > > > > +++ b/include/drm/drm_edid.h
> > > > > @@ -229,6 +229,20 @@ struct detailed_timing {
> > > > > DRM_EDID_YCBCR420_DC_36 | \
> > > > > DRM_EDID_YCBCR420_DC_30)
> > > > > +/*
> > > > > + * Supported Colorimetry from colorimetry data block
> > > > > + * as per CEA 861-G spec
> > > > > + */
> > > > > +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> > > > > +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> > > > > +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> > > > > +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> > > > > +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> > > > > +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> > > > > +
> > > > > /* ELD Header Block */
> > > > > #define DRM_ELD_HEADER_BLOCK_SIZE 4
> > > > > --
> > > > > 2.25.1
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > dri-devel mailing list
> > > > > dri-devel@lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [PATCH] drm: Parse Colorimetry data block from EDID
@ 2020-09-01 13:17 ` Daniel Vetter
0 siblings, 0 replies; 34+ messages in thread
From: Daniel Vetter @ 2020-09-01 13:17 UTC (permalink / raw)
To: crj
Cc: Ville Syrjälä, mripard, tzimmermann, linux-kernel,
airlied, dri-devel, maarten.lankhorst, daniel, linux-rockchip
On Tue, Sep 01, 2020 at 03:30:17PM +0800, crj wrote:
> Hi,
>
> 在 2020/9/1 3:53, Ville Syrjälä 写道:
> > On Fri, Aug 28, 2020 at 09:07:13AM +0800, crj wrote:
> > > Hi Ville Syrjälä,
> > >
> > > 在 2020/8/27 18:57, Ville Syrjälä 写道:
> > > > On Wed, Aug 26, 2020 at 10:23:28PM +0800, Algea Cao wrote:
> > > > > CEA 861.3 spec adds colorimetry data block for HDMI.
> > > > > Parsing the block to get the colorimetry data from
> > > > > panel.
> > > > And what exactly do you want to do with that data?
> > >
> > > We can get colorimetry data block from edid then support
> > >
> > > HDMI colorimetry such as BT2020.
> > But what do you want to do with it? The patch does nothing
> > functional.
>
> If we want to output BT2020 in HDMI driver, we can know whether TV support
> BT2020
>
> via connector->display_info.hdmi.colorimetry. If TV don't support BT2020,
> HDMI shouldn't
>
> ouput in BT2020.
You need to include these driver patches in your series, not just the core
changes. We don't review/merge just core enabling patches, we need an
entire functional slice.
-Daniel
>
> > > > > Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
> > > > > ---
> > > > >
> > > > > drivers/gpu/drm/drm_edid.c | 45 +++++++++++++++++++++++++++++++++++++
> > > > > include/drm/drm_connector.h | 3 +++
> > > > > include/drm/drm_edid.h | 14 ++++++++++++
> > > > > 3 files changed, 62 insertions(+)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > > > index 31496b6cfc56..67e607c04492 100644
> > > > > --- a/drivers/gpu/drm/drm_edid.c
> > > > > +++ b/drivers/gpu/drm/drm_edid.c
> > > > > @@ -3223,6 +3223,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> > > > > #define VIDEO_BLOCK 0x02
> > > > > #define VENDOR_BLOCK 0x03
> > > > > #define SPEAKER_BLOCK 0x04
> > > > > +#define COLORIMETRY_DATA_BLOCK 0x5
> > > > > #define HDR_STATIC_METADATA_BLOCK 0x6
> > > > > #define USE_EXTENDED_TAG 0x07
> > > > > #define EXT_VIDEO_CAPABILITY_BLOCK 0x00
> > > > > @@ -4309,6 +4310,48 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
> > > > > mode->clock = clock;
> > > > > }
> > > > > +static bool cea_db_is_hdmi_colorimetry_data_block(const u8 *db)
> > > > > +{
> > > > > + if (cea_db_tag(db) != USE_EXTENDED_TAG)
> > > > > + return false;
> > > > > +
> > > > > + if (db[1] != COLORIMETRY_DATA_BLOCK)
> > > > > + return false;
> > > > > +
> > > > > + if (cea_db_payload_len(db) < 2)
> > > > > + return false;
> > > > > +
> > > > > + return true;
> > > > > +}
> > > > > +
> > > > > +static void
> > > > > +drm_parse_colorimetry_data_block(struct drm_connector *connector, const u8 *db)
> > > > > +{
> > > > > + struct drm_hdmi_info *info = &connector->display_info.hdmi;
> > > > > +
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_xvYCC_709)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_xvYCC_709;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_sYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_sYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_ADBYCC_601)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_ADBYCC_601;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_ADB_RGB)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_ADB_RGB;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_CYCC)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_CYCC;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_YCC)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_YCC;
> > > > > + if (db[2] & DRM_EDID_CLRMETRY_BT2020_RGB)
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_BT2020_RGB;
> > > > > + /* Byte 4 Bit 7: DCI-P3 */
> > > > > + if (db[3] & BIT(7))
> > > > > + info->colorimetry |= DRM_EDID_CLRMETRY_DCI_P3;
> > > > > +
> > > > > + DRM_DEBUG_KMS("Supported Colorimetry 0x%x\n", info->colorimetry);
> > > > > +}
> > > > > +
> > > > > static bool cea_db_is_hdmi_hdr_metadata_block(const u8 *db)
> > > > > {
> > > > > if (cea_db_tag(db) != USE_EXTENDED_TAG)
> > > > > @@ -4994,6 +5037,8 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
> > > > > drm_parse_vcdb(connector, db);
> > > > > if (cea_db_is_hdmi_hdr_metadata_block(db))
> > > > > drm_parse_hdr_metadata_block(connector, db);
> > > > > + if (cea_db_is_hdmi_colorimetry_data_block(db))
> > > > > + drm_parse_colorimetry_data_block(connector, db);
> > > > > }
> > > > > }
> > > > > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > > > > index af145608b5ed..d599c3b9e881 100644
> > > > > --- a/include/drm/drm_connector.h
> > > > > +++ b/include/drm/drm_connector.h
> > > > > @@ -207,6 +207,9 @@ struct drm_hdmi_info {
> > > > > /** @y420_dc_modes: bitmap of deep color support index */
> > > > > u8 y420_dc_modes;
> > > > > +
> > > > > + /* @colorimetry: bitmap of supported colorimetry modes */
> > > > > + u16 colorimetry;
> > > > > };
> > > > > /**
> > > > > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> > > > > index cfa4f5af49af..98fa78c2f82d 100644
> > > > > --- a/include/drm/drm_edid.h
> > > > > +++ b/include/drm/drm_edid.h
> > > > > @@ -229,6 +229,20 @@ struct detailed_timing {
> > > > > DRM_EDID_YCBCR420_DC_36 | \
> > > > > DRM_EDID_YCBCR420_DC_30)
> > > > > +/*
> > > > > + * Supported Colorimetry from colorimetry data block
> > > > > + * as per CEA 861-G spec
> > > > > + */
> > > > > +#define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0)
> > > > > +#define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1)
> > > > > +#define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2)
> > > > > +#define DRM_EDID_CLRMETRY_ADBYCC_601 (1 << 3)
> > > > > +#define DRM_EDID_CLRMETRY_ADB_RGB (1 << 4)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6)
> > > > > +#define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7)
> > > > > +#define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15)
> > > > > +
> > > > > /* ELD Header Block */
> > > > > #define DRM_ELD_HEADER_BLOCK_SIZE 4
> > > > > --
> > > > > 2.25.1
> > > > >
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > dri-devel mailing list
> > > > > dri-devel@lists.freedesktop.org
> > > > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2020-09-01 16:37 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-26 14:23 [PATCH] drm: Parse Colorimetry data block from EDID Algea Cao
2020-08-26 14:23 ` Algea Cao
2020-08-26 14:23 ` Algea Cao
2020-08-27 7:34 ` Printing bitfields in the kernel (Re: [PATCH] drm: Parse Colorimetry data block from EDID) Pekka Paalanen
2020-08-27 7:34 ` Pekka Paalanen
2020-08-27 7:34 ` Pekka Paalanen
2020-08-28 4:58 ` Joe Perches
2020-08-28 4:58 ` Joe Perches
2020-08-28 4:58 ` Joe Perches
2020-08-27 10:57 ` [PATCH] drm: Parse Colorimetry data block from EDID Ville Syrjälä
2020-08-27 10:57 ` Ville Syrjälä
2020-08-27 10:57 ` Ville Syrjälä
2020-08-28 1:07 ` crj
2020-08-28 1:07 ` crj
2020-08-28 1:07 ` crj
2020-08-31 19:53 ` Ville Syrjälä
2020-08-31 19:53 ` Ville Syrjälä
2020-08-31 19:53 ` Ville Syrjälä
2020-09-01 7:30 ` crj
2020-09-01 7:30 ` crj
2020-09-01 7:30 ` crj
2020-09-01 13:17 ` Daniel Vetter
2020-09-01 13:17 ` Daniel Vetter
2020-09-01 13:17 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2020-01-23 22:40 Abhinav Kumar
2020-01-23 22:40 ` Abhinav Kumar
2020-01-24 14:36 ` Ville Syrjälä
2020-01-24 14:36 ` Ville Syrjälä
2020-01-24 20:43 ` abhinavk
2020-01-24 20:43 ` abhinavk
2020-01-27 18:46 ` Stephen Boyd
2020-01-27 18:46 ` Stephen Boyd
2020-01-27 20:42 ` abhinavk
2020-01-27 20:42 ` abhinavk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.