From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.11 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796054052; b=lLOIeXJgf/c3W01nZ/zr7RFLhREzUVxP/ufsIXwQKjuklUNluT09/L8wBJF+mVJ5uxPE FhBbVZ1wexc2SftYCYBKBSSRYThA9py25UqyAY8mW8MJVXWhA1OSnGLs1fO2D765xzczy 1bdKGbMP3agkPFFR6M9tQmJB5VUPbcsDJAfGwp2WRNEQAfWA8iRQPlO3NuSF6acPvS5PC 4MHeIAU1AHYpaKo3a6GC5bKvUCvgNLfgp3C4onQbi+OLrUVihuc1LBSwciCirTh0tBu6R tTnWUy7T6tiG//q+XjxOcIUSpfHlvFgZvRg9mXF+XDCVSewGjlirkVK0tqyvLlMtKvw== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796054052; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type:X-ZohoMailClient; bh=lZjKsbe+0yAZX7BKRxnUv23kvbFe3XcpeyYMLQu/B8A=; b=mCKwp7n8HVY5r7tvROBVVAnRf24Ytwsa0gJ0Nqoz9vWL3LeO7UdvLxZFiCXmaHbXD+e5 jbgINH3djbILwcu8XSO4yOUVTVH8U+F+xAXC6fqBF1IXwb5o3JPhV39xbWxLTNwuyD3Pn C1TvHD0VNeEwy9KLkXC9OWpM+K3DRK546yEJmpr63T7q1W4Bb78L+0CPcLJWQIyYhMI0J QAqZYoEUmRGNfe8OgyIpo+9Aefau+EoJ8jbuAw32P0VfCVjDqM1KdP5r9NvGimDM8Czo+ GKz9z1EME/0XaixrAYkpE8n16k8OFZUtuJ707EDQLmpe2ZA+X58IYtMHX6ddFu4Lm3A== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=hqIqOIke; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.11 Received: from sender5-op-o11.zoho.com (sender5-op-o11.zoho.com [165.173.182.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29595606A31C; Mon, 30 Nov 2026 15:54:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 29595606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=hqIqOIke ARC-Seal: i=1; a=rsa-sha256; t=1796054003; cv=none; d=zohomail.com; s=zohoarc; b=bPVBl/5rH4rkTSv01UC5spiymEbobo6vlVYNkj49CAfg3xwWs1kfBEMZtimoNVZL31BSTCfbWdrfVgv5LkadLldQYPbsHdUdVOy+IF+UwPZe9JO4FS0THFOa5aoJ7/7u+eCjQxLqMUGM/jHV8f18mRpO7qVhEeKY9TJllFdiEhY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796054003; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=lZjKsbe+0yAZX7BKRxnUv23kvbFe3XcpeyYMLQu/B8A=; b=OrTRfCfDrxSkpizVe2/K000/hshg3kdUecgUZBet47zgT53bZX+Js7mTEnmy/QTO/LqlC4dF3hbV67EaUHYNCZ2PHHwlJPIiESnZVdGv1hWCMhFZsSr7NFiNb/Z8gXixgUnAFK/whfSufcW4F/bs0sEg/06AiTGUaiPPXAFZfms= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=detlev.casanova@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=hqIqOIkeDThlc09WrVreGRbOcesg/mLyxqIxu6YhAMQeBcoxSbTKxI/7s/ssqYj2pitKyJp8cZMdnC8DOlC9B2eCUErPoKqB50PhSAwwDeeBsdTwa9N/UG3uY0xY4vNlQtytJtL2qno/TrKCq5wokMHJSi+s+0HMcZF8sPraYo4=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=lZjKsbe+0yAZX7BKRxnUv23kvbFe3XcpeyYMLQu/B8A=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1796054000062317.9163857056118; Mon, 30 Nov 2026 07:53:20 -0800 (PST) From: Detlev Casanova To: Mauro Carvalho Chehab , Ezequiel Garcia , Heiko Stuebner , Hans Verkuil , Jonas Karlman , Nicolas Dufresne Cc: Sven =?UTF-8?B?UMO8c2NoZWw=?= , kernel@collabora.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 4/5] media: rkvdec: Split into core and master platform drivers Date: Mon, 30 Nov 2026 10:53:18 -0500 Message-ID: In-Reply-To: References: <20260810-rkvdec-multicore-v2-0-986f89d22cdc@collabora.com> <20260810-rkvdec-multicore-v2-4-986f89d22cdc@collabora.com> X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-ZohoMailClient: External Hello ! On Thursday, 19 November 2026 12:58:37 EST Nicolas Dufresne wrote: > Hi, >=20 > Le lundi 10 ao=C3=BBt 2026 =C3=A0 11:22 -0400, Detlev Casanova a =C3=A9cr= it : > > Prepare the driver for multi-core support by restructuring around the > > component framework, based on what rga does. >=20 > Add a blank between paragraph. >=20 > > This commit only adds the plumbing and does not yet enable more > > than a single core to run (Each additionnal core adding will return > > -EBUSY). > > =20 [...] > > diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-rcb.c > > b/drivers/media/platform/rockchip/rkvdec/rkvdec-rcb.c index > > 191f78278c01..44df5b6df80c 100644 [...] > > @@ -77,12 +76,13 @@ void rkvdec_free_rcb(struct rkvdec_ctx *ctx) > >=20 > > case RKVDEC_ALLOC_SRAM: > > virt_addr =3D (unsigned long)cfg- >rcb_bufs[i].cpu; > >=20 > > - if (dev->iommu_domain) > > - iommu_unmap(dev->iommu_domain,=20 virt_addr, rcb_size); > > - gen_pool_free(dev->sram_pool, virt_addr,=20 rcb_size); > > + if (iommu_get_domain_for_dev(core->dev)) > > + =09 iommu_unmap(iommu_get_domain_for_dev(core->dev), > > + virt_addr,=20 rcb_size); >=20 > Also, see > https://lore.kernel.org/all/70ed0df5a04b11d8dcfe41d91e86fc28dedcb132.came= l@c > ollabora.com/ where I suggest to port to dma api. I mean, its not like the > page table of SRAM is going to move, but I also don't see why we have to > use iommu_map/unmap(), so if not, better clean that up now. I'll add a separate commit to fix this and to be backported to stable versi= ons. > > + gen_pool_free(core->sram_pool, virt_addr,=20 rcb_size); > >=20 > > break; > > =09 > > case RKVDEC_ALLOC_DMA: > > - dma_free_coherent(dev->dev, > > + dma_free_coherent(rkvdec->main_core->dev, > >=20 > > rcb_size, > > cfg- >rcb_bufs[i].cpu, > > cfg- >rcb_bufs[i].dma); [...] > > diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c > > b/drivers/media/platform/rockchip/rkvdec/rkvdec.c index > > db2731af06cf..d3b13132b751 100644 > > --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c > > +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c > > @@ -11,12 +11,14 @@ > >=20 > > #include > > #include > >=20 > > +#include > >=20 > > #include > > #include > > #include > > #include > > #include > > #include > >=20 > > +#include > >=20 > > #include > > #include > > #include > >=20 > > @@ -652,14 +654,11 @@ static int rkvdec_enum_framesizes(struct file *fi= le, > > void *priv,>=20 > > static int rkvdec_querycap(struct file *file, void *priv, > > =20 > > struct v4l2_capability *cap) > > =20 > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D video_drvdata(file); > >=20 > > struct video_device *vdev =3D video_devdata(file); > >=20 > > - strscpy(cap->driver, rkvdec->dev->driver->name, > > - sizeof(cap->driver)); > > + strscpy(cap->driver, "rkvdec", sizeof(cap->driver)); > >=20 > > strscpy(cap->card, vdev->name, sizeof(cap->card)); > >=20 > > - snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s", > > - rkvdec->dev->driver->name); > > + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:rkvdec"); > >=20 > > return 0; > > =20 > > } > >=20 > > @@ -1026,8 +1025,6 @@ static void rkvdec_stop_streaming(struct vb2_queue > > *q)>=20 > > if (desc->ops->stop) > > =09 > > desc->ops->stop(ctx); > >=20 > > - > > - rkvdec_free_rcb(ctx); > >=20 > > } > > =09 > > rkvdec_queue_cleanup(q, VB2_BUF_STATE_ERROR); > >=20 > > @@ -1062,26 +1059,28 @@ static const struct media_device_ops > > rkvdec_media_ops =3D {>=20 > > }; > > =20 > > static void rkvdec_job_finish_no_pm(struct rkvdec_ctx *ctx, > >=20 > > - enum vb2_buffer_state result) > > + enum vb2_buffer_state result) > >=20 > > { > >=20 > > + struct v4l2_m2m_ctx *m2m_ctx =3D ctx->fh.m2m_ctx; > > + struct v4l2_m2m_dev *m2m_dev =3D m2m_ctx->m2m_dev; > > + > >=20 > > if (ctx->coded_fmt_desc->ops->done) { > > =09 > > struct vb2_v4l2_buffer *src_buf, *dst_buf; > >=20 > > - src_buf =3D v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx); > > - dst_buf =3D v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); > > + src_buf =3D v4l2_m2m_next_src_buf(m2m_ctx); > > + dst_buf =3D v4l2_m2m_next_dst_buf(m2m_ctx); > >=20 > > ctx->coded_fmt_desc->ops->done(ctx, src_buf, dst_buf,=20 result); > > =09 > > } > >=20 > > - v4l2_m2m_buf_done_and_job_finish(ctx->dev->m2m_dev, ctx- >fh.m2m_ctx, > > - result); > > + v4l2_m2m_buf_done_and_job_finish(m2m_dev, m2m_ctx, result); > >=20 > > } > > =20 > > static void rkvdec_job_finish(struct rkvdec_ctx *ctx, > >=20 > > - enum vb2_buffer_state result) > > + enum vb2_buffer_state result) > >=20 > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D ctx->dev; > > + pm_runtime_mark_last_busy(ctx->core->dev); > > + pm_runtime_put_autosuspend(ctx->core->dev); >=20 > Since we modify its default domain, so basically call into the core0 iomm= u, > should be also make sure core0 is up, or does the iommu driver handles it > independently? =46rom what I checked, when the domain table stored in ram is written on it= s=20 devices, the function checks if the device is powered on before writing or= =20 just skips it. (See rk_iommu_zap_iova()) When the device comes back on, the domain table is written on it from RAM. > p.s. didn't take the time to check the DT here >=20 > > - pm_runtime_put_autosuspend(rkvdec->dev); > >=20 > > rkvdec_job_finish_no_pm(ctx, result); > > =20 > > } > >=20 > > @@ -1112,14 +1111,14 @@ void rkvdec_run_postamble(struct rkvdec_ctx *ct= x, > > struct rkvdec_run *run)>=20 > > void rkvdec_quirks_disable_qos(struct rkvdec_ctx *ctx) > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D ctx->dev; > > + struct rkvdec_core *core =3D ctx->core; > >=20 > > u32 reg; > > =09 > > /* Set undocumented swreg_block_gating_e field */ > >=20 > > - reg =3D readl(rkvdec->regs + RKVDEC_REG_QOS_CTRL); > > + reg =3D readl(core->regs + RKVDEC_REG_QOS_CTRL); > >=20 > > reg &=3D GENMASK(31, 16); > > reg |=3D 0xEFFF; > >=20 > > - writel(reg, rkvdec->regs + RKVDEC_REG_QOS_CTRL); > > + writel(reg, core->regs + RKVDEC_REG_QOS_CTRL); > >=20 > > } > > =20 > > void rkvdec_memcpy_toio(void __iomem *dst, void *src, size_t len) > >=20 > > @@ -1131,40 +1130,42 @@ void rkvdec_memcpy_toio(void __iomem *dst, void > > *src, size_t len)>=20 > > #endif > > } > >=20 > > -void rkvdec_schedule_watchdog(struct rkvdec_dev *rkvdec, u32 > > timeout_threshold) +void rkvdec_schedule_watchdog(struct rkvdec_core > > *core, u32 timeout_threshold)>=20 > > { > > =20 > > /* Set watchdog at 2 times the hardware timeout threshold */ > > u32 watchdog_time; > >=20 > > - unsigned long axi_rate =3D clk_get_rate(rkvdec->axi_clk); > > + unsigned long axi_rate =3D clk_get_rate(core->axi_clk); > >=20 > > if (axi_rate) > > =09 > > watchdog_time =3D 2 * div_u64(1000 *=20 (u64)timeout_threshold, axi_rate); > > =09 > > else > > =09 > > watchdog_time =3D 2000; > >=20 > > - schedule_delayed_work(&rkvdec->watchdog_work, > > msecs_to_jiffies(watchdog_time)); > > + schedule_delayed_work(&core->watchdog_work, > > msecs_to_jiffies(watchdog_time));>=20 > > } > > =20 > > static void rkvdec_device_run(void *priv) > > { > > =20 > > struct rkvdec_ctx *ctx =3D priv; > >=20 > > - struct rkvdec_dev *rkvdec =3D ctx->dev; > >=20 > > const struct rkvdec_coded_fmt_desc *desc =3D ctx->coded_fmt_desc; > > int ret; > > =09 > > if (WARN_ON(!desc)) > > =09 > > return; > >=20 > > - ret =3D pm_runtime_resume_and_get(rkvdec->dev); > > + ctx->core =3D ctx->dev->main_core; > > + ctx->core->curr_ctx =3D ctx; > > + > > + ret =3D pm_runtime_resume_and_get(ctx->core->dev); > >=20 > > if (ret < 0) { > > =09 > > rkvdec_job_finish_no_pm(ctx, VB2_BUF_STATE_ERROR); > > return; > > =09 > > } > > =09 > > if (!rkvdec_rcb_buf_validate_size(ctx)) { > >=20 > > - rkvdec_free_rcb(ctx); > > + rkvdec_free_rcb(ctx->dev, ctx->core); > >=20 > > - ret =3D rkvdec_allocate_rcb(ctx, > > + ret =3D rkvdec_allocate_rcb(ctx->dev, ctx->core, > >=20 > > ctx- >decoded_fmt.fmt.pix_mp.width, > > ctx- >decoded_fmt.fmt.pix_mp.height, > > ctx->dev->variant- >rcb_sizes, > >=20 > > @@ -1340,10 +1341,11 @@ static const struct v4l2_file_operations > > rkvdec_fops =3D {>=20 > > static int rkvdec_v4l2_init(struct rkvdec_dev *rkvdec) > > { > > =20 > > int ret; > >=20 > > + struct device *dev =3D rkvdec->main_core->dev; > >=20 > > - ret =3D v4l2_device_register(rkvdec->dev, &rkvdec->v4l2_dev); > > + ret =3D v4l2_device_register(dev, &rkvdec->v4l2_dev); > >=20 > > if (ret) { > >=20 > > - dev_err(rkvdec->dev, "Failed to register V4L2=20 device\n"); > > + dev_err(dev, "Failed to register V4L2 device\n"); > >=20 > > return ret; > > =09 > > } > >=20 > > @@ -1354,7 +1356,7 @@ static int rkvdec_v4l2_init(struct rkvdec_dev > > *rkvdec)>=20 > > goto err_unregister_v4l2; > > =09 > > } > >=20 > > - rkvdec->mdev.dev =3D rkvdec->dev; > > + rkvdec->mdev.dev =3D dev; > >=20 > > strscpy(rkvdec->mdev.model, "rkvdec", sizeof(rkvdec->mdev.model)); > > strscpy(rkvdec->mdev.bus_info, "platform:rkvdec", > > =09 > > sizeof(rkvdec->mdev.bus_info)); > >=20 > > @@ -1420,9 +1422,9 @@ static void rkvdec_v4l2_cleanup(struct rkvdec_dev > > *rkvdec)>=20 > > v4l2_device_unregister(&rkvdec->v4l2_dev); > > =20 > > } > >=20 > > -static void rkvdec_iommu_restore(struct rkvdec_dev *rkvdec) > > +static void rkvdec_iommu_restore(struct rkvdec_core *core) > >=20 > > { > >=20 > > - if (rkvdec->empty_domain) { > > + if (core->empty_domain) { > >=20 > > /* > > =09 > > * To rewrite mapping into the attached IOMMU core,=20 attach a new empty > > domain that * will program an empty table, then detach=20 it to restore > > the default domain and>=20 > > @@ -1430,29 +1432,29 @@ static void rkvdec_iommu_restore(struct rkvdec_= dev > > *rkvdec)>=20 > > * This is safely done in this interrupt handler to=20 make sure no memory > > get mapped * through the IOMMU while the empty domain=20 is attached. > > */ > >=20 > > - iommu_attach_device(rkvdec->empty_domain, rkvdec->dev); > > - iommu_detach_device(rkvdec->empty_domain, rkvdec->dev); > > + iommu_attach_device(core->empty_domain, core->dev); > > + iommu_detach_device(core->empty_domain, core->dev); >=20 > On second core, that will restore the second core default domain, which is > also empty. At least for the second core, you have to explicitly attach t= he > main core default domain. It should be possible to just attach the empty > domain, attach the main core default domain regardless. Yes, but this commit only separate cores/master devices. It still will only= =20 use the first core only (extra cores will not be in the list of cores). The= =20 next commit takes care of multi core support. > nit: Remember this is a hack, we should plan on having a call or ops into > the rkiommu driver to signal that we (or the IP) operated a soft reset. > > } > > =20 > > } > > =20 > > static irqreturn_t rk3399_irq_handler(struct rkvdec_ctx *ctx) > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D ctx->dev; > > + struct rkvdec_core *core =3D ctx->core; > >=20 > > enum vb2_buffer_state state; > > u32 status; > >=20 > > - status =3D readl(rkvdec->regs + RKVDEC_REG_INTERRUPT); > > - writel(0, rkvdec->regs + RKVDEC_REG_INTERRUPT); > > + status =3D readl(core->regs + RKVDEC_REG_INTERRUPT); > > + writel(0, core->regs + RKVDEC_REG_INTERRUPT); > >=20 > > if (status & RKVDEC_RDY_STA) { > > =09 > > state =3D VB2_BUF_STATE_DONE; > > =09 > > } else { > > =09 > > state =3D VB2_BUF_STATE_ERROR; > > if (status & RKVDEC_SOFTRESET_RDY) > >=20 > > - rkvdec_iommu_restore(rkvdec); > > + rkvdec_iommu_restore(core); > >=20 > > } > >=20 > > - if (cancel_delayed_work(&rkvdec->watchdog_work)) > > + if (cancel_delayed_work(&core->watchdog_work)) > >=20 > > rkvdec_job_finish(ctx, state); > > =09 > > return IRQ_HANDLED; > >=20 > > @@ -1460,12 +1462,12 @@ static irqreturn_t rk3399_irq_handler(struct > > rkvdec_ctx *ctx)>=20 > > static irqreturn_t vdpu381_irq_handler(struct rkvdec_ctx *ctx) > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D ctx->dev; > > + struct rkvdec_core *core =3D ctx->core; > >=20 > > enum vb2_buffer_state state; > > u32 status; > >=20 > > - status =3D readl(rkvdec->regs + VDPU381_REG_STA_INT); > > - writel(0, rkvdec->regs + VDPU381_REG_STA_INT); > > + status =3D readl(core->regs + VDPU381_REG_STA_INT); > > + writel(0, core->regs + VDPU381_REG_STA_INT); > >=20 > > if (status & VDPU381_STA_INT_DEC_RDY_STA) { > > =09 > > state =3D VB2_BUF_STATE_DONE; > >=20 > > @@ -1474,10 +1476,10 @@ static irqreturn_t vdpu381_irq_handler(struct > > rkvdec_ctx *ctx)>=20 > > if (status & (VDPU381_STA_INT_SOFTRESET_RDY | > > =09 > > VDPU381_STA_INT_TIMEOUT | > > VDPU381_STA_INT_ERROR)) > >=20 > > - rkvdec_iommu_restore(rkvdec); > > + rkvdec_iommu_restore(core); > >=20 > > } > >=20 > > - if (cancel_delayed_work(&rkvdec->watchdog_work)) > > + if (cancel_delayed_work(&core->watchdog_work)) > >=20 > > rkvdec_job_finish(ctx, state); > > =09 > > return IRQ_HANDLED; > >=20 > > @@ -1485,24 +1487,24 @@ static irqreturn_t vdpu381_irq_handler(struct > > rkvdec_ctx *ctx)>=20 > > static irqreturn_t vdpu383_irq_handler(struct rkvdec_ctx *ctx) > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D ctx->dev; > > + struct rkvdec_core *core =3D ctx->core; > >=20 > > enum vb2_buffer_state state; > > u32 status; > >=20 > > - status =3D readl(rkvdec->link + VDPU383_LINK_STA_INT); > > - writel(FIELD_PREP_WM16(VDPU383_STA_INT_ALL, 0), rkvdec->link + > > VDPU383_LINK_STA_INT); + status =3D readl(core->link + > > VDPU383_LINK_STA_INT); > > + writel(FIELD_PREP_WM16(VDPU383_STA_INT_ALL, 0), core->link + > > VDPU383_LINK_STA_INT);>=20 > > /* On vdpu383, the interrupts must be disabled */ > > writel(FIELD_PREP_WM16(VDPU383_INT_EN_IRQ |=20 VDPU383_INT_EN_LINE_IRQ, 0), > >=20 > > - rkvdec->link + VDPU383_LINK_INT_EN); > > + core->link + VDPU383_LINK_INT_EN); > >=20 > > if (status & VDPU383_STA_INT_DEC_RDY_STA) { > > =09 > > state =3D VB2_BUF_STATE_DONE; > > =09 > > } else { > > =09 > > state =3D VB2_BUF_STATE_ERROR; > >=20 > > - rkvdec_iommu_restore(rkvdec); > > + rkvdec_iommu_restore(core); > >=20 > > } > >=20 > > - if (cancel_delayed_work(&rkvdec->watchdog_work)) > > + if (cancel_delayed_work(&core->watchdog_work)) > >=20 > > rkvdec_job_finish(ctx, state); > > =09 > > return IRQ_HANDLED; > >=20 > > @@ -1510,11 +1512,14 @@ static irqreturn_t vdpu383_irq_handler(struct > > rkvdec_ctx *ctx)>=20 > > static irqreturn_t rkvdec_irq_handler(int irq, void *priv) > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D priv; > > - struct rkvdec_ctx *ctx =3D v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); > > - const struct rkvdec_variant *variant =3D rkvdec->variant; > > + irqreturn_t ret; > > + struct rkvdec_core *core =3D priv; > > + struct rkvdec_ctx *ctx =3D core->curr_ctx; > > + const struct rkvdec_variant *variant =3D ctx->dev->variant; > > + > > + ret =3D variant->ops->irq_handler(ctx); > >=20 > > - return variant->ops->irq_handler(ctx); > > + return ret; > >=20 > > } > > =20 > > /* > >=20 > > @@ -1591,62 +1596,19 @@ static void vdpu383_flatten_matrices(u8 *output, > > const u8 *input, int matrices,>=20 > > static void rkvdec_watchdog_func(struct work_struct *work) > > { > >=20 > > - struct rkvdec_dev *rkvdec; > > + struct rkvdec_core *core; > >=20 > > struct rkvdec_ctx *ctx; > >=20 > > - rkvdec =3D container_of(to_delayed_work(work), struct rkvdec_dev, > > + core =3D container_of(to_delayed_work(work), struct rkvdec_core, > >=20 > > watchdog_work); > >=20 > > - ctx =3D v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); > > + ctx =3D core->curr_ctx; > >=20 > > if (ctx) { > >=20 > > - dev_err(rkvdec->dev, "Frame processing timed out!\n"); > > - writel(RKVDEC_IRQ_DIS, rkvdec->regs +=20 RKVDEC_REG_INTERRUPT); > > + dev_err(core->dev, "Frame processing timed out!\n"); > > + writel(RKVDEC_IRQ_DIS, core->regs +=20 RKVDEC_REG_INTERRUPT); > >=20 > > rkvdec_job_finish(ctx, VB2_BUF_STATE_ERROR); > > =09 > > } > > =20 > > } > >=20 > > -/* > > - * Some SoCs, like RK3588 have multiple identical VDPU cores, but the > > - * kernel is currently missing support for multi-core handling. Exposi= ng > > - * separate devices for each core to userspace is bad, since that does > > - * not allow scheduling tasks properly (and creates ABI). With this > > workaround - * the driver will only probe for the first core and early > > exit for the other - * cores. Once the driver gains multi-core support, > > the same technique - * for detecting the first core can be used to > > cluster all cores together. - */ > > -static int rkvdec_disable_multicore(struct rkvdec_dev *rkvdec) > > -{ > > - struct device_node *node =3D NULL; > > - const char *compatible; > > - bool is_first_core; > > - int ret; > > - > > - /* Intentionally ignores the fallback strings */ > > - ret =3D of_property_read_string(rkvdec->dev->of_node, "compatible", > > &compatible); - if (ret) > > - return ret; > > - > > - /* The first compatible and available node found is considered the=20 main > > core */ - do { > > - node =3D of_find_compatible_node(node, NULL, compatible); > > - if (of_device_is_available(node)) > > - break; > > - } while (node); > > - > > - if (!node) > > - return -EINVAL; > > - > > - is_first_core =3D (rkvdec->dev->of_node =3D=3D node); > > - > > - of_node_put(node); > > - > > - if (!is_first_core) { > > - dev_info(rkvdec->dev, "missing multi-core support,=20 ignoring this > > instance\n"); - return -ENODEV; > > - } > > - > > - return 0; > > -} > > - > >=20 > > static const struct rkvdec_variant_ops rk3399_variant_ops =3D { > > =20 > > .irq_handler =3D rk3399_irq_handler, > > .colmv_size =3D rkvdec_colmv_size, > >=20 > > @@ -1757,49 +1719,75 @@ static const struct of_device_id of_rkvdec_matc= h[] > > =3D {>=20 > > }; > > MODULE_DEVICE_TABLE(of, of_rkvdec_match); > >=20 > > -static int rkvdec_probe(struct platform_device *pdev) > > +static int rkvdec_core_bind(struct device *dev, struct device *master, > > void *data) +{ > > + struct platform_device *pdev =3D to_platform_device(dev); > > + struct rkvdec_core *core =3D platform_get_drvdata(pdev); > > + struct rkvdec_dev *rkvdec =3D data; > > + > > + if (rkvdec->main_core) > > + return dev_err_probe(dev, -EBUSY, > > + "rkvdec already has a bound=20 core\n"); > > + > > + rkvdec->main_core =3D core; > > + > > + dev_info(dev, "Registered core\n"); > > + > > + return 0; > > +} > > + > > +static const struct component_ops rkvdec_core_ops =3D { > > + .bind =3D rkvdec_core_bind, > > +}; > > + > > +static int rkvdec_core_probe(struct platform_device *pdev) > >=20 > > { > > =20 > > const struct rkvdec_variant *variant; > >=20 > > - struct rkvdec_dev *rkvdec; > > + struct rkvdec_core *core; > >=20 > > int ret, irq; > >=20 > > + if (!pdev->dev.of_node) > > + return -ENODEV; > > + > >=20 > > variant =3D of_device_get_match_data(&pdev->dev); > > if (!variant) > >=20 > > - return -EINVAL; > > + return dev_err_probe(&pdev->dev, -ENODEV, "failed to=20 get match > > data\n"); > >=20 > > - rkvdec =3D devm_kzalloc(&pdev->dev, sizeof(*rkvdec), GFP_KERNEL); > > - if (!rkvdec) > > + core =3D devm_kzalloc(&pdev->dev, sizeof(*core), GFP_KERNEL); > > + if (!core) > >=20 > > return -ENOMEM; > >=20 > > - platform_set_drvdata(pdev, rkvdec); > > - rkvdec->dev =3D &pdev->dev; > > - rkvdec->variant =3D variant; > > - mutex_init(&rkvdec->vdev_lock); > > - INIT_DELAYED_WORK(&rkvdec->watchdog_work, rkvdec_watchdog_func); > > - > > - ret =3D rkvdec_disable_multicore(rkvdec); > > - if (ret) > > - return ret; > > + core->dev =3D &pdev->dev; > > + INIT_DELAYED_WORK(&core->watchdog_work, rkvdec_watchdog_func); > >=20 > > - ret =3D devm_clk_bulk_get_all_enabled(&pdev->dev, &rkvdec->clocks); > > + ret =3D devm_clk_bulk_get_all_enabled(&pdev->dev, &core->clocks); >=20 > Just a note, we'll have a conflict here, someone noted that PM runtime > should enable the clock instead, there is a small fix that might be picked > before this one. Just rebase if that happens. I'll rebase before sending the next version > > if (ret < 0) > > =09 > > return ret; > >=20 > > + core->num_clocks =3D ret; > >=20 > > - rkvdec->num_clocks =3D ret; > > - rkvdec->axi_clk =3D devm_clk_get(&pdev->dev, "axi"); > > + core->axi_clk =3D devm_clk_get(&pdev->dev, "axi"); > >=20 > > - if (rkvdec->variant->has_single_reg_region) { > > - rkvdec->regs =3D devm_platform_ioremap_resource(pdev, 0); > > - if (IS_ERR(rkvdec->regs)) > > - return PTR_ERR(rkvdec->regs); > > + if (variant->has_single_reg_region) { > > + core->regs =3D devm_platform_ioremap_resource(pdev, 0); > > + if (IS_ERR(core->regs)) > > + return PTR_ERR(core->regs); > >=20 > > } else { > >=20 > > - rkvdec->regs =3D=20 devm_platform_ioremap_resource_byname(pdev, "function"); > > - if (IS_ERR(rkvdec->regs)) > > - return PTR_ERR(rkvdec->regs); > > + core->regs =3D=20 devm_platform_ioremap_resource_byname(pdev, "function"); > > + if (IS_ERR(core->regs)) > > + return PTR_ERR(core->regs); > > + > > + core->link =3D=20 devm_platform_ioremap_resource_byname(pdev, "link"); > > + if (IS_ERR(core->link)) > > + return PTR_ERR(core->link); > > + } > > + > > + if (iommu_get_domain_for_dev(&pdev->dev)) { > > + core->empty_domain =3D iommu_paging_domain_alloc(core- >dev); > >=20 > > - rkvdec->link =3D=20 devm_platform_ioremap_resource_byname(pdev, "link"); > > - if (IS_ERR(rkvdec->link)) > > - return PTR_ERR(rkvdec->link); > > + if (IS_ERR(core->empty_domain)) { > > + dev_warn(core->dev, "cannot alloc new empty=20 domain\n"); > > + core->empty_domain =3D NULL; > > + } > >=20 > > } > > =09 > > ret =3D dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); > >=20 > > @@ -1816,32 +1804,26 @@ static int rkvdec_probe(struct platform_device > > *pdev)>=20 > > ret =3D devm_request_threaded_irq(&pdev->dev, irq, NULL, > > =09 > > rkvdec_irq_handler,=20 IRQF_ONESHOT, > >=20 > > - dev_name(&pdev->dev),=20 rkvdec); > > + dev_name(&pdev->dev),=20 core); > >=20 > > if (ret) { > >=20 > > - dev_err(&pdev->dev, "Could not request vdec IRQ\n"); > > + dev_err(&pdev->dev, "Could not request core IRQ\n"); > >=20 > > return ret; > > =09 > > } > >=20 > > - rkvdec->sram_pool =3D of_gen_pool_get(pdev->dev.of_node, "sram", 0); > > - if (!rkvdec->sram_pool && rkvdec->variant->num_rcb_sizes > 0) > > + core->sram_pool =3D of_gen_pool_get(pdev->dev.of_node, "sram", 0); > > + if (!core->sram_pool && variant->num_rcb_sizes > 0) > >=20 > > dev_info(&pdev->dev, "No sram node, RCB will be stored=20 in RAM\n"); > > =09 > > pm_runtime_set_autosuspend_delay(&pdev->dev, 100); > > pm_runtime_use_autosuspend(&pdev->dev); > > pm_runtime_enable(&pdev->dev); > >=20 > > - ret =3D rkvdec_v4l2_init(rkvdec); > > - if (ret) > > - goto err_disable_runtime_pm; > > + platform_set_drvdata(pdev, core); > >=20 > > - rkvdec->iommu_domain =3D iommu_get_domain_for_dev(&pdev->dev); > > - if (rkvdec->iommu_domain) { > > - rkvdec->empty_domain =3D=20 iommu_paging_domain_alloc(rkvdec->dev); > > - > > - if (IS_ERR(rkvdec->empty_domain)) { > > - rkvdec->empty_domain =3D NULL; > > - dev_warn(rkvdec->dev, "cannot alloc new=20 empty domain\n"); > > - } > > + ret =3D component_add(&pdev->dev, &rkvdec_core_ops); > > + if (ret < 0) { > > + dev_err(&pdev->dev, "failed to register component:=20 %d\n", ret); > > + goto err_disable_runtime_pm; > >=20 > > } > > =09 > > return 0; > >=20 > > @@ -1849,60 +1831,254 @@ static int rkvdec_probe(struct platform_device > > *pdev)>=20 > > err_disable_runtime_pm: > > pm_runtime_dont_use_autosuspend(&pdev->dev); > > pm_runtime_disable(&pdev->dev); > >=20 > > - > > - if (rkvdec->sram_pool) > > - gen_pool_destroy(rkvdec->sram_pool); > > + if (core->empty_domain) > > + iommu_domain_free(core->empty_domain); > >=20 > > return ret; > > =20 > > } > >=20 > > -static void rkvdec_remove(struct platform_device *pdev) > > +static void rkvdec_core_remove(struct platform_device *pdev) > >=20 > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D platform_get_drvdata(pdev); > > + struct rkvdec_core *core =3D platform_get_drvdata(pdev); > >=20 > > - cancel_delayed_work_sync(&rkvdec->watchdog_work); > > + component_del(&pdev->dev, &rkvdec_core_ops); > >=20 > > - rkvdec_v4l2_cleanup(rkvdec); > > - pm_runtime_disable(&pdev->dev); > >=20 > > pm_runtime_dont_use_autosuspend(&pdev->dev); > >=20 > > + pm_runtime_disable(&pdev->dev); > >=20 > > - if (rkvdec->empty_domain) > > - iommu_domain_free(rkvdec->empty_domain); > > + if (core->empty_domain) > > + iommu_domain_free(core->empty_domain); > >=20 > > } > > =20 > > #ifdef CONFIG_PM > >=20 > > -static int rkvdec_runtime_resume(struct device *dev) > > +static int rkvdec_core_runtime_resume(struct device *dev) > >=20 > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D dev_get_drvdata(dev); > > + struct rkvdec_core *core =3D dev_get_drvdata(dev); > >=20 > > - return clk_bulk_prepare_enable(rkvdec->num_clocks, rkvdec- >clocks); > > + return clk_bulk_prepare_enable(core->num_clocks, core->clocks); > >=20 > > } > >=20 > > -static int rkvdec_runtime_suspend(struct device *dev) > > +static int rkvdec_core_runtime_suspend(struct device *dev) > >=20 > > { > >=20 > > - struct rkvdec_dev *rkvdec =3D dev_get_drvdata(dev); > > + struct rkvdec_core *core =3D dev_get_drvdata(dev); > > + > > + clk_bulk_disable_unprepare(core->num_clocks, core->clocks); > >=20 > > - clk_bulk_disable_unprepare(rkvdec->num_clocks, rkvdec->clocks); > >=20 > > return 0; > > =20 > > } > > #endif > >=20 > > -static const struct dev_pm_ops rkvdec_pm_ops =3D { > > +static const struct dev_pm_ops rkvdec_core_pm_ops =3D { > >=20 > > SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, > > =09 > > pm_runtime_force_resume) > >=20 > > - SET_RUNTIME_PM_OPS(rkvdec_runtime_suspend, rkvdec_runtime_resume,=20 NULL) > > + SET_RUNTIME_PM_OPS(rkvdec_core_runtime_suspend, > > + rkvdec_core_runtime_resume, NULL) > > +}; > > + > > +static struct platform_driver rkvdec_core_pdrv =3D { > > + .probe =3D rkvdec_core_probe, > > + .remove =3D rkvdec_core_remove, > > + .driver =3D { > > + .name =3D "rkvdec-core", > > + .of_match_table =3D of_rkvdec_match, > > + .pm =3D &rkvdec_core_pm_ops, > > + }, > > +}; > > + > > +static int rkvdec_bind(struct device *dev) > > +{ > > + struct rkvdec_dev *rkvdec =3D dev_get_drvdata(dev); > > + int ret; > > + > > + ret =3D component_bind_all(dev, rkvdec); > > + if (ret) { > > + dev_err(dev, "component bind failed\n"); > > + return ret; > > + } > > + > > + ret =3D rkvdec_v4l2_init(rkvdec); > > + if (ret) > > + goto err_unbind; > > + > > + return 0; > > + > > +err_unbind: > > + component_unbind_all(dev, NULL); > > + return ret; > > +} > > + > > +static void rkvdec_unbind(struct device *dev) > > +{ > > + struct rkvdec_dev *rkvdec =3D dev_get_drvdata(dev); > > + > > + cancel_delayed_work_sync(&rkvdec->main_core->watchdog_work); > > + > > + rkvdec_v4l2_cleanup(rkvdec); > > + > > + rkvdec_free_rcb(rkvdec, rkvdec->main_core); > > + > > + component_unbind_all(dev, NULL); > > +} > > + > > +static const struct component_master_ops rkvdec_master_ops =3D { > > + .bind =3D rkvdec_bind, > > + .unbind =3D rkvdec_unbind, > >=20 > > }; > >=20 > > -static struct platform_driver rkvdec_driver =3D { > > +static int rkvdec_probe(struct platform_device *pdev) > > +{ > > + const struct of_device_id *match_desc =3D pdev->dev.platform_data; > > + struct device *dev =3D &pdev->dev; > > + struct component_match *match =3D NULL; > > + struct device_node *core_node; > > + struct rkvdec_dev *rkvdec; > > + > > + if (!match_desc) > > + return dev_err_probe(dev, -ENODEV, "missing platform=20 data\n"); > > + > > + for_each_compatible_node(core_node, NULL, match_desc->compatible)=20 { > > + if (!of_device_is_available(core_node)) > > + continue; > > + > > + of_node_get(core_node); > > + component_match_add_release(dev, &match,=20 component_release_of, > > + =20 component_compare_of, core_node); > > + } > > + > > + if (!match) > > + return dev_err_probe(dev, -ENODEV, > > + "no matching available=20 component devices found\n"); > > + > > + rkvdec =3D devm_kzalloc(dev, sizeof(*rkvdec), GFP_KERNEL); > > + if (!rkvdec) > > + return -ENOMEM; > > + > > + rkvdec->variant =3D match_desc->data; > > + if (!rkvdec->variant) > > + return dev_err_probe(dev, -ENODEV, "failed to get match=20 data\n"); > > + > > + mutex_init(&rkvdec->vdev_lock); > > + > > + dev_set_drvdata(dev, rkvdec); > > + > > + return component_master_add_with_match(dev, &rkvdec_master_ops,=20 match); > > +} > > + > > +static void rkvdec_remove(struct platform_device *pdev) > > +{ > > + component_master_del(&pdev->dev, &rkvdec_master_ops); > > +} > > + > > +static struct platform_driver rkvdec_pdrv =3D { > >=20 > > .probe =3D rkvdec_probe, > > .remove =3D rkvdec_remove, > > .driver =3D { > >=20 > > - .name =3D "rkvdec", > > - .of_match_table =3D of_rkvdec_match, > > - .pm =3D &rkvdec_pm_ops, > > + .name =3D "rkvdec", > >=20 > > }, > > =20 > > }; > >=20 > > -module_platform_driver(rkvdec_driver); > > + > > +static bool rkvdec_of_has_available_node(const char *compat) > > +{ > > + struct device_node *node; > > + > > + for_each_compatible_node(node, NULL, compat) { > > + if (of_device_is_available(node)) { > > + of_node_put(node); > > + return true; > > + } > > + } > > + > > + return false; > > +} > > + > > +static int rkvdec_create_platform_device(struct platform_device **ppde= v, > > + const struct=20 of_device_id *match) > > +{ > > + struct platform_device *pdev; > > + int ret; > > + > > + pdev =3D platform_device_alloc(match->compatible,=20 PLATFORM_DEVID_NONE); > > + if (!pdev) > > + return -ENOMEM; > > + > > + ret =3D platform_device_add_data(pdev, match, sizeof(*match)); > > + if (ret) > > + goto free_platform_device; > > + > > + ret =3D platform_device_add(pdev); > > + if (ret) > > + goto free_platform_device; > > + > > + ret =3D device_driver_attach(&rkvdec_pdrv.driver, &pdev->dev); > > + if (ret) > > + goto del_platform_device; > > + > > + *ppdev =3D pdev; > > + > > + return 0; > > + > > +del_platform_device: > > + platform_device_del(pdev); > > +free_platform_device: > > + platform_device_put(pdev); > > + return ret; > > +} > > + > > +static struct platform_device *master_pdevs[ARRAY_SIZE(of_rkvdec_match= ) - > > 1]; + > > +static int __init rkvdec_init(void) > > +{ > > + unsigned int i; > > + int ret; > > + > > + ret =3D platform_driver_register(&rkvdec_core_pdrv); > > + if (ret) > > + return ret; > > + > > + ret =3D platform_driver_register(&rkvdec_pdrv); > > + if (ret) > > + goto unregister_core_driver; > > + > > + for (i =3D 0; i < ARRAY_SIZE(master_pdevs); i++) { > > + if (! rkvdec_of_has_available_node(of_rkvdec_match[i].compatible)) > > + continue; > > + > > + ret =3D rkvdec_create_platform_device(&master_pdevs[i], > > + =20 &of_rkvdec_match[i]); > > + if (ret) > > + goto unregister_platform_devices; > > + } > > + > > + return 0; > > + > > +unregister_platform_devices: > > + for (i =3D 0; i < ARRAY_SIZE(master_pdevs); i++) { > > + if (master_pdevs[i]) { > > + platform_device_unregister(master_pdevs[i]); > > + master_pdevs[i] =3D NULL; > > + } > > + } > > + platform_driver_unregister(&rkvdec_pdrv); > > +unregister_core_driver: > > + platform_driver_unregister(&rkvdec_core_pdrv); > > + return ret; > > +} > > +module_init(rkvdec_init); > > + > > +static void __exit rkvdec_exit(void) > > +{ > > + unsigned int i; > > + > > + for (i =3D 0; i < ARRAY_SIZE(master_pdevs); i++) { > > + if (master_pdevs[i]) { > > + platform_device_unregister(master_pdevs[i]); > > + master_pdevs[i] =3D NULL; > > + } > > + } > > + platform_driver_unregister(&rkvdec_pdrv); > > + platform_driver_unregister(&rkvdec_core_pdrv); > > +} > > +module_exit(rkvdec_exit); > >=20 > > MODULE_AUTHOR("Boris Brezillon "); > > MODULE_DESCRIPTION("Rockchip Video Decoder driver"); > >=20 > > diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.h > > b/drivers/media/platform/rockchip/rkvdec/rkvdec.h index > > a24be6638b6b..36eadcfcabdb 100644 > > --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.h > > +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.h > > @@ -125,23 +125,28 @@ struct rkvdec_coded_fmt_desc { > >=20 > > u32 subsystem_flags; > > =20 > > }; > >=20 > > -struct rkvdec_dev { > > - struct v4l2_device v4l2_dev; > > - struct media_device mdev; > > - struct video_device vdev; > > - struct v4l2_m2m_dev *m2m_dev; > > +struct rkvdec_core { > >=20 > > struct device *dev; > > struct clk_bulk_data *clocks; > > unsigned int num_clocks; > > struct clk *axi_clk; > > void __iomem *regs; > > void __iomem *link; > >=20 > > - struct mutex vdev_lock; /* serializes ioctls */ > >=20 > > struct delayed_work watchdog_work; > > struct gen_pool *sram_pool; > >=20 > > - struct iommu_domain *iommu_domain; > >=20 > > struct iommu_domain *empty_domain; > >=20 > > + struct rkvdec_rcb_config *rcb_config; > > + struct rkvdec_ctx *curr_ctx; > > +}; > > + > > +struct rkvdec_dev { > > + struct v4l2_device v4l2_dev; > > + struct media_device mdev; > > + struct video_device vdev; > > + struct v4l2_m2m_dev *m2m_dev; > > + struct mutex vdev_lock; /* serializes ioctls */ > >=20 > > const struct rkvdec_variant *variant; > >=20 > > + struct rkvdec_core *main_core; > >=20 > > }; > > =20 > > struct rkvdec_ctx { > >=20 > > @@ -152,8 +157,8 @@ struct rkvdec_ctx { > >=20 > > struct v4l2_ctrl_handler ctrl_hdl; > > struct rkvdec_dev *dev; > > enum rkvdec_image_fmt image_fmt; > >=20 > > - struct rkvdec_rcb_config *rcb_config; > >=20 > > u32 colmv_offset; > >=20 > > + struct rkvdec_core *core; > >=20 > > void *priv; > > u8 has_sps_st_rps: 1; > > u8 has_sps_lt_rps: 1; > >=20 > > @@ -179,7 +184,7 @@ struct rkvdec_aux_buf { > >=20 > > void rkvdec_run_preamble(struct rkvdec_ctx *ctx, struct rkvdec_run *ru= n); > > void rkvdec_run_postamble(struct rkvdec_ctx *ctx, struct rkvdec_run > > *run); > > void rkvdec_memcpy_toio(void __iomem *dst, void *src, size_t len); > >=20 > > -void rkvdec_schedule_watchdog(struct rkvdec_dev *rkvdec, u32 > > timeout_threshold); +void rkvdec_schedule_watchdog(struct rkvdec_core > > *core, u32 timeout_threshold);>=20 > > void rkvdec_quirks_disable_qos(struct rkvdec_ctx *ctx); >=20 > So not that much, yet the iommu restore hack seems broken now at first > sight. I don't agree for this commit. > Nicolas