gvt-next-2017-12-05 - VFIO mdev display dmabuf interface and gvt support (Tina) - VFIO mdev opregion support/fixes (Tina/Xiong/Chris) - workload scheduling optimization (Changbin) - preemption fix and temporal workaround (Zhenyu) - and misc fixes after refactor (Chris)
Showing the changes to include/uapi (1 of 22 files). Show all
Unified · Split
| @@ -502,6 +502,68 @@ struct vfio_pci_hot_reset { · 501 unmodified lines | ||
| 502 | 502 | |
| 503 | 503 | #define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13) |
| 504 | 504 | |
| 505 | +/** | |
| 506 | + * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14, | |
| 507 | + * struct vfio_device_query_gfx_plane) | |
| 508 | + * | |
| 509 | + * Set the drm_plane_type and flags, then retrieve the gfx plane info. | |
| 510 | + * | |
| 511 | + * flags supported: | |
| 512 | + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set | |
| 513 | + * to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no | |
| 514 | + * support for dma-buf. | |
| 515 | + * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set | |
| 516 | + * to ask if the mdev supports region. 0 on support, -EINVAL on no | |
| 517 | + * support for region. | |
| 518 | + * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set | |
| 519 | + * with each call to query the plane info. | |
| 520 | + * - Others are invalid and return -EINVAL. | |
| 521 | + * | |
| 522 | + * Note: | |
| 523 | + * 1. Plane could be disabled by guest. In that case, success will be | |
| 524 | + * returned with zero-initialized drm_format, size, width and height | |
| 525 | + * fields. | |
| 526 | + * 2. x_hot/y_hot is set to 0xFFFFFFFF if no hotspot information available | |
| 527 | + * | |
| 528 | + * Return: 0 on success, -errno on other failure. | |
| 529 | + */ | |
| 530 | +struct vfio_device_gfx_plane_info { | |
| 531 | + __u32 argsz; | |
| 532 | + __u32 flags; | |
| 533 | +#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0) | |
| 534 | +#define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1) | |
| 535 | +#define VFIO_GFX_PLANE_TYPE_REGION (1 << 2) | |
| 536 | + /* in */ | |
| 537 | + __u32 drm_plane_type; /* type of plane: DRM_PLANE_TYPE_* */ | |
| 538 | + /* out */ | |
| 539 | + __u32 drm_format; /* drm format of plane */ | |
| 540 | + __u64 drm_format_mod; /* tiled mode */ | |
| 541 | + __u32 width; /* width of plane */ | |
| 542 | + __u32 height; /* height of plane */ | |
| 543 | + __u32 stride; /* stride of plane */ | |
| 544 | + __u32 size; /* size of plane in bytes, align on page*/ | |
| 545 | + __u32 x_pos; /* horizontal position of cursor plane */ | |
| 546 | + __u32 y_pos; /* vertical position of cursor plane*/ | |
| 547 | + __u32 x_hot; /* horizontal position of cursor hotspot */ | |
| 548 | + __u32 y_hot; /* vertical position of cursor hotspot */ | |
| 549 | + union { | |
| 550 | + __u32 region_index; /* region index */ | |
| 551 | + __u32 dmabuf_id; /* dma-buf id */ | |
| 552 | + }; | |
| 553 | +}; | |
| 554 | + | |
| 555 | +#define VFIO_DEVICE_QUERY_GFX_PLANE _IO(VFIO_TYPE, VFIO_BASE + 14) | |
| 556 | + | |
| 557 | +/** | |
| 558 | + * VFIO_DEVICE_GET_GFX_DMABUF - _IOW(VFIO_TYPE, VFIO_BASE + 15, __u32) | |
| 559 | + * | |
| 560 | + * Return a new dma-buf file descriptor for an exposed guest framebuffer | |
| 561 | + * described by the provided dmabuf_id. The dmabuf_id is returned from VFIO_ | |
| 562 | + * DEVICE_QUERY_GFX_PLANE as a token of the exposed guest framebuffer. | |
| 563 | + */ | |
| 564 | + | |
| 565 | +#define VFIO_DEVICE_GET_GFX_DMABUF _IO(VFIO_TYPE, VFIO_BASE + 15) | |
| 566 | + | |
| 505 | 567 | /* -------- API for Type1 VFIO IOMMU -------- */ |
| 506 | 568 | |
| 507 | 569 | /** |