diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-01-21 17:38:37 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-02-13 18:07:57 -0500 |
commit | 8acf658ad6246be7913647e6e76da6a539bff425 (patch) | |
tree | aedf43f2c990f6772fcf43581a8df6383870a721 | |
parent | 2180c3c7e76536ce8ff0fd957a11dbfaa1e93403 (diff) |
drm/fb-helper: streamline drm_fb_helper_single_fb_probe
No need to check whether we've allocated a new fb since we're not
always doing that. Also, we always need to register the fbdev and add
it to the panic notifier.
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 535c2cadf4d1..e0d4b04c0eb5 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -752,10 +752,14 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, | |||
752 | } | 752 | } |
753 | EXPORT_SYMBOL(drm_fb_helper_pan_display); | 753 | EXPORT_SYMBOL(drm_fb_helper_pan_display); |
754 | 754 | ||
755 | /* | ||
756 | * Allocates the backing storage through the ->fb_probe callback and then | ||
757 | * registers the fbdev and sets up the panic notifier. | ||
758 | */ | ||
755 | static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, | 759 | static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, |
756 | int preferred_bpp) | 760 | int preferred_bpp) |
757 | { | 761 | { |
758 | int new_fb = 0; | 762 | int ret = 0; |
759 | int crtc_count = 0; | 763 | int crtc_count = 0; |
760 | int i; | 764 | int i; |
761 | struct fb_info *info; | 765 | struct fb_info *info; |
@@ -833,9 +837,9 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, | |||
833 | } | 837 | } |
834 | 838 | ||
835 | /* push down into drivers */ | 839 | /* push down into drivers */ |
836 | new_fb = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); | 840 | ret = (*fb_helper->funcs->fb_probe)(fb_helper, &sizes); |
837 | if (new_fb < 0) | 841 | if (ret < 0) |
838 | return new_fb; | 842 | return ret; |
839 | 843 | ||
840 | info = fb_helper->fbdev; | 844 | info = fb_helper->fbdev; |
841 | 845 | ||
@@ -851,15 +855,12 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, | |||
851 | fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; | 855 | fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; |
852 | 856 | ||
853 | 857 | ||
854 | if (new_fb) { | 858 | info->var.pixclock = 0; |
855 | info->var.pixclock = 0; | 859 | if (register_framebuffer(info) < 0) |
856 | if (register_framebuffer(info) < 0) | 860 | return -EINVAL; |
857 | return -EINVAL; | ||
858 | |||
859 | dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", | ||
860 | info->node, info->fix.id); | ||
861 | 861 | ||
862 | } | 862 | dev_info(fb_helper->dev->dev, "fb%d: %s frame buffer device\n", |
863 | info->node, info->fix.id); | ||
863 | 864 | ||
864 | /* Switch back to kernel console on panic */ | 865 | /* Switch back to kernel console on panic */ |
865 | /* multi card linked list maybe */ | 866 | /* multi card linked list maybe */ |
@@ -869,8 +870,8 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, | |||
869 | &paniced); | 870 | &paniced); |
870 | register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); | 871 | register_sysrq_key('v', &sysrq_drm_fb_helper_restore_op); |
871 | } | 872 | } |
872 | if (new_fb) | 873 | |
873 | list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); | 874 | list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); |
874 | 875 | ||
875 | return 0; | 876 | return 0; |
876 | } | 877 | } |