aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0136-drm-amd-display-start-using-linux-hdmi-header.patch
blob: 79b69c588ed97775f4f5d15172f9a8e4ca1d6bf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
From b2e388759f80373255ff1266618e0b43cfaa37fe Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Tue, 10 Jan 2017 09:33:32 +1000
Subject: [PATCH 0136/4131] drm/amd/display: start using linux hdmi header

DAL has defines for things, and it doesn't even use them itself.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 18 ++++++++----------
 .../gpu/drm/amd/display/include/set_mode_types.h   | 22 +---------------------
 2 files changed, 9 insertions(+), 31 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 59770bc..4bb6b1d 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -1334,13 +1334,12 @@ static void set_avi_info_frame(
 
 	/* Initialize header */
 	info_frame.avi_info_packet.info_packet_hdmi.bits.header.
-			info_frame_type = INFO_FRAME_AVI;
+			info_frame_type = HDMI_INFOFRAME_TYPE_AVI;
 	/* InfoFrameVersion_3 is defined by CEA861F (Section 6.4), but shall
 	* not be used in HDMI 2.0 (Section 10.1) */
-	info_frame.avi_info_packet.info_packet_hdmi.bits.header.version =
-			INFO_FRAME_VERSION_2;
+	info_frame.avi_info_packet.info_packet_hdmi.bits.header.version = 2;
 	info_frame.avi_info_packet.info_packet_hdmi.bits.header.length =
-			INFO_FRAME_SIZE_AVI;
+			HDMI_AVI_INFOFRAME_SIZE;
 
 	/*
 	 * IDO-defined (Y2,Y1,Y0 = 1,1,1) shall not be used by devices built
@@ -1473,10 +1472,9 @@ static void set_avi_info_frame(
 	check_sum =
 		&info_frame.
 		avi_info_packet.info_packet_hdmi.packet_raw_data.sb[0];
-	*check_sum = INFO_FRAME_AVI + INFO_FRAME_SIZE_AVI
-			+ INFO_FRAME_VERSION_2;
+	*check_sum = HDMI_INFOFRAME_TYPE_AVI + HDMI_AVI_INFOFRAME_SIZE + 2;
 
-	for (byte_index = 1; byte_index <= INFO_FRAME_SIZE_AVI; byte_index++)
+	for (byte_index = 1; byte_index <= HDMI_AVI_INFOFRAME_SIZE; byte_index++)
 		*check_sum += info_frame.avi_info_packet.info_packet_hdmi.
 				packet_raw_data.sb[byte_index];
 
@@ -1588,7 +1586,7 @@ static void set_vendor_info_packet(struct core_stream *stream,
 		info_packet->sb[5] = stream->public.timing.hdmi_vic;
 
 	/* Header */
-	info_packet->hb0 = 0x81; /* VSIF packet type. */
+	info_packet->hb0 = HDMI_INFOFRAME_TYPE_VENDOR; /* VSIF packet type. */
 	info_packet->hb1 = 0x01; /* Version */
 
 	/* 4 lower bits = Length, 4 higher bits = 0 (reserved) */
@@ -1629,7 +1627,7 @@ static void set_spd_info_packet(struct core_stream *stream,
 		/* HB0  = Packet Type = 0x83 (Source Product
 		 *	  Descriptor InfoFrame)
 		 */
-		info_packet->hb0 = 0x83;
+		info_packet->hb0 = HDMI_INFOFRAME_TYPE_SPD;
 
 		/* HB1  = Version = 0x01 */
 		info_packet->hb1 = 0x01;
@@ -1651,7 +1649,7 @@ static void set_spd_info_packet(struct core_stream *stream,
 		/* HB1  = Packet Type = 0x83 (Source Product
 		 *	  Descriptor InfoFrame)
 		 */
-		info_packet->hb1 = 0x83;
+		info_packet->hb1 = HDMI_INFOFRAME_TYPE_SPD;
 
 		/* HB2  = [Bits 7:0 = Least significant eight bits -
 		 *	  For INFOFRAME, the value must be 1Bh]
diff --git a/drivers/gpu/drm/amd/display/include/set_mode_types.h b/drivers/gpu/drm/amd/display/include/set_mode_types.h
index d18210f..fee2b6f 100644
--- a/drivers/gpu/drm/amd/display/include/set_mode_types.h
+++ b/drivers/gpu/drm/amd/display/include/set_mode_types.h
@@ -27,6 +27,7 @@
 #define __DAL_SET_MODE_TYPES_H__
 
 #include "dc_types.h"
+#include <linux/hdmi.h>
 
 /* Info frame packet status */
 enum info_frame_flag {
@@ -36,27 +37,6 @@ enum info_frame_flag {
 	INFO_PACKET_PACKET_UPDATE_SCAN_TYPE = 8
 };
 
-/* Info frame types */
-enum info_frame_type {
-	INFO_FRAME_GAMUT = 0x0A,
-	INFO_FRAME_VENDOR_INFO = 0x81,
-	INFO_FRAME_AVI = 0x82
-};
-
-/* Info frame versions */
-enum info_frame_version {
-	INFO_FRAME_VERSION_1 = 1,
-	INFO_FRAME_VERSION_2 = 2,
-	INFO_FRAME_VERSION_3 = 3
-};
-
-/* Info frame size */
-enum info_frame_size {
-	INFO_FRAME_SIZE_AVI = 13,
-	INFO_FRAME_SIZE_VENDOR = 25,
-	INFO_FRAME_SIZE_AUDIO = 10
-};
-
 struct hdmi_info_frame_header {
 	uint8_t info_frame_type;
 	uint8_t version;
-- 
2.7.4