aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Friedt <chrisfriedt@gmail.com>2014-02-01 10:01:15 -0500
committerThomas Hellstrom <thellstrom@vmware.com>2014-04-03 03:34:06 -0400
commitaa6de142c901cd2d90ef08db30ae87da214bedcc (patch)
tree4a8c32e0eec89e8f64731a0f62e24280c90b7761
parent89dcbda65ca8ddcddee67d0f6734d82fde60398d (diff)
drm/vmwgfx: correct fb_fix_screeninfo.line_length
Previously, the vmwgfx_fb driver would allow users to call FBIOSET_VINFO, but it would not adjust the FINFO properly, resulting in distorted screen rendering. The patch corrects that behaviour. See https://bugs.gentoo.org/show_bug.cgi?id=494794 for examples. Cc: stable@vger.kernel.org Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_fb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
index 9699bd174ae4..a89ad938eacf 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
@@ -147,7 +147,7 @@ static int vmw_fb_check_var(struct fb_var_screeninfo *var,
147 } 147 }
148 148
149 if (!vmw_kms_validate_mode_vram(vmw_priv, 149 if (!vmw_kms_validate_mode_vram(vmw_priv,
150 info->fix.line_length, 150 var->xres * var->bits_per_pixel/8,
151 var->yoffset + var->yres)) { 151 var->yoffset + var->yres)) {
152 DRM_ERROR("Requested geom can not fit in framebuffer\n"); 152 DRM_ERROR("Requested geom can not fit in framebuffer\n");
153 return -EINVAL; 153 return -EINVAL;
@@ -162,6 +162,8 @@ static int vmw_fb_set_par(struct fb_info *info)
162 struct vmw_private *vmw_priv = par->vmw_priv; 162 struct vmw_private *vmw_priv = par->vmw_priv;
163 int ret; 163 int ret;
164 164
165 info->fix.line_length = info->var.xres * info->var.bits_per_pixel/8;
166
165 ret = vmw_kms_write_svga(vmw_priv, info->var.xres, info->var.yres, 167 ret = vmw_kms_write_svga(vmw_priv, info->var.xres, info->var.yres,
166 info->fix.line_length, 168 info->fix.line_length,
167 par->bpp, par->depth); 169 par->bpp, par->depth);
@@ -177,6 +179,7 @@ static int vmw_fb_set_par(struct fb_info *info)
177 vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset); 179 vmw_write(vmw_priv, SVGA_REG_DISPLAY_POSITION_Y, info->var.yoffset);
178 vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres); 180 vmw_write(vmw_priv, SVGA_REG_DISPLAY_WIDTH, info->var.xres);
179 vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres); 181 vmw_write(vmw_priv, SVGA_REG_DISPLAY_HEIGHT, info->var.yres);
182 vmw_write(vmw_priv, SVGA_REG_BYTES_PER_LINE, info->fix.line_length);
180 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID); 183 vmw_write(vmw_priv, SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID);
181 } 184 }
182 185