aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2014-11-27 21:48:48 -0500
committerAlex Deucher <alexander.deucher@amd.com>2014-12-03 14:26:49 -0500
commitc9d61b00b9e7782191aa567d8dc09b1962d1db6a (patch)
treeee76e795852302794fb79161543b34a5fc51e8a3
parentf7a3db75a6aaaf7bcc186dde0cf37f1627492af6 (diff)
drm/radeon: Hide cursor on CRTCs used by fbdev (v2)
Since we are now preserving the cursor across modesets, the cursor could be left over in console if e.g. X crashed. v2: add comment about universal plane support Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 0ea1db83d573..29b9220ec399 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -48,10 +48,40 @@ struct radeon_fbdev {
48 struct radeon_device *rdev; 48 struct radeon_device *rdev;
49}; 49};
50 50
51/**
52 * radeon_fb_helper_set_par - Hide cursor on CRTCs used by fbdev.
53 *
54 * @info: fbdev info
55 *
56 * This function hides the cursor on all CRTCs used by fbdev.
57 */
58static int radeon_fb_helper_set_par(struct fb_info *info)
59{
60 int ret;
61
62 ret = drm_fb_helper_set_par(info);
63
64 /* XXX: with universal plane support fbdev will automatically disable
65 * all non-primary planes (including the cursor)
66 */
67 if (ret == 0) {
68 struct drm_fb_helper *fb_helper = info->par;
69 int i;
70
71 for (i = 0; i < fb_helper->crtc_count; i++) {
72 struct drm_crtc *crtc = fb_helper->crtc_info[i].mode_set.crtc;
73
74 radeon_crtc_cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
75 }
76 }
77
78 return ret;
79}
80
51static struct fb_ops radeonfb_ops = { 81static struct fb_ops radeonfb_ops = {
52 .owner = THIS_MODULE, 82 .owner = THIS_MODULE,
53 .fb_check_var = drm_fb_helper_check_var, 83 .fb_check_var = drm_fb_helper_check_var,
54 .fb_set_par = drm_fb_helper_set_par, 84 .fb_set_par = radeon_fb_helper_set_par,
55 .fb_fillrect = cfb_fillrect, 85 .fb_fillrect = cfb_fillrect,
56 .fb_copyarea = cfb_copyarea, 86 .fb_copyarea = cfb_copyarea,
57 .fb_imageblit = cfb_imageblit, 87 .fb_imageblit = cfb_imageblit,