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 <vgarodia@codeaurora.org>
This commit is contained in:
parent
c8be54f0a9
commit
65106f1bc6
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user