video: driver: restrict image load to 16K x 16K

Add strict check in msm_vidc_check_mbpf_supported() to
reject image session, if total image load exceeds 16K.
Added msm_vidc_print_insts_info() support to print all
running instance info, if new session is rejected due
to mbpf/mbps checks.

Change-Id: I98bab985fcf4f4d20c6f263c48e0c701ec86ab6f
Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
Govindaraj Rajagopal
2021-05-28 20:29:44 +05:30
parent c1bf1d2bc9
commit b2e9fada31
7 changed files with 173 additions and 71 deletions

View File

@@ -135,12 +135,21 @@ static inline bool is_meta_enabled(struct msm_vidc_inst *inst, unsigned int type
return enabled;
}
static inline bool is_linear_colorformat(enum msm_vidc_colorformat_type colorformat)
static inline bool is_linear_yuv_colorformat(enum msm_vidc_colorformat_type colorformat)
{
return colorformat == MSM_VIDC_FMT_NV12 ||
colorformat == MSM_VIDC_FMT_NV21 ||
colorformat == MSM_VIDC_FMT_P010 ||
colorformat == MSM_VIDC_FMT_RGBA8888;
colorformat == MSM_VIDC_FMT_P010;
}
static inline bool is_linear_rgba_colorformat(enum msm_vidc_colorformat_type colorformat)
{
return colorformat == MSM_VIDC_FMT_RGBA8888;
}
static inline bool is_linear_colorformat(enum msm_vidc_colorformat_type colorformat)
{
return is_linear_yuv_colorformat(colorformat) || is_linear_rgba_colorformat(colorformat);
}
static inline bool is_ubwc_colorformat(enum msm_vidc_colorformat_type colorformat)
@@ -397,7 +406,7 @@ int msm_vidc_update_debug_str(struct msm_vidc_inst *inst);
void msm_vidc_allow_dcvs(struct msm_vidc_inst *inst);
bool msm_vidc_allow_decode_batch(struct msm_vidc_inst *inst);
int msm_vidc_check_session_supported(struct msm_vidc_inst *inst);
int msm_vidc_check_mbps_supported(struct msm_vidc_inst *inst);
int msm_vidc_check_core_mbps(struct msm_vidc_inst *inst);
int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst);
int msm_vidc_update_timestamp(struct msm_vidc_inst *inst, u64 timestamp);
int msm_vidc_calc_framerate(struct msm_vidc_inst *inst);