aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-09-21 04:30:12 -0400
committerAlex Williamson <alex.williamson@redhat.com>2018-10-11 12:22:35 -0400
commit3cdf752506b29ace75b6e1318abac06073d600e4 (patch)
tree33fafd77fc715f845ef95d8fbfdd1fc01167fe5c
parentcf3f98c7f466a7c79458cdeb779afb9309e243e0 (diff)
vfio: add edid api for display (vgpu) devices.
This allows to set EDID monitor information for the vgpu display, for a more flexible display configuration, using a special vfio region. Check the comment describing struct vfio_region_gfx_edid for more details. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
-rw-r--r--include/uapi/linux/vfio.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 1aa7b82e8169..44b66b09c5fe 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -301,6 +301,56 @@ 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#define VFIO_REGION_TYPE_GFX (1)
305#define VFIO_REGION_SUBTYPE_GFX_EDID (1)
306
307/**
308 * struct vfio_region_gfx_edid - EDID region layout.
309 *
310 * Set display link state and EDID blob.
311 *
312 * The EDID blob has monitor information such as brand, name, serial
313 * number, physical size, supported video modes and more.
314 *
315 * This special region allows userspace (typically qemu) set a virtual
316 * EDID for the virtual monitor, which allows a flexible display
317 * configuration.
318 *
319 * For the edid blob spec look here:
320 * https://en.wikipedia.org/wiki/Extended_Display_Identification_Data
321 *
322 * On linux systems you can find the EDID blob in sysfs:
323 * /sys/class/drm/${card}/${connector}/edid
324 *
325 * You can use the edid-decode ulility (comes with xorg-x11-utils) to
326 * decode the EDID blob.
327 *
328 * @edid_offset: location of the edid blob, relative to the
329 * start of the region (readonly).
330 * @edid_max_size: max size of the edid blob (readonly).
331 * @edid_size: actual edid size (read/write).
332 * @link_state: display link state (read/write).
333 * VFIO_DEVICE_GFX_LINK_STATE_UP: Monitor is turned on.
334 * VFIO_DEVICE_GFX_LINK_STATE_DOWN: Monitor is turned off.
335 * @max_xres: max display width (0 == no limitation, readonly).
336 * @max_yres: max display height (0 == no limitation, readonly).
337 *
338 * EDID update protocol:
339 * (1) set link-state to down.
340 * (2) update edid blob and size.
341 * (3) set link-state to up.
342 */
343struct vfio_region_gfx_edid {
344 __u32 edid_offset;
345 __u32 edid_max_size;
346 __u32 edid_size;
347 __u32 max_xres;
348 __u32 max_yres;
349 __u32 link_state;
350#define VFIO_DEVICE_GFX_LINK_STATE_UP 1
351#define VFIO_DEVICE_GFX_LINK_STATE_DOWN 2
352};
353
304/* 354/*
305 * The MSIX mappable capability informs that MSIX data of a BAR can be mmapped 355 * 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 356 * which allows direct access to non-MSIX registers which happened to be within