diff --git a/driver/platform/common/src/msm_vidc_platform.c b/driver/platform/common/src/msm_vidc_platform.c index d5b7b0fa30..8304f025db 100644 --- a/driver/platform/common/src/msm_vidc_platform.c +++ b/driver/platform/common/src/msm_vidc_platform.c @@ -2478,27 +2478,26 @@ int msm_vidc_adjust_session_priority(void *instance, struct v4l2_ctrl *ctrl) } /* * Priority handling - * Client will set 0 (realtime), 1+ (non-realtime) - * Driver adds NRT_PRIORITY_OFFSET (2) to clients non-realtime priority - * and hence PRIORITY values in the driver become 0, 3+. - * Driver may move decode realtime sessions to non-realtime by - * increasing priority by 1 to RT sessions in HW overloaded cases. - * So driver PRIORITY values can be 0, 1, 3+. + * Client will set 0 (realtime), (1 to 4) (non-realtime) * When driver setting priority to firmware, driver adds * FIRMWARE_PRIORITY_OFFSET (1) for all sessions except * non-critical sessions. So finally firmware priority values ranges * from 0 (Critical session), 1 (realtime session), - * 2+ (non-realtime session) + * (2 to 5) (non-realtime session). + * Driver may move decode realtime sessions to non-realtime by + * increasing priority by 1 to RT sessions in HW overloaded cases. + * Following will be priority based on requirement - + * ___________________________________________________________ + * | Description | HAL Value |Driver value|FW Value| + * |_________________|__________________|____________|________| + * |Critical Priority| Vendor Extension | Via control| 0 | + * | RT | 0 | 0 | 1 | + * | NRT | -1 to -4 | 1-4 | 2-5 | + * |_________________|__________________|____________|________| */ - if (ctrl) { - /* add offset when client sets non-realtime */ - if (ctrl->val) - adjusted_value = ctrl->val + NRT_PRIORITY_OFFSET; - else - adjusted_value = ctrl->val; - } else { - adjusted_value = inst->capabilities[PRIORITY].value; - } + + adjusted_value = ctrl ? ctrl->val : + inst->capabilities[PRIORITY].value; msm_vidc_update_cap_value(inst, PRIORITY, adjusted_value, __func__); diff --git a/driver/platform/kalama/src/msm_vidc_kalama.c b/driver/platform/kalama/src/msm_vidc_kalama.c index b6819eaea3..4d54aa3e45 100644 --- a/driver/platform/kalama/src/msm_vidc_kalama.c +++ b/driver/platform/kalama/src/msm_vidc_kalama.c @@ -1589,7 +1589,7 @@ static struct msm_platform_inst_capability instance_cap_data_kalama[] = { CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED}, {PRIORITY, DEC|ENC, CODECS_ALL, - 0, 1 + NRT_PRIORITY_OFFSET, 1, 1 + NRT_PRIORITY_OFFSET, + 0, 4, 1, 4, V4L2_CID_MPEG_VIDC_PRIORITY, HFI_PROP_SESSION_PRIORITY, CAP_FLAG_DYNAMIC_ALLOWED}, diff --git a/driver/platform/pineapple/src/msm_vidc_pineapple.c b/driver/platform/pineapple/src/msm_vidc_pineapple.c index 71070fea27..32717fae26 100644 --- a/driver/platform/pineapple/src/msm_vidc_pineapple.c +++ b/driver/platform/pineapple/src/msm_vidc_pineapple.c @@ -1693,7 +1693,7 @@ static struct msm_platform_inst_capability instance_cap_data_pineapple[] = { CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED}, {PRIORITY, DEC|ENC, CODECS_ALL, - 0, 1 + NRT_PRIORITY_OFFSET, 1, 1 + NRT_PRIORITY_OFFSET, + 0, 4, 1, 4, V4L2_CID_MPEG_VIDC_PRIORITY, HFI_PROP_SESSION_PRIORITY, CAP_FLAG_DYNAMIC_ALLOWED}, diff --git a/driver/platform/waipio/src/waipio.c b/driver/platform/waipio/src/waipio.c index f78e1b6804..9c6d802653 100644 --- a/driver/platform/waipio/src/waipio.c +++ b/driver/platform/waipio/src/waipio.c @@ -1208,7 +1208,7 @@ static struct msm_platform_inst_capability instance_cap_data_waipio[] = { CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED}, {PRIORITY, DEC|ENC, CODECS_ALL, - 0, 1 + NRT_PRIORITY_OFFSET, 1, 1 + NRT_PRIORITY_OFFSET, + 0, 4, 1, 4, 0, HFI_PROP_SESSION_PRIORITY, CAP_FLAG_DYNAMIC_ALLOWED},