mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
drm/virtio: params struct for virtio_gpu_cmd_create_resource()
Add format, width and height fields to the virtio_gpu_object_params struct. With that in place we can use the parameter struct for virtio_gpu_cmd_create_resource() calls too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Noralf Trønnes <noralf@tronnes.org> Link: http://patchwork.freedesktop.org/patch/msgid/20190318113332.10900-4-kraxel@redhat.com
This commit is contained in:
@@ -88,7 +88,6 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
|
||||
struct virtio_gpu_object_params params = { 0 };
|
||||
int ret;
|
||||
uint32_t pitch;
|
||||
uint32_t format;
|
||||
|
||||
if (args->bpp != 32)
|
||||
return -EINVAL;
|
||||
@@ -97,16 +96,17 @@ int virtio_gpu_mode_dumb_create(struct drm_file *file_priv,
|
||||
args->size = pitch * args->height;
|
||||
args->size = ALIGN(args->size, PAGE_SIZE);
|
||||
|
||||
params.format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB8888);
|
||||
params.width = args->width;
|
||||
params.height = args->height;
|
||||
params.size = args->size;
|
||||
ret = virtio_gpu_gem_create(file_priv, dev, ¶ms, &gobj,
|
||||
&args->handle);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
format = virtio_gpu_translate_format(DRM_FORMAT_HOST_XRGB8888);
|
||||
obj = gem_to_virtio_gpu_obj(gobj);
|
||||
virtio_gpu_cmd_create_resource(vgdev, obj, format,
|
||||
args->width, args->height);
|
||||
virtio_gpu_cmd_create_resource(vgdev, obj, ¶ms);
|
||||
|
||||
/* attach the object to the resource */
|
||||
ret = virtio_gpu_object_attach(vgdev, obj, NULL);
|
||||
|
||||
Reference in New Issue
Block a user