From 99ec97ea334b71a055e1c9fb2f48b46096c11f22 Mon Sep 17 00:00:00 2001 From: Jonathan Goyvaerts Date: Wed, 4 Nov 2026 14:27:43 -0300 Subject: [PATCH] arm64: dts: apple: t604x-j614-j616: scale the 720p camera preset The 1280x720 preset cropped the top-left 1280x720 corner of the 1920x1080 window that firmware configuration 5 delivers, without scaling. A 720p stream, which video calls often ask for, therefore showed an off-centre view about two thirds as wide as the 1080p one. Crop the whole 1920x1080 window and let the scaler bring it down to 1280x720, as the driver already does for the sizes it derives itself (such as 640x480 from the 1080p crop). The driver offered P010 only for presets whose crop equals their output, so the scaled preset would lose it and a 1280x720 P010 request would fall back to 1280x960. Accept a crop at the origin with the output's aspect ratio that is no smaller than the output instead. Signed-off-by: Jonathan Goyvaerts Assisted-by: LLM --- arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi | 4 ++-- drivers/media/platform/apple/isp/isp-cam.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi index 27593217fd195..e8173fc6d3ec4 100644 --- a/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi +++ b/arch/arm64/boot/dts/apple/t604x-j614-j616.dtsi @@ -4483,12 +4483,12 @@ apple,output-size = <1920 1080>; apple,crop = <0 0 1920 1080>; }; - /* 1280x720 */ + /* 1280x720: the same window as 1920x1080, scaled down */ preset1 { apple,config-index = <5>; apple,input-size = <1920 2160>; apple,output-size = <1280 720>; - apple,crop = <0 0 1280 720>; + apple,crop = <0 0 1920 1080>; }; }; }; diff --git a/drivers/media/platform/apple/isp/isp-cam.c b/drivers/media/platform/apple/isp/isp-cam.c index 004a7fa13d019..41125ef37ddac 100644 --- a/drivers/media/platform/apple/isp/isp-cam.c +++ b/drivers/media/platform/apple/isp/isp-cam.c @@ -312,8 +312,10 @@ static int isp_ch_cache_sensor_configs(struct apple_isp *isp, u32 ch, u32 count) preset->input_dim.x == config->in_width && preset->input_dim.y == config->in_height && !preset->crop_offset.x && !preset->crop_offset.y && - preset->crop_size.x == preset->output_dim.x && - preset->crop_size.y == preset->output_dim.y) + /* Same aspect ratio, never enlarged: the scaler may shrink it. */ + preset->crop_size.x >= preset->output_dim.x && + preset->crop_size.x * preset->output_dim.y == + preset->crop_size.y * preset->output_dim.x) preset->p010 = preview || reported; } if (!cached->usable)