Hi Petko, On Thu, Jul 07, 2022 at 03:17:51PM +0300, Petko Manolov wrote: > On 22-07-07 00:47:21, Laurent Pinchart wrote: > > > > MEDIA_BUS_FMT_* are media bus formats, they describe the format of data as it > > gets transmitted on buses between entities. The main purposes of those formats > > are configuration of entities in the pipeline (an IP core will need to be > > configured differently if it receives 10-bit raw data or 12-bit raw data for > > instance), and validation of the pipeline configuration (the format on the > > output of an entity must match the format on the input of the next entity). > > > > V4L2_PIX_FMT_* are pixel formats, and they describe the format of data as > > stored in memory. They're only meaningful for the DMA engines at the end of > > the pipeline, and while they're related to the media bus formats (the DMA > > engine can't write to memory, for instance, V4L2_PIX_FMT_YUYV if it receives > > MEDIA_BUS_FMT_SGRBG10 from the previous entity), there's no fixed 1:1 mapping > > between the two formats. The mapping is device-dependent. For instance, a DMA > > engine that receives YUV 4:2:2 data in the form of MEDIA_BUS_FMT_YUYV8_1X16 > > could support writing it in different pixel formats, such as > > V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16, ... > > Thanks for these details. > > I was wondering why V4L2_PIX_FMT_SGBRG12 would not be used for > MEDIA_BUS_FMT_SGBRG12_1X12 bus formats, but i guess the answer i can extract > from the info above is "device dependent". And I think it's also wrong in the imx7-media-csi driver. I've sent a pull request ([1]) for v5.20 that should fix this, in particular in patch "staging: media: imx: imx7-media-csi: Fix list of supported formats" ([2]). [1] https://lore.kernel.org/linux-media/YsbEoobPgKoYcZUs@xxxxxxxxxxxxxxxxxxxxxxxxxx/ [2] https://lore.kernel.org/linux-media/20220510115859.19777-46-laurent.pinchart@xxxxxxxxxxxxxxxx/ > > I have work in progress patches that address issues with the imx7-csi-bridge > > driver, once they land we could look into this. I'm afraid I'm a bit slow > > these days due to covid. > > Quick recovery! Looking forward to these patches. Thank you. The pull request has been sent, so this should be fixed in v5.20. > For me, changing VID_MEM_LIMIT to 512MB works OK for the moment. I am not yet > certain how this constant is related to the global CMA parameter. In the > default kernel config CMA is 32MB, while VID_MEM_LIMIT is 64MB. Isn't this > wrong? There's no real rule about the maximum amount of memory V4L2 driver can/should allocate. Every driver sets its own limits (and some drivers don't set a limit at all). 64MB is clearly too little. Feel free to submit a patch to increase this in the imx7-media-csi driver (on top of [1] to avoid conflicts). -- Regards, Laurent Pinchart