Merge v4.20-rc4 into drm-next
[linux-block.git] / drivers / gpu / drm / drm_fb_helper.c
index dd852a25d37540fdf9ee6254f08a68b98df3e9a5..5e9ca6f9637929ff76a37db4c8e936eba82c5279 100644 (file)
@@ -1635,6 +1635,10 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
        if (var->pixclock != 0 || in_dbg_master())
                return -EINVAL;
 
+       if ((drm_format_info_block_width(fb->format, 0) > 1) ||
+           (drm_format_info_block_height(fb->format, 0) > 1))
+               return -EINVAL;
+
        /*
         * Changes struct fb_var_screeninfo are currently not pushed back
         * to KMS, hence fail if different settings are requested.
@@ -1952,6 +1956,8 @@ void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helpe
 {
        struct drm_framebuffer *fb = fb_helper->fb;
 
+       WARN_ON((drm_format_info_block_width(fb->format, 0) > 1) ||
+               (drm_format_info_block_height(fb->format, 0) > 1));
        info->pseudo_palette = fb_helper->pseudo_palette;
        info->var.xres_virtual = fb->width;
        info->var.yres_virtual = fb->height;