video: driver: Fix buffer type and region mapping

Fixed incorrect mapping and restructured code for readability.

Change-Id: Iaef5e780d168883ff2cc7b243b1bf3aa094e3df2
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
This commit is contained in:
Chinmay Sawarkar
2021-04-06 22:13:03 -07:00
parent d77900d9ab
commit 29f8295bae

View File

@@ -835,17 +835,27 @@ u32 msm_vidc_get_buffer_region(struct msm_vidc_inst *inst,
region = MSM_VIDC_NON_SECURE;
break;
case MSM_VIDC_BUF_OUTPUT:
if (is_decode_session(inst))
region = MSM_VIDC_NON_SECURE_PIXEL;
else
if (is_encode_session(inst))
region = MSM_VIDC_NON_SECURE;
else
region = MSM_VIDC_NON_SECURE_PIXEL;
break;
case MSM_VIDC_BUF_DPB:
region = MSM_VIDC_NON_SECURE_PIXEL;
break;
default:
case MSM_VIDC_BUF_INPUT_META:
case MSM_VIDC_BUF_OUTPUT_META:
case MSM_VIDC_BUF_BIN:
case MSM_VIDC_BUF_COMV:
case MSM_VIDC_BUF_NON_COMV:
case MSM_VIDC_BUF_LINE:
case MSM_VIDC_BUF_PERSIST:
case MSM_VIDC_BUF_VPSS:
region = MSM_VIDC_NON_SECURE;
break;
default:
i_vpr_e(inst, "%s: invalid driver buffer type %d\n",
func, buffer_type);
}
} else {
switch (buffer_type) {
@@ -865,19 +875,16 @@ u32 msm_vidc_get_buffer_region(struct msm_vidc_inst *inst,
case MSM_VIDC_BUF_OUTPUT_META:
region = MSM_VIDC_NON_SECURE;
break;
case MSM_VIDC_BUF_BIN:
region = MSM_VIDC_SECURE_BITSTREAM;
case MSM_VIDC_BUF_DPB:
case MSM_VIDC_BUF_VPSS:
region = MSM_VIDC_SECURE_PIXEL;
break;
case MSM_VIDC_BUF_BIN:
case MSM_VIDC_BUF_ARP:
case MSM_VIDC_BUF_COMV:
case MSM_VIDC_BUF_NON_COMV:
case MSM_VIDC_BUF_LINE:
region = MSM_VIDC_SECURE_NONPIXEL;
break;
case MSM_VIDC_BUF_DPB:
region = MSM_VIDC_SECURE_PIXEL;
break;
case MSM_VIDC_BUF_PERSIST:
case MSM_VIDC_BUF_ARP:
region = MSM_VIDC_SECURE_NONPIXEL;
break;
default: