aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_fourcc.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2019-05-27 18:25:46 -0400
committerDave Airlie <airlied@redhat.com>2019-05-27 18:59:11 -0400
commit88cd7a2c1b29f61a2a3fab76216a43f3b779e0cd (patch)
treeb8a4311c8f7edfc92c1055b6a5a86b1a5552878e /include/drm/drm_fourcc.h
parentcd6c84d8f0cdc911df435bb075ba22ce3c605b07 (diff)
parent909fa3321d348ef69366aad9e84e1dd9ee0bd060 (diff)
Merge tag 'drm-misc-next-2019-05-24' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
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> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/052875a5-27ba-3832-60c2-193d950afdff@linux.intel.com
Diffstat (limited to 'include/drm/drm_fourcc.h')
-rw-r--r--include/drm/drm_fourcc.h50
1 files changed, 44 insertions, 6 deletions
diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h
index b3d9d88ab290..306d1efeb5e0 100644
--- a/include/drm/drm_fourcc.h
+++ b/include/drm/drm_fourcc.h
@@ -260,6 +260,50 @@ drm_format_info_is_yuv_sampling_444(const struct drm_format_info *info)
260 return info->is_yuv && info->hsub == 1 && info->vsub == 1; 260 return info->is_yuv && info->hsub == 1 && info->vsub == 1;
261} 261}
262 262
263/**
264 * drm_format_info_plane_width - width of the plane given the first plane
265 * @info: pixel format info
266 * @width: width of the first plane
267 * @plane: plane index
268 *
269 * Returns:
270 * The width of @plane, given that the width of the first plane is @width.
271 */
272static inline
273int drm_format_info_plane_width(const struct drm_format_info *info, int width,
274 int plane)
275{
276 if (!info || plane >= info->num_planes)
277 return 0;
278
279 if (plane == 0)
280 return width;
281
282 return width / info->hsub;
283}
284
285/**
286 * drm_format_info_plane_height - height of the plane given the first plane
287 * @info: pixel format info
288 * @height: height of the first plane
289 * @plane: plane index
290 *
291 * Returns:
292 * The height of @plane, given that the height of the first plane is @height.
293 */
294static inline
295int drm_format_info_plane_height(const struct drm_format_info *info, int height,
296 int plane)
297{
298 if (!info || plane >= info->num_planes)
299 return 0;
300
301 if (plane == 0)
302 return height;
303
304 return height / info->vsub;
305}
306
263const struct drm_format_info *__drm_format_info(u32 format); 307const struct drm_format_info *__drm_format_info(u32 format);
264const struct drm_format_info *drm_format_info(u32 format); 308const struct drm_format_info *drm_format_info(u32 format);
265const struct drm_format_info * 309const struct drm_format_info *
@@ -268,12 +312,6 @@ drm_get_format_info(struct drm_device *dev,
268uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth); 312uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth);
269uint32_t drm_driver_legacy_fb_format(struct drm_device *dev, 313uint32_t drm_driver_legacy_fb_format(struct drm_device *dev,
270 uint32_t bpp, uint32_t depth); 314 uint32_t bpp, uint32_t depth);
271int drm_format_num_planes(uint32_t format);
272int drm_format_plane_cpp(uint32_t format, int plane);
273int drm_format_horz_chroma_subsampling(uint32_t format);
274int drm_format_vert_chroma_subsampling(uint32_t format);
275int drm_format_plane_width(int width, uint32_t format, int plane);
276int drm_format_plane_height(int height, uint32_t format, int plane);
277unsigned int drm_format_info_block_width(const struct drm_format_info *info, 315unsigned int drm_format_info_block_width(const struct drm_format_info *info,
278 int plane); 316 int plane);
279unsigned int drm_format_info_block_height(const struct drm_format_info *info, 317unsigned int drm_format_info_block_height(const struct drm_format_info *info,