Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp626997pxt; Thu, 5 Aug 2021 07:55:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXe5vMNmsLxnSLO4ga3Iz8B2xdXgGe5d9J9vUsHtYfgRjvjXLzNR/HlWiTOkao6nl/M5gB X-Received: by 2002:a05:6402:78f:: with SMTP id d15mr7031353edy.233.1628175302757; Thu, 05 Aug 2021 07:55:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628175302; cv=none; d=google.com; s=arc-20160816; b=XqVAjBL7maSonXL4DEjWq0gFzoW5yuv51QChH6H5i43eSd6pFAjl7zXLLExSyQs9wL fYwuGC9tdQN3rZtshEgsfCmLvBQ842iiqy6akFbm+uJ1lUWhxoO5zZvaSGYw98FZZZZf yznT6Z/ZxUh8wao9PcxXhroeQRDsMnEOBhf3D0HajPI7+wqCzNFwMi9o0gKzh36RbJVz KQ1kb/357o1AwKpl4k0fK/Zy8YKt1mR7ENbt1jHQVUNrTp9uhNHTUJ0ikCZsXweJU5VG +DnWoJwfST8jNWmFFAtYTrP/K0WSrvt9FjQ0kBwcKIYnUpaKOAiJEqp7c5+pJsGw7v8F +kvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=U5ggewkExS9bxvXh+kl+B5lw5E8VM/ntvQJiOTI4lu0=; b=tYAM+jLNJ/cDxObjhi8oFS3aIPTlUf80Lj0MFA879Pit8tWmPD6OJs1GHmTWceQ22t l2AKnNgH133tewadIF1cQ8qjXMklYmQPFrtRJFLHUOcT+Xb1CLMLi/5Qhl9E6RrqmpbW KD9cVU97CFiL7xFyJ8rGbaWqkc12NFS+q+Y1P55yVTDkV5UJTlNUDxiFtUdMz/XB3P13 1erufjCeLhEXx0nSQlfYjqVL0mZlVe0/7g9HBOTgXckQw+sSelmDCGzigdLwRATHd/c+ dQdVA/+RgvzzuuG2v4XQBQaR+djIxye1Y7WDfO1XVzGZFv999PckI3svefVH/TrE9+7H /+ow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si5876897ejy.710.2021.08.05.07.54.38; Thu, 05 Aug 2021 07:55:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242047AbhHEOp7 (ORCPT + 99 others); Thu, 5 Aug 2021 10:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241715AbhHEOnM (ORCPT ); Thu, 5 Aug 2021 10:43:12 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F38ACC061765; Thu, 5 Aug 2021 07:42:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id B9D3D1F440A2 From: Andrzej Pietrasiewicz To: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev Cc: Andrzej Pietrasiewicz , Benjamin Gaignard , Boris Brezillon , Ezequiel Garcia , Fabio Estevam , Greg Kroah-Hartman , Hans Verkuil , Heiko Stuebner , Jernej Skrabec , Mauro Carvalho Chehab , Nicolas Dufresne , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , kernel@collabora.com, Ezequiel Garcia Subject: [PATCH v3 03/10] hantro: Simplify postprocessor Date: Thu, 5 Aug 2021 16:42:39 +0200 Message-Id: <20210805144246.11998-4-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210805144246.11998-1-andrzej.p@collabora.com> References: <20210805144246.11998-1-andrzej.p@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ezequiel Garcia Add a 'postprocessed' boolean property to struct hantro_fmt to signal that a format is produced by the post-processor. This will allow to introduce the G2 post-processor in a simple way. Signed-off-by: Ezequiel Garcia Signed-off-by: Andrzej Pietrasiewicz --- drivers/staging/media/hantro/hantro.h | 2 ++ drivers/staging/media/hantro/hantro_postproc.c | 8 +------- drivers/staging/media/hantro/imx8m_vpu_hw.c | 1 + drivers/staging/media/hantro/rockchip_vpu_hw.c | 1 + drivers/staging/media/hantro/sama5d4_vdec_hw.c | 1 + 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/hantro/hantro.h b/drivers/staging/media/hantro/hantro.h index c2e01959dc00..dd5e56765d4e 100644 --- a/drivers/staging/media/hantro/hantro.h +++ b/drivers/staging/media/hantro/hantro.h @@ -263,6 +263,7 @@ struct hantro_ctx { * @max_depth: Maximum depth, for bitstream formats * @enc_fmt: Format identifier for encoder registers. * @frmsize: Supported range of frame sizes (only for bitstream formats). + * @postprocessed: Indicates if this format needs the post-processor. */ struct hantro_fmt { char *name; @@ -272,6 +273,7 @@ struct hantro_fmt { int max_depth; enum hantro_enc_fmt enc_fmt; struct v4l2_frmsize_stepwise frmsize; + bool postprocessed; }; struct hantro_reg { diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c index 882fb8bc5ddd..4549aec08feb 100644 --- a/drivers/staging/media/hantro/hantro_postproc.c +++ b/drivers/staging/media/hantro/hantro_postproc.c @@ -53,15 +53,9 @@ const struct hantro_postproc_regs hantro_g1_postproc_regs = { bool hantro_needs_postproc(const struct hantro_ctx *ctx, const struct hantro_fmt *fmt) { - struct hantro_dev *vpu = ctx->dev; - if (ctx->is_encoder) return false; - - if (!vpu->variant->postproc_fmts) - return false; - - return fmt->fourcc != V4L2_PIX_FMT_NV12; + return fmt->postprocessed; } static void hantro_postproc_g1_enable(struct hantro_ctx *ctx) diff --git a/drivers/staging/media/hantro/imx8m_vpu_hw.c b/drivers/staging/media/hantro/imx8m_vpu_hw.c index 22fa7d2f3b64..02e61438220a 100644 --- a/drivers/staging/media/hantro/imx8m_vpu_hw.c +++ b/drivers/staging/media/hantro/imx8m_vpu_hw.c @@ -82,6 +82,7 @@ static const struct hantro_fmt imx8m_vpu_postproc_fmts[] = { { .fourcc = V4L2_PIX_FMT_YUYV, .codec_mode = HANTRO_MODE_NONE, + .postprocessed = true, }, }; diff --git a/drivers/staging/media/hantro/rockchip_vpu_hw.c b/drivers/staging/media/hantro/rockchip_vpu_hw.c index 6c1ad5534ce5..f372f767d4ff 100644 --- a/drivers/staging/media/hantro/rockchip_vpu_hw.c +++ b/drivers/staging/media/hantro/rockchip_vpu_hw.c @@ -62,6 +62,7 @@ static const struct hantro_fmt rockchip_vpu1_postproc_fmts[] = { { .fourcc = V4L2_PIX_FMT_YUYV, .codec_mode = HANTRO_MODE_NONE, + .postprocessed = true, }, }; diff --git a/drivers/staging/media/hantro/sama5d4_vdec_hw.c b/drivers/staging/media/hantro/sama5d4_vdec_hw.c index f3fecc7248c4..b2fc1c5613e1 100644 --- a/drivers/staging/media/hantro/sama5d4_vdec_hw.c +++ b/drivers/staging/media/hantro/sama5d4_vdec_hw.c @@ -15,6 +15,7 @@ static const struct hantro_fmt sama5d4_vdec_postproc_fmts[] = { { .fourcc = V4L2_PIX_FMT_YUYV, .codec_mode = HANTRO_MODE_NONE, + .postprocessed = true, }, }; -- 2.17.1