-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch adds a kms driver for the virtio gpu. The xorg modesetting driver can handle the device just fine, the framebuffer for fbcon is there too. Qemu patches for the host side are under review currently. The pci version of the device comes in two variants: with and without vga compatibility. The former has a extra memory bar for the vga framebuffer, the later is a pure virtio device. The only concern for this driver is that in the virtio-vga case we have to kick out the firmware framebuffer. Initial revision has only 2d support, 3d (virgl) support requires some more work on the qemu side and will be added later. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
- Loading branch information
Showing
21 changed files
with
3,585 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
config DRM_VIRTIO_GPU | ||
tristate "Virtio GPU driver" | ||
depends on DRM && VIRTIO | ||
select FB_SYS_FILLRECT | ||
select FB_SYS_COPYAREA | ||
select FB_SYS_IMAGEBLIT | ||
select DRM_KMS_HELPER | ||
select DRM_KMS_FB_HELPER | ||
select DRM_TTM | ||
help | ||
This is the virtual GPU driver for virtio. It can be used with | ||
QEMU based VMMs (like KVM or Xen). | ||
|
||
If unsure say M. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Makefile for the drm device driver. This driver provides support for the | ||
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. | ||
|
||
ccflags-y := -Iinclude/drm | ||
|
||
virtio-gpu-y := virtgpu_drv.o virtgpu_kms.o virtgpu_drm_bus.o virtgpu_gem.o \ | ||
virtgpu_fb.o virtgpu_display.o virtgpu_vq.o virtgpu_ttm.o \ | ||
virtgpu_fence.o virtgpu_object.o virtgpu_debugfs.o virtgpu_plane.o | ||
|
||
obj-$(CONFIG_DRM_VIRTIO_GPU) += virtio-gpu.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* All Rights Reserved. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice (including the | ||
* next paragraph) shall be included in all copies or substantial | ||
* portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
* IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE | ||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
#include <linux/debugfs.h> | ||
|
||
#include "drmP.h" | ||
#include "virtgpu_drv.h" | ||
|
||
static int | ||
virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data) | ||
{ | ||
struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
struct virtio_gpu_device *vgdev = node->minor->dev->dev_private; | ||
|
||
seq_printf(m, "fence %ld %lld\n", | ||
atomic64_read(&vgdev->fence_drv.last_seq), | ||
vgdev->fence_drv.sync_seq); | ||
return 0; | ||
} | ||
|
||
static struct drm_info_list virtio_gpu_debugfs_list[] = { | ||
{ "irq_fence", virtio_gpu_debugfs_irq_info, 0, NULL }, | ||
}; | ||
|
||
#define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(virtio_gpu_debugfs_list) | ||
|
||
int | ||
virtio_gpu_debugfs_init(struct drm_minor *minor) | ||
{ | ||
drm_debugfs_create_files(virtio_gpu_debugfs_list, | ||
VIRTIO_GPU_DEBUGFS_ENTRIES, | ||
minor->debugfs_root, minor); | ||
return 0; | ||
} | ||
|
||
void | ||
virtio_gpu_debugfs_takedown(struct drm_minor *minor) | ||
{ | ||
drm_debugfs_remove_files(virtio_gpu_debugfs_list, | ||
VIRTIO_GPU_DEBUGFS_ENTRIES, | ||
minor); | ||
} |
Oops, something went wrong.