This patch adds helpers dpu_format_horz/vert_chroma_subsampling() to
get horizontal or vertical sub-samplings of pixel formats which are
supported by the current dpu base driver.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
}
EXPORT_SYMBOL_GPL(dpu_vproc_get_vscale_cap);
+int dpu_format_horz_chroma_subsampling(u32 format)
+{
+ switch (format) {
+ case DRM_FORMAT_YUYV:
+ case DRM_FORMAT_UYVY:
+ case DRM_FORMAT_NV12:
+ case DRM_FORMAT_NV21:
+ case DRM_FORMAT_NV16:
+ case DRM_FORMAT_NV61:
+ return 2;
+ default:
+ return 1;
+ }
+}
+
+int dpu_format_vert_chroma_subsampling(u32 format)
+{
+ switch (format) {
+ case DRM_FORMAT_NV12:
+ case DRM_FORMAT_NV21:
+ return 2;
+ default:
+ return 1;
+ }
+}
+
#define DPU_UNIT_INIT(dpu, base, unit, name, id, pec_ofs, ofs) \
{ \
int ret; \
struct dpu_vscaler *vs_priv[3];
};
+int dpu_format_horz_chroma_subsampling(u32 format);
+int dpu_format_vert_chroma_subsampling(u32 format);
+
#define DECLARE_DPU_UNIT_INIT_FUNC(block) \
int dpu_##block##_init(struct dpu_soc *dpu, unsigned int id, \
unsigned long pec_base, unsigned long base)