From 65106f1bc6d6e773368803ff3ee351036892992a Mon Sep 17 00:00:00 2001 From: Vikash Garodia Date: Wed, 21 Aug 2019 19:41:16 +0530 Subject: [PATCH] msm: vidc: Remove cluster controls V4L controls are made to be part of a cluster when they are interdependent. If any one control in that cluster is updated, all the remaining controls get updated as well with the current control value. Existing video usecase does not require any v4l controls to be clustered. Hence removing the cluster controls. Change-Id: I98dfc4af5291837054a8a28b00942fea6866f0a9 Signed-off-by: Vikash Garodia --- msm/vidc/msm_vidc.c | 13 ++----------- msm/vidc/msm_vidc_common.c | 29 ----------------------------- msm/vidc/msm_vidc_internal.h | 6 ------ 3 files changed, 2 insertions(+), 46 deletions(-) diff --git a/msm/vidc/msm_vidc.c b/msm/vidc/msm_vidc.c index a77421da93e8..a3bb1e8850d6 100644 --- a/msm/vidc/msm_vidc.c +++ b/msm/vidc/msm_vidc.c @@ -1443,7 +1443,6 @@ static int msm_vidc_op_s_ctrl(struct v4l2_ctrl *ctrl) { int rc = 0; - unsigned int c = 0; struct msm_vidc_inst *inst; const char *ctrl_name = NULL; @@ -1459,17 +1458,9 @@ static int msm_vidc_op_s_ctrl(struct v4l2_ctrl *ctrl) return -EINVAL; } - for (c = 0; c < ctrl->ncontrols; ++c) { - if (ctrl->cluster[c]->is_new) { - rc = msm_vidc_try_set_ctrl(inst, ctrl->cluster[c]); - if (rc) { - dprintk(VIDC_ERR, "Failed setting %x\n", - ctrl->cluster[c]->id); - break; - } - } - } + rc = msm_vidc_try_set_ctrl(inst, ctrl); if (rc) { + dprintk(VIDC_ERR, "Failed setting %x\n", ctrl->id); ctrl_name = v4l2_ctrl_get_name(ctrl->id); dprintk(VIDC_ERR, "Failed setting control: Inst = %pK (%s)\n", inst, ctrl_name ? ctrl_name : "Invalid ctrl"); diff --git a/msm/vidc/msm_vidc_common.c b/msm/vidc/msm_vidc_common.c index f6b984f2dcc4..e7b4d24982d5 100644 --- a/msm/vidc/msm_vidc_common.c +++ b/msm/vidc/msm_vidc_common.c @@ -43,24 +43,6 @@ int msm_comm_g_ctrl_for_id(struct msm_vidc_inst *inst, int id) return ctrl->val; } -static struct v4l2_ctrl **get_super_cluster(struct msm_vidc_inst *inst, - int num_ctrls) -{ - int c = 0; - struct v4l2_ctrl **cluster = kmalloc(sizeof(struct v4l2_ctrl *) * - num_ctrls, GFP_KERNEL); - - if (!cluster || !inst) { - kfree(cluster); - return NULL; - } - - for (c = 0; c < num_ctrls; c++) - cluster[c] = inst->ctrls[c]; - - return cluster; -} - int msm_comm_hfi_to_v4l2(int id, int value) { switch (id) { @@ -658,16 +640,6 @@ int msm_comm_ctrl_init(struct msm_vidc_inst *inst, } inst->num_ctrls = num_ctrls; - /* Construct a super cluster of all controls */ - inst->cluster = get_super_cluster(inst, num_ctrls); - if (!inst->cluster) { - dprintk(VIDC_ERR, - "Failed to setup super cluster\n"); - return -EINVAL; - } - - v4l2_ctrl_cluster(num_ctrls, inst->cluster); - return ret_val; } @@ -679,7 +651,6 @@ int msm_comm_ctrl_deinit(struct msm_vidc_inst *inst) } kfree(inst->ctrls); - kfree(inst->cluster); v4l2_ctrl_handler_free(&inst->ctrl_handler); return 0; diff --git a/msm/vidc/msm_vidc_internal.h b/msm/vidc/msm_vidc_internal.h index c54bb0ea2cda..f30ae5fb1c0f 100644 --- a/msm/vidc/msm_vidc_internal.h +++ b/msm/vidc/msm_vidc_internal.h @@ -537,7 +537,6 @@ struct msm_vidc_inst { struct vidc_frame_data superframe_data[VIDC_SUPERFRAME_MAX]; struct v4l2_ctrl_handler ctrl_handler; struct completion completions[SESSION_MSG_END - SESSION_MSG_START + 1]; - struct v4l2_ctrl **cluster; struct v4l2_fh event_handler; struct msm_smem *extradata_handle; bool in_reconfig; @@ -582,11 +581,6 @@ struct msm_vidc_inst { extern struct msm_vidc_drv *vidc_driver; -struct msm_vidc_ctrl_cluster { - struct v4l2_ctrl **cluster; - struct list_head list; -}; - struct msm_vidc_ctrl { u32 id; char name[MAX_NAME_LENGTH];