devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Eugen.Hristev@microchip.com>
To: <jacopo@jmondi.org>
Cc: <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<Claudiu.Beznea@microchip.com>, <robh+dt@kernel.org>,
	<Nicolas.Ferre@microchip.com>
Subject: Re: [PATCH v6 04/13] media: atmel: atmel-isc: implement media controller
Date: Mon, 7 Mar 2022 11:48:58 +0000	[thread overview]
Message-ID: <91a12e64-cfa7-a443-fcfa-5e190e978a53@microchip.com> (raw)
In-Reply-To: <da9d690e-e3ac-6813-c9f6-6c610ee407a0@microchip.com>

[snip]

>>> +static int isc_scaler_g_sel(struct v4l2_subdev *sd,
>>> +                         struct v4l2_subdev_state *sd_state,
>>> +                         struct v4l2_subdev_selection *sel)
>>> +{
>>> +     struct isc_device *isc = container_of(sd, struct isc_device, scaler_sd);
>>> +
>>> +     if (sel->pad == ISC_SCALER_PAD_SOURCE)
>>> +             return -EINVAL;
>>> +
>>> +     if (sel->target == V4L2_SEL_TGT_CROP_BOUNDS) {
>>> +             /* bounds are the input format received */
>>> +             sel->r.height = isc->scaler_format[ISC_SCALER_PAD_SINK].height;
>>> +             sel->r.width = isc->scaler_format[ISC_SCALER_PAD_SINK].width;
>>
>> I'll re-paste our discussion on v4 to make sure we're on the same page
>>
>> -------------------------------------------------------------------------------
>>>>> +     if (sel->pad == ISC_SCALER_PAD_SOURCE)
>>>>> +             return -EINVAL;
>>>>> +
>>>>> +     if (sel->target != V4L2_SEL_TGT_CROP_BOUNDS &&
>>>>> +         sel->target != V4L2_SEL_TGT_CROP)
>>>>> +             return -EINVAL;
>>>>> +
>>>>> +     sel->r.height = isc->max_height;
>>>>> +     sel->r.width = isc->max_width;
>>>>
>>>> The CROP_BOUNDS should be set to the same size as the sink pad image format,
>>>> as it represents the maximum valid crop rectangle.
>>>>
>>>> TGT_CROP should report the configured crop rectangle which can be
>>>> intiialized to the same size as CROP_BOUNDS, if my understanding of
>>>> the spec is correct
>>>
>>> So you would like to have this differentiated, and report the
>>> CROP_BOUNDS to whatever is on the sink pad, and the TGT_CROP to what is
>>> reported now, the maximum size of the ISC frame .
>>> My understanding is correct ?
>>>
>>
>> I didn't know you have an HW limitation, so your _BOUNDS is not the
>> input image size but rather 3264x2464 ( == max_width x max_height).
>>
>> What I meant is that _BOUNDS should report the maximum rectangle size
>> that can be applied to the _CROP target. In you case you have an HW
>> limitation 3264x2464 and that's the largest rectangle you can apply.
>> TGT_CROP can be initialized to the same as _BOUND, but if you
>> implement s_selection it should report what has been there applied.
>> But as you don't implement s_selection yet, I think this is fine for
>> now. Maybe a little comment ?
>> -------------------------------------------------------------------------------
>>
>> I think then that _BOUNDS should be fixed to 3264x2464 and CROP to
>> src_fmt.
>>
>> The rest looks good! Thanks for pushing up to this version and thanks
>> for addressings comments!
>>
>> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
>>
>> Thanks
>>     j
> 
> Hello Jacopo,
> 
> So BOUNDS goes to isc max H / max V, and CROP goes to format of the
> source pad.
> Got it.
> 
> I will update with a v7 as soon as you give me your feedback on the
> patch 8/13 which still required some changes from v6.
> 
> Thanks again for reviewing this !


With the incoming v7, media-ctl -p now looks like this:

Device topology
- entity 1: atmel_isc_scaler (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev0
         pad0: Sink
                 [fmt:SRGGB10_1X10/3280x2464 field:none colorspace:srgb
                  crop.bounds:(0,0)/3264x2464
                  crop:(0,0)/3264x2464]
                 <- "csi2dc":1 [ENABLED,IMMUTABLE]
         pad1: Source
                 [fmt:SRGGB10_1X10/3264x2464 field:none colorspace:srgb]
                 -> "atmel_isc_common":0 [ENABLED,IMMUTABLE]

Bounds as maximum isc size: 3264x2464, crop as maximum isc size 3264x2464

In case e.g. the sensor is sending a stream at lower res, like 
1920x1080, it will keep the same bounds:

Device topology
- entity 1: atmel_isc_scaler (2 pads, 2 links)
             type V4L2 subdev subtype Unknown flags 0
             device node name /dev/v4l-subdev0
         pad0: Sink
                 [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb
                  crop.bounds:(0,0)/3264x2464
                  crop:(0,0)/1920x1080]
                 <- "csi2dc":1 [ENABLED,IMMUTABLE]
         pad1: Source
                 [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb]
                 -> "atmel_isc_common":0 [ENABLED,IMMUTABLE]


> 
> Eugen
> 


[snip]

  reply	other threads:[~2022-03-07 11:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 15:36 [PATCH v6 00/13] media: atmel: atmel-isc: implement media controller Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 01/13] media: atmel: atmel-isc-base: use streaming status when queueing buffers Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 02/13] media: atmel: atmel-isc-base: replace is_streaming call in s_fmt_vid_cap Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 03/13] media: atmel: atmel-isc: remove redundant comments Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 04/13] media: atmel: atmel-isc: implement media controller Eugen Hristev
2022-03-07  8:46   ` Jacopo Mondi
2022-03-07 10:31     ` Eugen.Hristev
2022-03-07 11:48       ` Eugen.Hristev [this message]
2022-03-03 15:36 ` [PATCH v6 05/13] media: atmel: atmel-sama5d2-isc: fix wrong mask in YUYV format check Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 06/13] media: atmel: atmel-isc-base: use mutex to lock awb workqueue from streaming Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 07/13] media: atmel: atmel-isc: compact the controller formats list Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 08/13] media: atmel: atmel-isc: change format propagation to subdev into only verification Eugen Hristev
2022-03-07 10:29   ` Jacopo Mondi
2022-03-03 15:36 ` [PATCH v6 09/13] media: atmel: atmel-sama7g5-isc: remove stray line Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 10/13] dt-bindings: media: microchip,xisc: add bus-width of 14 Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 11/13] ARM: dts: at91: sama7g5: add nodes for video capture Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 12/13] ARM: configs: at91: sama7: add xisc and csi2dc Eugen Hristev
2022-03-03 15:36 ` [PATCH v6 13/13] ARM: multi_v7_defconfig: add atmel video pipeline modules Eugen Hristev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91a12e64-cfa7-a443-fcfa-5e190e978a53@microchip.com \
    --to=eugen.hristev@microchip.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jacopo@jmondi.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).