aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-10-27 04:11:43 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-09 02:32:19 -0500
commit2cea2151623122f78b5287acba658208bb0ee4a7 (patch)
treed3527ce5e99c5bac7dbe20903a277bcf85d283bd /drivers/gpu/drm/amd
parenteb0d743b41882ad2987f4fe4000dce595fce1b7f (diff)
drm/amdgpu: Store CRTC relative amdgpu_crtc->cursor_x/y values
commit 8e57ec613df7d6bfa8ffe7512290c5415ebb8657 upstream. We were storing viewport relative coordinates. However, crtc_cursor_set2 and cursor_reset pass amdgpu_crtc->cursor_x/y as the x/y parameters of cursor_move_locked, which would break if the CRTC isn't located at (0, 0). Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v10_0.c6
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v11_0.c6
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v6_0.c5
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v8_0.c6
4 files changed, 12 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index 9260caef74fa..e5af57318f34 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -2577,6 +2577,9 @@ static int dce_v10_0_cursor_move_locked(struct drm_crtc *crtc,
2577 struct amdgpu_device *adev = crtc->dev->dev_private; 2577 struct amdgpu_device *adev = crtc->dev->dev_private;
2578 int xorigin = 0, yorigin = 0; 2578 int xorigin = 0, yorigin = 0;
2579 2579
2580 amdgpu_crtc->cursor_x = x;
2581 amdgpu_crtc->cursor_y = y;
2582
2580 /* avivo cursor are offset into the total surface */ 2583 /* avivo cursor are offset into the total surface */
2581 x += crtc->x; 2584 x += crtc->x;
2582 y += crtc->y; 2585 y += crtc->y;
@@ -2596,9 +2599,6 @@ static int dce_v10_0_cursor_move_locked(struct drm_crtc *crtc,
2596 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset, 2599 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset,
2597 ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); 2600 ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1));
2598 2601
2599 amdgpu_crtc->cursor_x = x;
2600 amdgpu_crtc->cursor_y = y;
2601
2602 return 0; 2602 return 0;
2603} 2603}
2604 2604
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index 367739bd1927..5b2fa17a5589 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -2593,6 +2593,9 @@ static int dce_v11_0_cursor_move_locked(struct drm_crtc *crtc,
2593 struct amdgpu_device *adev = crtc->dev->dev_private; 2593 struct amdgpu_device *adev = crtc->dev->dev_private;
2594 int xorigin = 0, yorigin = 0; 2594 int xorigin = 0, yorigin = 0;
2595 2595
2596 amdgpu_crtc->cursor_x = x;
2597 amdgpu_crtc->cursor_y = y;
2598
2596 /* avivo cursor are offset into the total surface */ 2599 /* avivo cursor are offset into the total surface */
2597 x += crtc->x; 2600 x += crtc->x;
2598 y += crtc->y; 2601 y += crtc->y;
@@ -2612,9 +2615,6 @@ static int dce_v11_0_cursor_move_locked(struct drm_crtc *crtc,
2612 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset, 2615 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset,
2613 ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); 2616 ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1));
2614 2617
2615 amdgpu_crtc->cursor_x = x;
2616 amdgpu_crtc->cursor_y = y;
2617
2618 return 0; 2618 return 0;
2619} 2619}
2620 2620
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index 15f9fc0514b2..b2447db693c0 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -1933,6 +1933,9 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc,
1933 1933
1934 int w = amdgpu_crtc->cursor_width; 1934 int w = amdgpu_crtc->cursor_width;
1935 1935
1936 amdgpu_crtc->cursor_x = x;
1937 amdgpu_crtc->cursor_y = y;
1938
1936 /* avivo cursor are offset into the total surface */ 1939 /* avivo cursor are offset into the total surface */
1937 x += crtc->x; 1940 x += crtc->x;
1938 y += crtc->y; 1941 y += crtc->y;
@@ -1952,8 +1955,6 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc,
1952 WREG32(EVERGREEN_CUR_SIZE + amdgpu_crtc->crtc_offset, 1955 WREG32(EVERGREEN_CUR_SIZE + amdgpu_crtc->crtc_offset,
1953 ((w - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); 1956 ((w - 1) << 16) | (amdgpu_crtc->cursor_height - 1));
1954 1957
1955 amdgpu_crtc->cursor_x = x;
1956 amdgpu_crtc->cursor_y = y;
1957 return 0; 1958 return 0;
1958} 1959}
1959 1960
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 8c4d808db0f1..80e71d100d58 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -2465,6 +2465,9 @@ static int dce_v8_0_cursor_move_locked(struct drm_crtc *crtc,
2465 struct amdgpu_device *adev = crtc->dev->dev_private; 2465 struct amdgpu_device *adev = crtc->dev->dev_private;
2466 int xorigin = 0, yorigin = 0; 2466 int xorigin = 0, yorigin = 0;
2467 2467
2468 amdgpu_crtc->cursor_x = x;
2469 amdgpu_crtc->cursor_y = y;
2470
2468 /* avivo cursor are offset into the total surface */ 2471 /* avivo cursor are offset into the total surface */
2469 x += crtc->x; 2472 x += crtc->x;
2470 y += crtc->y; 2473 y += crtc->y;
@@ -2484,9 +2487,6 @@ static int dce_v8_0_cursor_move_locked(struct drm_crtc *crtc,
2484 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset, 2487 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset,
2485 ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1)); 2488 ((amdgpu_crtc->cursor_width - 1) << 16) | (amdgpu_crtc->cursor_height - 1));
2486 2489
2487 amdgpu_crtc->cursor_x = x;
2488 amdgpu_crtc->cursor_y = y;
2489
2490 return 0; 2490 return 0;
2491} 2491}
2492 2492