From e98028956eb67708f01f224fec87246da7043b2c Mon Sep 17 00:00:00 2001 From: Priyanka Gujjula Date: Wed, 3 Jun 2020 15:36:44 +0530 Subject: [PATCH] msm: vidc: Ignore thumbnail session load Thumbnail sessions are considered to be non realtime sessions. Hence ignore the thumbnail sessions load on device while calculating the load and mark thumbnail sessions as perf session. Change-Id: Ifa89c2f670fa631b6805a5d796a04e07e294ca4c Signed-off-by: Priyanka Gujjula --- msm/vidc/msm_vidc.c | 7 ++++--- msm/vidc/msm_vidc_common.c | 15 ++++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/msm/vidc/msm_vidc.c b/msm/vidc/msm_vidc.c index bf40eeef23a8..180b6a39eb97 100644 --- a/msm/vidc/msm_vidc.c +++ b/msm/vidc/msm_vidc.c @@ -414,10 +414,11 @@ int msm_vidc_qbuf(void *instance, struct media_device *mdev, } /* - * set perf mode for image session buffers so that - * they will be processed quickly + * set perf mode for image and thumbnail session buffers + * so that they will be processed quickly */ - if (is_grid_session(inst) && b->type == INPUT_MPLANE) + if ((is_grid_session(inst) || is_thumbnail_session(inst)) + && b->type == INPUT_MPLANE) b->flags |= V4L2_BUF_FLAG_PERF_MODE; timestamp_us = (u64)((b->timestamp.tv_sec * 1000000ULL) + diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index 071e616eec90..d22a7c85d0ea 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -735,15 +735,20 @@ int msm_comm_get_inst_load(struct msm_vidc_inst *inst, * | Power Request Load = | * | res * max(op, fps)| * ----------------|----------------------------| - * NON-REALTIME/ | Admission Control Load = 0 | - * THUMBNAIL | Power Request Load = | + * NON-REALTIME | Admission Control Load = 0 | + * | Power Request Load = | * | res * max(op, fps)| * ----------------|----------------------------| + * THUMBNAIL | Always Load = 0 | + * | Perf mode added for | + * | thumbnail session buffers | + * | for faster decoding. | + * ----------------|----------------------------| */ - if ((is_thumbnail_session(inst) || - !is_realtime_session(inst)) && - quirks == LOAD_ADMISSION_CONTROL) { + if (is_thumbnail_session(inst) || + (!is_realtime_session(inst) && + quirks == LOAD_ADMISSION_CONTROL)) { load = 0; } else { load = msm_comm_get_mbs_per_sec(inst, quirks);