Commit 9c4ad466 authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm: virtio: fix virtio_gpu_mode_dumb_create

Lookup format using virtio_gpu_translate_format()
instead of hardcoding it.  Fixes xorg display on
bigendian guests (i.e. ppc64).
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: default avatarLaurent Vivier <lvivier@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170403070845.10793-3-kraxel@redhat.com
parent d519cb76
...@@ -88,6 +88,7 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, ...@@ -88,6 +88,7 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
int ret; int ret;
uint32_t pitch; uint32_t pitch;
uint32_t resid; uint32_t resid;
uint32_t format;
pitch = args->width * ((args->bpp + 1) / 8); pitch = args->width * ((args->bpp + 1) / 8);
args->size = pitch * args->height; args->size = pitch * args->height;
...@@ -98,9 +99,10 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv, ...@@ -98,9 +99,10 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
if (ret) if (ret)
goto fail; goto fail;
format = virtio_gpu_translate_format(DRM_FORMAT_XRGB8888);
virtio_gpu_resource_id_get(vgdev, &resid); virtio_gpu_resource_id_get(vgdev, &resid);
virtio_gpu_cmd_create_resource(vgdev, resid, virtio_gpu_cmd_create_resource(vgdev, resid, format,
2, args->width, args->height); args->width, args->height);
/* attach the object to the resource */ /* attach the object to the resource */
obj = gem_to_virtio_gpu_obj(gobj); obj = gem_to_virtio_gpu_obj(gobj);
......
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