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

Commit b56b4bf3 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: Fix downscaling check for HEIC"

parents 975aa1ba e62d012d
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -2361,6 +2361,17 @@ int msm_comm_vb2_buffer_done(struct msm_vidc_inst *inst,
	return 0;
}

static bool is_heic_encode_session(struct msm_vidc_inst *inst)
{
	if (inst->session_type == MSM_VIDC_ENCODER &&
		(get_hal_codec(inst->fmts[CAPTURE_PORT].fourcc) ==
		HAL_VIDEO_CODEC_HEVC) &&
		(inst->img_grid_dimension > 0))
		return true;
	else
		return false;
}

static bool is_eos_buffer(struct msm_vidc_inst *inst, u32 device_addr)
{
	struct eos_buf *temp, *next;
@@ -2406,10 +2417,7 @@ static void handle_ebd(enum hal_command_response cmd, void *data)
	}

	empty_buf_done = (struct vidc_hal_ebd *)&response->input_done;
	if (inst->session_type == MSM_VIDC_ENCODER &&
		(get_hal_codec(inst->fmts[CAPTURE_PORT].fourcc) ==
			HAL_VIDEO_CODEC_HEVC) &&
		(inst->img_grid_dimension > 0) &&
	if (is_heic_encode_session(inst) &&
		(empty_buf_done->input_tag < inst->tinfo.count - 1)) {
		dprintk(VIDC_DBG, "Wait for last tile. Current tile no: %d\n",
		empty_buf_done->input_tag);
@@ -4434,10 +4442,7 @@ int msm_comm_qbuf(struct msm_vidc_inst *inst, struct msm_vidc_buffer *mbuf)
		for (c = 0; c < etbs.count; ++c) {
			struct vidc_frame_data *frame_data = &etbs.data[c];

			if (inst->session_type == MSM_VIDC_ENCODER &&
				get_hal_codec(inst->fmts[CAPTURE_PORT].fourcc)
				 == HAL_VIDEO_CODEC_HEVC &&
				(inst->img_grid_dimension > 0)) {
			if (is_heic_encode_session(inst)) {
				rc = msm_comm_qbuf_heic_tiles(inst, frame_data);
				if (rc) {
					dprintk(VIDC_ERR,
@@ -5515,6 +5520,11 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst)
	u32 input_height, input_width, output_height, output_width;
	u32 rotation;

	if (is_heic_encode_session(inst)) {
		dprintk(VIDC_DBG, "Skip downscale check for HEIC\n");
		return 0;
	}

	input_height = inst->prop.height[OUTPUT_PORT];
	input_width = inst->prop.width[OUTPUT_PORT];
	output_height = inst->prop.height[CAPTURE_PORT];