The Linux Kernel Mailing List
 help / color / mirror / Atom feed
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>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v3 2/5] drm: use drm_mode_legacy_fb_format2 in drm_gem_fbdev_fb_create
Date: Wed, 19 Sep 2018 13:12:49 +0200	[thread overview]
Message-ID: <20180919111252.7932-3-kraxel@redhat.com> (raw)
In-Reply-To: <20180919111252.7932-1-kraxel@redhat.com>

Creating framebuffers for fbdev emulation should use the correct format
code too, so switch drm_gem_fbdev_fb_create() over to use the new
drm_mode_legacy_fb_format2() function.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/drm_gem_framebuffer_helper.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
index 7607f9cd6f..3619f1c78a 100644
--- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c
+++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c
@@ -308,6 +308,7 @@ drm_gem_fbdev_fb_create(struct drm_device *dev,
 			const struct drm_framebuffer_funcs *funcs)
 {
 	struct drm_mode_fb_cmd2 mode_cmd = { 0 };
+	bool native = dev->mode_config.quirk_addfb_prefer_host_byte_order;
 
 	mode_cmd.width = sizes->surface_width;
 	mode_cmd.height = sizes->surface_height;
@@ -316,8 +317,9 @@ drm_gem_fbdev_fb_create(struct drm_device *dev,
 	if (pitch_align)
 		mode_cmd.pitches[0] = roundup(mode_cmd.pitches[0],
 					      pitch_align);
-	mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
-							sizes->surface_depth);
+	mode_cmd.pixel_format = drm_mode_legacy_fb_format2(sizes->surface_bpp,
+							   sizes->surface_depth,
+							   native);
 	if (obj->size < mode_cmd.pitches[0] * mode_cmd.height)
 		return ERR_PTR(-EINVAL);
 
-- 
2.9.3


  parent reply	other threads:[~2018-09-19 11:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180919111252.7932-1-kraxel@redhat.com>
2018-09-19 11:12 ` [PATCH v3 1/5] drm: move native byte order quirk to new drm_mode_legacy_fb_format2 function Gerd Hoffmann
2018-09-21  9:39   ` Daniel Vetter
2018-09-19 11:12 ` Gerd Hoffmann [this message]
2018-09-19 11:12 ` [PATCH v3 3/5] drm/bochs: fix DRM_FORMAT_* handling for big endian machines Gerd Hoffmann
2018-09-19 11:12 ` [PATCH v3 4/5] drm/bochs: support changing byteorder at mode set time Gerd Hoffmann
2018-09-19 11:12 ` [PATCH v3 5/5] 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=20180919111252.7932-3-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=airlied@linux.ie \
    --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=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