video: driver: Add debugfs support to disable synx v2 fence

Add debugfs support to disable synx fence falling back
to dma sw fence via parameter "msm_vidc_disable_synx_fence"

Change-Id: I46b4833c2dfabec95f5ff34a0aef42043f8f6f5c
Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
This commit is contained in:
Akshata Sahukar
2023-03-15 18:23:11 -07:00
committed by Gerrit - the friendly Code Review server
parent eaf80f36cb
commit 625745bf00
4 changed files with 33 additions and 27 deletions

View File

@@ -324,7 +324,7 @@ static struct msm_platform_core_capability core_data_pineapple[] = {
{ENC_AUTO_FRAMERATE, 1},
{DEVICE_CAPS, V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_META_CAPTURE |
V4L2_CAP_STREAMING},
{SUPPORTS_SYNX_FENCE, 0}, /* disabled temporarily */
{SUPPORTS_SYNX_FENCE, 1},
{SUPPORTS_REQUESTS, 1},
};

View File

@@ -39,6 +39,7 @@ extern int msm_vidc_ddr_bw;
extern int msm_vidc_llc_bw;
extern bool msm_vidc_fw_dump;
extern unsigned int msm_vidc_enable_bugon;
extern bool msm_vidc_disable_synx_fence;
/* do not modify the log message as it is used in test scripts */
#define FMT_STRING_SET_CTRL \

View File

@@ -124,6 +124,10 @@ module_param_cb(msm_vidc_fw_dump, &msm_vidc_fw_dump_fops, &g_core, 0644);
bool msm_vidc_lossless_encode = !true;
EXPORT_SYMBOL(msm_vidc_lossless_encode);
/* disabled synx fence by default temporarily */
bool msm_vidc_disable_synx_fence = !false;
EXPORT_SYMBOL(msm_vidc_disable_synx_fence);
bool msm_vidc_syscache_disable = !true;
EXPORT_SYMBOL(msm_vidc_syscache_disable);
@@ -398,6 +402,8 @@ struct dentry* msm_vidc_debugfs_init_drv(void)
&msm_vidc_syscache_disable);
debugfs_create_bool("lossless_encoding", 0644, dir,
&msm_vidc_lossless_encode);
debugfs_create_bool("disable_synx_v2_fence", 0644, dir,
&msm_vidc_disable_synx_fence);
debugfs_create_u32("enable_bugon", 0644, dir,
&msm_vidc_enable_bugon);

View File

@@ -568,38 +568,37 @@ static int msm_vidc_component_master_bind(struct device *dev)
return rc;
}
/* register for synx fence */
if (core->capabilities[SUPPORTS_SYNX_FENCE].value) {
rc = call_fence_op(core, fence_register, core);
if (rc) {
d_vpr_e("%s: failed to register synx fence\n",
__func__);
core->capabilities[SUPPORTS_SYNX_FENCE].value = 0;
/*
* - Bail out the session for time being for this
* case where synx fence register call retunrs error
* to help with debugging
* - Re-initialize fence ops with dma_fence_ops.
* This is required once we start ignoring this
* synx fence register call error.
*/
if (msm_vidc_disable_synx_fence) {
/* override synx fence ops with dma fence ops */
core->fence_ops = get_dma_fence_ops();
if (!core->fence_ops) {
d_vpr_e("%s: invalid dma fence ops\n", __func__);
return -EINVAL;
}
return rc;
}
} else {
/*
* override synx fence ops with dma fence ops for
* time being until synx fence support is enabled
*/
core->fence_ops = get_dma_fence_ops();
if (!core->fence_ops) {
d_vpr_e("%s: invalid dma fence ops\n", __func__);
return -EINVAL;
core->capabilities[SUPPORTS_SYNX_FENCE].value = 0;
} else {
/* register for synx fence */
rc = call_fence_op(core, fence_register, core);
if (rc) {
d_vpr_e("%s: failed to register synx fence\n",
__func__);
core->capabilities[SUPPORTS_SYNX_FENCE].value = 0;
/*
* - Bail out the session for time being for this
* case where synx fence register call retunrs error
* to help with debugging
* - Re-initialize fence ops with dma_fence_ops.
* This is required once we start ignoring this
* synx fence register call error.
*/
core->fence_ops = get_dma_fence_ops();
if (!core->fence_ops) {
d_vpr_e("%s: invalid dma fence ops\n", __func__);
return -EINVAL;
}
return rc;
}
}
}