Commit 0e94043e authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm: replace DRIVER_PREFER_XBGR_30BPP driver flag with mode_config quirk

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20180905060445.15008-2-kraxel@redhat.com
parent 3ee22b76
...@@ -120,8 +120,8 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or, ...@@ -120,8 +120,8 @@ int drm_mode_addfb(struct drm_device *dev, struct drm_mode_fb_cmd *or,
r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth); r.pixel_format = drm_mode_legacy_fb_format(or->bpp, or->depth);
r.handles[0] = or->handle; r.handles[0] = or->handle;
if (r.pixel_format == DRM_FORMAT_XRGB2101010 && if (dev->mode_config.quirk_addfb_prefer_xbgr_30bpp &&
dev->driver->driver_features & DRIVER_PREFER_XBGR_30BPP) r.pixel_format == DRM_FORMAT_XRGB2101010)
r.pixel_format = DRM_FORMAT_XBGR2101010; r.pixel_format = DRM_FORMAT_XBGR2101010;
ret = drm_mode_addfb2(dev, &r, file_priv); ret = drm_mode_addfb2(dev, &r, file_priv);
......
...@@ -2174,7 +2174,7 @@ nv50_display_create(struct drm_device *dev) ...@@ -2174,7 +2174,7 @@ nv50_display_create(struct drm_device *dev)
nouveau_display(dev)->fini = nv50_display_fini; nouveau_display(dev)->fini = nv50_display_fini;
disp->disp = &nouveau_display(dev)->disp; disp->disp = &nouveau_display(dev)->disp;
dev->mode_config.funcs = &nv50_disp_func; dev->mode_config.funcs = &nv50_disp_func;
dev->driver->driver_features |= DRIVER_PREFER_XBGR_30BPP; dev->mode_config.quirk_addfb_prefer_xbgr_30bpp = true;
/* small shared memory area we use for notifiers and semaphores */ /* small shared memory area we use for notifiers and semaphores */
ret = nouveau_bo_new(&drm->client, 4096, 0x1000, TTM_PL_FLAG_VRAM, ret = nouveau_bo_new(&drm->client, 4096, 0x1000, TTM_PL_FLAG_VRAM,
......
...@@ -56,7 +56,6 @@ struct drm_printer; ...@@ -56,7 +56,6 @@ struct drm_printer;
#define DRIVER_ATOMIC 0x10000 #define DRIVER_ATOMIC 0x10000
#define DRIVER_KMS_LEGACY_CONTEXT 0x20000 #define DRIVER_KMS_LEGACY_CONTEXT 0x20000
#define DRIVER_SYNCOBJ 0x40000 #define DRIVER_SYNCOBJ 0x40000
#define DRIVER_PREFER_XBGR_30BPP 0x80000
/** /**
* struct drm_driver - DRM driver structure * struct drm_driver - DRM driver structure
......
...@@ -809,6 +809,7 @@ struct drm_mode_config { ...@@ -809,6 +809,7 @@ struct drm_mode_config {
/* dumb ioctl parameters */ /* dumb ioctl parameters */
uint32_t preferred_depth, prefer_shadow; uint32_t preferred_depth, prefer_shadow;
bool quirk_addfb_prefer_xbgr_30bpp;
/** /**
* @async_page_flip: Does this device support async flips on the primary * @async_page_flip: Does this device support async flips on the primary
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment