From: Gerd Hoffmann <kraxel@redhat.com>
To: dri-devel@lists.freedesktop.org
Cc: lvivier@redhat.com, Gerd Hoffmann <kraxel@redhat.com>,
David Airlie <airlied@linux.ie>,
virtualization@lists.linux-foundation.org (open list:VIRTIO GPU
DRIVER), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 2/2] drm: virtio: fix virtio_gpu_mode_dumb_create
Date: Mon, 3 Apr 2017 09:08:45 +0200 [thread overview]
Message-ID: <20170403070845.10793-3-kraxel@redhat.com> (raw)
In-Reply-To: <20170403070845.10793-1-kraxel@redhat.com>
Lookup format using virtio_gpu_translate_format()
instead of hardcoding it. Fixes xorg display on
bigendian guests (i.e. ppc64).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
drivers/gpu/drm/virtio/virtgpu_gem.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/gpu/drm/virtio/virtgpu_gem.c
index 336a57f..cc025d8 100644
--- a/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ b/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -88,6 +88,7 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
int ret;
uint32_t pitch;
uint32_t resid;
+ uint32_t format;
pitch = args->width * ((args->bpp + 1) / 8);
args->size = pitch * args->height;
@@ -98,9 +99,10 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
if (ret)
goto fail;
+ format = virtio_gpu_translate_format(DRM_FORMAT_XRGB8888);
virtio_gpu_resource_id_get(vgdev, &resid);
- virtio_gpu_cmd_create_resource(vgdev, resid,
- 2, args->width, args->height);
+ virtio_gpu_cmd_create_resource(vgdev, resid, format,
+ args->width, args->height);
/* attach the object to the resource */
obj = gem_to_virtio_gpu_obj(gobj);
--
2.9.3
next prev parent reply other threads:[~2017-04-03 7:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170403070845.10793-1-kraxel@redhat.com>
2017-04-03 7:08 ` [PATCH 1/2] drm: virtio: add virtio_gpu_translate_format Gerd Hoffmann
2017-04-03 7:51 ` Daniel Vetter
2017-04-03 9:05 ` Gerd Hoffmann
2017-04-03 7:08 ` Gerd Hoffmann [this message]
2017-04-03 7:45 ` [PATCH 2/2] drm: virtio: fix virtio_gpu_mode_dumb_create Dave Airlie
2017-04-03 7:53 ` Daniel Vetter
2017-04-03 9:02 ` 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=20170403070845.10793-3-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvivier@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/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