From patchwork Tue May 28 14:05:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tretter X-Patchwork-Id: 13676802 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCCE616DEA5 for ; Tue, 28 May 2024 14:05:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905131; cv=none; b=c/yz6ITwxOkJGrn9a3vPaPKCCyw24fH32KyCt0K2YzvSifi1KVw1KnhSCiPgpWokmRYvEBmt0ZFfNkNJ8+1+bdJEItasByxHkOQudkA9T03GXFYrLPfnx5iBkYBghKHyTqkivGZ37ujrq5TRT9OV1+ZntJVRfeo6/6acz+T5OJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905131; c=relaxed/simple; bh=Dqus7hH5cnhMZ9d8yBxqGyEs4dYgB8Emd/ABmEovwQU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c/y4GSOvQ4UMOpc78lk+DV+OZcRlJ26UTgFRU81uzw540OmYBYsQJW4vvlVV4mZROutHvUR4IpK5xB9MQfu7TVqmZ7AxrmAOLRyISEj0KUU5FGJmnps25foxKOppF6VWwojn/zsd03U1LOgFL59hBjJAHykADHhCJlEmq8jIcFo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de 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 1sBxS0-0005wE-OR; Tue, 28 May 2024 16:05:16 +0200 From: Michael Tretter Date: Tue, 28 May 2024 16:05:13 +0200 Subject: [PATCH 1/2] media: rockchip: rga: fix field in OUTPUT buffers Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240528-rk3568-rga-v1-1-b946e55d9d37@pengutronix.de> References: <20240528-rk3568-rga-v1-0-b946e55d9d37@pengutronix.de> In-Reply-To: <20240528-rk3568-rga-v1-0-b946e55d9d37@pengutronix.de> To: Jacob Chen , Ezequiel Garcia , Mauro Carvalho Chehab , Heiko Stuebner 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-media@vger.kernel.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 --- drivers/media/platform/rockchip/rga/rga-buf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/platform/rockchip/rga/rga-buf.c b/drivers/media/platform/rockchip/rga/rga-buf.c index 662c81b6d0b5..77c7535893e3 100644 --- a/drivers/media/platform/rockchip/rga/rga-buf.c +++ b/drivers/media/platform/rockchip/rga/rga-buf.c @@ -119,6 +119,16 @@ 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) { + v4l2_err(&ctx->rga->v4l2_dev, "Unsupported field %s\n", + v4l2_field_names[vbuf->field]); + return -EINVAL; + } + } + for (i = 0; i < vb->num_planes; i++) { vb2_set_plane_payload(vb, i, f->pix.plane_fmt[i].sizeimage);