mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Detlev Casanova <detlev.casanova@collabora.com>,
	 linux-kernel@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Ezequiel Garcia	 <ezequiel@vanguardiasur.com.ar>,
	Heiko Stuebner <heiko@sntech.de>,
	Ricardo Ribalda <ribalda@chromium.org>,
	Hans Verkuil <hverkuil@kernel.org>,
	Hans de Goede <hansg@kernel.org>,  Yunke Cao <yunkec@google.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Laurent Pinchart	 <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	 James Cowgill <james.cowgill@blaize.com>,
	linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
		linux-arm-kernel@lists.infradead.org, kernel@collabora.com,
	Jonas Karlman	 <jonas@kwiboo.se>,
	Diederik de Haas <didi.debian@cknow.org>
Subject: Re: [PATCH v8 11/17] media: rkvdec: Support per-variant interrupt handler
Date: Sun, 18 Jan 2026 17:10:05 -0500	[thread overview]
Message-ID: <a6b50b9799bcb63a692e1ac6f3f1df3611e50f11.camel@collabora.com> (raw)
In-Reply-To: <20260109161538.1294449-12-detlev.casanova@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 3773 bytes --]

Le vendredi 09 janvier 2026 à 11:15 -0500, Detlev Casanova a écrit :
> Prepare for supporting different variants with different interrupt
> managers.
> 
> To support other variants specific function type later, introduce the
> rkvdec_variant_ops struct.
> 
> Tested-by: Diederik de Haas <didi.debian@cknow.org>  # Rock 5B
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  .../media/platform/rockchip/rkvdec/rkvdec.c   | 21 ++++++++++++++++---
>  .../media/platform/rockchip/rkvdec/rkvdec.h   |  5 +++++
>  2 files changed, 23 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> index ff6a09e45462..174536ebdcc7 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> @@ -1222,10 +1222,9 @@ static void rkvdec_iommu_restore(struct rkvdec_dev
> *rkvdec)
>  	}
>  }
>  
> -static irqreturn_t rkvdec_irq_handler(int irq, void *priv)
> +static irqreturn_t rk3399_irq_handler(struct rkvdec_ctx *ctx)
>  {
> -	struct rkvdec_dev *rkvdec = priv;
> -	struct rkvdec_ctx *ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev);
> +	struct rkvdec_dev *rkvdec = ctx->dev;
>  	enum vb2_buffer_state state;
>  	u32 status;
>  
> @@ -1246,6 +1245,15 @@ static irqreturn_t rkvdec_irq_handler(int irq, void
> *priv)
>  	return IRQ_HANDLED;
>  }
>  
> +static irqreturn_t rkvdec_irq_handler(int irq, void *priv)
> +{
> +	struct rkvdec_dev *rkvdec = priv;
> +	struct rkvdec_ctx *ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev);
> +	const struct rkvdec_variant *variant = rkvdec->variant;
> +
> +	return variant->ops->irq_handler(ctx);
> +}
> +
>  static void rkvdec_watchdog_func(struct work_struct *work)
>  {
>  	struct rkvdec_dev *rkvdec;
> @@ -1261,16 +1269,22 @@ static void rkvdec_watchdog_func(struct work_struct
> *work)
>  	}
>  }
>  
> +static const struct rkvdec_variant_ops rk3399_variant_ops = {
> +	.irq_handler = rk3399_irq_handler,
> +};
> +
>  static const struct rkvdec_variant rk3288_rkvdec_variant = {
>  	.num_regs = 68,
>  	.coded_fmts = rk3288_coded_fmts,
>  	.num_coded_fmts = ARRAY_SIZE(rk3288_coded_fmts),
> +	.ops = &rk3399_variant_ops,
>  };
>  
>  static const struct rkvdec_variant rk3328_rkvdec_variant = {
>  	.num_regs = 109,
>  	.coded_fmts = rkvdec_coded_fmts,
>  	.num_coded_fmts = ARRAY_SIZE(rkvdec_coded_fmts),
> +	.ops = &rk3399_variant_ops,
>  	.quirks = RKVDEC_QUIRK_DISABLE_QOS,
>  };
>  
> @@ -1278,6 +1292,7 @@ static const struct rkvdec_variant rk3399_rkvdec_variant
> = {
>  	.num_regs = 78,
>  	.coded_fmts = rkvdec_coded_fmts,
>  	.num_coded_fmts = ARRAY_SIZE(rkvdec_coded_fmts),
> +	.ops = &rk3399_variant_ops,
>  };
>  
>  static const struct of_device_id of_rkvdec_match[] = {
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.h
> b/drivers/media/platform/rockchip/rkvdec/rkvdec.h
> index 751f39afe7e2..faabedd2b9d8 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.h
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.h
> @@ -67,12 +67,17 @@ vb2_to_rkvdec_decoded_buf(struct vb2_buffer *buf)
>  			    base.vb.vb2_buf);
>  }
>  
> +struct rkvdec_variant_ops {
> +	irqreturn_t (*irq_handler)(struct rkvdec_ctx *ctx);
> +};
> +
>  struct rkvdec_variant {
>  	unsigned int num_regs;
>  	const struct rkvdec_coded_fmt_desc *coded_fmts;
>  	size_t num_coded_fmts;
>  	const struct rcb_size_info *rcb_sizes;
>  	size_t num_rcb_sizes;
> +	const struct rkvdec_variant_ops *ops;
>  	unsigned int quirks;
>  };
>  

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-01-18 22:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 16:15 [PATCH v8 00/17] media: rkvdec: Add support for VDPU381 and VDPU383 Detlev Casanova
2026-01-09 16:15 ` [PATCH v8 01/17] media: uapi: HEVC: Add v4l2_ctrl_hevc_ext_sps_[ls]t_rps controls Detlev Casanova
2026-01-18 21:48   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 02/17] media: v4l2-ctrls: Add hevc_ext_sps_[ls]t_rps controls Detlev Casanova
2026-01-18 21:52   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 03/17] media: visl: Add HEVC short and long term RPS sets Detlev Casanova
2026-01-18 21:57   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 04/17] media: rkvdec: Switch to using structs instead of writel Detlev Casanova
2026-01-09 16:15 ` [PATCH v8 05/17] media: rkvdec: Move cabac tables to their own source file Detlev Casanova
2026-01-09 16:15 ` [PATCH v8 06/17] media: rkvdec: Use structs to represent the HW RPS Detlev Casanova
2026-01-09 16:15 ` [PATCH v8 07/17] media: rkvdec: Move h264 functions to common file Detlev Casanova
2026-01-09 16:15 ` [PATCH v8 08/17] media: rkvdec: Move hevc " Detlev Casanova
2026-01-09 16:15 ` [PATCH v8 09/17] media: rkvdec: Add variant specific coded formats list Detlev Casanova
2026-01-18 22:02   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 10/17] media: rkvdec: Add RCB and SRAM support Detlev Casanova
2026-01-18 22:08   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 11/17] media: rkvdec: Support per-variant interrupt handler Detlev Casanova
2026-01-18 22:10   ` Nicolas Dufresne [this message]
2026-01-18 22:12   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 12/17] media: rkvdec: Enable all clocks without naming them Detlev Casanova
2026-01-09 16:15 ` [PATCH v8 13/17] media: rkvdec: Disable multicore support Detlev Casanova
2026-01-18 22:13   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 14/17] media: rkvdec: Add H264 support for the VDPU381 variant Detlev Casanova
2026-01-09 20:37   ` Diederik de Haas
2026-01-18 22:18   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 15/17] media: rkvdec: Add H264 support for the VDPU383 variant Detlev Casanova
2026-01-18 22:20   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 16/17] media: rkvdec: Add HEVC support for the VDPU381 variant Detlev Casanova
2026-01-18 22:25   ` Nicolas Dufresne
2026-01-09 16:15 ` [PATCH v8 17/17] media: rkvdec: Add HEVC support for the VDPU383 variant Detlev Casanova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6b50b9799bcb63a692e1ac6f3f1df3611e50f11.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=corbet@lwn.net \
    --cc=detlev.casanova@collabora.com \
    --cc=didi.debian@cknow.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=hansg@kernel.org \
    --cc=heiko@sntech.de \
    --cc=hverkuil@kernel.org \
    --cc=james.cowgill@blaize.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yunkec@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®