File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -5737,6 +5737,48 @@ int drm_format_vert_chroma_subsampling(uint32_t format)
57375737}
57385738EXPORT_SYMBOL (drm_format_vert_chroma_subsampling );
57395739
5740+ /**
5741+ * drm_format_plane_width - width of the plane given the first plane
5742+ * @width: width of the first plane
5743+ * @format: pixel format
5744+ * @plane: plane index
5745+ *
5746+ * Returns:
5747+ * The width of @plane, given that the width of the first plane is @width.
5748+ */
5749+ int drm_format_plane_width (int width , uint32_t format , int plane )
5750+ {
5751+ if (plane >= drm_format_num_planes (format ))
5752+ return 0 ;
5753+
5754+ if (plane == 0 )
5755+ return width ;
5756+
5757+ return width / drm_format_horz_chroma_subsampling (format );
5758+ }
5759+ EXPORT_SYMBOL (drm_format_plane_width );
5760+
5761+ /**
5762+ * drm_format_plane_height - height of the plane given the first plane
5763+ * @height: height of the first plane
5764+ * @format: pixel format
5765+ * @plane: plane index
5766+ *
5767+ * Returns:
5768+ * The height of @plane, given that the height of the first plane is @height.
5769+ */
5770+ int drm_format_plane_height (int height , uint32_t format , int plane )
5771+ {
5772+ if (plane >= drm_format_num_planes (format ))
5773+ return 0 ;
5774+
5775+ if (plane == 0 )
5776+ return height ;
5777+
5778+ return height / drm_format_vert_chroma_subsampling (format );
5779+ }
5780+ EXPORT_SYMBOL (drm_format_plane_height );
5781+
57405782/**
57415783 * drm_rotation_simplify() - Try to simplify the rotation
57425784 * @rotation: Rotation to be simplified
Original file line number Diff line number Diff line change @@ -2498,6 +2498,8 @@ extern int drm_format_num_planes(uint32_t format);
24982498extern int drm_format_plane_cpp (uint32_t format , int plane );
24992499extern int drm_format_horz_chroma_subsampling (uint32_t format );
25002500extern int drm_format_vert_chroma_subsampling (uint32_t format );
2501+ extern int drm_format_plane_width (int width , uint32_t format , int plane );
2502+ extern int drm_format_plane_height (int height , uint32_t format , int plane );
25012503extern const char * drm_get_format_name (uint32_t format );
25022504extern struct drm_property * drm_mode_create_rotation_property (struct drm_device * dev ,
25032505 unsigned int supported_rotations );
You can’t perform that action at this time.
0 commit comments