From patchwork Fri Aug 9 16:06:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tretter X-Patchwork-Id: 13758928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E26FCC3DA4A for ; Fri, 9 Aug 2024 16:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=EIeW+HJBR16SuE97uLQq+dGbLQ8vw/xHBKoHOcSEF20=; b=DXUzB4Wr65CqynvybItOQPndIl aBuabVzH1agmCE9CO9ZWOkqpd49QAVaCKloagMVyI0CGQhpCWW5zBzmRK5ub5rSXaXa1ncO+Kq7/V klzJE51Fgha1hwFjhgXNO3Fa0qwuMtcnMnvcbS2NIa4LOVDTGDtw4NjRTyT6k69TZN6WO612QWiqQ 4s6wx81vl/4zXfGSOxekmLWGCF3DJ1ibK9X6EaOYN/XW5EX8h0t/jijeRsPF/QTuWC6kkeEHSjL1h wotnURoXDsxgr9A05rM7TcAfEYORlQyqYdoVGAeU0hadBRHNzRHOIouVFTVlHNoXJtBA04aCSJkP/ rXS6U3zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scS9D-0000000Bp7z-3IZ3; Fri, 09 Aug 2024 16:07:23 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scS8d-0000000Bp26-3aNl for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 16:06:49 +0000 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1scS8Y-0003Fl-Lx; Fri, 09 Aug 2024 18:06:42 +0200 From: Michael Tretter Date: Fri, 09 Aug 2024 18:06:30 +0200 Subject: [PATCH v2] media: rockchip: rga: fix field in OUTPUT buffers MIME-Version: 1.0 Message-Id: <20240528-rk3568-rga-v2-1-c8052f5af10c@pengutronix.de> X-B4-Tracking: v=1; b=H4sIAIU+tmYC/22OQQ6DIBBFr2JYl4ooWrvqPRoXCINOmgABamyMd y+66aarnzeZl/83EiEgRHIvNhJgwYjOZuCXgqhZ2gko6syEM94wwW80vGrR5pgkNcZUWjPFVSd IFkYZgY5BWjUfioU1lcl5VOVPOv58AIPrWfocMs8Ykwufc8NSHde/dUtFGR37pgUhdK/r7uHBT u8UnMX1qoEM+75/AUz7CwjRAAAA To: Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner , Hans Verkuil Cc: Michael Tretter , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de X-Mailer: b4 0.12.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:1101:1d::54 X-SA-Exim-Mail-From: m.tretter@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_090647_903371_FD600978 X-CRM114-Status: GOOD ( 13.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Returned buffers shouldn't contain V4L2_FIELD_ANY as field. Set the field to V4L2_FIELD_NONE, if it isn't set. Signed-off-by: Michael Tretter --- Fix the Streaming ioctl tests reported by v4l2-compliance for the Rockchip RGA driver. The remaining Patch 1 fixes the field of the returned buffers. Other patches from the series have already been applied. --- Changes in v2: - Drop already applied Patch 2 - Remove v4l2_err() to avoid spamming the log with invalid user input - Link to v1: https://lore.kernel.org/r/20240528-rk3568-rga-v1-0-b946e55d9d37@pengutronix.de --- drivers/media/platform/rockchip/rga/rga-buf.c | 7 +++++++ 1 file changed, 7 insertions(+) --- base-commit: 812765cd69540b1e3ed5f02e25ccb9904f6a82f7 change-id: 20240528-rk3568-rga-fff1dd0c2c75 Best regards, diff --git a/drivers/media/platform/rockchip/rga/rga-buf.c b/drivers/media/platform/rockchip/rga/rga-buf.c index 70808049d2e8..9e87ac79e8c6 100644 --- a/drivers/media/platform/rockchip/rga/rga-buf.c +++ b/drivers/media/platform/rockchip/rga/rga-buf.c @@ -119,6 +119,13 @@ static int rga_buf_prepare(struct vb2_buffer *vb) if (IS_ERR(f)) return PTR_ERR(f); + if (V4L2_TYPE_IS_OUTPUT(vb->vb2_queue->type)) { + if (vbuf->field == V4L2_FIELD_ANY) + vbuf->field = V4L2_FIELD_NONE; + if (vbuf->field != V4L2_FIELD_NONE) + return -EINVAL; + } + for (i = 0; i < vb->num_planes; i++) { vb2_set_plane_payload(vb, i, f->pix.plane_fmt[i].sizeimage);