Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2f7549d authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Select UBWC statistic parameters appropriately"

parents e7da47f2 ff64a11f
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -114,14 +114,18 @@ static int fill_dynamic_stats(struct msm_vidc_inst *inst,
{
{
	struct recon_buf *binfo, *nextb;
	struct recon_buf *binfo, *nextb;
	struct vidc_input_cr_data *temp, *next;
	struct vidc_input_cr_data *temp, *next;
	u32 min_cf = 0, max_cf = 0;
	u32 max_cr = 0, max_cf = 0, max_input_cr = 0;
	u32 min_input_cr = 0, max_input_cr = 0, min_cr = 0, max_cr = 0;
	u32 min_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO;
	u32 min_input_cr = MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO;
	u32 min_cf = MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR;


	mutex_lock(&inst->reconbufs.lock);
	mutex_lock(&inst->reconbufs.lock);
	list_for_each_entry_safe(binfo, nextb, &inst->reconbufs.list, list) {
	list_for_each_entry_safe(binfo, nextb, &inst->reconbufs.list, list) {
		if (binfo->CR)
			min_cr = min(min_cr, binfo->CR);
			min_cr = min(min_cr, binfo->CR);
		max_cr = max(max_cr, binfo->CR);
		if (binfo->CF)
			min_cf = min(min_cf, binfo->CF);
			min_cf = min(min_cf, binfo->CF);
		max_cr = max(max_cr, binfo->CR);
		max_cf = max(max_cf, binfo->CF);
		max_cf = max(max_cf, binfo->CF);
	}
	}
	mutex_unlock(&inst->reconbufs.lock);
	mutex_unlock(&inst->reconbufs.lock);
+8 −0
Original line number Original line Diff line number Diff line
@@ -2035,6 +2035,7 @@ static void handle_session_flush(enum hal_command_response cmd, void *data)
	struct msm_vidc_cb_cmd_done *response = data;
	struct msm_vidc_cb_cmd_done *response = data;
	struct msm_vidc_inst *inst;
	struct msm_vidc_inst *inst;
	struct v4l2_event flush_event = {0};
	struct v4l2_event flush_event = {0};
	struct recon_buf *binfo;
	u32 *ptr = NULL;
	u32 *ptr = NULL;
	enum hal_flush flush_type;
	enum hal_flush flush_type;
	int rc;
	int rc;
@@ -2089,6 +2090,13 @@ static void handle_session_flush(enum hal_command_response cmd, void *data)
		goto exit;
		goto exit;
	}
	}


	mutex_lock(&inst->reconbufs.lock);
	list_for_each_entry(binfo, &inst->reconbufs.list, list) {
		binfo->CR = 0;
		binfo->CF = 0;
	}
	mutex_unlock(&inst->reconbufs.lock);

	dprintk(VIDC_DBG,
	dprintk(VIDC_DBG,
		"Notify flush complete, flush_type: %x\n", flush_type);
		"Notify flush complete, flush_type: %x\n", flush_type);
	v4l2_event_queue_fh(&inst->event_handler, &flush_event);
	v4l2_event_queue_fh(&inst->event_handler, &flush_event);