From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796320510; b=0hQrOWhlcQoR6jWs82K6LgKCtwD7uqtf1uZ8w2wvD4tyIEdWqaHt2NmaL3iMf+wxx0I3 Pur+jTlng3r6FBcyXHkHmiiV2Su9G6K8JMG9o+iOud1BK+YeXwnKYUqtC9o+/ulbu0IGm 89v/myVCJmBylHv9dNp83nKMwwNzBfWeDC4PKQJD151GzoystKUJWbk0787cmbMGnOEU4 U9ManK5mw56rP/ygpiwIwNlOQ9aDuCx2njtgRWNQMqFQ3rP/JRxTs1w29v3E6DC3PtKOm gxe7IPVTqxD3Vgc84DsNQI4CSftqvBC9OFl5R1oKfqdnP1shNZ0cDWeQjw93lxe9t0g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796320510; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Subject:Date:Message-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key; bh=fgr90ZLNekiG8Ck04sSNo/AeU40iBeyYite9rvfOH1s=; b=1yqZqBSWqwa+aDkFvLDxYXnpg2NnYD0xbTc/38A3asBjOtRyfTGNwMPLr317ymz8XfRL dm0Tn6vk0yEej11loU8si8KL2UFQNzju+VCBPh+ubkjnxuoX8cBnQhDb3qEDT18Ly3YeJ BwV6F0MjCQs2hkOvwIH0g58l9ASsbNRdfLpT5LIgUelANi9MuDS/P6OhENNTMkmo9/dI5 BdweX5UCGP0SeWIfY2hJc4HumDhkS35rSQrw0kW4uweIA0+MEB6yqw6OeXwKfbFoiWTeG 1ca5UslUDgIXO9A7we2JZSy1JonOgT8U4uEUNuBOLb5pzK/fcMsMtGcltTRNZUw8gDg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ioSSxoXq; arc=none smtp.remote-ip=209.85.221.45 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F236606A338 for ; Thu, 3 Dec 2026 17:55:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9F236606A338 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=ioSSxoXq Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-48e3b22e971so78294f8f.0 for ; Thu, 03 Dec 2026 09:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796320508; x=1796925308; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=fgr90ZLNekiG8Ck04sSNo/AeU40iBeyYite9rvfOH1s=; b=ioSSxoXq/WrIwEGcdS2XQnbvO7unmqwsblaB9/K37stN5YsRAiGCCpGHvGTn5r7QeR BdxFACxWAvOnN9w468FXlBTR4Vu9ZyVsl+LIxSDYMml4rA1cXxC5S6mDw9mBxjnQnw7y BkTjrUrUZDr/0t0bwG22udOfaktNKtaa/BRfBMwdEsftZEyYYpcQkG/Ag4qAuX6/1ZjY QSLUV/atyU3g16a1ZakXWQNgOwbS7/OIK6Gvr36JW7jJRc55WKtASXTnyFRwo/kFhpvT 4K1SlfRy0dWC5++8gEMrBzlgkcs7bKxv9AiHht8HdaHznOyvYt0vCyN12Ri5ZA/03xG5 5t/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796320508; x=1796925308; h=cc:to:content-transfer-encoding:content-type:mime-version :message-id:date:subject:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to:content-type; bh=fgr90ZLNekiG8Ck04sSNo/AeU40iBeyYite9rvfOH1s=; b=RCPe/9/3nz/XBPG9OisjnALICraQWp65WrKOEBhDDVqHjBwBrdxVs67J2np0GJ2LKn B3mHeQeXfWNw1jppjeqwudj6WCu3XgtCTF0lZoO6/K93THu6r8OgYjcTcQYBhYR4bHWM hTbAJ/EhT8JiscFLwGEfZhAS2jbxOm8jqYKjNgpBsywf6KXfGbRj9U9LS/0LQRNC1bsI iMBGoaWrB4c9Gac4AuzYw1QWW20ZIlDQNe0iQ3freH1z++vjBVw47fDAvK66ZljMBTDO 0MgrJ5fqp8AyLZ294O8a8klWWB3yufM1zRwU3NxQXHaO8g/Kfp7+gqqwG0GdV7BHwdFo OK/Q== X-Forwarded-Encrypted: i=1; AL+hErFZzEHKtJ2IAGj8QDHsU2xtV+Si+W/+/fHj60x788ygHLNY+WI1S+95AldOSBwrPt/H2OXM5g7LWorB9Zs=@vger.kernel.org X-Gm-Message-State: APuU4Z+e73VYwUMYzvqYMSAeK91IckK5pAeYC4VWQtyR0wCgoCJZYvxQ cq+MEFbgSN434IRycSkVX7sYGML5D87ZlNDW+r50Z0rQy9QlrmDbFLIwkcnOR/Es X-Gm-Gg: AZFdTZdFIK3b7XUFUYrmWpyv/SU63ttltzA/6VNWpW2FRAA0yfU5mSaL4eYNcKqH1h1 fhDiYcoSgn1V6op0h97ORl9UrwlDXg2kyhHijlkJqzrlGlxBK7/ZFzARSNE5nSXjWnUKZfAhdR5 2MZHgTvCQIv6qnxG3hswtD8/q2M2qEp2Mn0QhgCcuau67qbnqsDXR5mxYqcZrq8s1ptRIGbhDKx pdkYdNSY9Mg9Qqs11YWnLhXZkOwrHdlycXTyQZZSxf7c0zFpEX6Qk5Gq06SibcANul0HIs/xx4i L7Plt3TaWbPpzcnk8wOxDN7ON78kUrrBf9dwhe58cjwgWIuwQHEesaKGJYRLStokP6NtLHlQKbE Cr5uIsT17XKMjKzOxeI8EePsfl98j+F+DCUEFUbd20Mv1dIskx50PLWN8EzxAsG8OByXDkmIvST +3WwicfZy0aON0fZ6oaGZjS5t1BmldbulC9Jywzwsk5XtcrjMA7Suxl5Rte7NizfIp8eE4O3OlH geeVsGT1wHjfuSUv36wKpWwt8Z33ZYjEQRoheMH43eLBny7Yhxs4ZORxyAznGsOznVJEN+xwiEO 1Pt/7inl9btd8TktFOUvfec04hHAgf5xyK/Hr3I8aLXcnaxczdvNXu4atVVwFx904EF/LTjI5tQ Sg+4kB6rWoij0JS7LxBuOPSi5rX2N0I32UpX6GKJ9VwHjCuw5tC6trFVR78XdWwEgm8u7 X-Received: by 2002:a05:6000:22c5:b0:4cf:cbc0:e957 with SMTP id ffacd0b85a97d-4cfcbc0f068mr5893732f8f.20.1796320508029; Thu, 03 Dec 2026 09:55:08 -0800 (PST) Received: from PC-Marco.local ([151.59.145.20]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4d174452809sm486985f8f.53.2026.12.03.09.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 09:55:07 -0800 (PST) From: Marco Ziliani Subject: [PATCH 0/3] media: i2c: ov8865: Fix long frame lengths, VBLANK on mode change and gain steps Date: Thu, 03 Dec 2026 18:54:58 +0100 Message-Id: <20261203-ov8865-fixes-v1-0-2bedf7e05579@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMyw5AMBCF4VeRWWtSbV3iVcRCa8pYIB1EIt5ds fxy8p8LGAMhQ51cEPAgpmWOyNIE3NjNAwrqo0FJVWRKarEcVVXkwtOJLKTW1hjn+7IzEJM14Df Eoml/824ndNv7Aff9AGxzJcZwAAAA X-Change-ID: 20261203-ov8865-fixes-033b44cfd7a4 To: Mauro Carvalho Chehab , Sakari Ailus Cc: Daniel Scally , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796320506; l=2141; i=rylos78@gmail.com; s=20261027; h=from:subject:message-id; bh=R4JVPaPduah5hlNaciYa4C5sFBI7KgAsCtqaCbP4Nj4=; b=xhou+wn3ZhmyCr6xqtjw8xHh9mdJXFvXTLunuWWfxeXLvNJuuma7AJ1EKL1YzKQDsMa1oSLnW 9XE0To0flauCl3WjYm7mEaG4O2VoF1n9hySUJCokWq2y9vchGHC9cKr X-Developer-Key: i=rylos78@gmail.com; a=ed25519; pk=nXCfiK5yExPZCMp+lfKif3gdXkfjkUK2qk7bDW+ixMo= Three fixes for the ov8865, found on the Microsoft Surface Pro 5 and Surface Book 2 (IPU3) and tested on a Surface Pro 7+ (IPU6) as well. Patch 1 fixes the VTS high byte mask, which keeps only bits 11:8 and wraps any frame length above 4095 lines. libcamera now sets VBLANK on the IPU3 pipeline and its AGC raises the exposure up to the frame length, so with libcamera master the rear camera of the Surface Book 2 goes black, or the stream stalls. It would be good to have this fixed before the next libcamera release. Patch 2 resets VBLANK to the mode default on every active format change, so that a frame length left over from the previous mode or user doesn't stick. Patch 3 lowers the analogue gain step from 128 (integer gains only) to 1, which the sensor resolves to about 1/128 of the current gain. Tested on a Surface Pro 5 with the media next driver plus this series, built for the running kernel, against the unpatched driver, at 800x600: unpatched patched VBLANK 5400 VTS read 1904, 30.25 fps VTS 6000, 9.60 fps VBLANK 14760 VTS read 3072, 18.75 fps VTS 15360, 3.75 fps VBLANK after full -> 800x600 14760 (stale) 40 (mode default) analogue gain step 128 1 The patches come from the linux-surface tree [1], where irishchug (Surface Book 2) and Firas Sharary (Surface Pro 7+) tested them. I used an AI coding assistant to draft these patches and the changelogs; I reviewed them and can answer for them. [1] https://github.com/linux-surface/kernel/pull/181 Signed-off-by: Marco Ziliani --- Marco Ziliani (3): media: i2c: ov8865: Fix the VTS high byte mask media: i2c: ov8865: Reset VBLANK on mode change media: i2c: ov8865: Allow fine analogue gain steps drivers/media/i2c/ov8865.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) --- base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8 change-id: 20261203-ov8865-fixes-033b44cfd7a4 Best regards, -- Marco Ziliani