video: driver: Update session priority setting

Modify session priority controls -
  ___________________________________________________________
 |  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   |
 |_________________|__________________|____________|________|

Change-Id: I7b28109bde3968f38c2e3cc42cf4cf5dd195cc10
Signed-off-by: Vedang Nagar <quic_vnagar@quicinc.com>
This commit is contained in:
Vedang Nagar
2023-05-23 20:43:38 +05:30
parent fdc186d299
commit 3018f2c1d3
4 changed files with 18 additions and 19 deletions

View File

@@ -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__);

View File

@@ -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},

View File

@@ -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},

View File

@@ -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},