Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796320510; b=sOn7C9bhzdB/U6keH8fvlUjyiwuflM5HIyxsLt65Q32CzplBSoA9YjqxCgxEOHpdVBki wHrU62Q3gu+JILC7mT8wmkU4kAcU3RUpi0AnZhA5siPT/EU6R9p14KwceSo479tMe1jcU umt2dHEeykgTazMGBpbKApUURobjd16c9YQKva0yNixiQ99qdj6FufMmdYIjiEbi5T8IW jFTnSW8N9tNWH0SxAMgEkDvM3fSFqSYCzm8PSaLyeoLHjJIW2yQKfx7Ust49golNaifc2 XISVAUuT7XCVnzhi8AgIceJnxmDD9LyUOQB3iJsieafYAwSUju3cQwBji7R3hyZFmKg== 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=TiCzasEb/nrigzHHH6VSig+XaT8WYRK0Ejdp6im6V5Xj1imynlJUReIhx4EoFtH86Vym gg+7bNEmQutWs6bxNEZrl98KvTHg9GpvWnlg9oIIMxT+xm2Yxoz5j7gzRVA6zItPh4lU/ s3DCxzEsLo6PIbm7qRhntOPGgMkt74k9VP/D4CgrO2HYXWwhQmRjmTH1Kl+eO7UOQWGWG HubGOhi/8CT4v26GcyUCWw9f8wMVv7zkB6/MWTW0UAbbf80ESbPpjWpeUQuGEhMYkNrd8 ljIXFObmG7XPaf6Y5a3dG0Ug2ta2q3nQ66Pa6v3pfJEm3H5vMs3hoL0F9++03smmfew== 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.46 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 9832A606A32C for ; Thu, 3 Dec 2026 17:55:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9832A606A32C 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-f46.google.com with SMTP id ffacd0b85a97d-4a9be758734so119527f8f.1 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=tJFvi6EZG4Tw+ByTZb5ibHum64zDI0+JzdL8sYLVB6Waq8FAq613EF5tj+ofRiGVxC T6kujxg2j/SM3gJk13vBO5ejPETEUalBk8Ji5CeITAB556Vn33Ffwm4gTJd5tXE6biiF x+Hhj62Nez5Kz+raBLhIABCIn3FBPAAh4JrECz5USbP5nCzWLmhUFA71XGurvDhAR4Ve xJBOAyvGA/+b3GlOc+sQsYIe/mbpvNui7Pxjn+LKPtATqfP8cq4TavNheGbmflutmM6W h2CztIlSMzgLUkSSMRn5JjZJYSL/lllg71OQ/8N53739rRvhQ9a7s1Ps+LAmAvBAyx/H MrqQ== X-Forwarded-Encrypted: i=1; AL+hErH5qPyRj1sQpTPOyiOiE0jyDJUeA/i0xKg6iw5ZI83RTvm1OwTVOnK6nW3NF116Lv7wjliIRXDMx7sZdA==@vger.kernel.org X-Gm-Message-State: APuU4Z/OwjxgB2vgR7JSJeQ6aiq1tkcV1wye16eoKYCFGdF0NdEUpeg0 d4xmPLt5BYoT/+80PgiVhDUdixuJ/BcKXCsWkWdqeSPp+oRN/YGMWIe9 X-Gm-Gg: AZFdTZfRlwiUBQrrgm40KYAWOh/11WJdjysrGg6oOworuKaeooje1kA3erpQuFVmI2D nuzKyrMP6ED5f4luibfq/g71fnctEQrsel5uSkRhoE0jtM41UmSt06bMmMMfg+V1HCmm/ZHl/R4 ElySHMmBq96zTdCs32ZPdRiPlaxgLIkldyjn67AJOiyq1qSh40gj3jLnRzr9q1FEVOafzBTydTH kTHgOCr/MCmdOGSFSNWAu9GOCBXAijqYf9hnb6k4zvLgwLFuw8eys92BuRo1Hsw33WXUUNHBYVC 3Wu+fbWyumAXi5vnsHKw+W3M3TTYM38IUe6RcXav7CCuqNxpJfNuOd5tpdC7TQ3c7GwsjfVfhbp F8tHd4xuElZzfy8QHKkafvlnTwoGS/W+6O0xWI3b4sy2t4p8TurrPhDWcHP04l+DFUArobNHc81 +Upx2VHHXsOqlIb06GO0pJlZ5zFQbxa/LCKOTk9KB1cxOxECAMpbMAseLzNE48Sh5UHQrHBqPu3 TdaVykkIrbOyjIgNMciotZLbwsgWVhlaI2mhvWKGy2rClRsSQQwb9B/fx0hXhEwmAU+5MdQR3Ze VjHgcUKEPhggnGKP1awy2leTwY9dAnYKro3XB7QD5b/usy8p3+lvAj5bH4y6W/72pNEpqvUQQ2v QGGmHlpfaD8iTUcVqaipw2RA+OFs2JKG4XwzJ+tntGpntyP3ryMR9ksrtxqtKI66mU5nw 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-media@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