drm-misc-next for v5.3, try #2: UAPI Changes: - Add HDR source metadata property. - Make drm.h compile on GNU/kFreeBSD by including stdint.h - Clarify how the userspace reviewer has to review new kernel UAPI. - Clarify that for using new UAPI, merging to drm-next or drm-misc-next should be enough. Cross-subsystem Changes: - video/hdmi: Add unpack function for DRM infoframes. - Device tree bindings: * Updating a property for Mali Midgard GPUs * Updating a property for STM32 DSI panel * Adding support for FriendlyELEC HD702E 800x1280 panel * Adding support for Evervision VGG804821 800x480 5.0" WVGA TFT panel * Adding support for the EDT ET035012DM6 3.5" 320x240 QVGA 24-bit RGB TFT. * Adding support for Three Five displays TFC S9700RTWV43TR-01B 800x480 panel with resistive touch found on TI's AM335X-EVM. * Adding support for EDT ETM0430G0DH6 480x272 panel. - Add OSD101T2587-53TS driver with DT bindings. - Add Samsung S6E63M0 panel driver with DT bindings. - Add VXT VL050-8048NT-C01 800x480 panel with DT bindings. - Dma-buf: - Make mmap callback actually optional. - Documentation updates. - Fix debugfs refcount inbalance. - Remove unused sync_dump function. - Fix device tree bindings in drm-misc-next after a botched merge. Core Changes: - Add support for HDR infoframes and related EDID parsing. - Remove prime sg_table caching, now done inside dma-buf. - Add shiny new drm_gem_vram helpers for simple VRAM drivers; with some fixes to the new API on top. - Small fix to job cleanup without timeout handler. - Documentation fixes to drm_fourcc. - Replace lookups of drm_format with struct drm_format_info; remove functions that become obsolete by this conversion. - Remove double include in bridge/panel.c and some drivers. - Remove drmP.h include from drm/edid and drm/dp. - Fix null pointer deref in drm_fb_helper_hotplug_event(). - Remove most members from drm_fb_helper_crtc, only mode_set is kept. - Remove race of fb helpers with userspace; only restore mode when userspace is not master. - Move legacy setup from drm_file.c to drm_legacy_misc.c - Rework scheduler job destruction. - drm/bus was removed, remove from TODO. - Add __drm_atomic_helper_crtc_reset() to subclass crtc_state, and convert some drivers to use it (conversion is not complete yet). - Bump vblank timeout wait to 100 ms for atomic. - Docbook fix for drm_hdmi_infoframe_set_hdr_metadata. Driver Changes: - sun4i: Use DRM_GEM_CMA_VMAP_DRIVER_OPS instead of definining manually. - v3d: Small cleanups, adding support for compute shaders, reservation/synchronization fixes and job management refactoring, fixes MMU and debugfs. - lima: Fix null pointer in irq handler on startup, set default timeout for scheduled jobs. - stm/ltdc: Assorted fixes and adding FB modifier support. - amdgpu: Avoid hw reset if guilty job was already signaled. - virtio: Add seqno to fences, add trace events, use correct flags for fence allocation. - Convert AST, bochs, mgag200, vboxvideo, hisilicon to the new drm_gem_vram API. - sun6i_mipi_dsi: Support DSI GENERIC_SHORT_WRITE_2 transfers. - bochs: Small fix to use PTR_RET_OR_ZERO and driver unload. - gma500: header fixes - cirrus: Remove unused files. - mediatek: Fix compiler warning after merging the HDR series. - vc4: Rework binner bo handling. Signed-off-by: Dave Airlie <airlied@redhat.com>
Showing the changes to include/linux (2 of 220 files). Show all
Unified · Split
| @@ -39,18 +39,20 @@ struct dma_buf_attachment; · 38 unmodified lines | ||
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | 41 | * struct dma_buf_ops - operations possible on struct dma_buf |
| 42 | − * @map_atomic: [optional] maps a page from the buffer into kernel address | |
| 43 | − * space, users may not block until the subsequent unmap call. | |
| 44 | − * This callback must not sleep. | |
| 45 | − * @unmap_atomic: [optional] unmaps a atomically mapped page from the buffer. | |
| 46 | − * This Callback must not sleep. | |
| 47 | − * @map: [optional] maps a page from the buffer into kernel address space. | |
| 48 | − * @unmap: [optional] unmaps a page from the buffer. | |
| 49 | 42 | * @vmap: [optional] creates a virtual mapping for the buffer into kernel |
| 50 | 43 | * address space. Same restrictions as for vmap and friends apply. |
| 51 | 44 | * @vunmap: [optional] unmaps a vmap from the buffer |
| 52 | 45 | */ |
| 53 | 46 | struct dma_buf_ops { |
| 47 | + /** | |
| 48 | + * @cache_sgt_mapping: | |
| 49 | + * | |
| 50 | + * If true the framework will cache the first mapping made for each | |
| 51 | + * attachment. This avoids creating mappings for attachments multiple | |
| 52 | + * times. | |
| 53 | + */ | |
| 54 | + bool cache_sgt_mapping; | |
| 55 | + | |
| 54 | 56 | /** |
| 55 | 57 | * @attach: |
| 56 | 58 | * |
| @@ -205,8 +207,6 @@ struct dma_buf_ops { · 148 unmodified lines | ||
| 205 | 207 | * to be restarted. |
| 206 | 208 | */ |
| 207 | 209 | int (*end_cpu_access)(struct dma_buf *, enum dma_data_direction); |
| 208 | − void *(*map)(struct dma_buf *, unsigned long); | |
| 209 | − void (*unmap)(struct dma_buf *, unsigned long, void *); | |
| 210 | 210 | |
| 211 | 211 | /** |
| 212 | 212 | * @mmap: |
| @@ -245,6 +245,31 @@ struct dma_buf_ops { · 32 unmodified lines | ||
| 245 | 245 | */ |
| 246 | 246 | int (*mmap)(struct dma_buf *, struct vm_area_struct *vma); |
| 247 | 247 | |
| 248 | + /** | |
| 249 | + * @map: | |
| 250 | + * | |
| 251 | + * Maps a page from the buffer into kernel address space. The page is | |
| 252 | + * specified by offset into the buffer in PAGE_SIZE units. | |
| 253 | + * | |
| 254 | + * This callback is optional. | |
| 255 | + * | |
| 256 | + * Returns: | |
| 257 | + * | |
| 258 | + * Virtual address pointer where requested page can be accessed. NULL | |
| 259 | + * on error or when this function is unimplemented by the exporter. | |
| 260 | + */ | |
| 261 | + void *(*map)(struct dma_buf *, unsigned long); | |
| 262 | + | |
| 263 | + /** | |
| 264 | + * @unmap: | |
| 265 | + * | |
| 266 | + * Unmaps a page from the buffer. Page offset and address pointer should | |
| 267 | + * be the same as the one passed to and returned by matching call to map. | |
| 268 | + * | |
| 269 | + * This callback is optional. | |
| 270 | + */ | |
| 271 | + void (*unmap)(struct dma_buf *, unsigned long, void *); | |
| 272 | + | |
| 248 | 273 | void *(*vmap)(struct dma_buf *); |
| 249 | 274 | void (*vunmap)(struct dma_buf *, void *vaddr); |
| 250 | 275 | }; |
| @@ -307,6 +332,8 @@ struct dma_buf { · 56 unmodified lines | ||
| 307 | 332 | * @dmabuf: buffer for this attachment. |
| 308 | 333 | * @dev: device attached to the buffer. |
| 309 | 334 | * @node: list of dma_buf_attachment. |
| 335 | + * @sgt: cached mapping. | |
| 336 | + * @dir: direction of cached mapping. | |
| 310 | 337 | * @priv: exporter specific attachment data. |
| 311 | 338 | * |
| 312 | 339 | * This structure holds the attachment information between the dma_buf buffer |
| @@ -322,6 +349,8 @@ struct dma_buf_attachment { · 9 unmodified lines | ||
| 322 | 349 | struct dma_buf *dmabuf; |
| 323 | 350 | struct device *dev; |
| 324 | 351 | struct list_head node; |
| 352 | + struct sg_table *sgt; | |
| 353 | + enum dma_data_direction dir; | |
| 325 | 354 | void *priv; |
| 326 | 355 | }; |
| 327 | 356 | |
| @@ -47,6 +47,7 @@ enum hdmi_infoframe_type { · 46 unmodified lines | ||
| 47 | 47 | HDMI_INFOFRAME_TYPE_AVI = 0x82, |
| 48 | 48 | HDMI_INFOFRAME_TYPE_SPD = 0x83, |
| 49 | 49 | HDMI_INFOFRAME_TYPE_AUDIO = 0x84, |
| 50 | + HDMI_INFOFRAME_TYPE_DRM = 0x87, | |
| 50 | 51 | }; |
| 51 | 52 | |
| 52 | 53 | #define HDMI_IEEE_OUI 0x000c03 |
| @@ -55,6 +56,7 @@ enum hdmi_infoframe_type { · 2 unmodified lines | ||
| 55 | 56 | #define HDMI_AVI_INFOFRAME_SIZE 13 |
| 56 | 57 | #define HDMI_SPD_INFOFRAME_SIZE 25 |
| 57 | 58 | #define HDMI_AUDIO_INFOFRAME_SIZE 10 |
| 59 | +#define HDMI_DRM_INFOFRAME_SIZE 26 | |
| 58 | 60 | |
| 59 | 61 | #define HDMI_INFOFRAME_SIZE(type) \ |
| 60 | 62 | (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE) |
| @@ -152,6 +154,17 @@ enum hdmi_content_type { · 91 unmodified lines | ||
| 152 | 154 | HDMI_CONTENT_TYPE_GAME, |
| 153 | 155 | }; |
| 154 | 156 | |
| 157 | +enum hdmi_metadata_type { | |
| 158 | + HDMI_STATIC_METADATA_TYPE1 = 1, | |
| 159 | +}; | |
| 160 | + | |
| 161 | +enum hdmi_eotf { | |
| 162 | + HDMI_EOTF_TRADITIONAL_GAMMA_SDR, | |
| 163 | + HDMI_EOTF_TRADITIONAL_GAMMA_HDR, | |
| 164 | + HDMI_EOTF_SMPTE_ST2084, | |
| 165 | + HDMI_EOTF_BT_2100_HLG, | |
| 166 | +}; | |
| 167 | + | |
| 155 | 168 | struct hdmi_avi_infoframe { |
| 156 | 169 | enum hdmi_infoframe_type type; |
| 157 | 170 | unsigned char version; |
| @@ -175,12 +188,37 @@ struct hdmi_avi_infoframe { · 17 unmodified lines | ||
| 175 | 188 | unsigned short right_bar; |
| 176 | 189 | }; |
| 177 | 190 | |
| 191 | +/* DRM Infoframe as per CTA 861.G spec */ | |
| 192 | +struct hdmi_drm_infoframe { | |
| 193 | + enum hdmi_infoframe_type type; | |
| 194 | + unsigned char version; | |
| 195 | + unsigned char length; | |
| 196 | + enum hdmi_eotf eotf; | |
| 197 | + enum hdmi_metadata_type metadata_type; | |
| 198 | + struct { | |
| 199 | + u16 x, y; | |
| 200 | + } display_primaries[3]; | |
| 201 | + struct { | |
| 202 | + u16 x, y; | |
| 203 | + } white_point; | |
| 204 | + u16 max_display_mastering_luminance; | |
| 205 | + u16 min_display_mastering_luminance; | |
| 206 | + u16 max_cll; | |
| 207 | + u16 max_fall; | |
| 208 | +}; | |
| 209 | + | |
| 178 | 210 | int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame); |
| 179 | 211 | ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer, |
| 180 | 212 | size_t size); |
| 181 | 213 | ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame, |
| 182 | 214 | void *buffer, size_t size); |
| 183 | 215 | int hdmi_avi_infoframe_check(struct hdmi_avi_infoframe *frame); |
| 216 | +int hdmi_drm_infoframe_init(struct hdmi_drm_infoframe *frame); | |
| 217 | +ssize_t hdmi_drm_infoframe_pack(struct hdmi_drm_infoframe *frame, void *buffer, | |
| 218 | + size_t size); | |
| 219 | +ssize_t hdmi_drm_infoframe_pack_only(const struct hdmi_drm_infoframe *frame, | |
| 220 | + void *buffer, size_t size); | |
| 221 | +int hdmi_drm_infoframe_check(struct hdmi_drm_infoframe *frame); | |
| 184 | 222 | |
| 185 | 223 | enum hdmi_spd_sdi { |
| 186 | 224 | HDMI_SPD_SDI_UNKNOWN, |
| @@ -320,6 +358,22 @@ struct hdmi_vendor_infoframe { · 133 unmodified lines | ||
| 320 | 358 | unsigned int s3d_ext_data; |
| 321 | 359 | }; |
| 322 | 360 | |
| 361 | +/* HDR Metadata as per 861.G spec */ | |
| 362 | +struct hdr_static_metadata { | |
| 363 | + __u8 eotf; | |
| 364 | + __u8 metadata_type; | |
| 365 | + __u16 max_cll; | |
| 366 | + __u16 max_fall; | |
| 367 | + __u16 min_cll; | |
| 368 | +}; | |
| 369 | + | |
| 370 | +struct hdr_sink_metadata { | |
| 371 | + __u32 metadata_type; | |
| 372 | + union { | |
| 373 | + struct hdr_static_metadata hdmi_type1; | |
| 374 | + }; | |
| 375 | +}; | |
| 376 | + | |
| 323 | 377 | int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame); |
| 324 | 378 | ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, |
| 325 | 379 | void *buffer, size_t size); |
| @@ -355,6 +409,7 @@ union hdmi_infoframe { · 29 unmodified lines | ||
| 355 | 409 | struct hdmi_spd_infoframe spd; |
| 356 | 410 | union hdmi_vendor_any_infoframe vendor; |
| 357 | 411 | struct hdmi_audio_infoframe audio; |
| 412 | + struct hdmi_drm_infoframe drm; | |
| 358 | 413 | }; |
| 359 | 414 | |
| 360 | 415 | ssize_t hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, |