Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/display: Move HDMI helpers into display-helper module

Move DRM's HMDI helpers into the display/ subdirectoy and add it
to DRM's display helpers. Update all affected drivers. No functional
changes.

The HDMI helpers were implemented in the EDID and connector code, but
are actually unrelated. With the move to the display-helper library, we
can remove the dependency on drm_edid.{c,h} in some driver's HDMI source
files.

Several of the HDMI helpers remain in EDID code because both share parts
of their implementation internally. With better refractoring of the EDID
code, those HDMI helpers could be moved into the display-helper library
as well.

v3:
* fix Kconfig dependencies (Javier)
v2:
* reduce HDMI helpers to avoid exporting functions (Jani)
* fix include statements (Jani, Javier)
* update Kconfig symbols

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220421073108.19226-8-tzimmermann@suse.de

+246 -212
+1
drivers/gpu/drm/Kconfig
··· 246 246 depends on DRM && PCI && MMU 247 247 select FW_LOADER 248 248 select DRM_DISPLAY_DP_HELPER 249 + select DRM_DISPLAY_HDMI_HELPER 249 250 select DRM_DISPLAY_HELPER 250 251 select DRM_KMS_HELPER 251 252 select DRM_SCHED
+1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 74 74 #include <linux/component.h> 75 75 76 76 #include <drm/display/drm_dp_mst_helper.h> 77 + #include <drm/display/drm_hdmi_helper.h> 77 78 #include <drm/drm_atomic.h> 78 79 #include <drm/drm_atomic_uapi.h> 79 80 #include <drm/drm_atomic_helper.h>
+2
drivers/gpu/drm/bridge/synopsys/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 config DRM_DW_HDMI 3 3 tristate 4 + select DRM_DISPLAY_HDMI_HELPER 5 + select DRM_DISPLAY_HELPER 4 6 select DRM_KMS_HELPER 5 7 select REGMAP_MMIO 6 8 select CEC_CORE if CEC_NOTIFIER
+1 -1
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 25 25 #include <uapi/linux/videodev2.h> 26 26 27 27 #include <drm/bridge/dw_hdmi.h> 28 + #include <drm/display/drm_hdmi_helper.h> 28 29 #include <drm/drm_atomic.h> 29 30 #include <drm/drm_atomic_helper.h> 30 31 #include <drm/drm_bridge.h> 31 - #include <drm/drm_edid.h> 32 32 #include <drm/drm_of.h> 33 33 #include <drm/drm_print.h> 34 34 #include <drm/drm_probe_helper.h>
+6
drivers/gpu/drm/display/Kconfig
··· 23 23 help 24 24 DRM display helpers for HDCP. 25 25 26 + config DRM_DISPLAY_HDMI_HELPER 27 + bool 28 + depends on DRM_DISPLAY_HELPER 29 + help 30 + DRM display helpers for HDMI. 31 + 26 32 config DRM_DP_AUX_CHARDEV 27 33 bool "DRM DP AUX Interface" 28 34 depends on DRM
+1
drivers/gpu/drm/display/Makefile
··· 8 8 drm_dp_mst_topology.o \ 9 9 drm_dsc_helper.o 10 10 drm_display_helper-$(CONFIG_DRM_DISPLAY_HDCP_HELPER) += drm_hdcp_helper.o 11 + drm_display_helper-$(CONFIG_DRM_DISPLAY_HDMI_HELPER) += drm_hdmi_helper.o 11 12 drm_display_helper-$(CONFIG_DRM_DP_AUX_CHARDEV) += drm_dp_aux_dev.o 12 13 drm_display_helper-$(CONFIG_DRM_DP_CEC) += drm_dp_cec.o 13 14
+199
drivers/gpu/drm/display/drm_hdmi_helper.c
··· 1 + // SPDX-License-Identifier: MIT 2 + 3 + #include <linux/module.h> 4 + 5 + #include <drm/display/drm_hdmi_helper.h> 6 + #include <drm/drm_connector.h> 7 + #include <drm/drm_edid.h> 8 + #include <drm/drm_modes.h> 9 + #include <drm/drm_print.h> 10 + #include <drm/drm_property.h> 11 + 12 + static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf) 13 + { 14 + return sink_eotf & BIT(output_eotf); 15 + } 16 + 17 + /** 18 + * drm_hdmi_infoframe_set_hdr_metadata() - fill an HDMI DRM infoframe with 19 + * HDR metadata from userspace 20 + * @frame: HDMI DRM infoframe 21 + * @conn_state: Connector state containing HDR metadata 22 + * 23 + * Return: 0 on success or a negative error code on failure. 24 + */ 25 + int drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame, 26 + const struct drm_connector_state *conn_state) 27 + { 28 + struct drm_connector *connector; 29 + struct hdr_output_metadata *hdr_metadata; 30 + int err; 31 + 32 + if (!frame || !conn_state) 33 + return -EINVAL; 34 + 35 + connector = conn_state->connector; 36 + 37 + if (!conn_state->hdr_output_metadata) 38 + return -EINVAL; 39 + 40 + hdr_metadata = conn_state->hdr_output_metadata->data; 41 + 42 + if (!hdr_metadata || !connector) 43 + return -EINVAL; 44 + 45 + /* Sink EOTF is Bit map while infoframe is absolute values */ 46 + if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf, 47 + connector->hdr_sink_metadata.hdmi_type1.eotf)) { 48 + DRM_DEBUG_KMS("EOTF Not Supported\n"); 49 + return -EINVAL; 50 + } 51 + 52 + err = hdmi_drm_infoframe_init(frame); 53 + if (err < 0) 54 + return err; 55 + 56 + frame->eotf = hdr_metadata->hdmi_metadata_type1.eotf; 57 + frame->metadata_type = hdr_metadata->hdmi_metadata_type1.metadata_type; 58 + 59 + BUILD_BUG_ON(sizeof(frame->display_primaries) != 60 + sizeof(hdr_metadata->hdmi_metadata_type1.display_primaries)); 61 + BUILD_BUG_ON(sizeof(frame->white_point) != 62 + sizeof(hdr_metadata->hdmi_metadata_type1.white_point)); 63 + 64 + memcpy(&frame->display_primaries, 65 + &hdr_metadata->hdmi_metadata_type1.display_primaries, 66 + sizeof(frame->display_primaries)); 67 + 68 + memcpy(&frame->white_point, 69 + &hdr_metadata->hdmi_metadata_type1.white_point, 70 + sizeof(frame->white_point)); 71 + 72 + frame->max_display_mastering_luminance = 73 + hdr_metadata->hdmi_metadata_type1.max_display_mastering_luminance; 74 + frame->min_display_mastering_luminance = 75 + hdr_metadata->hdmi_metadata_type1.min_display_mastering_luminance; 76 + frame->max_fall = hdr_metadata->hdmi_metadata_type1.max_fall; 77 + frame->max_cll = hdr_metadata->hdmi_metadata_type1.max_cll; 78 + 79 + return 0; 80 + } 81 + EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata); 82 + 83 + /* HDMI Colorspace Spec Definitions */ 84 + #define FULL_COLORIMETRY_MASK 0x1FF 85 + #define NORMAL_COLORIMETRY_MASK 0x3 86 + #define EXTENDED_COLORIMETRY_MASK 0x7 87 + #define EXTENDED_ACE_COLORIMETRY_MASK 0xF 88 + 89 + #define C(x) ((x) << 0) 90 + #define EC(x) ((x) << 2) 91 + #define ACE(x) ((x) << 5) 92 + 93 + #define HDMI_COLORIMETRY_NO_DATA 0x0 94 + #define HDMI_COLORIMETRY_SMPTE_170M_YCC (C(1) | EC(0) | ACE(0)) 95 + #define HDMI_COLORIMETRY_BT709_YCC (C(2) | EC(0) | ACE(0)) 96 + #define HDMI_COLORIMETRY_XVYCC_601 (C(3) | EC(0) | ACE(0)) 97 + #define HDMI_COLORIMETRY_XVYCC_709 (C(3) | EC(1) | ACE(0)) 98 + #define HDMI_COLORIMETRY_SYCC_601 (C(3) | EC(2) | ACE(0)) 99 + #define HDMI_COLORIMETRY_OPYCC_601 (C(3) | EC(3) | ACE(0)) 100 + #define HDMI_COLORIMETRY_OPRGB (C(3) | EC(4) | ACE(0)) 101 + #define HDMI_COLORIMETRY_BT2020_CYCC (C(3) | EC(5) | ACE(0)) 102 + #define HDMI_COLORIMETRY_BT2020_RGB (C(3) | EC(6) | ACE(0)) 103 + #define HDMI_COLORIMETRY_BT2020_YCC (C(3) | EC(6) | ACE(0)) 104 + #define HDMI_COLORIMETRY_DCI_P3_RGB_D65 (C(3) | EC(7) | ACE(0)) 105 + #define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1)) 106 + 107 + static const u32 hdmi_colorimetry_val[] = { 108 + [DRM_MODE_COLORIMETRY_NO_DATA] = HDMI_COLORIMETRY_NO_DATA, 109 + [DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = HDMI_COLORIMETRY_SMPTE_170M_YCC, 110 + [DRM_MODE_COLORIMETRY_BT709_YCC] = HDMI_COLORIMETRY_BT709_YCC, 111 + [DRM_MODE_COLORIMETRY_XVYCC_601] = HDMI_COLORIMETRY_XVYCC_601, 112 + [DRM_MODE_COLORIMETRY_XVYCC_709] = HDMI_COLORIMETRY_XVYCC_709, 113 + [DRM_MODE_COLORIMETRY_SYCC_601] = HDMI_COLORIMETRY_SYCC_601, 114 + [DRM_MODE_COLORIMETRY_OPYCC_601] = HDMI_COLORIMETRY_OPYCC_601, 115 + [DRM_MODE_COLORIMETRY_OPRGB] = HDMI_COLORIMETRY_OPRGB, 116 + [DRM_MODE_COLORIMETRY_BT2020_CYCC] = HDMI_COLORIMETRY_BT2020_CYCC, 117 + [DRM_MODE_COLORIMETRY_BT2020_RGB] = HDMI_COLORIMETRY_BT2020_RGB, 118 + [DRM_MODE_COLORIMETRY_BT2020_YCC] = HDMI_COLORIMETRY_BT2020_YCC, 119 + }; 120 + 121 + #undef C 122 + #undef EC 123 + #undef ACE 124 + 125 + /** 126 + * drm_hdmi_avi_infoframe_colorimetry() - fill the HDMI AVI infoframe 127 + * colorimetry information 128 + * @frame: HDMI AVI infoframe 129 + * @conn_state: connector state 130 + */ 131 + void drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame, 132 + const struct drm_connector_state *conn_state) 133 + { 134 + u32 colorimetry_val; 135 + u32 colorimetry_index = conn_state->colorspace & FULL_COLORIMETRY_MASK; 136 + 137 + if (colorimetry_index >= ARRAY_SIZE(hdmi_colorimetry_val)) 138 + colorimetry_val = HDMI_COLORIMETRY_NO_DATA; 139 + else 140 + colorimetry_val = hdmi_colorimetry_val[colorimetry_index]; 141 + 142 + frame->colorimetry = colorimetry_val & NORMAL_COLORIMETRY_MASK; 143 + /* 144 + * ToDo: Extend it for ACE formats as well. Modify the infoframe 145 + * structure and extend it in drivers/video/hdmi 146 + */ 147 + frame->extended_colorimetry = (colorimetry_val >> 2) & 148 + EXTENDED_COLORIMETRY_MASK; 149 + } 150 + EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorimetry); 151 + 152 + /** 153 + * drm_hdmi_avi_infoframe_bars() - fill the HDMI AVI infoframe 154 + * bar information 155 + * @frame: HDMI AVI infoframe 156 + * @conn_state: connector state 157 + */ 158 + void drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame, 159 + const struct drm_connector_state *conn_state) 160 + { 161 + frame->right_bar = conn_state->tv.margins.right; 162 + frame->left_bar = conn_state->tv.margins.left; 163 + frame->top_bar = conn_state->tv.margins.top; 164 + frame->bottom_bar = conn_state->tv.margins.bottom; 165 + } 166 + EXPORT_SYMBOL(drm_hdmi_avi_infoframe_bars); 167 + 168 + /** 169 + * drm_hdmi_avi_infoframe_content_type() - fill the HDMI AVI infoframe 170 + * content type information, based 171 + * on correspondent DRM property. 172 + * @frame: HDMI AVI infoframe 173 + * @conn_state: DRM display connector state 174 + * 175 + */ 176 + void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, 177 + const struct drm_connector_state *conn_state) 178 + { 179 + switch (conn_state->content_type) { 180 + case DRM_MODE_CONTENT_TYPE_GRAPHICS: 181 + frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; 182 + break; 183 + case DRM_MODE_CONTENT_TYPE_CINEMA: 184 + frame->content_type = HDMI_CONTENT_TYPE_CINEMA; 185 + break; 186 + case DRM_MODE_CONTENT_TYPE_GAME: 187 + frame->content_type = HDMI_CONTENT_TYPE_GAME; 188 + break; 189 + case DRM_MODE_CONTENT_TYPE_PHOTO: 190 + frame->content_type = HDMI_CONTENT_TYPE_PHOTO; 191 + break; 192 + default: 193 + /* Graphics is the default(0) */ 194 + frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; 195 + } 196 + 197 + frame->itc = conn_state->content_type != DRM_MODE_CONTENT_TYPE_NO_DATA; 198 + } 199 + EXPORT_SYMBOL(drm_hdmi_avi_infoframe_content_type);
-34
drivers/gpu/drm/drm_connector.c
··· 1486 1486 } 1487 1487 EXPORT_SYMBOL(drm_connector_attach_content_type_property); 1488 1488 1489 - 1490 - /** 1491 - * drm_hdmi_avi_infoframe_content_type() - fill the HDMI AVI infoframe 1492 - * content type information, based 1493 - * on correspondent DRM property. 1494 - * @frame: HDMI AVI infoframe 1495 - * @conn_state: DRM display connector state 1496 - * 1497 - */ 1498 - void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, 1499 - const struct drm_connector_state *conn_state) 1500 - { 1501 - switch (conn_state->content_type) { 1502 - case DRM_MODE_CONTENT_TYPE_GRAPHICS: 1503 - frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; 1504 - break; 1505 - case DRM_MODE_CONTENT_TYPE_CINEMA: 1506 - frame->content_type = HDMI_CONTENT_TYPE_CINEMA; 1507 - break; 1508 - case DRM_MODE_CONTENT_TYPE_GAME: 1509 - frame->content_type = HDMI_CONTENT_TYPE_GAME; 1510 - break; 1511 - case DRM_MODE_CONTENT_TYPE_PHOTO: 1512 - frame->content_type = HDMI_CONTENT_TYPE_PHOTO; 1513 - break; 1514 - default: 1515 - /* Graphics is the default(0) */ 1516 - frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; 1517 - } 1518 - 1519 - frame->itc = conn_state->content_type != DRM_MODE_CONTENT_TYPE_NO_DATA; 1520 - } 1521 - EXPORT_SYMBOL(drm_hdmi_avi_infoframe_content_type); 1522 - 1523 1489 /** 1524 1490 * drm_connector_attach_tv_margin_properties - attach TV connector margin 1525 1491 * properties
-159
drivers/gpu/drm/drm_edid.c
··· 5883 5883 connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; 5884 5884 } 5885 5885 5886 - static inline bool is_eotf_supported(u8 output_eotf, u8 sink_eotf) 5887 - { 5888 - return sink_eotf & BIT(output_eotf); 5889 - } 5890 - 5891 - /** 5892 - * drm_hdmi_infoframe_set_hdr_metadata() - fill an HDMI DRM infoframe with 5893 - * HDR metadata from userspace 5894 - * @frame: HDMI DRM infoframe 5895 - * @conn_state: Connector state containing HDR metadata 5896 - * 5897 - * Return: 0 on success or a negative error code on failure. 5898 - */ 5899 - int 5900 - drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame, 5901 - const struct drm_connector_state *conn_state) 5902 - { 5903 - struct drm_connector *connector; 5904 - struct hdr_output_metadata *hdr_metadata; 5905 - int err; 5906 - 5907 - if (!frame || !conn_state) 5908 - return -EINVAL; 5909 - 5910 - connector = conn_state->connector; 5911 - 5912 - if (!conn_state->hdr_output_metadata) 5913 - return -EINVAL; 5914 - 5915 - hdr_metadata = conn_state->hdr_output_metadata->data; 5916 - 5917 - if (!hdr_metadata || !connector) 5918 - return -EINVAL; 5919 - 5920 - /* Sink EOTF is Bit map while infoframe is absolute values */ 5921 - if (!is_eotf_supported(hdr_metadata->hdmi_metadata_type1.eotf, 5922 - connector->hdr_sink_metadata.hdmi_type1.eotf)) { 5923 - DRM_DEBUG_KMS("EOTF Not Supported\n"); 5924 - return -EINVAL; 5925 - } 5926 - 5927 - err = hdmi_drm_infoframe_init(frame); 5928 - if (err < 0) 5929 - return err; 5930 - 5931 - frame->eotf = hdr_metadata->hdmi_metadata_type1.eotf; 5932 - frame->metadata_type = hdr_metadata->hdmi_metadata_type1.metadata_type; 5933 - 5934 - BUILD_BUG_ON(sizeof(frame->display_primaries) != 5935 - sizeof(hdr_metadata->hdmi_metadata_type1.display_primaries)); 5936 - BUILD_BUG_ON(sizeof(frame->white_point) != 5937 - sizeof(hdr_metadata->hdmi_metadata_type1.white_point)); 5938 - 5939 - memcpy(&frame->display_primaries, 5940 - &hdr_metadata->hdmi_metadata_type1.display_primaries, 5941 - sizeof(frame->display_primaries)); 5942 - 5943 - memcpy(&frame->white_point, 5944 - &hdr_metadata->hdmi_metadata_type1.white_point, 5945 - sizeof(frame->white_point)); 5946 - 5947 - frame->max_display_mastering_luminance = 5948 - hdr_metadata->hdmi_metadata_type1.max_display_mastering_luminance; 5949 - frame->min_display_mastering_luminance = 5950 - hdr_metadata->hdmi_metadata_type1.min_display_mastering_luminance; 5951 - frame->max_fall = hdr_metadata->hdmi_metadata_type1.max_fall; 5952 - frame->max_cll = hdr_metadata->hdmi_metadata_type1.max_cll; 5953 - 5954 - return 0; 5955 - } 5956 - EXPORT_SYMBOL(drm_hdmi_infoframe_set_hdr_metadata); 5957 - 5958 5886 static u8 drm_mode_hdmi_vic(const struct drm_connector *connector, 5959 5887 const struct drm_display_mode *mode) 5960 5888 { ··· 6004 6076 } 6005 6077 EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode); 6006 6078 6007 - /* HDMI Colorspace Spec Definitions */ 6008 - #define FULL_COLORIMETRY_MASK 0x1FF 6009 - #define NORMAL_COLORIMETRY_MASK 0x3 6010 - #define EXTENDED_COLORIMETRY_MASK 0x7 6011 - #define EXTENDED_ACE_COLORIMETRY_MASK 0xF 6012 - 6013 - #define C(x) ((x) << 0) 6014 - #define EC(x) ((x) << 2) 6015 - #define ACE(x) ((x) << 5) 6016 - 6017 - #define HDMI_COLORIMETRY_NO_DATA 0x0 6018 - #define HDMI_COLORIMETRY_SMPTE_170M_YCC (C(1) | EC(0) | ACE(0)) 6019 - #define HDMI_COLORIMETRY_BT709_YCC (C(2) | EC(0) | ACE(0)) 6020 - #define HDMI_COLORIMETRY_XVYCC_601 (C(3) | EC(0) | ACE(0)) 6021 - #define HDMI_COLORIMETRY_XVYCC_709 (C(3) | EC(1) | ACE(0)) 6022 - #define HDMI_COLORIMETRY_SYCC_601 (C(3) | EC(2) | ACE(0)) 6023 - #define HDMI_COLORIMETRY_OPYCC_601 (C(3) | EC(3) | ACE(0)) 6024 - #define HDMI_COLORIMETRY_OPRGB (C(3) | EC(4) | ACE(0)) 6025 - #define HDMI_COLORIMETRY_BT2020_CYCC (C(3) | EC(5) | ACE(0)) 6026 - #define HDMI_COLORIMETRY_BT2020_RGB (C(3) | EC(6) | ACE(0)) 6027 - #define HDMI_COLORIMETRY_BT2020_YCC (C(3) | EC(6) | ACE(0)) 6028 - #define HDMI_COLORIMETRY_DCI_P3_RGB_D65 (C(3) | EC(7) | ACE(0)) 6029 - #define HDMI_COLORIMETRY_DCI_P3_RGB_THEATER (C(3) | EC(7) | ACE(1)) 6030 - 6031 - static const u32 hdmi_colorimetry_val[] = { 6032 - [DRM_MODE_COLORIMETRY_NO_DATA] = HDMI_COLORIMETRY_NO_DATA, 6033 - [DRM_MODE_COLORIMETRY_SMPTE_170M_YCC] = HDMI_COLORIMETRY_SMPTE_170M_YCC, 6034 - [DRM_MODE_COLORIMETRY_BT709_YCC] = HDMI_COLORIMETRY_BT709_YCC, 6035 - [DRM_MODE_COLORIMETRY_XVYCC_601] = HDMI_COLORIMETRY_XVYCC_601, 6036 - [DRM_MODE_COLORIMETRY_XVYCC_709] = HDMI_COLORIMETRY_XVYCC_709, 6037 - [DRM_MODE_COLORIMETRY_SYCC_601] = HDMI_COLORIMETRY_SYCC_601, 6038 - [DRM_MODE_COLORIMETRY_OPYCC_601] = HDMI_COLORIMETRY_OPYCC_601, 6039 - [DRM_MODE_COLORIMETRY_OPRGB] = HDMI_COLORIMETRY_OPRGB, 6040 - [DRM_MODE_COLORIMETRY_BT2020_CYCC] = HDMI_COLORIMETRY_BT2020_CYCC, 6041 - [DRM_MODE_COLORIMETRY_BT2020_RGB] = HDMI_COLORIMETRY_BT2020_RGB, 6042 - [DRM_MODE_COLORIMETRY_BT2020_YCC] = HDMI_COLORIMETRY_BT2020_YCC, 6043 - }; 6044 - 6045 - #undef C 6046 - #undef EC 6047 - #undef ACE 6048 - 6049 - /** 6050 - * drm_hdmi_avi_infoframe_colorimetry() - fill the HDMI AVI infoframe 6051 - * colorimetry information 6052 - * @frame: HDMI AVI infoframe 6053 - * @conn_state: connector state 6054 - */ 6055 - void 6056 - drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame, 6057 - const struct drm_connector_state *conn_state) 6058 - { 6059 - u32 colorimetry_val; 6060 - u32 colorimetry_index = conn_state->colorspace & FULL_COLORIMETRY_MASK; 6061 - 6062 - if (colorimetry_index >= ARRAY_SIZE(hdmi_colorimetry_val)) 6063 - colorimetry_val = HDMI_COLORIMETRY_NO_DATA; 6064 - else 6065 - colorimetry_val = hdmi_colorimetry_val[colorimetry_index]; 6066 - 6067 - frame->colorimetry = colorimetry_val & NORMAL_COLORIMETRY_MASK; 6068 - /* 6069 - * ToDo: Extend it for ACE formats as well. Modify the infoframe 6070 - * structure and extend it in drivers/video/hdmi 6071 - */ 6072 - frame->extended_colorimetry = (colorimetry_val >> 2) & 6073 - EXTENDED_COLORIMETRY_MASK; 6074 - } 6075 - EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorimetry); 6076 - 6077 6079 /** 6078 6080 * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe 6079 6081 * quantization range information ··· 6058 6200 HDMI_YCC_QUANTIZATION_RANGE_FULL; 6059 6201 } 6060 6202 EXPORT_SYMBOL(drm_hdmi_avi_infoframe_quant_range); 6061 - 6062 - /** 6063 - * drm_hdmi_avi_infoframe_bars() - fill the HDMI AVI infoframe 6064 - * bar information 6065 - * @frame: HDMI AVI infoframe 6066 - * @conn_state: connector state 6067 - */ 6068 - void 6069 - drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame, 6070 - const struct drm_connector_state *conn_state) 6071 - { 6072 - frame->right_bar = conn_state->tv.margins.right; 6073 - frame->left_bar = conn_state->tv.margins.left; 6074 - frame->top_bar = conn_state->tv.margins.top; 6075 - frame->bottom_bar = conn_state->tv.margins.bottom; 6076 - } 6077 - EXPORT_SYMBOL(drm_hdmi_avi_infoframe_bars); 6078 6203 6079 6204 static enum hdmi_3d_structure 6080 6205 s3d_structure_from_display_mode(const struct drm_display_mode *mode)
+1
drivers/gpu/drm/i915/Kconfig
··· 12 12 select TMPFS 13 13 select DRM_DISPLAY_DP_HELPER 14 14 select DRM_DISPLAY_HDCP_HELPER 15 + select DRM_DISPLAY_HDMI_HELPER 15 16 select DRM_DISPLAY_HELPER 16 17 select DRM_KMS_HELPER 17 18 select DRM_PANEL
+1 -1
drivers/gpu/drm/i915/display/intel_dp.c
··· 37 37 38 38 #include <drm/display/drm_dp_helper.h> 39 39 #include <drm/display/drm_dsc_helper.h> 40 + #include <drm/display/drm_hdmi_helper.h> 40 41 #include <drm/drm_atomic_helper.h> 41 42 #include <drm/drm_crtc.h> 42 - #include <drm/drm_edid.h> 43 43 #include <drm/drm_probe_helper.h> 44 44 45 45 #include "g4x_dp.h"
+1
drivers/gpu/drm/i915/display/intel_hdmi.c
··· 33 33 #include <linux/string_helpers.h> 34 34 35 35 #include <drm/display/drm_hdcp_helper.h> 36 + #include <drm/display/drm_hdmi_helper.h> 36 37 #include <drm/drm_atomic_helper.h> 37 38 #include <drm/drm_crtc.h> 38 39 #include <drm/drm_edid.h>
+1 -1
drivers/gpu/drm/i915/display/intel_lspcon.c
··· 24 24 */ 25 25 26 26 #include <drm/display/drm_dp_dual_mode_helper.h> 27 + #include <drm/display/drm_hdmi_helper.h> 27 28 #include <drm/drm_atomic_helper.h> 28 - #include <drm/drm_edid.h> 29 29 30 30 #include "intel_de.h" 31 31 #include "intel_display_types.h"
+1
drivers/gpu/drm/i915/display/intel_sdvo.c
··· 31 31 #include <linux/i2c.h> 32 32 #include <linux/slab.h> 33 33 34 + #include <drm/display/drm_hdmi_helper.h> 34 35 #include <drm/drm_atomic_helper.h> 35 36 #include <drm/drm_crtc.h> 36 37 #include <drm/drm_edid.h>
+2
drivers/gpu/drm/vc4/Kconfig
··· 5 5 depends on DRM 6 6 depends on SND && SND_SOC 7 7 depends on COMMON_CLK 8 + select DRM_DISPLAY_HDMI_HELPER 9 + select DRM_DISPLAY_HELPER 8 10 select DRM_KMS_HELPER 9 11 select DRM_GEM_CMA_HELPER 10 12 select DRM_PANEL_BRIDGE
+1 -1
drivers/gpu/drm/vc4/vc4_hdmi.c
··· 31 31 * encoder block has CEC support. 32 32 */ 33 33 34 + #include <drm/display/drm_hdmi_helper.h> 34 35 #include <drm/drm_atomic_helper.h> 35 - #include <drm/drm_edid.h> 36 36 #include <drm/drm_probe_helper.h> 37 37 #include <drm/drm_simple_kms_helper.h> 38 38 #include <drm/drm_scdc_helper.h>
+27
include/drm/display/drm_hdmi_helper.h
··· 1 + /* SPDX-License-Identifier: MIT */ 2 + 3 + #ifndef DRM_HDMI_HELPER 4 + #define DRM_HDMI_HELPER 5 + 6 + #include <linux/hdmi.h> 7 + 8 + struct drm_connector; 9 + struct drm_connector_state; 10 + struct drm_display_mode; 11 + 12 + void 13 + drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame, 14 + const struct drm_connector_state *conn_state); 15 + 16 + void 17 + drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame, 18 + const struct drm_connector_state *conn_state); 19 + 20 + int 21 + drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame, 22 + const struct drm_connector_state *conn_state); 23 + 24 + void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, 25 + const struct drm_connector_state *conn_state); 26 + 27 + #endif
-3
include/drm/drm_connector.h
··· 1784 1784 int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector); 1785 1785 int drm_mode_create_dp_colorspace_property(struct drm_connector *connector); 1786 1786 int drm_mode_create_content_type_property(struct drm_device *dev); 1787 - void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame, 1788 - const struct drm_connector_state *conn_state); 1789 - 1790 1787 int drm_mode_create_suggested_offset_properties(struct drm_device *dev); 1791 1788 1792 1789 int drm_connector_set_path_property(struct drm_connector *connector,
-12
include/drm/drm_edid.h
··· 401 401 const struct drm_display_mode *mode); 402 402 403 403 void 404 - drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame, 405 - const struct drm_connector_state *conn_state); 406 - 407 - void 408 - drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame, 409 - const struct drm_connector_state *conn_state); 410 - 411 - void 412 404 drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame, 413 405 const struct drm_connector *connector, 414 406 const struct drm_display_mode *mode, 415 407 enum hdmi_quantization_range rgb_quant_range); 416 - 417 - int 418 - drm_hdmi_infoframe_set_hdr_metadata(struct hdmi_drm_infoframe *frame, 419 - const struct drm_connector_state *conn_state); 420 408 421 409 /** 422 410 * drm_eld_mnl - Get ELD monitor name length in bytes.