aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-01-11 04:27:25 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-01-13 12:03:44 -0500
commit69bcc0b7140c30de552aa3ef08322295862e8e2f (patch)
tree1455f4151f71be3a49143416ac631adb3c6daf8d /drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
parentab8db87b8256e13a62f10af1d32f5fc233c398cc (diff)
Revert "drm/amdgpu: Only update the CUR_SIZE register when necessary"
This reverts commits 7c83d7abc9997cf1efac2c0ce384b5e8453ee870 and a1f49cc179ce6b7b7758ae3ff5cdb138d0ee0f56. They caused the HW cursor to disappear under various circumstances in the wild. I wasn't able to reproduce any of them, and I'm not sure what's going on. But those changes aren't a big deal anyway, so let's just revert for now. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=191291 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99143 Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/dce_v6_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/dce_v6_0.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index b4e4ec630e8c..39df6a50637f 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -1859,6 +1859,8 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc,
1859 struct amdgpu_device *adev = crtc->dev->dev_private; 1859 struct amdgpu_device *adev = crtc->dev->dev_private;
1860 int xorigin = 0, yorigin = 0; 1860 int xorigin = 0, yorigin = 0;
1861 1861
1862 int w = amdgpu_crtc->cursor_width;
1863
1862 amdgpu_crtc->cursor_x = x; 1864 amdgpu_crtc->cursor_x = x;
1863 amdgpu_crtc->cursor_y = y; 1865 amdgpu_crtc->cursor_y = y;
1864 1866
@@ -1878,6 +1880,8 @@ static int dce_v6_0_cursor_move_locked(struct drm_crtc *crtc,
1878 1880
1879 WREG32(mmCUR_POSITION + amdgpu_crtc->crtc_offset, (x << 16) | y); 1881 WREG32(mmCUR_POSITION + amdgpu_crtc->crtc_offset, (x << 16) | y);
1880 WREG32(mmCUR_HOT_SPOT + amdgpu_crtc->crtc_offset, (xorigin << 16) | yorigin); 1882 WREG32(mmCUR_HOT_SPOT + amdgpu_crtc->crtc_offset, (xorigin << 16) | yorigin);
1883 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset,
1884 ((w - 1) << 16) | (amdgpu_crtc->cursor_height - 1));
1881 1885
1882 return 0; 1886 return 0;
1883} 1887}
@@ -1903,7 +1907,6 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc,
1903 int32_t hot_y) 1907 int32_t hot_y)
1904{ 1908{
1905 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); 1909 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
1906 struct amdgpu_device *adev = crtc->dev->dev_private;
1907 struct drm_gem_object *obj; 1910 struct drm_gem_object *obj;
1908 struct amdgpu_bo *aobj; 1911 struct amdgpu_bo *aobj;
1909 int ret; 1912 int ret;
@@ -1944,7 +1947,9 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc,
1944 1947
1945 dce_v6_0_lock_cursor(crtc, true); 1948 dce_v6_0_lock_cursor(crtc, true);
1946 1949
1947 if (hot_x != amdgpu_crtc->cursor_hot_x || 1950 if (width != amdgpu_crtc->cursor_width ||
1951 height != amdgpu_crtc->cursor_height ||
1952 hot_x != amdgpu_crtc->cursor_hot_x ||
1948 hot_y != amdgpu_crtc->cursor_hot_y) { 1953 hot_y != amdgpu_crtc->cursor_hot_y) {
1949 int x, y; 1954 int x, y;
1950 1955
@@ -1953,16 +1958,10 @@ static int dce_v6_0_crtc_cursor_set2(struct drm_crtc *crtc,
1953 1958
1954 dce_v6_0_cursor_move_locked(crtc, x, y); 1959 dce_v6_0_cursor_move_locked(crtc, x, y);
1955 1960
1956 amdgpu_crtc->cursor_hot_x = hot_x;
1957 amdgpu_crtc->cursor_hot_y = hot_y;
1958 }
1959
1960 if (width != amdgpu_crtc->cursor_width ||
1961 height != amdgpu_crtc->cursor_height) {
1962 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset,
1963 (width - 1) << 16 | (height - 1));
1964 amdgpu_crtc->cursor_width = width; 1961 amdgpu_crtc->cursor_width = width;
1965 amdgpu_crtc->cursor_height = height; 1962 amdgpu_crtc->cursor_height = height;
1963 amdgpu_crtc->cursor_hot_x = hot_x;
1964 amdgpu_crtc->cursor_hot_y = hot_y;
1966 } 1965 }
1967 1966
1968 dce_v6_0_show_cursor(crtc); 1967 dce_v6_0_show_cursor(crtc);
@@ -1986,7 +1985,6 @@ unpin:
1986static void dce_v6_0_cursor_reset(struct drm_crtc *crtc) 1985static void dce_v6_0_cursor_reset(struct drm_crtc *crtc)
1987{ 1986{
1988 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); 1987 struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
1989 struct amdgpu_device *adev = crtc->dev->dev_private;
1990 1988
1991 if (amdgpu_crtc->cursor_bo) { 1989 if (amdgpu_crtc->cursor_bo) {
1992 dce_v6_0_lock_cursor(crtc, true); 1990 dce_v6_0_lock_cursor(crtc, true);
@@ -1994,10 +1992,6 @@ static void dce_v6_0_cursor_reset(struct drm_crtc *crtc)
1994 dce_v6_0_cursor_move_locked(crtc, amdgpu_crtc->cursor_x, 1992 dce_v6_0_cursor_move_locked(crtc, amdgpu_crtc->cursor_x,
1995 amdgpu_crtc->cursor_y); 1993 amdgpu_crtc->cursor_y);
1996 1994
1997 WREG32(mmCUR_SIZE + amdgpu_crtc->crtc_offset,
1998 (amdgpu_crtc->cursor_width - 1) << 16 |
1999 (amdgpu_crtc->cursor_height - 1));
2000
2001 dce_v6_0_show_cursor(crtc); 1995 dce_v6_0_show_cursor(crtc);
2002 dce_v6_0_lock_cursor(crtc, false); 1996 dce_v6_0_lock_cursor(crtc, false);
2003 } 1997 }