From: Gerd Hoffmann Date: Fri, 21 Sep 2018 13:47:04 +0000 (+0200) Subject: drm: move quirk_addfb_prefer_xbgr_30bpp handling to drm_driver_legacy_fb_format too X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9dd3cb243ddfc1408f373bf17b03aa0e2a7784c9;p=openwrt%2Fstaging%2Fblogic.git drm: move quirk_addfb_prefer_xbgr_30bpp handling to drm_driver_legacy_fb_format too Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20180921134704.12826-7-kraxel@redhat.com --- diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 7c6d3922ed40..90a1c846fc25 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -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); diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 1e2126101c18..3bf729d0aae5 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -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;