MLK-16075-12 gpu: imx: dpu: common: Add helpers dpu_vproc_has/get_fetcheco_cap()
authorLiu Ying <victor.liu@nxp.com>
Tue, 25 Jul 2017 03:40:22 +0000 (11:40 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:33:51 +0000 (15:33 -0500)
This patch adds helpers dpu_vproc_has/get_fetcheco_cap() support
so that the users may check if a video processing mask has fetcheco
capability or get the fetcheco capability from the mask.
We currently only support fetcheco0 and fetcheco1.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/gpu/imx/dpu/dpu-common.c
drivers/gpu/imx/dpu/dpu-prv.h
include/video/dpu.h

index 477c256..5ab02e2 100644 (file)
@@ -549,6 +549,12 @@ static const struct of_device_id dpu_dt_ids[] = {
 };
 MODULE_DEVICE_TABLE(of, dpu_dt_ids);
 
+bool dpu_vproc_has_fetcheco_cap(u32 cap_mask)
+{
+       return !!(cap_mask & DPU_VPROC_CAP_FETCHECO);
+}
+EXPORT_SYMBOL_GPL(dpu_vproc_has_fetcheco_cap);
+
 bool dpu_vproc_has_hscale_cap(u32 cap_mask)
 {
        return !!(cap_mask & DPU_VPROC_CAP_HSCALE);
@@ -561,6 +567,12 @@ bool dpu_vproc_has_vscale_cap(u32 cap_mask)
 }
 EXPORT_SYMBOL_GPL(dpu_vproc_has_vscale_cap);
 
+u32 dpu_vproc_get_fetcheco_cap(u32 cap_mask)
+{
+       return cap_mask & DPU_VPROC_CAP_FETCHECO;
+}
+EXPORT_SYMBOL_GPL(dpu_vproc_get_fetcheco_cap);
+
 u32 dpu_vproc_get_hscale_cap(u32 cap_mask)
 {
        return cap_mask & DPU_VPROC_CAP_HSCALE;
index e6ea910..5f22cfb 100644 (file)
@@ -139,11 +139,15 @@ enum {
 #define DPU_VPROC_CAP_VSCALER4 BIT(1)
 #define DPU_VPROC_CAP_HSCALER5 BIT(2)
 #define DPU_VPROC_CAP_VSCALER5 BIT(3)
+#define DPU_VPROC_CAP_FETCHECO0        BIT(4)
+#define DPU_VPROC_CAP_FETCHECO1        BIT(5)
 
 #define DPU_VPROC_CAP_HSCALE   (DPU_VPROC_CAP_HSCALER4 | \
                                 DPU_VPROC_CAP_HSCALER5)
 #define DPU_VPROC_CAP_VSCALE   (DPU_VPROC_CAP_VSCALER4 | \
                                 DPU_VPROC_CAP_VSCALER5)
+#define DPU_VPROC_CAP_FETCHECO (DPU_VPROC_CAP_FETCHECO0 | \
+                                DPU_VPROC_CAP_FETCHECO1)
 
 struct dpu_unit {
        char *name;
index 1ac4a07..a576bd1 100644 (file)
@@ -631,9 +631,11 @@ void dpu_vs_put(struct dpu_vscaler *vs);
 struct dpu_hscaler *fetchdecode_get_hscaler(struct dpu_fetchdecode *fd);
 struct dpu_vscaler *fetchdecode_get_vscaler(struct dpu_fetchdecode *fd);
 
+bool dpu_vproc_has_fetcheco_cap(u32 cap_mask);
 bool dpu_vproc_has_hscale_cap(u32 cap_mask);
 bool dpu_vproc_has_vscale_cap(u32 cap_mask);
 
+u32 dpu_vproc_get_fetcheco_cap(u32 cap_mask);
 u32 dpu_vproc_get_hscale_cap(u32 cap_mask);
 u32 dpu_vproc_get_vscale_cap(u32 cap_mask);