aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/vfio.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux/vfio.h')
-rw-r--r--include/uapi/linux/vfio.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index e3301dbd27d4..c74372163ed2 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -301,6 +301,16 @@ struct vfio_region_info_cap_type {
301#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2) 301#define VFIO_REGION_SUBTYPE_INTEL_IGD_HOST_CFG (2)
302#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3) 302#define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3)
303 303
304/*
305 * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped
306 * which allows direct access to non-MSIX registers which happened to be within
307 * the same system page.
308 *
309 * Even though the userspace gets direct access to the MSIX data, the existing
310 * VFIO_DEVICE_SET_IRQS interface must still be used for MSIX configuration.
311 */
312#define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3
313
304/** 314/**
305 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9, 315 * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,
306 * struct vfio_irq_info) 316 * struct vfio_irq_info)
@@ -503,6 +513,68 @@ struct vfio_pci_hot_reset {
503 513
504#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) 514#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)
505 515
516/**
517 * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14,
518 * struct vfio_device_query_gfx_plane)
519 *
520 * Set the drm_plane_type and flags, then retrieve the gfx plane info.
521 *
522 * flags supported:
523 * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set
524 * to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no
525 * support for dma-buf.
526 * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set
527 * to ask if the mdev supports region. 0 on support, -EINVAL on no
528 * support for region.
529 * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set
530 * with each call to query the plane info.
531 * - Others are invalid and return -EINVAL.
532 *
533 * Note:
534 * 1. Plane could be disabled by guest. In that case, success will be
535 * returned with zero-initialized drm_format, size, width and height
536 * fields.
537 * 2. x_hot/y_hot is set to 0xFFFFFFFF if no hotspot information available
538 *
539 * Return: 0 on success, -errno on other failure.
540 */
541struct vfio_device_gfx_plane_info {
542 __u32 argsz;
543 __u32 flags;
544#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0)
545#define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1)
546#define VFIO_GFX_PLANE_TYPE_REGION (1 << 2)
547 /* in */
548 __u32 drm_plane_type; /* type of plane: DRM_PLANE_TYPE_* */
549 /* out */
550 __u32 drm_format; /* drm format of plane */
551 __u64 drm_format_mod; /* tiled mode */
552 __u32 width; /* width of plane */
553 __u32 height; /* height of plane */
554 __u32 stride; /* stride of plane */
555 __u32 size; /* size of plane in bytes, align on page*/
556 __u32 x_pos; /* horizontal position of cursor plane */
557 __u32 y_pos; /* vertical position of cursor plane*/
558 __u32 x_hot; /* horizontal position of cursor hotspot */
559 __u32 y_hot; /* vertical position of cursor hotspot */
560 union {
561 __u32 region_index; /* region index */
562 __u32 dmabuf_id; /* dma-buf id */
563 };
564};
565
566#define VFIO_DEVICE_QUERY_GFX_PLANE _IO(VFIO_TYPE, VFIO_BASE + 14)
567
568/**
569 * VFIO_DEVICE_GET_GFX_DMABUF - _IOW(VFIO_TYPE, VFIO_BASE + 15, __u32)
570 *
571 * Return a new dma-buf file descriptor for an exposed guest framebuffer
572 * described by the provided dmabuf_id. The dmabuf_id is returned from VFIO_
573 * DEVICE_QUERY_GFX_PLANE as a token of the exposed guest framebuffer.
574 */
575
576#define VFIO_DEVICE_GET_GFX_DMABUF _IO(VFIO_TYPE, VFIO_BASE + 15)
577
506/* -------- API for Type1 VFIO IOMMU -------- */ 578/* -------- API for Type1 VFIO IOMMU -------- */
507 579
508/** 580/**