This patch adds helper fetchdecode_need_fetcheco() so that users may
check if a fetchdecode needs to use fetcheco for a specific pixel format.
Signed-off-by: Liu Ying <victor.liu@nxp.com>
}
EXPORT_SYMBOL_GPL(fetchdecode_get_fetcheco);
+bool fetchdecode_need_fetcheco(struct dpu_fetchdecode *fd, u32 fmt)
+{
+ struct dpu_fetcheco *fe = fetchdecode_get_fetcheco(fd);
+
+ if (IS_ERR_OR_NULL(fe))
+ return false;
+
+ switch (fmt) {
+ case DRM_FORMAT_NV12:
+ case DRM_FORMAT_NV21:
+ case DRM_FORMAT_NV16:
+ case DRM_FORMAT_NV61:
+ case DRM_FORMAT_NV24:
+ case DRM_FORMAT_NV42:
+ return true;
+ }
+
+ return false;
+}
+EXPORT_SYMBOL_GPL(fetchdecode_need_fetcheco);
+
struct dpu_hscaler *fetchdecode_get_hscaler(struct dpu_fetchdecode *fd)
{
struct dpu_soc *dpu = fd->dpu;
int fetchdecode_fetchtype(struct dpu_fetchdecode *fd, fetchtype_t *type);
shadow_load_req_t fetchdecode_to_shdldreq_t(struct dpu_fetchdecode *fd);
u32 fetchdecode_get_vproc_mask(struct dpu_fetchdecode *fd);
+bool fetchdecode_need_fetcheco(struct dpu_fetchdecode *fd, u32 fmt);
unsigned int fetchdecode_get_stream_id(struct dpu_fetchdecode *fd);
void fetchdecode_set_stream_id(struct dpu_fetchdecode *fd, unsigned int id);
struct dpu_fetchdecode *dpu_fd_get(struct dpu_soc *dpu, int id);