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

Commit e09c3481 authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Mauro Carvalho Chehab
Browse files

[media] rcar-vin: fix bug in pixelformat selection



If the requested pixelformat is not supported fallback to the default
format, do not revert the entire format.

Signed-off-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 8afb72ed
Loading
Loading
Loading
Loading
+5 −12
Original line number Diff line number Diff line
@@ -206,7 +206,6 @@ static int __rvin_try_format(struct rvin_dev *vin,
			     struct v4l2_pix_format *pix,
			     struct rvin_source_fmt *source)
{
	const struct rvin_video_format *info;
	u32 rwidth, rheight, walign;
	int ret;

@@ -218,17 +217,11 @@ static int __rvin_try_format(struct rvin_dev *vin,
	if (pix->field == V4L2_FIELD_ANY)
		pix->field = vin->format.field;

	/*
	 * Retrieve format information and select the current format if the
	 * requested format isn't supported.
	 */
	info = rvin_format_from_pixel(pix->pixelformat);
	if (!info) {
		vin_dbg(vin, "Format %x not found, keeping %x\n",
			pix->pixelformat, vin->format.pixelformat);
		*pix = vin->format;
		pix->width = rwidth;
		pix->height = rheight;
	/* If requested format is not supported fallback to the default */
	if (!rvin_format_from_pixel(pix->pixelformat)) {
		vin_dbg(vin, "Format 0x%x not found, using default 0x%x\n",
			pix->pixelformat, RVIN_DEFAULT_FORMAT);
		pix->pixelformat = RVIN_DEFAULT_FORMAT;
	}

	/* Always recalculate */