aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-02-14 19:21:55 -0500
committerDave Airlie <airlied@redhat.com>2013-02-14 19:22:01 -0500
commit3314fdf8b44bd4914050614fa2c56b7c587fabc2 (patch)
tree72f3d96e0042535769faee1a56e6da12d5a570a8 /drivers/gpu/drm/radeon
parentf934ec8c34b9dcefb5a4f35b0bda33bca289cbe6 (diff)
parenta065b46a01b25d7d364e01e75f7ec2bd9ed5d9cb (diff)
Merge branch 'drm-fb-helper' of git://people.freedesktop.org/~danvet/drm into drm-next
This is the drm fb helper cleanup, mostly motivated by strange things I've seen in my locking rework and the i915 modeset revamp. Compared to the original submission I've reinstated the setup flexibility you'd like to retain, kerneldoc has been reviewed by Laurent Pinchart and Rob Clark reviewed the code changes. Quick overview of the changes: - Cleaned-up library interface for drivers using the fb helper, also simplified the fb allocation callback since no driver supported reallocating the fb on-the-fly. And the fbdev/fbcon code keeps pointers to the old mapping around anyway, so reallocating backing storage will be much more work. - No longer call the crtc helper "disable everything" function at init time, but allow drivers to do so. Motivated by i915's fastboot effort and allows us to drop a bunch of noop dummy functions just to avoid calling NULL function pointers from i915.ko. - Properly clear old state when doing modeset calls, the fb helper left some old modes in there and unconditionally set an fb (even when disabling a crtc). The crtc helpers didn't care, but i915 modeset code can now drop a few special cases. - Full kerneldoc for the fb helper. Yay! - My version of the "don't sleep in panic ->unblank calls". The patch is already in -mm, I guess Andrew can drop it as soon as this pull lands in drm-next. * 'drm-fb-helper' of git://people.freedesktop.org/~danvet/drm: drm/fb-helper: remove unused members of struct drm_fb_helper drm/fb-helper: don't sleep for screen unblank when an oopps is in progress drm/fb-helper: improve kerneldoc drm/<drivers>: simplify ->fb_probe callback drm/fb-helper: streamline drm_fb_helper_single_fb_probe drm/fb-helper: directly call set_par from the hotplug handler drm/fb-helper: fixup set_config semantics drm/i915: rip out helper->disable noop functions drm/fb-helper: don't disable everything in initial_config drm/tegra: don't set up initial fbcon config twice drm/fb-helper: unexport drm_fb_helper_single_fb_probe drm/fb-helper: unexport drm_fb_helper_panic drm/fb-helper: kill drm_fb_helper_restore drm: review locking for drm_fb_helper_restore_fbdev_mode
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 515e5ee1f9ee..b1746741bc59 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -187,9 +187,10 @@ out_unref:
187 return ret; 187 return ret;
188} 188}
189 189
190static int radeonfb_create(struct radeon_fbdev *rfbdev, 190static int radeonfb_create(struct drm_fb_helper *helper,
191 struct drm_fb_helper_surface_size *sizes) 191 struct drm_fb_helper_surface_size *sizes)
192{ 192{
193 struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper;
193 struct radeon_device *rdev = rfbdev->rdev; 194 struct radeon_device *rdev = rfbdev->rdev;
194 struct fb_info *info; 195 struct fb_info *info;
195 struct drm_framebuffer *fb = NULL; 196 struct drm_framebuffer *fb = NULL;
@@ -300,22 +301,6 @@ out_unref:
300 return ret; 301 return ret;
301} 302}
302 303
303static int radeon_fb_find_or_create_single(struct drm_fb_helper *helper,
304 struct drm_fb_helper_surface_size *sizes)
305{
306 struct radeon_fbdev *rfbdev = (struct radeon_fbdev *)helper;
307 int new_fb = 0;
308 int ret;
309
310 if (!helper->fb) {
311 ret = radeonfb_create(rfbdev, sizes);
312 if (ret)
313 return ret;
314 new_fb = 1;
315 }
316 return new_fb;
317}
318
319void radeon_fb_output_poll_changed(struct radeon_device *rdev) 304void radeon_fb_output_poll_changed(struct radeon_device *rdev)
320{ 305{
321 drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper); 306 drm_fb_helper_hotplug_event(&rdev->mode_info.rfbdev->helper);
@@ -349,7 +334,7 @@ static int radeon_fbdev_destroy(struct drm_device *dev, struct radeon_fbdev *rfb
349static struct drm_fb_helper_funcs radeon_fb_helper_funcs = { 334static struct drm_fb_helper_funcs radeon_fb_helper_funcs = {
350 .gamma_set = radeon_crtc_fb_gamma_set, 335 .gamma_set = radeon_crtc_fb_gamma_set,
351 .gamma_get = radeon_crtc_fb_gamma_get, 336 .gamma_get = radeon_crtc_fb_gamma_get,
352 .fb_probe = radeon_fb_find_or_create_single, 337 .fb_probe = radeonfb_create,
353}; 338};
354 339
355int radeon_fbdev_init(struct radeon_device *rdev) 340int radeon_fbdev_init(struct radeon_device *rdev)
@@ -379,6 +364,10 @@ int radeon_fbdev_init(struct radeon_device *rdev)
379 } 364 }
380 365
381 drm_fb_helper_single_add_all_connectors(&rfbdev->helper); 366 drm_fb_helper_single_add_all_connectors(&rfbdev->helper);
367
368 /* disable all the possible outputs/crtcs before entering KMS mode */
369 drm_helper_disable_unused_functions(rdev->ddev);
370
382 drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel); 371 drm_fb_helper_initial_config(&rfbdev->helper, bpp_sel);
383 return 0; 372 return 0;
384} 373}