aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2010-12-23 11:40:37 -0500
committerDave Airlie <airlied@redhat.com>2011-01-06 22:44:40 -0500
commitdfe63bb0ad9810db13aab0058caba97866e0a681 (patch)
treeffc5e9335283001c072aa0377ba9fd92ac3b1919 /drivers/gpu
parentf598aa7593427ffe3a61e7767c34bd695a5e7ed0 (diff)
drm: Update fbdev fb_fix_screeninfo
If you change the color depth via fbset or some other framebuffer aware userland application struct fb_fix_screeninfo is not updated to this new information. This patch fixes this issue. Also the function is changed to just pass in struct drm_framebuffer so in the future we could use more fields. I'm hoping some day fix->smem* could be set here :-) Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-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
4 files changed, 21 insertions, 24 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 5c4f9b9ecdc..0307d601f5e 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 67738f32dfd..701e830d001 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 6d56a54b6e2..a26d04740c8 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 66324b5bb5b..ca32e9c1e91 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