All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frieder Schrempf <frieder.schrempf@kontron.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, Rui Miguel Silva <rmfrfs@gmail.com>,
	Steve Longerbeam <slongerbeam@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	Fabio Estevam <festevam@gmail.com>
Subject: Re: [PATCH v2 00/77] media: imx: Miscellaneous fixes and cleanups for i.MX7
Date: Mon, 26 Apr 2021 10:06:51 +0200	[thread overview]
Message-ID: <5a600024-b5e9-e57f-f2c9-d75520666163@kontron.de> (raw)
In-Reply-To: <71888be2-faf3-f4c2-5cac-2a39acbeba81@kontron.de>

On 15.04.21 18:04, Frieder Schrempf wrote:
> On 15.04.21 11:00, Frieder Schrempf wrote:
>> Hi Laurent,
>>
>> On 19.03.21 02:27, Laurent Pinchart wrote:
>>> Hi Frieder,
>>>
>>> On Wed, Mar 17, 2021 at 07:04:19PM +0100, Frieder Schrempf wrote:
>>>> On 15.02.21 05:26, Laurent Pinchart wrote:
>>>>> Hello,
>>>>>
>>>>> This large patch series is a collection of miscellaneous fixes, 
>>>>> cleanups
>>>>> and enhancements for the i.MX7 camera support. Most notably, it
>>>>> implements support for the Media Controller API in the driver.
>>>>>
>>>>> Compared to v1, review comments have been taken into account, and the
>>>>> patches have been rebased on top of the DT bindings and latest imx
>>>>> changes as present in the linux-media tree. Patches 38/77, 39/77, 
>>>>> 60/77
>>>>> and 61/77 are new. For additional information, please see individual
>>>>> patches.
>>>>>
>>>>> I have successfully tested the code on an i.MX6ULL board (with an
>>>>> MT9M114 sensor), an I.MX7D board (with an IMX296 sensor), and an 
>>>>> i.MX8MM
>>>>> board (with an OV5640 sensor, and additional patches for i.MX8MM
>>>>> support).
>>>>
>>>> First of all, thanks for the great work!
>>>
>>> You're welcome.
>>>
>>>> I'm currently trying to get a setup with CSI + MIPI + ADV7280 
>>>> working on
>>>> an i.MX8MM system. Would you mind sharing the additional patches I need
>>>> for this?
>>>>
>>>> I guess you are referring to patches for the MIPI CSIS PHY and the
>>>> devicetree. Anything else, that I'm missing?
>>>
>>> I've pushed my work in progress patches to
>>>
>>>     git://linuxtv.org/pinchartl/media.git imx/next
>>>
>>> I haven't tested this on mainline though, as the i.MX8MM board I'm using
>>> currently requires an NXP BSP.
>>>
>>> For the DT integration, here's what I have in imx8mm.dtsi:
>>>
>> [...]
>>>
>>> Mainline seems to be missing the power domains, so you'll likely have to
>>> sort this out.
>>>
>>
>> Thanks a lot for the patches. I finally found some time to test this 
>> with our hardware. I'm working on v5.10 mainline and applied pending 
>> support for the power-domains from Lucas [1].
>>
>> It doesn't look bad and I can bring up the media devices, etc. but up 
>> to now I couldn't get any image from the ADV7280A-M.
>>
>> This is the first time I'm working with the media/v4l subsystem, so I 
>> might be missing some trivial things. Also I'm not quite sure if the 
>> adv7180 driver is currently fully compatible.
>>
>> Anyway here are some things I noticed. Maybe you could have a quick 
>> look and see if you can gather something from that, which helps me to 
>> get this running?
>>
>> After enabling the link to the adv7180 with:
>>
>> media-ctl -l "'adv7180 1-0021':0 -> 'imx7-mipi-csis.0':0[1]"
>>
>> all the links look ok, but not all the parameters seem to be 
>> propagated up to the subdevs (see [2]). But I don't even know if this 
>> should happen automatically.
>>
>> After setting up the format like this, the subdev setup looks ok as 
>> far as I can judge (see [3]):
>>
>> media-ctl -V "'adv7180 1-0021':0 [fmt:UYVY2X8/720x240 field:alternate]"
>> media-ctl -V "'imx7-mipi-csis.0':1 [fmt:UYVY2X8/720x240 field:alternate]"
>>
>> Also there is one small issue with the adv7180 not implementing 
>> neither V4L2_CID_LINK_FREQ nor V4L2_CID_PIXEL_RATE. So 
>> v4l2_get_link_rate() fails, but as this seems to be only used to 
>> calculate hs_settle, I just hardcoded the hs_settle value for now.
>>
>> Finally I don't get any image from the analog converter. The stream 
>> seems to be setup correctly, but I don't receive any frames. Though I 
>> can see that there is data on the MIPI CSI lanes.
> 
> I discovered, that when the stream is running and I toggle the 
> CSITX_PWRDN bit in the ADV7280 (disable and the enable again the MIPI 
> CSI TX), I receive a single frame from the camera, but nothing more 
> until I restart the streaming and toggle the CSITX_PWRDN again.
> 
> Also I'm not able to get any frame data if I try to get progressive 
> frames from the ADV (setting field = none and fmt = UYVY2X8/720x480), or 
> if I try to use PAL instead of NTSC.
> 
> So at least I know now that my hardware seems to work in general. But I 
> still hope to get this setup fully working...
> 

Just to wrap this up: It seems like for YUV422 you need some "special" 
settings.

First of all, just as with the RGB formats I needed to set 
MIPI_CSIS_ISPCFG_PIXEL_MODE_DUAL in the MIPI CSIS driver and 
BIT_TWO_8BIT_SENSOR in the CR3 register in the CSI driver.

Without this the MIPI CSIS hardware will always run into an overflow 
condition as soon as some data has been received.

Further I needed to set BIT_MIPI_DOUBLE_CMPNT in CR18 to get the colors 
right. No idea what it really does, but the RM mentions YUV422 in the 
description for this bit.

With this setup (and some changes on the adv7180 driver) I can get 
proper images from the camera. Though there's one problem remaining 
related to synchronization. It looks like the ADV outputs some invalid 
data at the beginning of the stream which results in an arbitrary 
horizontal and vertical offset of the image.

I guess that this could maybe be solved by implementing g_skip_frames() 
for the CSI driver, but I haven't tried that.

If anyone is interested, here is my WIP branch: 
https://git.kontron-electronics.de/linux/linux/-/commits/v5.10-mx8mm-csi.

      reply	other threads:[~2021-04-26  8:06 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-15  4:26 [PATCH v2 00/77] media: imx: Miscellaneous fixes and cleanups for i.MX7 Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 01/77] media: imx: Drop dependency on I2C Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 02/77] media: imx: Move dependency on VIDEO_DEV to common Kconfig symbol Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 03/77] media: imx: Drop manual dependency on VIDEO_IMX_MEDIA Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 04/77] media: imx: Compile imx6-media-objs only for CONFIG_VIDEO_IMX_CSI Laurent Pinchart
2021-02-26 15:45   ` Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 05/77] media: imx: Set default sizes through macros in all drivers Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 06/77] media: imx: utils: Add ability to filter pixel formats by mbus code Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 07/77] media: imx: capture: Use dev_* instead of v4l2_* to log messages Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 08/77] media: imx: capture: Use device name to construct bus_info Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 09/77] media: imx: capture: Remove forward declaration of capture_qops Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 10/77] media: imx: capture: Handle errors from v4l2_fh_open() Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 11/77] media: imx: capture: Clean up capture_priv structure Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 12/77] media: imx: capture: Remove capture_priv stop field Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 13/77] media: imx: capture: Move queue and ctrl handler init to init function Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 14/77] media: imx: capture: Initialize video_device programmatically Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 15/77] media: imx: capture: Register the video device after completing init Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 16/77] media: imx: capture: Store v4l2_pix_format in imx_media_video_dev Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 17/77] media: imx: capture: Move default format init to a separate function Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 18/77] media: imx: capture: Rename querycap handler to capture_querycap Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 19/77] media: imx: capture: Rename ioctl operations with legacy prefix Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 20/77] media: imx: capture: Add a mechanism to disable control inheritance Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 21/77] media: imx: capture: Remove unneeded variable in __capture_legacy_try_fmt Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 22/77] media: imx: capture: Pass v4l2_pix_format to __capture_legacy_try_fmt() Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 23/77] media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt() Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 24/77] media: imx: capture: Extract format lookup from __capture_legacy_try_fmt Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 25/77] media: imx: capture: Simplify capture_validate_fmt() implementation Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 26/77] media: imx: capture: Simplify __capture_legacy_try_fmt() Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 27/77] media: imx: capture: Decouple video node from source with MC-centric API Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 28/77] media: imx: capture: Expose V4L2_CAP_IO_MC for the " Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 29/77] media: imx: imx7-media-csi: Disable legacy video node API Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 30/77] media: imx: capture: Support creating immutable link to capture device Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 31/77] media: imx: imx7-media-csi: Remove control handler Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 32/77] media: imx: imx7-media-csi: Move (de)init from link setup to .s_stream() Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 33/77] media: imx: imx7-media-csi: Create immutable link to capture device Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 34/77] media: imx: imx7-media-csi: Replace CSICR*_RESET_VAL with values Laurent Pinchart
2021-02-15  4:26 ` [PATCH v2 35/77] media: imx: imx7-media-csi: Tidy up register fields macros Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 36/77] media: imx: imx7-media-csi: Reorganize code in sections Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 37/77] media: imx: imx7-media-csi: Validate capture format in .link_validate() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 38/77] media: imx: imx7-media-csi: Fix source type identification Laurent Pinchart
2021-03-01  9:30   ` Rui Miguel Silva
2021-02-15  4:27 ` [PATCH v2 39/77] media: imx: imx7-media-csi: Don't lock access to is_csi2 Laurent Pinchart
2021-03-01  9:31   ` Rui Miguel Silva
2021-02-15  4:27 ` [PATCH v2 40/77] media: imx: imx7-media-csi: Rename imx7_csi_dma_start() to *_setup() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 41/77] media: imx: imx7-media-csi: Split imx7_csi_dma_stop() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 42/77] media: imx: imx7-media-csi: Move CSI configuration before source start Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 43/77] media: imx: imx7-media-csi: Merge streaming_start() with csi_enable() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 44/77] media: imx: imx7-media-csi: Merge hw_reset() with init_interface() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 45/77] media: imx: imx7-media-csi: Set the MIPI data type based on the bus code Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 46/77] media: imx: imx7-media-csi: Don't set the buffer stride when disabling Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 47/77] media: imx: imx7-media-csi: Merge all config in imx7_csi_configure() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 48/77] media: imx: imx7-media-csi: Clear all configurable CSICR18 fields Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 49/77] media: imx: imx7-media-csi: Set RFF burst type in imx7_csi_configure() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 50/77] media: imx: imx7-media-csi: Simplify imx7_csi_rx_fifo_clear() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 51/77] media: imx: imx7-media-csi: Don't double-enable the CSI Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 52/77] media: imx: imx7-media-csi: Don't double-enable the RxFIFO Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 53/77] media: imx: imx7-media-csi: Remove double reflash of DMA controller Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 54/77] media: imx: imx7-media-csi: Don't enable SOF and EOF interrupts Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 55/77] media: imx: imx7_media-csi: Add support for additional Bayer patterns Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 56/77] media: v4l2-mc: Add link flags to v4l2_create_fwnode_links_to_pad() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 57/77] media: imx: imx7_media-csi: Create immutable link to source device Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 58/77] dt-bindings: media: nxp,imx7-mipi-csi2: Drop the reset-names property Laurent Pinchart
2021-03-05 21:41   ` Rob Herring
2021-02-15  4:27 ` [PATCH v2 59/77] dt-bindings: media: nxp,imx7-mipi-csi2: Drop fsl,csis-hs-settle property Laurent Pinchart
2021-03-05 21:42   ` Rob Herring
2021-02-15  4:27 ` [PATCH v2 60/77] dt-bindings: media: nxp,imx7-mipi-csi2: Indent example with 4 spaces Laurent Pinchart
2021-03-01  9:33   ` Rui Miguel Silva
2021-03-05 21:42   ` Rob Herring
2021-02-15  4:27 ` [PATCH v2 61/77] dt-bindings: media: nxp,imx7-mipi-csi2: Expand descriptions Laurent Pinchart
2021-03-01  9:35   ` Rui Miguel Silva
2021-03-05 21:43   ` Rob Herring
2021-02-15  4:27 ` [PATCH v2 62/77] media: imx: imx7_mipi_csis: Acquire reset control without naming it Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 63/77] media: imx: imx7_mipi_csis: Fix input size alignment Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 64/77] media: imx: imx7_mipi_csis: Make source .s_power() optional Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 65/77] media: imx: imx7_mipi_csis: Avoid double get of wrap clock Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 66/77] media: imx: imx7_mipi_csis: Drop 10-bit YUV support Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 67/77] media: imx: imx7_mipi_csis: Fix UYVY8 media bus format Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 68/77] media: imx: imx7_mipi_csis: Inline mipi_csis_set_hsync_settle() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 69/77] media: imx: imx7_mipi_csis: Move link setup check out of locked section Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 70/77] media: imx: imx7_mipi_csis: Calculate Ths_settle from source lane rate Laurent Pinchart
2021-03-01 16:40   ` [PATCH v2.1 " Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 71/77] media: imx: imx7_mipi_csis: Turn register access macros into functions Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 72/77] media: imx: imx7_mipi_csis: Fully initialize MIPI_CSIS_DPHYCTRL register Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 73/77] media: imx: imx7_mipi_csis: Define macros for DPHY_BCTRL_L fields Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 74/77] media: imx: imx7_mipi_csis: Make ISP registers macros take channel ID Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 75/77] media: imx: imx7_mipi_csis: Rename register macros to match datasheet Laurent Pinchart
2021-03-01 16:41   ` [PATCH v2.1 " Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 76/77] media: imx: imx7_mipi_csis: Use register macros in mipi_csis_dump_regs() Laurent Pinchart
2021-02-15  4:27 ` [PATCH v2 77/77] media: imx: imx7_mipi_csis: Print shadow registers " Laurent Pinchart
2021-03-16 11:56 ` [PATCH] imx7-media-csi: csi2 only Martin Kepplinger
2021-03-16 18:05   ` Laurent Pinchart
2021-03-17 10:08     ` Martin Kepplinger
2021-03-17 10:19       ` Laurent Pinchart
2021-03-28 14:25         ` Martin Kepplinger
2021-03-28 16:43           ` Laurent Pinchart
2021-03-17 18:04 ` [PATCH v2 00/77] media: imx: Miscellaneous fixes and cleanups for i.MX7 Frieder Schrempf
2021-03-19  1:27   ` Laurent Pinchart
2021-04-15  9:00     ` Frieder Schrempf
2021-04-15 16:04       ` Frieder Schrempf
2021-04-26  8:06         ` Frieder Schrempf [this message]

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=5a600024-b5e9-e57f-f2c9-d75520666163@kontron.de \
    --to=frieder.schrempf@kontron.de \
    --cc=ezequiel@collabora.com \
    --cc=festevam@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rmfrfs@gmail.com \
    --cc=slongerbeam@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.