History

Merge tag 'drm-misc-next-2020-11-27-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

drm-misc-next for 5.11: UAPI Changes: Cross-subsystem Changes: * char/agp: Disable frontend without CONFIG_DRM_LEGACY * mm: Fix fput in mmap error path; Introduce vma_set_file() to change vma->vm_file Core Changes: * dma-buf: Use sgtables in system heap; Move heap helpers to CMA-heap code; Skip sync for unmapped buffers; Alloc higher order pages is available; Respect num_fences when initializing shared fence list * doc: Improvements around DRM modes and SCALING_FILTER * Pass full state to connector atomic functions + callee updates * Cleanups * shmem: Map pages with caching by default; Cleanups * ttm: Fix DMA32 for global page pool * fbdev: Cleanups * fb-helper: Update framebuffer after userspace writes; Unmap console buffer during shutdown; Rework damage handling of shadow framebuffer Driver Changes: * amdgpu: Multi-hop fixes, Clenaups * imx: Fix rotation for Vivante tiled formats; Support nearest-neighour skaling; Cleanups * mcde: Fix RGB formats; Support DPI output; Cleanups * meson: HDMI clock fixes * panel: Add driver and bindings for Innolux N125HCE-GN1 * panel/s6e63m0: More backlight levels; Fix init; Cleanups * via: Clenunps * virtio: Use fence ID for handling fences; Cleanups

Daniel Vetter committed 5 years ago

Commit 5fbd41d2 parents 1d36dff 05faf1570 files · +2131 −902Browse files

Showing the changes to include/uapi (2 of 70 files). Show all

Unified · Split

2 files
  1. include/uapi/drm/drm_mode.h +126 −39
  2. include/uapi/linux/virtio_gpu.h +4 −0
include/uapi/drm/drm_mode.h+126−39
@@ -218,6 +218,27 @@ extern "C" { · 217 unmodified lines
218218 #define DRM_MODE_CONTENT_PROTECTION_DESIRED 1
219219 #define DRM_MODE_CONTENT_PROTECTION_ENABLED 2
220220
221+/**
222+ * struct drm_mode_modeinfo - Display mode information.
223+ * @clock: pixel clock in kHz
224+ * @hdisplay: horizontal display size
225+ * @hsync_start: horizontal sync start
226+ * @hsync_end: horizontal sync end
227+ * @htotal: horizontal total size
228+ * @hskew: horizontal skew
229+ * @vdisplay: vertical display size
230+ * @vsync_start: vertical sync start
231+ * @vsync_end: vertical sync end
232+ * @vtotal: vertical total size
233+ * @vscan: vertical scan
234+ * @vrefresh: approximate vertical refresh rate in Hz
235+ * @flags: bitmask of misc. flags, see DRM_MODE_FLAG_* defines
236+ * @type: bitmask of type flags, see DRM_MODE_TYPE_* defines
237+ * @name: string describing the mode resolution
238+ *
239+ * This is the user-space API display mode information structure. For the
240+ * kernel version see struct drm_display_mode.
241+ */
221242 struct drm_mode_modeinfo {
222243 __u32 clock;
223244 __u16 hdisplay;
@@ -368,27 +389,95 @@ enum drm_mode_subconnector { · 144 unmodified lines
368389 #define DRM_MODE_CONNECTOR_WRITEBACK 18
369390 #define DRM_MODE_CONNECTOR_SPI 19
370391
392+/**
393+ * struct drm_mode_get_connector - Get connector metadata.
394+ *
395+ * User-space can perform a GETCONNECTOR ioctl to retrieve information about a
396+ * connector. User-space is expected to retrieve encoders, modes and properties
397+ * by performing this ioctl at least twice: the first time to retrieve the
398+ * number of elements, the second time to retrieve the elements themselves.
399+ *
400+ * To retrieve the number of elements, set @count_props and @count_encoders to
401+ * zero, set @count_modes to 1, and set @modes_ptr to a temporary struct
402+ * drm_mode_modeinfo element.
403+ *
404+ * To retrieve the elements, allocate arrays for @encoders_ptr, @modes_ptr,
405+ * @props_ptr and @prop_values_ptr, then set @count_modes, @count_props and
406+ * @count_encoders to their capacity.
407+ *
408+ * Performing the ioctl only twice may be racy: the number of elements may have
409+ * changed with a hotplug event in-between the two ioctls. User-space is
410+ * expected to retry the last ioctl until the number of elements stabilizes.
411+ * The kernel won't fill any array which doesn't have the expected length.
412+ *
413+ * **Force-probing a connector**
414+ *
415+ * If the @count_modes field is set to zero, the kernel will perform a forced
416+ * probe on the connector to refresh the connector status, modes and EDID.
417+ * A forced-probe can be slow and the ioctl will block. A force-probe can cause
418+ * flickering and temporary freezes, so it should not be performed
419+ * automatically.
420+ *
421+ * User-space shouldn't need to force-probe connectors in general: the kernel
422+ * will automatically take care of probing connectors that don't support
423+ * hot-plug detection when appropriate. However, user-space may force-probe
424+ * connectors on user request (e.g. clicking a "Scan connectors" button, or
425+ * opening a UI to manage screens).
426+ */
371427 struct drm_mode_get_connector {
372−
428+ /** @encoders_ptr: Pointer to ``__u32`` array of object IDs. */
373429 __u64 encoders_ptr;
430+ /** @modes_ptr: Pointer to struct drm_mode_modeinfo array. */
374431 __u64 modes_ptr;
432+ /** @props_ptr: Pointer to ``__u32`` array of property IDs. */
375433 __u64 props_ptr;
434+ /** @prop_values_ptr: Pointer to ``__u64`` array of property values. */
376435 __u64 prop_values_ptr;
377436
437+ /** @count_modes: Number of modes. */
378438 __u32 count_modes;
439+ /** @count_props: Number of properties. */
379440 __u32 count_props;
441+ /** @count_encoders: Number of encoders. */
380442 __u32 count_encoders;
381443
382− __u32 encoder_id; /**< Current Encoder */
383− __u32 connector_id; /**< Id */
444+ /** @encoder_id: Object ID of the current encoder. */
445+ __u32 encoder_id;
446+ /** @connector_id: Object ID of the connector. */
447+ __u32 connector_id;
448+ /**
449+ * @connector_type: Type of the connector.
450+ *
451+ * See DRM_MODE_CONNECTOR_* defines.
452+ */
384453 __u32 connector_type;
454+ /**
455+ * @connector_type_id: Type-specific connector number.
456+ *
457+ * This is not an object ID. This is a per-type connector number. Each
458+ * (type, type_id) combination is unique across all connectors of a DRM
459+ * device.
460+ */
385461 __u32 connector_type_id;
386462
463+ /**
464+ * @connection: Status of the connector.
465+ *
466+ * See enum drm_connector_status.
467+ */
387468 __u32 connection;
388− __u32 mm_width; /**< width in millimeters */
389− __u32 mm_height; /**< height in millimeters */
469+ /** @mm_width: Width of the connected sink in millimeters. */
470+ __u32 mm_width;
471+ /** @mm_height: Height of the connected sink in millimeters. */
472+ __u32 mm_height;
473+ /**
474+ * @subpixel: Subpixel order of the connected sink.
475+ *
476+ * See enum subpixel_order.
477+ */
390478 __u32 subpixel;
391479
480+ /** @pad: Padding, must be zero. */
392481 __u32 pad;
393482 };
394483
@@ -905,24 +994,23 @@ struct drm_format_modifier { · 510 unmodified lines
905994
906995 /**
907996 * struct drm_mode_create_blob - Create New block property
908− * @data: Pointer to data to copy.
909− * @length: Length of data to copy.
910− * @blob_id: new property ID.
997+ *
911998 * Create a new 'blob' data property, copying length bytes from data pointer,
912999 * and returning new blob ID.
9131000 */
9141001 struct drm_mode_create_blob {
915− /** Pointer to data to copy. */
1002+ /** @data: Pointer to data to copy. */
9161003 __u64 data;
917− /** Length of data to copy. */
1004+ /** @length: Length of data to copy. */
9181005 __u32 length;
919− /** Return: new property ID. */
1006+ /** @blob_id: Return: new property ID. */
9201007 __u32 blob_id;
9211008 };
9221009
9231010 /**
9241011 * struct drm_mode_destroy_blob - Destroy user blob
9251012 * @blob_id: blob_id to destroy
1013+ *
9261014 * Destroy a user-created blob property.
9271015 *
9281016 * User-space can release blobs as soon as they do not need to refer to them by
@@ -937,36 +1025,32 @@ struct drm_mode_destroy_blob { · 8 unmodified lines
9371025
9381026 /**
9391027 * struct drm_mode_create_lease - Create lease
940− * @object_ids: Pointer to array of object ids.
941− * @object_count: Number of object ids.
942− * @flags: flags for new FD.
943− * @lessee_id: unique identifier for lessee.
944− * @fd: file descriptor to new drm_master file.
1028+ *
9451029 * Lease mode resources, creating another drm_master.
9461030 */
9471031 struct drm_mode_create_lease {
948− /** Pointer to array of object ids (__u32) */
1032+ /** @object_ids: Pointer to array of object ids (__u32) */
9491033 __u64 object_ids;
950− /** Number of object ids */
1034+ /** @object_count: Number of object ids */
9511035 __u32 object_count;
952− /** flags for new FD (O_CLOEXEC, etc) */
1036+ /** @flags: flags for new FD (O_CLOEXEC, etc) */
9531037 __u32 flags;
9541038
955− /** Return: unique identifier for lessee. */
1039+ /** @lessee_id: Return: unique identifier for lessee. */
9561040 __u32 lessee_id;
957− /** Return: file descriptor to new drm_master file */
1041+ /** @fd: Return: file descriptor to new drm_master file */
9581042 __u32 fd;
9591043 };
9601044
9611045 /**
9621046 * struct drm_mode_list_lessees - List lessees
963− * @count_lessees: Number of lessees.
964− * @pad: pad.
965− * @lessees_ptr: Pointer to lessess.
966− * List lesses from a drm_master
1047+ *
1048+ * List lesses from a drm_master.
9671049 */
9681050 struct drm_mode_list_lessees {
969− /** Number of lessees.
1051+ /**
1052+ * @count_lessees: Number of lessees.
1053+ *
9701054 * On input, provides length of the array.
9711055 * On output, provides total number. No
9721056 * more than the input number will be written
@@ -974,23 +1058,26 @@ struct drm_mode_list_lessees { · 1 unmodified line
9741058 * the size and then the data.
9751059 */
9761060 __u32 count_lessees;
1061+ /** @pad: Padding. */
9771062 __u32 pad;
9781063
979− /** Pointer to lessees.
980− * pointer to __u64 array of lessee ids
1064+ /**
1065+ * @lessees_ptr: Pointer to lessees.
1066+ *
1067+ * Pointer to __u64 array of lessee ids
9811068 */
9821069 __u64 lessees_ptr;
9831070 };
9841071
9851072 /**
9861073 * struct drm_mode_get_lease - Get Lease
987− * @count_objects: Number of leased objects.
988− * @pad: pad.
989− * @objects_ptr: Pointer to objects.
990− * Get leased objects
1074+ *
1075+ * Get leased objects.
9911076 */
9921077 struct drm_mode_get_lease {
993− /** Number of leased objects.
1078+ /**
1079+ * @count_objects: Number of leased objects.
1080+ *
9941081 * On input, provides length of the array.
9951082 * On output, provides total number. No
9961083 * more than the input number will be written
@@ -998,22 +1085,22 @@ struct drm_mode_get_lease { · 1 unmodified line
9981085 * the size and then the data.
9991086 */
10001087 __u32 count_objects;
1088+ /** @pad: Padding. */
10011089 __u32 pad;
10021090
1003− /** Pointer to objects.
1004− * pointer to __u32 array of object ids
1091+ /**
1092+ * @objects_ptr: Pointer to objects.
1093+ *
1094+ * Pointer to __u32 array of object ids.
10051095 */
10061096 __u64 objects_ptr;
10071097 };
10081098
10091099 /**
10101100 * struct drm_mode_revoke_lease - Revoke lease
1011− * @lessee_id: Unique ID of lessee.
1012− * Revoke lease
10131101 */
10141102 struct drm_mode_revoke_lease {
1015− /** Unique ID of lessee
1016− */
1103+ /** @lessee_id: Unique ID of lessee */
10171104 __u32 lessee_id;
10181105 };
10191106
include/uapi/linux/virtio_gpu.h+4−0
@@ -115,6 +115,10 @@ enum virtio_gpu_ctrl_type { · 114 unmodified lines
115115
116116 enum virtio_gpu_shm_id {
117117 VIRTIO_GPU_SHM_ID_UNDEFINED = 0,
118+ /*
119+ * VIRTIO_GPU_CMD_RESOURCE_MAP_BLOB
120+ * VIRTIO_GPU_CMD_RESOURCE_UNMAP_BLOB
121+ */
118122 VIRTIO_GPU_SHM_ID_HOST_VISIBLE = 1
119123 };
120124