aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_cursor.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c
index 801731aeab61..9f9780b7ddf0 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -22,8 +22,10 @@ static void mga_hide_cursor(struct mga_device *mdev)
22{ 22{
23 WREG8(MGA_CURPOSXL, 0); 23 WREG8(MGA_CURPOSXL, 0);
24 WREG8(MGA_CURPOSXH, 0); 24 WREG8(MGA_CURPOSXH, 0);
25 mgag200_bo_unpin(mdev->cursor.pixels_1); 25 if (mdev->cursor.pixels_1->pin_count)
26 mgag200_bo_unpin(mdev->cursor.pixels_2); 26 mgag200_bo_unpin(mdev->cursor.pixels_1);
27 if (mdev->cursor.pixels_2->pin_count)
28 mgag200_bo_unpin(mdev->cursor.pixels_2);
27} 29}
28 30
29int mga_crtc_cursor_set(struct drm_crtc *crtc, 31int mga_crtc_cursor_set(struct drm_crtc *crtc,
@@ -32,7 +34,7 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
32 uint32_t width, 34 uint32_t width,
33 uint32_t height) 35 uint32_t height)
34{ 36{
35 struct drm_device *dev = (struct drm_device *)file_priv->minor->dev; 37 struct drm_device *dev = crtc->dev;
36 struct mga_device *mdev = (struct mga_device *)dev->dev_private; 38 struct mga_device *mdev = (struct mga_device *)dev->dev_private;
37 struct mgag200_bo *pixels_1 = mdev->cursor.pixels_1; 39 struct mgag200_bo *pixels_1 = mdev->cursor.pixels_1;
38 struct mgag200_bo *pixels_2 = mdev->cursor.pixels_2; 40 struct mgag200_bo *pixels_2 = mdev->cursor.pixels_2;