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


Groups > linux.kernel > #1604482

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-20 13:40 +0100
Message-ID <tn4Lo-4J7-35@gated-at.bofh.it> (permalink)
References <tjkOJ-708-5@gated-at.bofh.it> <tjkOJ-708-19@gated-at.bofh.it> <tmKWn-7EG-27@gated-at.bofh.it> <tmOwW-1M4-17@gated-at.bofh.it> <tn4s2-4zk-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Mar 20, 2017 at 12:55:26PM +0100, Philipp Zabel wrote:
> The above paragraph suggests we skip any rectangles that are not
> supported. In our case that would be 3. and 4., since the CSI can't
> compose into a larger frame. I hadn't realised that the crop selection
> currently happens on the source pad.

I'd recommend viewing the documentation in its post-processed version,
because then you get the examples as pictures, and they say that a
picture is worth 1000 words.  See

  https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/dev-subdev.html

There is almost an exact example of what we're trying to do - it's
figure 4.6.  Here, we have a sink pad with a cropping rectangle on
the input, which is then scaled to a composition rectangle (there's
no bounds rectangle, and it's specified that in such a case the
top,left of the composition rectangle will always be 0,0 - see quote
below).

Where it differs is that the example also supports source cropping
for two source pads.  We don't support that.

The same document says:

  Scaling support is optional. When supported by a subdev, the crop
  rectangle on the subdev's sink pad is scaled to the size configured
  using the
  :ref:`VIDIOC_SUBDEV_S_SELECTION <VIDIOC_SUBDEV_G_SELECTION>` IOCTL
  using ``V4L2_SEL_TGT_COMPOSE`` selection target on the same pad. If the
  subdev supports scaling but not composing, the top and left values are
  not used and must always be set to zero.

which in itself describes _exactly_ our hardware here as far as the
cropping and scaling the hardware supports.

> Except when composing is not supported. If the sink compose and source
> crop rectangles are not supported, the source pad format takes their
> place in determining the scaling output resolution. At least that's how
> I read the documentation.

This isn't how I read it.  Scaling is the relationship between the size
of the sink crop and sink compose rectangle.  Composition requires that
there be a composition bounds rectangle to define the composition space,
and the top,left of the composition rectangle be adjustable to place
the composition rectangle within that space.

The above quoted paragraph from the documentation backs up my view in
its final sentence - it doesn't say "if the subdev supports scaling
but not composing, there is no composition rectangle" but says that
there _is_ one but its top,left coordinates are always zero.

-- 
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