Re: [PATCH 3/5] media: dt-bindings: Add Apple ISP
From: Asahi Lina <hidden>
Date: 2025-02-19 15:36:45
Also in:
asahi, imx, linux-devicetree, linux-media, linux-pm, lkml
On February 19, 2025 12:05:29 PM GMT+01:00, Sasha Finkelstein [off-list ref] wrote:
On Wed, 19 Feb 2025 at 11:53, Laurent Pinchart [off-list ref] wrote:quoted
quoted
Those are board-specific and not discoverable via the ISP protocol.But they are settable through the ISP protocol, aren't they ? For instance, looking at isp-imx248.dtsi, the first four entries are /* 1280x720 */ preset0 { apple,config-index = <0>; apple,input-size = <1296 736>; apple,output-size = <1280 720>; apple,crop = <8 8 1280 720>; }; /* 960x720 (4:3) */ preset1 { apple,config-index = <0>; apple,input-size = <1296 736>; apple,output-size = <960 720>; apple,crop = <168 8 960 720>; }; /* 960x540 (16:9) */ preset2 { apple,config-index = <0>; apple,input-size = <1296 736>; apple,output-size = <960 540>; apple,crop = <8 8 1280 720>; }; /* 640x480 (4:3) */ preset3 { apple,config-index = <0>; apple,input-size = <1296 736>; apple,output-size = <640 480>; apple,crop = <168 8 960 720>; }; But I may be interested in capturing a 640x480 frame with cropping only and without scaling, with input-size = 1296x736 output-size = 640x480 crop = (328,128)/640x480 Or I may want my cropped frame to be located in the upper-left corner: input-size = 1296x736 output-size = 640x480 crop = (8,8)/640x480 If I set those parameters through the ISP protocol, won't it work ? -- Regards, Laurent PinchartFor cropping - you do not want to change those parameters, the sensor is partially occluded, and the crop area is specified in such a way to not expose those pixels. As for scaling - we can expose only the 1:1 scale and let userspace deal with it, but it appears that it expects the other common output sizes to exist.
The square sensor with the hack is the IMX558. The configs there are actually a workaround for missing ANE support. What the driver is supposed to be doing is using the higher numbered presets, which crop internally and exclude the occluded area. But those on machines with that sensor end up requiring ANE integration for denoising and ISP crashes without it. Config #0 doesn't use ANE, so the crops are re-creations of the other configs so it behaves the same minus the denoising.