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

Commit 45b06915 authored by Vikash Garodia's avatar Vikash Garodia Committed by Pushkaraj Patil
Browse files

msm: vidc: update format during downscaling



When downscaling is enabled, update the port format
parameters based on port type.
Avoid updating the instance property during reconfig event
with sufficient resource. V4L2 Client expects downscaled
parameters rather than reconfig parameters.

Change-Id: I629a0b78a56806018976f7f82e8c526fef456ec9
CRs-Fixed: 629474
Signed-off-by: default avatarVikash Garodia <vgarodia@codeaurora.org>
parent eb7b84f4
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -1018,6 +1018,26 @@ int msm_vdec_g_fmt(struct msm_vidc_inst *inst, struct v4l2_format *f)
			f->fmt.pix_mp.plane_fmt[0].reserved[0] =
				(__u16)inst->prop.height[CAPTURE_PORT];
		}

		if (msm_comm_get_stream_output_mode(inst) ==
			HAL_VIDEO_DECODER_SECONDARY) {
			if (f->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
				f->fmt.pix_mp.height =
					inst->prop.height[CAPTURE_PORT];
				f->fmt.pix_mp.width =
					inst->prop.width[CAPTURE_PORT];
			} else if (f->type ==
					V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
				f->fmt.pix_mp.height =
					inst->prop.height[OUTPUT_PORT];
				f->fmt.pix_mp.width =
					inst->prop.width[OUTPUT_PORT];
				f->fmt.pix_mp.plane_fmt[0].bytesperline =
					(__u16)inst->prop.width[OUTPUT_PORT];
				f->fmt.pix_mp.plane_fmt[0].reserved[0] =
					(__u16)inst->prop.height[OUTPUT_PORT];
			}
		}
	} else {
		dprintk(VIDC_ERR,
			"Buf type not recognized, type = %d\n",
+15 −2
Original line number Diff line number Diff line
@@ -698,8 +698,21 @@ static void handle_event_change(enum command_response cmd, void *data)
		} else {
			dprintk(VIDC_DBG,
				"V4L2_EVENT_SEQ_CHANGED_SUFFICIENT\n");
			inst->prop.height[CAPTURE_PORT] = event_notify->height;
			inst->prop.width[CAPTURE_PORT] = event_notify->width;
			if (msm_comm_get_stream_output_mode(inst) !=
				HAL_VIDEO_DECODER_SECONDARY) {
				dprintk(VIDC_DBG,
					"event_notify->height = %d event_notify->width = %d\n",
					event_notify->height,
					event_notify->width);
				inst->prop.height[CAPTURE_PORT] =
					event_notify->height;
				inst->prop.width[CAPTURE_PORT] =
					event_notify->width;
				inst->prop.height[OUTPUT_PORT] =
					event_notify->height;
				inst->prop.width[OUTPUT_PORT] =
					event_notify->width;
			}
		}
		rc = msm_vidc_check_session_supported(inst);
		if (!rc) {