aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0336-drm-amd-display-Fix-hotspot-programming-during-set-c.patch
blob: 052065d2f69efb78d0d95d0a2c6006ffb15d3b73 (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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
From 42c6d9fda6b67d2a52639a2b87f180245bd238b8 Mon Sep 17 00:00:00 2001
From: Zeyu Fan <Zeyu.Fan@amd.com>
Date: Mon, 3 Apr 2017 11:54:11 -0400
Subject: [PATCH 0336/4131] drm/amd/display: Fix hotspot programming during set
 cursor position.

- Remove x,y hotspot from dc_cursor_attributes. Only program it
  through setPosition.

Signed-off-by: Zeyu Fan <Zeyu.Fan@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Zeyu Fan <Zeyu.Fan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c   |  5 -----
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h              |  7 -------
 drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_cursor.c | 11 ++++-------
 drivers/gpu/drm/amd/display/dc/dce120/dce120_ipp_cursor.c | 15 ++++-----------
 4 files changed, 8 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index fa8769b..4e528aa 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -90,8 +90,6 @@ static void dm_set_cursor(
 	attributes.address.low_part  = lower_32_bits(gpu_addr);
 	attributes.width             = width;
 	attributes.height            = height;
-	attributes.x_hot             = 0;
-	attributes.y_hot             = 0;
 	attributes.color_format      = CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA;
 	attributes.rotation_angle    = 0;
 	attributes.attribute_flags.value = 0;
@@ -118,7 +116,6 @@ static void dm_set_cursor(
 	position.x = x;
 	position.y = y;
 
-	position.hot_spot_enable = true;
 	position.x_hotspot = xorigin;
 	position.y_hotspot = yorigin;
 
@@ -260,7 +257,6 @@ static int dm_crtc_cursor_set(
 		position.enable = false;
 		position.x = 0;
 		position.y = 0;
-		position.hot_spot_enable = false;
 
 		if (amdgpu_crtc->stream) {
 			/*set cursor visible false*/
@@ -344,7 +340,6 @@ static int dm_crtc_cursor_move(struct drm_crtc *crtc,
 	position.x = x;
 	position.y = y;
 
-	position.hot_spot_enable = true;
 	position.x_hotspot = xorigin;
 	position.y_hotspot = yorigin;
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
index 568b7f0..b785dd7 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
@@ -395,11 +395,6 @@ struct dc_cursor_position {
 	 */
 	bool enable;
 
-	/*
-	 * This parameter indicates whether cursor hot spot should be
-	 * programmed
-	 */
-	bool hot_spot_enable;
 };
 
 struct dc_cursor_mi_param {
@@ -464,8 +459,6 @@ struct dc_cursor_attributes {
 	/* Width and height should correspond to cursor surface width x heigh */
 	uint32_t width;
 	uint32_t height;
-	uint32_t x_hot;
-	uint32_t y_hot;
 
 	enum dc_cursor_color_format color_format;
 
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_cursor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_cursor.c
index 1cab12b..5b230b1 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_cursor.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_cursor.c
@@ -86,11 +86,10 @@ void dce110_ipp_cursor_set_position(
 
 	program_position(ipp110, position->x, position->y);
 
-	if (position->hot_spot_enable)
-		program_hotspot(
-				ipp110,
-				position->x_hotspot,
-				position->y_hotspot);
+	program_hotspot(
+			ipp110,
+			position->x_hotspot,
+			position->y_hotspot);
 
 	/* unlock cursor registers */
 	lock(ipp110, false);
@@ -111,8 +110,6 @@ bool dce110_ipp_cursor_set_attributes(
 		attributes->attribute_flags.bits.ENABLE_MAGNIFICATION,
 		attributes->attribute_flags.bits.INVERSE_TRANSPARENT_CLAMPING);
 
-	/* Program hot spot coordinates */
-	program_hotspot(ipp110, attributes->x_hot, attributes->y_hot);
 
 	/*
 	 * Program cursor size -- NOTE: HW spec specifies that HW register
diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_ipp_cursor.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_ipp_cursor.c
index d520b5d..15671fd 100644
--- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_ipp_cursor.c
+++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_ipp_cursor.c
@@ -151,11 +151,10 @@ void dce120_ipp_cursor_set_position(
 		CURSOR_X_POSITION, position->x,
 		CURSOR_Y_POSITION, position->y);
 
-	if (position->hot_spot_enable)
-		DCP_REG_SET_2(
-			DCP0_CUR_HOT_SPOT,
-			CURSOR_HOT_SPOT_X, position->x_hotspot,
-			CURSOR_HOT_SPOT_Y, position->y_hotspot);
+	DCP_REG_SET_2(
+		DCP0_CUR_HOT_SPOT,
+		CURSOR_HOT_SPOT_X, position->x_hotspot,
+		CURSOR_HOT_SPOT_Y, position->y_hotspot);
 
 	/* unlock cursor registers */
 	lock(ipp110, false);
@@ -176,12 +175,6 @@ bool dce120_ipp_cursor_set_attributes(
 		attributes->attribute_flags.bits.ENABLE_MAGNIFICATION,
 		attributes->attribute_flags.bits.INVERSE_TRANSPARENT_CLAMPING);
 
-	/* Program hot spot coordinates */
-	DCP_REG_SET_2(
-		DCP0_CUR_HOT_SPOT,
-		CURSOR_HOT_SPOT_X, attributes->x_hot,
-		CURSOR_HOT_SPOT_Y, attributes->y_hot);
-
 	/*
 	 * Program cursor size -- NOTE: HW spec specifies that HW register
 	 * stores size as (height - 1, width - 1)
-- 
2.7.4