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

Commit b1be8db2 authored by Benjamin Chan's avatar Benjamin Chan Committed by Narendra Muppalla
Browse files

msm: sde: Reject 0 size image for SDE rotator



Rotator HW cannot support 0 dimension of input and output image. During
V4L2 validation, it must reject any 0 size image format setting.

CRs-Fixed: 1073633
Change-Id: I503561677271c39894b7a6910fe8d9c5c25e9c28
Signed-off-by: default avatarBenjamin Chan <bkchan@codeaurora.org>
parent dbec6bb5
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1123,6 +1123,13 @@ static int sde_rotator_try_fmt_vid_cap(struct file *file,
	struct sde_rotation_config config;
	int ret;

	if ((f->fmt.pix.width == 0) || (f->fmt.pix.height == 0)) {
		SDEDEV_WARN(ctx->rot_dev->dev,
				"Not supporting 0 width/height: %dx%d\n",
				f->fmt.pix.width, f->fmt.pix.height);
		return -EINVAL;
	}

	sde_rot_mgr_lock(rot_dev->mgr);
	sde_rotator_get_config_from_ctx(ctx, &config);
	config.output.format = f->fmt.pix.pixelformat;
@@ -1162,6 +1169,13 @@ static int sde_rotator_try_fmt_vid_out(struct file *file,
	struct sde_rotation_config config;
	int ret;

	if ((f->fmt.pix.width == 0) || (f->fmt.pix.height == 0)) {
		SDEDEV_WARN(ctx->rot_dev->dev,
				"Not supporting 0 width/height: %dx%d\n",
				f->fmt.pix.width, f->fmt.pix.height);
		return -EINVAL;
	}

	sde_rot_mgr_lock(rot_dev->mgr);
	sde_rotator_get_config_from_ctx(ctx, &config);
	config.input.format = f->fmt.pix.pixelformat;