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

Commit 50afcdfb authored by Ravi Kiran Vonteddu's avatar Ravi Kiran Vonteddu
Browse files

msm: vidc: Check maximum width capability of Q6



Maximum width capability check is required to take
care of indefinite behavior when a clip having width
more than Q6 capability is played. Also, make the
capability check generic for Q6 and Venus.

Change-Id: Ic10be0ad4434019fea45e7a090b21ba5cf54d9a6
CRs-fixed: 626642
Signed-off-by: default avatarRavi Kiran Vonteddu <rvontedd@codeaurora.org>
parent 792ce78d
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -3488,12 +3488,13 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
				capability->height.min);
			rc = -ENOTSUPP;
		}
		if (!rc) {
			rc = call_hfi_op(hdev, capability_check,
				inst->fmts[OUTPUT_PORT]->fourcc,
		if (!rc && (inst->prop.width[CAPTURE_PORT] >
			capability->width.max)) {
			dprintk(VIDC_ERR,
				"Unsupported width = %u supported max width = %u",
				inst->prop.width[CAPTURE_PORT],
				&capability->width.max,
				&capability->height.max);
				capability->width.max);
				rc = -ENOTSUPP;
		}

		if (!rc && (inst->prop.height[CAPTURE_PORT]
+0 −19
Original line number Diff line number Diff line
@@ -3895,24 +3895,6 @@ int venus_hfi_get_core_capabilities(void)
	return rc;
}

int venus_hfi_capability_check(u32 fourcc, u32 width,
		u32 *max_width, u32 *max_height)
{
	int rc = 0;
	if (!max_width || !max_height) {
		dprintk(VIDC_ERR, "%s - invalid parameter\n", __func__);
		return -EINVAL;
	}

	if (width > *max_width) {
		dprintk(VIDC_ERR,
		"Unsupported width = %u supported max width = %u\n",
		width, *max_width);
		rc = -ENOTSUPP;
	}
	return rc;
}

static void *venus_hfi_add_device(u32 device_id,
			struct msm_vidc_platform_resources *res,
			hfi_cmd_response_callback callback)
@@ -4068,7 +4050,6 @@ static void venus_init_hfi_callbacks(struct hfi_device *hdev)
	hdev->unload_fw = venus_hfi_unload_fw;
	hdev->get_fw_info = venus_hfi_get_fw_info;
	hdev->get_stride_scanline = venus_hfi_get_stride_scanline;
	hdev->capability_check = venus_hfi_capability_check;
	hdev->get_core_capabilities = venus_hfi_get_core_capabilities;
	hdev->power_enable = venus_hfi_power_enable;
}
+0 −2
Original line number Diff line number Diff line
@@ -1277,8 +1277,6 @@ struct hfi_device {
	int (*get_fw_info)(void *dev, enum fw_info info);
	int (*get_stride_scanline)(int color_fmt, int width,
		int height,	int *stride, int *scanlines);
	int (*capability_check)(u32 fourcc, u32 width,
		u32 *max_width, u32 *max_height);
	int (*session_clean)(void *sess);
	int (*get_core_capabilities)(void);
	int (*power_enable)(void *dev);