Loading drivers/gpu/drm/drm_atomic.c +4 −0 Original line number Diff line number Diff line Loading @@ -1410,6 +1410,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, return -EINVAL; } state->content_protection = val; } else if (property == connector->colorspace_property) { state->colorspace = val; } else if (property == config->writeback_fb_id_property) { struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, NULL, val); int ret = drm_atomic_set_writeback_fb_for_connector(state, fb); Loading Loading @@ -1507,6 +1509,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = state->picture_aspect_ratio; } else if (property == config->content_type_property) { *val = state->content_type; } else if (property == connector->colorspace_property) { *val = state->colorspace; } else if (property == connector->scaling_mode_property) { *val = state->scaling_mode; } else if (property == connector->content_protection_property) { Loading drivers/gpu/drm/drm_connector.c +108 −0 Original line number Diff line number Diff line Loading @@ -805,6 +805,55 @@ static struct drm_prop_enum_list drm_cp_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_content_protection_name, drm_cp_enum_list) static const struct drm_prop_enum_list hdmi_colorspaces[] = { /* For Default case, driver will set the colorspace */ { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, /* Standard Definition Colorimetry based on CEA 861 */ { DRM_MODE_COLORIMETRY_SMPTE_170M_YCC, "SMPTE_170M_YCC" }, { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, /* Standard Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, /* High Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, /* Colorimetry based on IEC 61966-2-5 [33] */ { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, /* Colorimetry based on IEC 61966-2-5 */ { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, /* Added as part of Additional Colorimetry Extension in 861.G */ { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, { DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" }, }; static const struct drm_prop_enum_list dp_colorspaces[] = { /* For Default case, driver will set the colorspace */ { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, /* Standard Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, /* High Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, /* Colorimetry based on IEC 61966-2-5 */ { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, /* DP MSA Colorimetry */ { DRM_MODE_DP_COLORIMETRY_BT601_YCC, "BT601_YCC" }, { DRM_MODE_DP_COLORIMETRY_BT709_YCC, "BT709_YCC" }, { DRM_MODE_DP_COLORIMETRY_SRGB, "sRGB" }, { DRM_MODE_DP_COLORIMETRY_RGB_WIDE_GAMUT, "RGB Wide Gamut" }, { DRM_MODE_DP_COLORIMETRY_SCRGB, "scRGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, }; /** * DOC: standard connector properties * Loading Loading @@ -1373,6 +1422,65 @@ int drm_mode_create_aspect_ratio_property(struct drm_device *dev) } EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); /** * DOC: standard connector properties * * Colorspace: * drm_mode_create_colorspace_property - create colorspace property * This property helps select a suitable colorspace based on the sink * capability. Modern sink devices support wider gamut like BT2020. * This helps switch to BT2020 mode if the BT2020 encoded video stream * is being played by the user, same for any other colorspace. Thereby * giving a good visual experience to users. * * The expectation from userspace is that it should parse the EDID * and get supported colorspaces. Use this property and switch to the * one supported. Sink supported colorspaces should be retrieved by * userspace from EDID and driver will not explicitly expose them. * * Basically the expectation from userspace is: * - Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink * colorspace * - Set this new property to let the sink know what it * converted the CRTC output to. * - This property is just to inform sink what colorspace * source is trying to drive. * * Called by a driver the first time it's needed, must be attached to desired * connectors. */ int drm_mode_create_colorspace_property(struct drm_connector *connector) { struct drm_device *dev = connector->dev; struct drm_property *prop; if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA || connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) { prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", hdmi_colorspaces, ARRAY_SIZE(hdmi_colorspaces)); if (!prop) return -ENOMEM; } else if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", dp_colorspaces, ARRAY_SIZE(dp_colorspaces)); if (!prop) return -ENOMEM; } else { DRM_DEBUG_KMS("Colorspace property not supported\n"); return 0; } connector->colorspace_property = prop; return 0; } EXPORT_SYMBOL(drm_mode_create_colorspace_property); /** * drm_mode_create_content_type_property - create content type property * @dev: DRM device Loading drivers/gpu/drm/drm_edid.c +51 −0 Original line number Diff line number Diff line Loading @@ -2848,6 +2848,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid, #define VSVDB_HDR10_PLUS_IEEE_CODE 0x90848b #define VSVDB_HDR10_PLUS_APP_VER_MASK 0x3 #define HDR_STATIC_METADATA_EXTENDED_DATA_BLOCK 0x06 #define COLORIMETRY_EXTENDED_DATA_BLOCK 0x05 #define USE_EXTENDED_TAG 0x07 #define EXT_VIDEO_CAPABILITY_BLOCK 0x00 #define EXT_VIDEO_DATA_BLOCK_420 0x0E Loading Loading @@ -3906,6 +3907,53 @@ u32 block_length, enum luminance_value value) return block_length > NO_LUMINANCE_DATA && value <= block_length; } /* * drm_extract_clrmetry_db - Parse the HDMI colorimetry extended block * @connector: connector corresponding to the HDMI sink * @db: start of the HDMI colorimetry extended block * * Parses the HDMI colorimetry block to extract sink info for @connector. */ static void drm_extract_clrmetry_db(struct drm_connector *connector, const u8 *db) { if (!db) { DRM_ERROR("invalid db\n"); return; } /* Byte 3 Bit 0: xvYCC_601 */ if (db[2] & BIT(0)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_601; /* Byte 3 Bit 1: xvYCC_709 */ if (db[2] & BIT(1)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_709; /* Byte 3 Bit 2: sYCC_601 */ if (db[2] & BIT(2)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_sYCC_601; /* Byte 3 Bit 3: ADBYCC_601 */ if (db[2] & BIT(3)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_ADBYCC_601; /* Byte 3 Bit 4: ADB_RGB */ if (db[2] & BIT(4)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_ADB_RGB; /* Byte 3 Bit 5: BT2020_CYCC */ if (db[2] & BIT(5)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_CYCC; /* Byte 3 Bit 6: BT2020_YCC */ if (db[2] & BIT(6)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_YCC; /* Byte 3 Bit 7: BT2020_RGB */ if (db[2] & BIT(7)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_RGB; /* Byte 4 Bit 7: DCI-P3 */ if (db[3] & BIT(7)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_DCI_P3; DRM_DEBUG_KMS("colorimetry fmts = 0x%x\n", connector->color_enc_fmt); } /* * drm_extract_hdr_db - Parse the HDMI HDR extended block * @connector: connector corresponding to the HDMI sink Loading Loading @@ -3987,6 +4035,9 @@ drm_hdmi_extract_extended_blk_info(struct drm_connector *connector, case HDR_STATIC_METADATA_EXTENDED_DATA_BLOCK: drm_extract_hdr_db(connector, db); break; case COLORIMETRY_EXTENDED_DATA_BLOCK: drm_extract_clrmetry_db(connector, db); break; default: break; } Loading include/drm/drm_connector.h +50 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,40 @@ enum drm_panel_orientation { DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, }; /* * This is a consolidated colorimetry list supported by HDMI and * DP protocol standard. The respective connectors will register * a property with the subset of this list (supported by that * respective protocol). Userspace will set the colorspace through * a colorspace property which will be created and exposed to * userspace. */ /* For Default case, driver will set the colorspace */ #define DRM_MODE_COLORIMETRY_DEFAULT 0 /* CEA 861 Normal Colorimetry options */ #define DRM_MODE_COLORIMETRY_NO_DATA 0 #define DRM_MODE_COLORIMETRY_SMPTE_170M_YCC 1 #define DRM_MODE_COLORIMETRY_BT709_YCC 2 /* CEA 861 Extended Colorimetry Options */ #define DRM_MODE_COLORIMETRY_XVYCC_601 3 #define DRM_MODE_COLORIMETRY_XVYCC_709 4 #define DRM_MODE_COLORIMETRY_SYCC_601 5 #define DRM_MODE_COLORIMETRY_OPYCC_601 6 #define DRM_MODE_COLORIMETRY_OPRGB 7 #define DRM_MODE_COLORIMETRY_BT2020_CYCC 8 #define DRM_MODE_COLORIMETRY_BT2020_RGB 9 #define DRM_MODE_COLORIMETRY_BT2020_YCC 10 /* Additional Colorimetry extension added as part of CTA 861.G */ #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11 #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12 /* DP MSA Colorimetry Options */ #define DRM_MODE_DP_COLORIMETRY_BT601_YCC 13 #define DRM_MODE_DP_COLORIMETRY_BT709_YCC 14 #define DRM_MODE_DP_COLORIMETRY_SRGB 15 #define DRM_MODE_DP_COLORIMETRY_RGB_WIDE_GAMUT 16 #define DRM_MODE_DP_COLORIMETRY_SCRGB 17 /** * struct drm_display_info - runtime data about the connected sink * Loading Loading @@ -449,6 +483,13 @@ struct drm_connector_state { */ unsigned int content_protection; /** * @colorspace: State variable for Connector property to request * colorspace change on Sink. This is most commonly used to switch * to wider color gamuts like BT2020. */ u32 colorspace; /** * @writeback_job: Writeback job for writeback connectors * Loading Loading @@ -916,6 +957,12 @@ struct drm_connector { */ struct drm_property *content_protection_property; /** * @colorspace_property: Connector property to set the suitable * colorspace supported by the sink. */ struct drm_property *colorspace_property; /** * @path_blob_ptr: * Loading Loading @@ -1012,6 +1059,7 @@ struct drm_connector { * @pt_scan_info: PT scan info obtained from the VCDB of EDID * @it_scan_info: IT scan info obtained from the VCDB of EDID * @ce_scan_info: CE scan info obtained from the VCDB of EDID * @color_enc_fmt: Colorimetry encoding formats of sink * @hdr_eotf: Electro optical transfer function obtained from HDR block * @hdr_metadata_type_one: Metadata type one obtained from HDR block * @hdr_max_luminance: desired max luminance obtained from HDR block Loading @@ -1030,6 +1078,7 @@ struct drm_connector { u8 pt_scan_info; u8 it_scan_info; u8 ce_scan_info; u32 color_enc_fmt; u32 hdr_eotf; bool hdr_metadata_type_one; u32 hdr_max_luminance; Loading Loading @@ -1238,6 +1287,7 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, int drm_connector_attach_content_protection_property( struct drm_connector *connector); int drm_mode_create_aspect_ratio_property(struct drm_device *dev); int drm_mode_create_colorspace_property(struct drm_connector *connector); int drm_mode_create_content_type_property(struct drm_device *dev); void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, const struct drm_connector_state *conn_state); Loading include/drm/drm_edid.h +10 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,16 @@ struct detailed_timing { DRM_EDID_YCBCR420_DC_36 | \ DRM_EDID_YCBCR420_DC_30) #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 Loading Loading
drivers/gpu/drm/drm_atomic.c +4 −0 Original line number Diff line number Diff line Loading @@ -1410,6 +1410,8 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, return -EINVAL; } state->content_protection = val; } else if (property == connector->colorspace_property) { state->colorspace = val; } else if (property == config->writeback_fb_id_property) { struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, NULL, val); int ret = drm_atomic_set_writeback_fb_for_connector(state, fb); Loading Loading @@ -1507,6 +1509,8 @@ drm_atomic_connector_get_property(struct drm_connector *connector, *val = state->picture_aspect_ratio; } else if (property == config->content_type_property) { *val = state->content_type; } else if (property == connector->colorspace_property) { *val = state->colorspace; } else if (property == connector->scaling_mode_property) { *val = state->scaling_mode; } else if (property == connector->content_protection_property) { Loading
drivers/gpu/drm/drm_connector.c +108 −0 Original line number Diff line number Diff line Loading @@ -805,6 +805,55 @@ static struct drm_prop_enum_list drm_cp_enum_list[] = { }; DRM_ENUM_NAME_FN(drm_get_content_protection_name, drm_cp_enum_list) static const struct drm_prop_enum_list hdmi_colorspaces[] = { /* For Default case, driver will set the colorspace */ { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, /* Standard Definition Colorimetry based on CEA 861 */ { DRM_MODE_COLORIMETRY_SMPTE_170M_YCC, "SMPTE_170M_YCC" }, { DRM_MODE_COLORIMETRY_BT709_YCC, "BT709_YCC" }, /* Standard Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, /* High Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, /* Colorimetry based on IEC 61966-2-1/Amendment 1 */ { DRM_MODE_COLORIMETRY_SYCC_601, "SYCC_601" }, /* Colorimetry based on IEC 61966-2-5 [33] */ { DRM_MODE_COLORIMETRY_OPYCC_601, "opYCC_601" }, /* Colorimetry based on IEC 61966-2-5 */ { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_CYCC, "BT2020_CYCC" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, /* Added as part of Additional Colorimetry Extension in 861.G */ { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, { DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER, "DCI-P3_RGB_Theater" }, }; static const struct drm_prop_enum_list dp_colorspaces[] = { /* For Default case, driver will set the colorspace */ { DRM_MODE_COLORIMETRY_DEFAULT, "Default" }, /* Standard Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_601, "XVYCC_601" }, /* High Definition Colorimetry based on IEC 61966-2-4 */ { DRM_MODE_COLORIMETRY_XVYCC_709, "XVYCC_709" }, /* Colorimetry based on IEC 61966-2-5 */ { DRM_MODE_COLORIMETRY_OPRGB, "opRGB" }, { DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65, "DCI-P3_RGB_D65" }, /* DP MSA Colorimetry */ { DRM_MODE_DP_COLORIMETRY_BT601_YCC, "BT601_YCC" }, { DRM_MODE_DP_COLORIMETRY_BT709_YCC, "BT709_YCC" }, { DRM_MODE_DP_COLORIMETRY_SRGB, "sRGB" }, { DRM_MODE_DP_COLORIMETRY_RGB_WIDE_GAMUT, "RGB Wide Gamut" }, { DRM_MODE_DP_COLORIMETRY_SCRGB, "scRGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_RGB, "BT2020_RGB" }, /* Colorimetry based on ITU-R BT.2020 */ { DRM_MODE_COLORIMETRY_BT2020_YCC, "BT2020_YCC" }, }; /** * DOC: standard connector properties * Loading Loading @@ -1373,6 +1422,65 @@ int drm_mode_create_aspect_ratio_property(struct drm_device *dev) } EXPORT_SYMBOL(drm_mode_create_aspect_ratio_property); /** * DOC: standard connector properties * * Colorspace: * drm_mode_create_colorspace_property - create colorspace property * This property helps select a suitable colorspace based on the sink * capability. Modern sink devices support wider gamut like BT2020. * This helps switch to BT2020 mode if the BT2020 encoded video stream * is being played by the user, same for any other colorspace. Thereby * giving a good visual experience to users. * * The expectation from userspace is that it should parse the EDID * and get supported colorspaces. Use this property and switch to the * one supported. Sink supported colorspaces should be retrieved by * userspace from EDID and driver will not explicitly expose them. * * Basically the expectation from userspace is: * - Set up CRTC DEGAMMA/CTM/GAMMA to convert to some sink * colorspace * - Set this new property to let the sink know what it * converted the CRTC output to. * - This property is just to inform sink what colorspace * source is trying to drive. * * Called by a driver the first time it's needed, must be attached to desired * connectors. */ int drm_mode_create_colorspace_property(struct drm_connector *connector) { struct drm_device *dev = connector->dev; struct drm_property *prop; if (connector->connector_type == DRM_MODE_CONNECTOR_HDMIA || connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) { prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", hdmi_colorspaces, ARRAY_SIZE(hdmi_colorspaces)); if (!prop) return -ENOMEM; } else if (connector->connector_type == DRM_MODE_CONNECTOR_eDP || connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) { prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, "Colorspace", dp_colorspaces, ARRAY_SIZE(dp_colorspaces)); if (!prop) return -ENOMEM; } else { DRM_DEBUG_KMS("Colorspace property not supported\n"); return 0; } connector->colorspace_property = prop; return 0; } EXPORT_SYMBOL(drm_mode_create_colorspace_property); /** * drm_mode_create_content_type_property - create content type property * @dev: DRM device Loading
drivers/gpu/drm/drm_edid.c +51 −0 Original line number Diff line number Diff line Loading @@ -2848,6 +2848,7 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid, #define VSVDB_HDR10_PLUS_IEEE_CODE 0x90848b #define VSVDB_HDR10_PLUS_APP_VER_MASK 0x3 #define HDR_STATIC_METADATA_EXTENDED_DATA_BLOCK 0x06 #define COLORIMETRY_EXTENDED_DATA_BLOCK 0x05 #define USE_EXTENDED_TAG 0x07 #define EXT_VIDEO_CAPABILITY_BLOCK 0x00 #define EXT_VIDEO_DATA_BLOCK_420 0x0E Loading Loading @@ -3906,6 +3907,53 @@ u32 block_length, enum luminance_value value) return block_length > NO_LUMINANCE_DATA && value <= block_length; } /* * drm_extract_clrmetry_db - Parse the HDMI colorimetry extended block * @connector: connector corresponding to the HDMI sink * @db: start of the HDMI colorimetry extended block * * Parses the HDMI colorimetry block to extract sink info for @connector. */ static void drm_extract_clrmetry_db(struct drm_connector *connector, const u8 *db) { if (!db) { DRM_ERROR("invalid db\n"); return; } /* Byte 3 Bit 0: xvYCC_601 */ if (db[2] & BIT(0)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_601; /* Byte 3 Bit 1: xvYCC_709 */ if (db[2] & BIT(1)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_xvYCC_709; /* Byte 3 Bit 2: sYCC_601 */ if (db[2] & BIT(2)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_sYCC_601; /* Byte 3 Bit 3: ADBYCC_601 */ if (db[2] & BIT(3)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_ADBYCC_601; /* Byte 3 Bit 4: ADB_RGB */ if (db[2] & BIT(4)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_ADB_RGB; /* Byte 3 Bit 5: BT2020_CYCC */ if (db[2] & BIT(5)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_CYCC; /* Byte 3 Bit 6: BT2020_YCC */ if (db[2] & BIT(6)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_YCC; /* Byte 3 Bit 7: BT2020_RGB */ if (db[2] & BIT(7)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_BT2020_RGB; /* Byte 4 Bit 7: DCI-P3 */ if (db[3] & BIT(7)) connector->color_enc_fmt |= DRM_EDID_CLRMETRY_DCI_P3; DRM_DEBUG_KMS("colorimetry fmts = 0x%x\n", connector->color_enc_fmt); } /* * drm_extract_hdr_db - Parse the HDMI HDR extended block * @connector: connector corresponding to the HDMI sink Loading Loading @@ -3987,6 +4035,9 @@ drm_hdmi_extract_extended_blk_info(struct drm_connector *connector, case HDR_STATIC_METADATA_EXTENDED_DATA_BLOCK: drm_extract_hdr_db(connector, db); break; case COLORIMETRY_EXTENDED_DATA_BLOCK: drm_extract_clrmetry_db(connector, db); break; default: break; } Loading
include/drm/drm_connector.h +50 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,40 @@ enum drm_panel_orientation { DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, }; /* * This is a consolidated colorimetry list supported by HDMI and * DP protocol standard. The respective connectors will register * a property with the subset of this list (supported by that * respective protocol). Userspace will set the colorspace through * a colorspace property which will be created and exposed to * userspace. */ /* For Default case, driver will set the colorspace */ #define DRM_MODE_COLORIMETRY_DEFAULT 0 /* CEA 861 Normal Colorimetry options */ #define DRM_MODE_COLORIMETRY_NO_DATA 0 #define DRM_MODE_COLORIMETRY_SMPTE_170M_YCC 1 #define DRM_MODE_COLORIMETRY_BT709_YCC 2 /* CEA 861 Extended Colorimetry Options */ #define DRM_MODE_COLORIMETRY_XVYCC_601 3 #define DRM_MODE_COLORIMETRY_XVYCC_709 4 #define DRM_MODE_COLORIMETRY_SYCC_601 5 #define DRM_MODE_COLORIMETRY_OPYCC_601 6 #define DRM_MODE_COLORIMETRY_OPRGB 7 #define DRM_MODE_COLORIMETRY_BT2020_CYCC 8 #define DRM_MODE_COLORIMETRY_BT2020_RGB 9 #define DRM_MODE_COLORIMETRY_BT2020_YCC 10 /* Additional Colorimetry extension added as part of CTA 861.G */ #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11 #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12 /* DP MSA Colorimetry Options */ #define DRM_MODE_DP_COLORIMETRY_BT601_YCC 13 #define DRM_MODE_DP_COLORIMETRY_BT709_YCC 14 #define DRM_MODE_DP_COLORIMETRY_SRGB 15 #define DRM_MODE_DP_COLORIMETRY_RGB_WIDE_GAMUT 16 #define DRM_MODE_DP_COLORIMETRY_SCRGB 17 /** * struct drm_display_info - runtime data about the connected sink * Loading Loading @@ -449,6 +483,13 @@ struct drm_connector_state { */ unsigned int content_protection; /** * @colorspace: State variable for Connector property to request * colorspace change on Sink. This is most commonly used to switch * to wider color gamuts like BT2020. */ u32 colorspace; /** * @writeback_job: Writeback job for writeback connectors * Loading Loading @@ -916,6 +957,12 @@ struct drm_connector { */ struct drm_property *content_protection_property; /** * @colorspace_property: Connector property to set the suitable * colorspace supported by the sink. */ struct drm_property *colorspace_property; /** * @path_blob_ptr: * Loading Loading @@ -1012,6 +1059,7 @@ struct drm_connector { * @pt_scan_info: PT scan info obtained from the VCDB of EDID * @it_scan_info: IT scan info obtained from the VCDB of EDID * @ce_scan_info: CE scan info obtained from the VCDB of EDID * @color_enc_fmt: Colorimetry encoding formats of sink * @hdr_eotf: Electro optical transfer function obtained from HDR block * @hdr_metadata_type_one: Metadata type one obtained from HDR block * @hdr_max_luminance: desired max luminance obtained from HDR block Loading @@ -1030,6 +1078,7 @@ struct drm_connector { u8 pt_scan_info; u8 it_scan_info; u8 ce_scan_info; u32 color_enc_fmt; u32 hdr_eotf; bool hdr_metadata_type_one; u32 hdr_max_luminance; Loading Loading @@ -1238,6 +1287,7 @@ int drm_connector_attach_scaling_mode_property(struct drm_connector *connector, int drm_connector_attach_content_protection_property( struct drm_connector *connector); int drm_mode_create_aspect_ratio_property(struct drm_device *dev); int drm_mode_create_colorspace_property(struct drm_connector *connector); int drm_mode_create_content_type_property(struct drm_device *dev); void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, const struct drm_connector_state *conn_state); Loading
include/drm/drm_edid.h +10 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,16 @@ struct detailed_timing { DRM_EDID_YCBCR420_DC_36 | \ DRM_EDID_YCBCR420_DC_30) #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 Loading