drm: move quirk_addfb_prefer_xbgr_30bpp handling to drm_driver_legacy_fb_format too
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 21 Sep 2018 13:47:04 +0000 (15:47 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 25 Sep 2018 12:49:50 +0000 (14:49 +0200)
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20180921134704.12826-7-kraxel@redhat.com
drivers/gpu/drm/drm_fourcc.c
drivers/gpu/drm/drm_framebuffer.c

index 7c6d3922ed400d2cd6d9fd392361836ab3b0838c..90a1c846fc25aada95b51178060a17d20aa5ed47 100644 (file)
@@ -121,6 +121,11 @@ uint32_t drm_driver_legacy_fb_format(struct drm_device *dev,
                if (fmt == DRM_FORMAT_XRGB1555)
                        fmt = DRM_FORMAT_HOST_XRGB1555;
        }
+
+       if (dev->mode_config.quirk_addfb_prefer_xbgr_30bpp &&
+           fmt == DRM_FORMAT_XRGB2101010)
+               fmt = DRM_FORMAT_XBGR2101010;
+
        return fmt;
 }
 EXPORT_SYMBOL(drm_driver_legacy_fb_format);
index 1e2126101c18f9cf7913ea8f34f3c834aada7015..3bf729d0aae5899e1bca8dbd5783bbc38f899c73 100644 (file)
@@ -129,10 +129,6 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
        r.pitches[0] = or->pitch;
        r.handles[0] = or->handle;
 
-       if (dev->mode_config.quirk_addfb_prefer_xbgr_30bpp &&
-           r.pixel_format == DRM_FORMAT_XRGB2101010)
-               r.pixel_format = DRM_FORMAT_XBGR2101010;
-
        ret = drm_mode_addfb2(dev, &r, file_priv);
        if (ret)
                return ret;