@@ -153,6 +153,24 @@ bool ipu_pixelformat_is_planar(u32 pixelformat)
}
EXPORT_SYMBOL_GPL(ipu_pixelformat_is_planar);
+bool ipu_drm_fourcc_is_planar(u32 drm_fourcc)
+{
+ switch (drm_fourcc) {
+ case DRM_FORMAT_YUV420:
+ case DRM_FORMAT_YVU420:
+ case DRM_FORMAT_YUV422:
+ case DRM_FORMAT_YVU422:
+ case DRM_FORMAT_NV12:
+ case DRM_FORMAT_NV21:
+ case DRM_FORMAT_NV16:
+ case DRM_FORMAT_NV61:
+ return true;
+ }
+
+ return false;
+}
+EXPORT_SYMBOL_GPL(ipu_drm_fourcc_is_planar);
+
enum ipu_color_space ipu_mbus_code_to_colorspace(u32 mbus_code)
{
switch (mbus_code & 0xf000) {
@@ -380,6 +380,7 @@ enum ipu_color_space ipu_pixelformat_to_colorspace(u32 pixelformat);
enum ipu_color_space ipu_mbus_code_to_colorspace(u32 mbus_code);
int ipu_stride_to_bytes(u32 pixel_stride, u32 pixelformat);
bool ipu_pixelformat_is_planar(u32 pixelformat);
+bool ipu_drm_fourcc_is_planar(u32 drm_fourcc);
int ipu_degrees_to_rot_mode(enum ipu_rotate_mode *mode, int degrees,
bool hflip, bool vflip);
int ipu_rot_mode_to_degrees(int *degrees, enum ipu_rotate_mode mode,
Adds ipu_drm_fourcc_is_planar(), which is equivalent to ipu_pixelformat_is_planar() but accepts a drm fourcc format. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> --- drivers/gpu/ipu-v3/ipu-common.c | 18 ++++++++++++++++++ include/video/imx-ipu-v3.h | 1 + 2 files changed, 19 insertions(+)