Merge v5.6-rc2 into drm-misc-next
[linux-2.6-microblaze.git] / drivers / gpu / drm / drm_fb_helper.c
index f47454d..490a99d 100644 (file)
@@ -1257,7 +1257,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
         * Changes struct fb_var_screeninfo are currently not pushed back
         * to KMS, hence fail if different settings are requested.
         */
-       if (var->bits_per_pixel != fb->format->cpp[0] * 8 ||
+       if (var->bits_per_pixel > fb->format->cpp[0] * 8 ||
            var->xres > fb->width || var->yres > fb->height ||
            var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
                drm_dbg_kms(dev, "fb requested width/height/bpp can't fit in current fb "
@@ -1282,6 +1282,11 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
                drm_fb_helper_fill_pixel_fmt(var, fb->format->depth);
        }
 
+       /*
+        * Likewise, bits_per_pixel should be rounded up to a supported value.
+        */
+       var->bits_per_pixel = fb->format->cpp[0] * 8;
+
        /*
         * drm fbdev emulation doesn't support changing the pixel format at all,
         * so reject all pixel format changing requests.
@@ -1551,7 +1556,9 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
                for (j = 0; j < mode_set->num_connectors; j++) {
                        struct drm_connector *connector = mode_set->connectors[j];
 
-                       if (connector->has_tile) {
+                       if (connector->has_tile &&
+                           desired_mode->hdisplay == connector->tile_h_size &&
+                           desired_mode->vdisplay == connector->tile_v_size) {
                                lasth = (connector->tile_h_loc == (connector->num_h_tile - 1));
                                lastv = (connector->tile_v_loc == (connector->num_v_tile - 1));
                                /* cloning to multiple tiles is just crazy-talk, so: */