aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2010-12-20 14:10:39 -0500
committerDave Airlie <airlied@redhat.com>2010-12-20 21:49:44 -0500
commit57084d05379fe5c081d024006129b0565a11855f (patch)
treeff13b1d40642d7ff8d1b3215bad93554a5a42af5 /drivers/gpu/drm
parentb08ebe7e776e5be0271ed1e1bbb384e1f29dd117 (diff)
drm/fb: Don't expose mmio for fbdev emulation layer
For the fbdev api if the struct fb_var_screeninfo accel_flags field is set to FB_ACCELF_TEXT then userland applications can not mmap the mmio region. Since it is a bad idea for DRM drivers to expose the mmio region via the fbdev layer we always set the accel_flags to prevent this. Please apply. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c3
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c6
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c4
-rw-r--r--drivers/gpu/drm/radeon/radeon_fb.c2
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fb.c3
5 files changed, 4 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index d2849e4ea4d0..aa377115483b 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -985,6 +985,8 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
985 info->fix.type = FB_TYPE_PACKED_PIXELS; 985 info->fix.type = FB_TYPE_PACKED_PIXELS;
986 info->fix.visual = depth == 8 ? FB_VISUAL_PSEUDOCOLOR : 986 info->fix.visual = depth == 8 ? FB_VISUAL_PSEUDOCOLOR :
987 FB_VISUAL_TRUECOLOR; 987 FB_VISUAL_TRUECOLOR;
988 info->fix.mmio_start = 0;
989 info->fix.mmio_len = 0;
988 info->fix.type_aux = 0; 990 info->fix.type_aux = 0;
989 info->fix.xpanstep = 1; /* doing it in hw */ 991 info->fix.xpanstep = 1; /* doing it in hw */
990 info->fix.ypanstep = 1; /* doing it in hw */ 992 info->fix.ypanstep = 1; /* doing it in hw */
@@ -1005,6 +1007,7 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
1005 info->var.xres_virtual = fb->width; 1007 info->var.xres_virtual = fb->width;
1006 info->var.yres_virtual = fb->height; 1008 info->var.yres_virtual = fb->height;
1007 info->var.bits_per_pixel = fb->bits_per_pixel; 1009 info->var.bits_per_pixel = fb->bits_per_pixel;
1010 info->var.accel_flags = FB_ACCELF_TEXT;
1008 info->var.xoffset = 0; 1011 info->var.xoffset = 0;
1009 info->var.yoffset = 0; 1012 info->var.yoffset = 0;
1010 info->var.activate = FB_ACTIVATE_NOW; 1013 info->var.activate = FB_ACTIVATE_NOW;
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index af2a1dddc28e..ced3eef8da07 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -68,7 +68,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
68 struct drm_gem_object *fbo = NULL; 68 struct drm_gem_object *fbo = NULL;
69 struct drm_i915_gem_object *obj_priv; 69 struct drm_i915_gem_object *obj_priv;
70 struct device *device = &dev->pdev->dev; 70 struct device *device = &dev->pdev->dev;
71 int size, ret, mmio_bar = IS_GEN2(dev) ? 1 : 0; 71 int size, ret;
72 72
73 /* we don't do packed 24bpp */ 73 /* we don't do packed 24bpp */
74 if (sizes->surface_bpp == 24) 74 if (sizes->surface_bpp == 24)
@@ -156,10 +156,6 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
156 drm_fb_helper_fill_fix(info, fb->pitch, fb->depth); 156 drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
157 drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height); 157 drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
158 158
159 /* FIXME: we really shouldn't expose mmio space at all */
160 info->fix.mmio_start = pci_resource_start(dev->pdev, mmio_bar);
161 info->fix.mmio_len = pci_resource_len(dev->pdev, mmio_bar);
162
163 info->pixmap.size = 64*1024; 159 info->pixmap.size = 64*1024;
164 info->pixmap.buf_align = 8; 160 info->pixmap.buf_align = 8;
165 info->pixmap.access_align = 32; 161 info->pixmap.access_align = 32;
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index ea861c915149..9dbe1eff2ae5 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -348,10 +348,6 @@ nouveau_fbcon_create(struct nouveau_fbdev *nfbdev,
348 drm_fb_helper_fill_fix(info, fb->pitch, fb->depth); 348 drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
349 drm_fb_helper_fill_var(info, &nfbdev->helper, sizes->fb_width, sizes->fb_height); 349 drm_fb_helper_fill_var(info, &nfbdev->helper, sizes->fb_width, sizes->fb_height);
350 350
351 /* FIXME: we really shouldn't expose mmio space at all */
352 info->fix.mmio_start = pci_resource_start(pdev, 1);
353 info->fix.mmio_len = pci_resource_len(pdev, 1);
354
355 /* Set aperture base/size for vesafb takeover */ 351 /* Set aperture base/size for vesafb takeover */
356 info->apertures = dev_priv->apertures; 352 info->apertures = dev_priv->apertures;
357 if (!info->apertures) { 353 if (!info->apertures) {
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index efa211898fe6..f7b4762fa6b6 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -247,8 +247,6 @@ static int radeonfb_create(struct radeon_fbdev *rfbdev,
247 info->apertures->ranges[0].base = rdev->ddev->mode_config.fb_base; 247 info->apertures->ranges[0].base = rdev->ddev->mode_config.fb_base;
248 info->apertures->ranges[0].size = rdev->mc.real_vram_size; 248 info->apertures->ranges[0].size = rdev->mc.real_vram_size;
249 249
250 info->fix.mmio_start = 0;
251 info->fix.mmio_len = 0;
252 info->pixmap.size = 64*1024; 250 info->pixmap.size = 64*1024;
253 info->pixmap.buf_align = 8; 251 info->pixmap.buf_align = 8;
254 info->pixmap.access_align = 32; 252 info->pixmap.access_align = 32;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index 41d9a5b73c03..dd596f2bd6e8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -480,9 +480,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv)
480 info->fix.smem_start = 0; 480 info->fix.smem_start = 0;
481 info->fix.smem_len = fb_size; 481 info->fix.smem_len = fb_size;
482 482
483 info->fix.mmio_start = 0;
484 info->fix.mmio_len = 0;
485
486 info->pseudo_palette = par->pseudo_palette; 483 info->pseudo_palette = par->pseudo_palette;
487 info->screen_base = par->vmalloc; 484 info->screen_base = par->vmalloc;
488 info->screen_size = fb_size; 485 info->screen_size = fb_size;