BACKPORT: drm/virtio: implement context init: support init ioctl

This implements the context initialization ioctl.  A list of params
is passed in by userspace, and kernel driver validates them.  The
only currently supported param is VIRTGPU_CONTEXT_PARAM_CAPSET_ID.

If the context has already been initialized, -EEXIST is returned.
This happens after Linux userspace does dumb_create + followed by
opening the Mesa virgl driver with the same virtgpu instance.

However, for most applications, 3D contexts will be explicitly
initialized when the feature is available.

Signed-off-by: Anthoine Bourgeois <[email protected]>
Acked-by: Lingfeng Yang <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>

Bug: 278150168
Change-Id: I3dd83a1765fd26f40e86e3b25b597e946a83da9f
(cherry picked from commit 4fb530e5caf7cb666948db65f245b350ce520436)
[kaiyili: Reslved merge conflicts in virtio_gpu/{virtgpu_drv.h,virtgpu_ioctl.c}]
Signed-off-by: Kaiyi Li <[email protected]>
2 files changed