From patchwork Thu Nov 5 23:23:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Faizel K B X-Patchwork-Id: 28778 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 41A29C3307 for ; Thu, 5 Nov 2026 23:23:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E6F476A7C0; Fri, 6 Nov 2026 00:23:37 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="D2/5VWqQ"; dkim-atps=neutral Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5902B6A7BA for ; Fri, 6 Nov 2026 00:23:36 +0100 (CET) Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-3b09cc7ed1aso17898a91.2 for ; Thu, 05 Nov 2026 15:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793921014; x=1794525814; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=++VDHdPlpTNkCnA4mn1+LWZP5PXeiA0pzKCa5Fy4gJ4=; b=D2/5VWqQdeHGI29+K6X4ZsLNCmV4p30/syhvmzcE8BUyWN/+OyHbGFwE1AWrfcyePX ppzjhWpUSHE/KB/4AOmhzmJ6AVaLvoP58eNdaXgMWIUTqluA5SJL2iRnIlZMJ2sowPpX LTn3rMrRu8QeauK8meOAOk7vr2OFrg5RkDvN2zSfkTQCICOoWUUtnKCf6LTvpO/rhtxP NeGJf2nrvPgTphz5JAfzOBm0vFglt7+upeejkn6qasEqXuY1/QUAZHwi+JeRPBI547IM U//avwJZkgMiqDivXLG1y78446rUuCJ5/7Du0MXU3kuApkU2QW2gIW4H2lUgngoXpWjV aDIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793921014; x=1794525814; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=++VDHdPlpTNkCnA4mn1+LWZP5PXeiA0pzKCa5Fy4gJ4=; b=hhexyBN6Cm6OO1MKmQmptSGa+ye4IKOhLAkQfC9F+eDRAN1gVrMpJNOBCpjQGYwFJH 3DUX6VQsPyC9sL6vVdJzVrdicxfNVauShlZM78OU7b2DFgxwyrAjyOxrzbI8pxxX1oal Chs7XLzyql30GJWp1HMJ7EDxBYRDoCxPLOBv1zuUMj4gEF59mDZi732n/Yj7xzfBicj1 tGSgWv+6qjODyGJXtKfWkjlabeTBsNO+paAnGtbOCXHJ0egF+/+d+ICiY7X9exwEJiaz vxZ3DUsn764jxUq+49k/kpPRF+g/pfqJHneYgUhgm20X8DZrgK8cD9/s08a2dBa69JiL cBTg== X-Forwarded-Encrypted: i=1; AKwUvByFiMASTZTYlC3dY0+6EGdAYmqrjWw9Q3x6PJpiJ66ohGriLCVMgZvGp2CwSry9KsWH2oJS9eEspYENTkfTjgY=@lists.libcamera.org X-Gm-Message-State: APuU4Z/i9EnQ/Q6RZvqD7dW4i6LvekxH3MO7dlFLZQDkWHU0xq0DvZl4 3iWFASXqhC6Z7ec4nuEDD20fbiQP136WOs0/ePejMTWrfgDOkMhrYgfn X-Gm-Gg: AYBFou1l2FKbYBQmnUwxgr1FrCGNkw+GF+Lkd/rJB1OIzSAb74oo81NqoqvbEknh8fJ 09p2DjldjLUT6/e7Zje939/S7I0BB5jM2RGDbMDU1gyi6KI3xT9f1VCHm15NxTHh7Aw6BLmiqVg IKcONfZcyjXrC6RCBkgWsasKRKGXh4SSQPbNgjXhP38TvaCPHNxcK/d6d1SHwzxFcqhZM8h8Mvt RJ2LzCw5d2glCskZms01p6pmfPtUSswQRn7pqcJ6K93Rm4IdUe3CZJjghbqCMK9Bvuczc7686js hqCHCwKtbFulgiaqr0+tz7ihz467AlRi4qbvoeo6oivx7OalIstblNGRT79pN4E0Zxy30+F+1kG /OkCQPHc8kOUEdFnG6XvY1+xZb2RrHyeMaiT+F6klTz+d5qbivv9Y7yjJBYTIdJID/OxeQV99+S HjCM2n16mzYZsKKItEK6/fuCFYdsv+LPP0t3v2jDelDCLzLo7/EgzDbkFtP7CuGXcgVnrXWQxcO HKTYtynW4S5XCqKfyycfjvFRgvunYdWY1GieBtpJEDO7MgrLPgQxrydJoqkhSFfeuX4iF46Rd7o K3pbb093lS2rAsU5cNObpNyJpct0BUTAR19ywYB0flWnVqfkg3S6TIl21GNLNyy4thfTjwhFWIe jxZ8qOyY= X-Received: by 2002:a17:90b:2590:b0:3a0:c1b1:45fb with SMTP id 98e67ed59e1d1-3b0db014274mr896768a91.0.1793921014532; Thu, 05 Nov 2026 15:23:34 -0800 (PST) Received: from FAIZEL-KB.. ([2001:569:5b64:e100:f564:53e0:ae9d:9600]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-3b0b323cd3csm5317297a91.3.2026.11.05.15.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 15:23:33 -0800 (PST) From: Faizel K B To: Mehdi Djait , Michael Riesch Cc: Mauro Carvalho Chehab , Heiko Stuebner , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, libcamera-devel@lists.libcamera.org, Robert Mader , Faizel K B Subject: [PATCH 0/2] media: rockchip: rkcif: ENUM_FMT and bytesperline fixes Date: Thu, 5 Nov 2026 16:23:08 -0700 Message-ID: <20261105232310.385463-1-faizel.kb@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series fixes two issues in the rkcif MIPI capture path, found while using the libcamera simple pipeline handler with a Sony IMX415 on a Radxa ROCK 5B+ (RK3588). Patch 1 makes VIDIOC_ENUM_FMT honour the mbus_code field, as required for V4L2_CAP_IO_MC devices. Without it, userspace can select a pixel format that doesn't match the media bus format, e.g. a different Bayer order, and the captured images have wrong colours. Patch 2 aligns bytesperline to 8 bytes, as required by the MIPI DMA, and honours a larger value requested by userspace. This allows the capture buffers to be imported as DMA-BUFs by the libcamera GPU software ISP on Panfrost, which needs a 64-byte stride alignment, instead of copying every frame. Tested on ROCK 5B+ with IMX415 (SGBRG10, 3864x2192): correct colours without any userspace workaround, and a stride of 7936 bytes accepted and used for zero-copy import. The corresponding libcamera change is under review at: https://patchwork.libcamera.org/patch/28662/ Faizel K B (2): media: rockchip: rkcif: Filter enumerated formats by media bus code media: rockchip: rkcif: Honour the requested bytesperline on MIPI .../platform/rockchip/rkcif/rkcif-stream.c | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4