Browse Source

Merge "video: driver: remove unused APIs and other fixes/cleanup"

qctecmdr 2 years ago
parent
commit
bac8dc98cd

+ 0 - 1
driver/platform/common/src/msm_vidc_platform.c

@@ -180,7 +180,6 @@ static struct vb2_ops msm_vb2_ops = {
 	.queue_setup                    = msm_vb2_queue_setup,
 	.start_streaming                = msm_vb2_start_streaming,
 	.buf_queue                      = msm_vb2_buf_queue,
-	.buf_cleanup                    = msm_vb2_buf_cleanup,
 	.stop_streaming                 = msm_vb2_stop_streaming,
 	.buf_out_validate               = msm_vb2_buf_out_validate,
 	.buf_request_complete           = msm_vb2_request_complete,

+ 0 - 3
driver/vidc/inc/msm_vidc_driver.h

@@ -560,11 +560,8 @@ int msm_vidc_num_buffers(struct msm_vidc_inst *inst,
 	enum msm_vidc_buffer_type type, enum msm_vidc_buffer_attributes attr);
 void core_lock(struct msm_vidc_core *core, const char *function);
 void core_unlock(struct msm_vidc_core *core, const char *function);
-bool core_lock_check(struct msm_vidc_core *core, const char *function);
 void inst_lock(struct msm_vidc_inst *inst, const char *function);
 void inst_unlock(struct msm_vidc_inst *inst, const char *function);
-bool inst_lock_check(struct msm_vidc_inst *inst, const char *function);
-bool client_lock_check(struct msm_vidc_inst *inst, const char *func);
 void client_lock(struct msm_vidc_inst *inst, const char *function);
 void client_unlock(struct msm_vidc_inst *inst, const char *function);
 int msm_vidc_update_bitstream_buffer_size(struct msm_vidc_inst *inst);

+ 0 - 1
driver/vidc/inc/msm_vidc_inst.h

@@ -137,7 +137,6 @@ struct msm_vidc_inst {
 	u32                                dpb_list_payload[MAX_DPB_LIST_ARRAY_SIZE];
 	bool                               input_dpb_list_enabled;
 	bool                               output_dpb_list_enabled;
-	u32                                max_map_output_count;
 	u32                                auto_framerate;
 	u32                                max_rate;
 	bool                               has_bframe;

+ 0 - 1
driver/vidc/inc/msm_vidc_internal.h

@@ -202,7 +202,6 @@ enum msm_vidc_metadata_bits {
 #define SW_PC_DELAY_VALUE             (HW_RESPONSE_TIMEOUT_VALUE + 500)
 #define FW_UNLOAD_DELAY_VALUE         (SW_PC_DELAY_VALUE + 1500)
 
-#define MAX_MAP_OUTPUT_COUNT 64
 #define MAX_DPB_COUNT 32
  /*
   * max dpb count in firmware = 16

+ 0 - 1
driver/vidc/inc/msm_vidc_vb2.h

@@ -43,7 +43,6 @@ int msm_vidc_stop_streaming(struct msm_vidc_inst *inst, struct vb2_queue *q);
 int msm_vb2_start_streaming(struct vb2_queue *q, unsigned int count);
 void msm_vb2_stop_streaming(struct vb2_queue *q);
 void msm_vb2_buf_queue(struct vb2_buffer *vb2);
-void msm_vb2_buf_cleanup(struct vb2_buffer *vb);
 int msm_vb2_buf_out_validate(struct vb2_buffer *vb);
 void msm_vb2_request_complete(struct vb2_buffer *vb);
 #endif // _MSM_VIDC_VB2_H_

+ 0 - 46
driver/vidc/src/msm_vdec.c

@@ -1759,39 +1759,6 @@ static int msm_vdec_subscribe_output_port_settings_change(struct msm_vidc_inst *
 	return rc;
 }
 
-static int msm_vdec_update_max_map_output_count(struct msm_vidc_inst *inst)
-{
-	int rc = 0;
-	struct v4l2_format *f;
-	u32 width, height, count;
-
-	f = &inst->fmts[OUTPUT_PORT];
-	width = f->fmt.pix_mp.width;
-	height = f->fmt.pix_mp.height;
-
-	/*
-	 * adjust max map output count based on resolution
-	 * to enhance performance.
-	 * For 8K session: count = 20
-	 * For 4K session: count = 32
-	 * For 1080p session: count = 48
-	 * For all remaining sessions: count = 64
-	 */
-	if (res_is_greater_than(width, height, 4096, 2160))
-		count = 20;
-	else if (res_is_greater_than(width, height, 1920, 1080))
-		count = 32;
-	else if (res_is_greater_than(width, height, 1280, 720))
-		count = 48;
-	else
-		count = 64;
-
-	inst->max_map_output_count = count;
-	i_vpr_h(inst, "%s: count: %d\n", __func__, inst->max_map_output_count);
-
-	return rc;
-}
-
 int msm_vdec_streamon_output(struct msm_vidc_inst *inst)
 {
 	int rc = 0;
@@ -1816,10 +1783,6 @@ int msm_vdec_streamon_output(struct msm_vidc_inst *inst)
 	if (rc)
 		goto error;
 
-	rc = msm_vdec_update_max_map_output_count(inst);
-	if (rc)
-		goto error;
-
 	rc = msm_vdec_set_output_properties(inst);
 	if (rc)
 		goto error;
@@ -1973,13 +1936,6 @@ static int msm_vdec_release_nonref_buffers(struct msm_vidc_inst *inst)
 	int i = 0;
 	bool found = false;
 
-	/*
-	 * if DPB_LIST subscribed on output port then driver need to
-	 * hold MAX_BPB_COUNT of read only buffer at least.
-	 */
-	if (!inst->output_dpb_list_enabled)
-		goto release_buffers;
-
 	/* count read_only buffers which are not pending release in read_only list */
 	list_for_each_entry(ro_buf, &inst->buffers.read_only.list, list) {
 		if (!(ro_buf->attr & MSM_VIDC_ATTR_READ_ONLY))
@@ -2025,7 +1981,6 @@ static int msm_vdec_release_nonref_buffers(struct msm_vidc_inst *inst)
 	i_vpr_l(inst, "%s: fw ro buf count %d, non-ref ro count %d\n",
 		__func__, fw_ro_count, nonref_ro_count);
 
-release_buffers:
 	/* release the eligible buffers as per above condition */
 	list_for_each_entry(ro_buf, &inst->buffers.read_only.list, list) {
 		found = false;
@@ -2704,7 +2659,6 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst)
 			inst->buffers.output.min_count +
 			inst->buffers.output.extra_count;
 	inst->buffers.output.size = f->fmt.pix_mp.plane_fmt[0].sizeimage;
-	inst->max_map_output_count = MAX_MAP_OUTPUT_COUNT;
 	inst->fw_min_count = 0;
 
 	f = &inst->fmts[OUTPUT_META_PORT];

+ 2 - 17
driver/vidc/src/msm_vidc_driver.c

@@ -4520,11 +4520,6 @@ void put_inst(struct msm_vidc_inst *inst)
 	kref_put(&inst->kref, msm_vidc_close_helper);
 }
 
-bool core_lock_check(struct msm_vidc_core *core, const char *func)
-{
-	return mutex_is_locked(&core->lock);
-}
-
 void core_lock(struct msm_vidc_core *core, const char *function)
 {
 	mutex_lock(&core->lock);
@@ -4535,11 +4530,6 @@ void core_unlock(struct msm_vidc_core *core, const char *function)
 	mutex_unlock(&core->lock);
 }
 
-bool inst_lock_check(struct msm_vidc_inst *inst, const char *func)
-{
-	return mutex_is_locked(&inst->lock);
-}
-
 void inst_lock(struct msm_vidc_inst *inst, const char *function)
 {
 	mutex_lock(&inst->lock);
@@ -4550,11 +4540,6 @@ void inst_unlock(struct msm_vidc_inst *inst, const char *function)
 	mutex_unlock(&inst->lock);
 }
 
-bool client_lock_check(struct msm_vidc_inst *inst, const char *func)
-{
-	return mutex_is_locked(&inst->client_lock);
-}
-
 void client_lock(struct msm_vidc_inst *inst, const char *function)
 {
 	mutex_lock(&inst->client_lock);
@@ -4752,7 +4737,7 @@ int msm_vidc_update_debug_str(struct msm_vidc_inst *inst)
 	return 0;
 }
 
-static int msm_vidc_print_insts_info(struct msm_vidc_core *core)
+static int msm_vidc_print_running_instances_info(struct msm_vidc_core *core)
 {
 	struct msm_vidc_inst *inst;
 	u32 height, width, fps, orate;
@@ -5301,7 +5286,7 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
 exit:
 	if (rc) {
 		i_vpr_e(inst, "%s: current session not supported\n", __func__);
-		msm_vidc_print_insts_info(inst->core);
+		msm_vidc_print_running_instances_info(inst->core);
 	}
 
 	return rc;

+ 0 - 4
driver/vidc/src/msm_vidc_vb2.c

@@ -683,10 +683,6 @@ unlock:
 	put_inst(inst);
 }
 
-void msm_vb2_buf_cleanup(struct vb2_buffer *vb)
-{
-}
-
 int msm_vb2_buf_out_validate(struct vb2_buffer *vb)
 {
 	struct vb2_v4l2_buffer *vbuf;