aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c41
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c1
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c1
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c2
-rw-r--r--include/drm/drm_fb_helper.h3
5 files changed, 21 insertions, 27 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 5c4f9b9ecdc0..0307d601f5e5 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -607,6 +607,25 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
607} 607}
608EXPORT_SYMBOL(drm_fb_helper_fini); 608EXPORT_SYMBOL(drm_fb_helper_fini);
609 609
610void drm_fb_helper_fill_fix(struct fb_info *info, struct drm_framebuffer *fb)
611{
612 info->fix.type = FB_TYPE_PACKED_PIXELS;
613 info->fix.visual = fb->depth == 8 ? FB_VISUAL_PSEUDOCOLOR :
614 FB_VISUAL_TRUECOLOR;
615 info->fix.mmio_start = 0;
616 info->fix.mmio_len = 0;
617 info->fix.type_aux = 0;
618 info->fix.xpanstep = 1; /* doing it in hw */
619 info->fix.ypanstep = 1; /* doing it in hw */
620 info->fix.ywrapstep = 0;
621 info->fix.accel = FB_ACCEL_NONE;
622 info->fix.type_aux = 0;
623
624 info->fix.line_length = fb->pitch;
625 return;
626}
627EXPORT_SYMBOL(drm_fb_helper_fill_fix);
628
610static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, 629static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
611 u16 blue, u16 regno, struct fb_info *info) 630 u16 blue, u16 regno, struct fb_info *info)
612{ 631{
@@ -816,6 +835,7 @@ int drm_fb_helper_set_par(struct fb_info *info)
816 mutex_unlock(&dev->mode_config.mutex); 835 mutex_unlock(&dev->mode_config.mutex);
817 return ret; 836 return ret;
818 } 837 }
838 drm_fb_helper_fill_fix(info, fb_helper->fb);
819 } 839 }
820 mutex_unlock(&dev->mode_config.mutex); 840 mutex_unlock(&dev->mode_config.mutex);
821 841
@@ -953,6 +973,7 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
953 973
954 if (new_fb) { 974 if (new_fb) {
955 info->var.pixclock = 0; 975 info->var.pixclock = 0;
976 drm_fb_helper_fill_fix(info, fb_helper->fb);
956 if (register_framebuffer(info) < 0) { 977 if (register_framebuffer(info) < 0) {
957 return -EINVAL; 978 return -EINVAL;
958 } 979 }
@@ -979,26 +1000,6 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
979} 1000}
980EXPORT_SYMBOL(drm_fb_helper_single_fb_probe); 1001EXPORT_SYMBOL(drm_fb_helper_single_fb_probe);
981 1002
982void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
983 uint32_t depth)
984{
985 info->fix.type = FB_TYPE_PACKED_PIXELS;
986 info->fix.visual = depth == 8 ? FB_VISUAL_PSEUDOCOLOR :
987 FB_VISUAL_TRUECOLOR;
988 info->fix.mmio_start = 0;
989 info->fix.mmio_len = 0;
990 info->fix.type_aux = 0;
991 info->fix.xpanstep = 1; /* doing it in hw */
992 info->fix.ypanstep = 1; /* doing it in hw */
993 info->fix.ywrapstep = 0;
994 info->fix.accel = FB_ACCEL_NONE;
995 info->fix.type_aux = 0;
996
997 info->fix.line_length = pitch;
998 return;
999}
1000EXPORT_SYMBOL(drm_fb_helper_fill_fix);
1001
1002void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, 1003void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
1003 uint32_t fb_width, uint32_t fb_height) 1004 uint32_t fb_width, uint32_t fb_height)
1004{ 1005{
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 67738f32dfd4..701e830d0012 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -150,7 +150,6 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
150 150
151// memset(info->screen_base, 0, size); 151// memset(info->screen_base, 0, size);
152 152
153 drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
154 drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); 153 drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
155 154
156 info->pixmap.size = 64*1024; 155 info->pixmap.size = 64*1024;
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 6d56a54b6e2e..a26d04740c88 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -359,7 +359,6 @@ nouveau_fbcon_create(struct nouveau_fbdev *nfbdev,
359 info->screen_base = nvbo_kmap_obj_iovirtual(nouveau_fb->nvbo); 359 info->screen_base = nvbo_kmap_obj_iovirtual(nouveau_fb->nvbo);
360 info->screen_size = size; 360 info->screen_size = size;
361 361
362 drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
363 drm_fb_helper_fill_var(info, &nfbdev->helper, sizes->fb_width, sizes->fb_height); 362 drm_fb_helper_fill_var(info, &nfbdev->helper, sizes->fb_width, sizes->fb_height);
364 363
365 /* Set aperture base/size for vesafb takeover */ 364 /* Set aperture base/size for vesafb takeover */
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 66324b5bb5ba..ca32e9c1e91d 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -225,8 +225,6 @@ static int radeonfb_create(struct radeon_fbdev *rfbdev,
225 225
226 strcpy(info->fix.id, "radeondrmfb"); 226 strcpy(info->fix.id, "radeondrmfb");
227 227
228 drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
229
230 info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT; 228 info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT;
231 info->fbops = &radeonfb_ops; 229 info->fbops = &radeonfb_ops;
232 230
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index f22e7fe4b6db..aac27bd56e89 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -121,9 +121,6 @@ int drm_fb_helper_setcolreg(unsigned regno,
121void drm_fb_helper_restore(void); 121void drm_fb_helper_restore(void);
122void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, 122void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
123 uint32_t fb_width, uint32_t fb_height); 123 uint32_t fb_width, uint32_t fb_height);
124void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
125 uint32_t depth);
126
127int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); 124int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
128 125
129bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); 126bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);