Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605511

Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in sink set_fmt

From Russell King - ARM Linux <linux@armlinux.org.uk>
Newsgroups linux.kernel
Subject Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in sink set_fmt
Date 2017-03-21 12:30 +0100
Message-ID <tnq9b-2CM-9@gated-at.bofh.it> (permalink)
References (4 earlier) <tn4s2-4zk-13@gated-at.bofh.it> <tn4Lo-4J7-35@gated-at.bofh.it> <tn6tQ-5Wi-29@gated-at.bofh.it> <tn6tQ-5Wi-27@gated-at.bofh.it> <tn9i1-7Yx-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Mar 20, 2017 at 06:23:24PM +0100, Philipp Zabel wrote:
> @@ -1173,15 +1196,8 @@ static void csi_try_fmt(struct csi_priv *priv,
>  		incc = imx_media_find_mbus_format(infmt->code,
>  						  CS_SEL_ANY, true);
>  
> -		if (sdformat->format.width < priv->crop.width * 3 / 4)
> -			sdformat->format.width = priv->crop.width / 2;
> -		else
> -			sdformat->format.width = priv->crop.width;
> -
> -		if (sdformat->format.height < priv->crop.height * 3 / 4)
> -			sdformat->format.height = priv->crop.height / 2;
> -		else
> -			sdformat->format.height = priv->crop.height;
> +		sdformat->format.width = compose->width;
> +		sdformat->format.height = compose->height;
>  
>  		if (incc->bayer) {
>  			sdformat->format.code = infmt->code;

We need to do more in here, because right now setting the source pads
overwrites the colorimetry etc information.  Maybe something like the
below?  I'm wondering if it would be a saner approach to copy the
sink format and update the parameters that can be changed, rather than
trying to list all the parameters that shouldn't be changed.  What if
the format structure gains a new member?

diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index 1492b92e1970..756204ced53c 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -1221,6 +1221,12 @@ static void csi_try_fmt(struct csi_priv *priv,
 			sdformat->format.field =  (infmt->height == 480) ?
 				V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT;
 		}
+
+		/* copy settings we can't change */
+		sdformat->format.colorspace = infmt->colorspace;
+		sdformat->format.ycbcr_enc = infmt->ycbcr_enc;
+		sdformat->format.quantization = infmt->quantization;
+		sdformat->format.xfer_func = infmt->xfer_func;
 		break;
 	case CSI_SINK_PAD:
 		v4l_bound_align_image(&sdformat->format.width, MIN_W, MAX_W,



-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-19 16:30 +0100
  Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Steve Longerbeam <slongerbeam@gmail.com> - 2017-03-19 20:20 +0100
    Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-20 13:20 +0100
      Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-20 13:40 +0100
        Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-20 15:30 +0100
          Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-20 18:20 +0100
          Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-20 18:30 +0100
            Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-20 22:00 +0100
            Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Steve Longerbeam <slongerbeam@gmail.com> - 2017-03-21 05:20 +0100
            Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-21 12:30 +0100
              Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Steve Longerbeam <slongerbeam@gmail.com> - 2017-03-22 01:00 +0100
            Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Steve Longerbeam <slongerbeam@gmail.com> - 2017-03-22 00:40 +0100
          Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-20 18:50 +0100
            Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-20 19:20 +0100
        Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Philipp Zabel <p.zabel@pengutronix.de> - 2017-03-20 15:30 +0100
          Re: [PATCH v5 38/39] media: imx: csi: fix crop rectangle reset in  sink set_fmt Steve Longerbeam <slongerbeam@gmail.com> - 2017-03-20 21:10 +0100

csiph-web