de80fe4628f23e8965e77675cbf6696aeb41ad86
[openwrt/staging/stintel.git] /
1 From d27c36f9beed7d6a9d19ea1d642a7fb898eb6d95 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Wed, 14 Apr 2021 16:21:08 +0200
4 Subject: [PATCH] drm/edid: Rename drm_hdmi_avi_infoframe_colorspace to
5 _colorimetry
6
7 The drm_hdmi_avi_infoframe_colorspace() function actually sets the
8 colorimetry and extended_colorimetry fields in the hdmi_avi_infoframe
9 structure with DRM_MODE_COLORIMETRY_* values.
10
11 To make things worse, the hdmi_avi_infoframe structure also has a
12 colorspace field used to signal whether an RGB or YUV output is being
13 used.
14
15 Let's remove the inconsistency and allow for the colorspace usage by
16 renaming the function.
17
18 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
19 ---
20 drivers/gpu/drm/drm_edid.c | 8 ++++----
21 drivers/gpu/drm/i915/display/intel_hdmi.c | 2 +-
22 drivers/gpu/drm/i915/display/intel_lspcon.c | 2 +-
23 drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
24 include/drm/drm_edid.h | 4 ++--
25 5 files changed, 9 insertions(+), 9 deletions(-)
26
27 --- a/drivers/gpu/drm/drm_edid.c
28 +++ b/drivers/gpu/drm/drm_edid.c
29 @@ -5743,13 +5743,13 @@ static const u32 hdmi_colorimetry_val[]
30 #undef ACE
31
32 /**
33 - * drm_hdmi_avi_infoframe_colorspace() - fill the HDMI AVI infoframe
34 - * colorspace information
35 + * drm_hdmi_avi_infoframe_colorimetry() - fill the HDMI AVI infoframe
36 + * colorimetry information
37 * @frame: HDMI AVI infoframe
38 * @conn_state: connector state
39 */
40 void
41 -drm_hdmi_avi_infoframe_colorspace(struct hdmi_avi_infoframe *frame,
42 +drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
43 const struct drm_connector_state *conn_state)
44 {
45 u32 colorimetry_val;
46 @@ -5768,7 +5768,7 @@ drm_hdmi_avi_infoframe_colorspace(struct
47 frame->extended_colorimetry = (colorimetry_val >> 2) &
48 EXTENDED_COLORIMETRY_MASK;
49 }
50 -EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorspace);
51 +EXPORT_SYMBOL(drm_hdmi_avi_infoframe_colorimetry);
52
53 /**
54 * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
55 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
56 +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
57 @@ -730,7 +730,7 @@ intel_hdmi_compute_avi_infoframe(struct
58 else
59 frame->colorspace = HDMI_COLORSPACE_RGB;
60
61 - drm_hdmi_avi_infoframe_colorspace(frame, conn_state);
62 + drm_hdmi_avi_infoframe_colorimetry(frame, conn_state);
63
64 /* nonsense combination */
65 drm_WARN_ON(encoder->base.dev, crtc_state->limited_color_range &&
66 --- a/drivers/gpu/drm/i915/display/intel_lspcon.c
67 +++ b/drivers/gpu/drm/i915/display/intel_lspcon.c
68 @@ -537,7 +537,7 @@ void lspcon_set_infoframes(struct intel_
69 frame.avi.colorspace = HDMI_COLORSPACE_RGB;
70
71 /* Set the Colorspace as per the HDMI spec */
72 - drm_hdmi_avi_infoframe_colorspace(&frame.avi, conn_state);
73 + drm_hdmi_avi_infoframe_colorimetry(&frame.avi, conn_state);
74
75 /* nonsense combination */
76 drm_WARN_ON(encoder->base.dev, crtc_state->limited_color_range &&
77 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
78 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
79 @@ -517,7 +517,7 @@ static void vc4_hdmi_set_avi_infoframe(s
80 vc4_encoder->limited_rgb_range ?
81 HDMI_QUANTIZATION_RANGE_LIMITED :
82 HDMI_QUANTIZATION_RANGE_FULL);
83 - drm_hdmi_avi_infoframe_colorspace(&frame.avi, cstate);
84 + drm_hdmi_avi_infoframe_colorimetry(&frame.avi, cstate);
85 drm_hdmi_avi_infoframe_bars(&frame.avi, cstate);
86
87 vc4_hdmi_write_infoframe(encoder, &frame);
88 --- a/include/drm/drm_edid.h
89 +++ b/include/drm/drm_edid.h
90 @@ -401,8 +401,8 @@ drm_hdmi_vendor_infoframe_from_display_m
91 const struct drm_display_mode *mode);
92
93 void
94 -drm_hdmi_avi_infoframe_colorspace(struct hdmi_avi_infoframe *frame,
95 - const struct drm_connector_state *conn_state);
96 +drm_hdmi_avi_infoframe_colorimetry(struct hdmi_avi_infoframe *frame,
97 + const struct drm_connector_state *conn_state);
98
99 void
100 drm_hdmi_avi_infoframe_bars(struct hdmi_avi_infoframe *frame,