1
0
Fork 0

MLK-16075-12 gpu: imx: dpu: common: Add helpers dpu_vproc_has/get_fetcheco_cap()

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>
pull/10/head
Liu Ying 2017-07-25 11:40:22 +08:00 committed by Jason Liu
parent 79d9ad555b
commit 80fb07bebb
3 changed files with 18 additions and 0 deletions

View 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;

View 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;

View 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);