diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-10-28 12:48:00 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-10-16 10:44:02 +0200 |
commit | 62fb7a5e10962ac6ae2a2d2dbd3aedcb2a3e3257 (patch) | |
tree | 1998adc2960bd46f3a8ce8adb0be17ba13fca722 /drivers/gpu/drm/virtio/virtgpu_drv.c | |
parent | 7552ed8a1a810552e16664d7020d61d2b01b9199 (diff) | |
download | blackbird-op-linux-62fb7a5e10962ac6ae2a2d2dbd3aedcb2a3e3257.tar.gz blackbird-op-linux-62fb7a5e10962ac6ae2a2d2dbd3aedcb2a3e3257.zip |
virtio-gpu: add 3d/virgl support
Add the bits needed for opengl rendering support: query
capabilities, new virtio commands, drm ioctls.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/virtio/virtgpu_drv.c')
-rw-r--r-- | drivers/gpu/drm/virtio/virtgpu_drv.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c index 7d9610aaeff9..c27d3a30df0a 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -73,6 +73,14 @@ static struct virtio_device_id id_table[] = { }; static unsigned int features[] = { +#ifdef __LITTLE_ENDIAN + /* + * Gallium command stream send by virgl is native endian. + * Because of that we only support little endian guests on + * little endian hosts. + */ + VIRTIO_GPU_F_VIRGL, +#endif }; static struct virtio_driver virtio_gpu_driver = { .feature_table = features, @@ -114,6 +122,8 @@ static struct drm_driver driver = { .set_busid = drm_virtio_set_busid, .load = virtio_gpu_driver_load, .unload = virtio_gpu_driver_unload, + .open = virtio_gpu_driver_open, + .postclose = virtio_gpu_driver_postclose, .dumb_create = virtio_gpu_mode_dumb_create, .dumb_map_offset = virtio_gpu_mode_dumb_mmap, @@ -125,8 +135,13 @@ static struct drm_driver driver = { #endif .gem_free_object = virtio_gpu_gem_free_object, + .gem_open_object = virtio_gpu_gem_object_open, + .gem_close_object = virtio_gpu_gem_object_close, .fops = &virtio_gpu_driver_fops, + .ioctls = virtio_gpu_ioctls, + .num_ioctls = DRM_VIRTIO_NUM_IOCTLS, + .name = DRIVER_NAME, .desc = DRIVER_DESC, .date = DRIVER_DATE, |