From: Gerd Hoffmann <kraxel@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: michel@daenzer.net, imirkin@alum.mit.edu,
Gerd Hoffmann <kraxel@redhat.com>,
Gustavo Padovan <gustavo@padovan.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
Ben Skeggs <bskeggs@redhat.com>,
linux-kernel@vger.kernel.org (open list),
nouveau@lists.freedesktop.org (open list:DRM DRIVER FOR NVIDIA
GEFORCE/QUADRO GPUS)
Subject: [PATCH v2 1/6] drm: replace DRIVER_PREFER_XBGR_30BPP driver flag with mode_config quirk
Date: Wed, 5 Sep 2018 08:04:40 +0200 [thread overview]
Message-ID: <20180905060445.15008-2-kraxel@redhat.com> (raw)
In-Reply-To: <20180905060445.15008-1-kraxel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/drm/drm_drv.h | 1 -
include/drm/drm_mode_config.h | 1 +
drivers/gpu/drm/drm_framebuffer.c | 4 ++--
drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 46a8009784..23b9678137 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -56,7 +56,6 @@ struct drm_printer;
#define DRIVER_ATOMIC 0x10000
#define DRIVER_KMS_LEGACY_CONTEXT 0x20000
#define DRIVER_SYNCOBJ 0x40000
-#define DRIVER_PREFER_XBGR_30BPP 0x80000
/**
* struct drm_driver - DRM driver structure
diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
index a0b202e1d6..5d29f4ba6f 100644
--- a/include/drm/drm_mode_config.h
+++ b/include/drm/drm_mode_config.h
@@ -809,6 +809,7 @@ struct drm_mode_config {
/* dumb ioctl parameters */
uint32_t preferred_depth, prefer_shadow;
+ bool quirk_addfb_prefer_xbgr_30bpp;
/**
* @async_page_flip: Does this device support async flips on the primary
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c
index 781af1d42d..17b7b8944d 100644
--- a/drivers/gpu/drm/drm_framebuffer.c
+++ b/drivers/gpu/drm/drm_framebuffer.c
@@ -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.handles[0] = or->handle;
- if (r.pixel_format == DRM_FORMAT_XRGB2101010 &&
- dev->driver->driver_features & DRIVER_PREFER_XBGR_30BPP)
+ 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);
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 8412119bd9..a9bb656058 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -2174,7 +2174,7 @@ nv50_display_create(struct drm_device *dev)
nouveau_display(dev)->fini = nv50_display_fini;
disp->disp = &nouveau_display(dev)->disp;
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 */
ret = nouveau_bo_new(&drm->client, 4096, 0x1000, TTM_PL_FLAG_VRAM,
--
2.9.3
next parent reply other threads:[~2018-09-05 6:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180905060445.15008-1-kraxel@redhat.com>
2018-09-05 6:04 ` Gerd Hoffmann [this message]
2018-09-05 6:04 ` [PATCH v2 2/6] drm: byteorder: add DRM_FORMAT_HOST_* Gerd Hoffmann
2018-09-05 6:04 ` [PATCH v2 3/6] drm: do not mask out DRM_FORMAT_BIG_ENDIAN Gerd Hoffmann
2018-09-05 6:04 ` [PATCH v2 4/6] drm: fix drm_mode_addfb() on big endian machines Gerd Hoffmann
2018-09-05 18:19 ` Daniel Vetter
2018-09-06 7:18 ` Gerd Hoffmann
2018-09-05 6:04 ` [PATCH v2 5/6] drm/bochs: fix DRM_FORMAT_* handling for " Gerd Hoffmann
2018-09-05 6:04 ` [PATCH v2 6/6] drm/virtio: fix DRM_FORMAT_* handling Gerd Hoffmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180905060445.15008-2-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=airlied@linux.ie \
--cc=bskeggs@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=imirkin@alum.mit.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=michel@daenzer.net \
--cc=nouveau@lists.freedesktop.org \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox