]> git.ipfire.org Git - people/ms/linux.git/blobdiff - drivers/gpu/drm/vmwgfx/vmwgfx_fb.c
drm/vmwgfx: Prune modes based on available VRAM size
[people/ms/linux.git] / drivers / gpu / drm / vmwgfx / vmwgfx_fb.c
index 409e172f4abfe94502be96502e251b5d6b2e54c9..086ef04902632f7d3a7d653c2c984add5ca9c9d6 100644 (file)
@@ -144,6 +144,13 @@ static int vmw_fb_check_var(struct fb_var_screeninfo *var,
                return -EINVAL;
        }
 
+       if (!vmw_kms_validate_mode_vram(vmw_priv,
+                                       info->fix.line_length,
+                                       var->yoffset + var->yres)) {
+               DRM_ERROR("Requested geom can not fit in framebuffer\n");
+               return -EINVAL;
+       }
+
        return 0;
 }