diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2014-11-28 05:48:48 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-12-03 22:26:49 +0300 |
commit | c9d61b00b9e7782191aa567d8dc09b1962d1db6a (patch) | |
tree | ee76e795852302794fb79161543b34a5fc51e8a3 /drivers | |
parent | f7a3db75a6aaaf7bcc186dde0cf37f1627492af6 (diff) | |
download | linux-c9d61b00b9e7782191aa567d8dc09b1962d1db6a.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 32 |
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 { struct radeon_device *rdev; }; +/** + * radeon_fb_helper_set_par - Hide cursor on CRTCs used by fbdev. + * + * @info: fbdev info + * + * This function hides the cursor on all CRTCs used by fbdev. + */ +static int radeon_fb_helper_set_par(struct fb_info *info) +{ + int ret; + + ret = drm_fb_helper_set_par(info); + + /* XXX: with universal plane support fbdev will automatically disable + * all non-primary planes (including the cursor) + */ + if (ret == 0) { + struct drm_fb_helper *fb_helper = info->par; + int i; + + for (i = 0; i < fb_helper->crtc_count; i++) { + struct drm_crtc *crtc = fb_helper->crtc_info[i].mode_set.crtc; + + radeon_crtc_cursor_set2(crtc, NULL, 0, 0, 0, 0, 0); + } + } + + return ret; +} + static struct fb_ops radeonfb_ops = { .owner = THIS_MODULE, .fb_check_var = drm_fb_helper_check_var, - .fb_set_par = drm_fb_helper_set_par, + .fb_set_par = radeon_fb_helper_set_par, .fb_fillrect = cfb_fillrect, .fb_copyarea = cfb_copyarea, .fb_imageblit = cfb_imageblit, |