From: Frank Li <Frank.li@nxp.com>
To: "Ming Qian(OSS)" <ming.qian@oss.nxp.com>
Cc: mchehab@kernel.org, hverkuil-cisco@xs4all.nl,
mirela.rabulea@oss.nxp.com, nicolas@ndufresne.ca,
shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com, xiahong.bao@nxp.com,
eagle.zhou@nxp.com, linux-imx@nxp.com, imx@lists.linux.dev,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] media: imx-jpeg: Add encoder V1 support for i.MX952
Date: Thu, 29 Jan 2026 11:22:42 -0500 [thread overview]
Message-ID: <aXuJUhFEmhjBbulb@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <69a3d328-748c-445d-bcbd-823b5b314543@oss.nxp.com>
On Thu, Jan 29, 2026 at 09:42:39AM +0800, Ming Qian(OSS) wrote:
>
> Hi Frank,
>
> On 1/29/2026 4:48 AM, Frank Li wrote:
> > On Tue, Jan 27, 2026 at 03:37:00PM +0800, ming.qian@oss.nxp.com wrote:
> > > From: Ming Qian <ming.qian@oss.nxp.com>
> > >
> > > The i.MX952 SoC features an upgraded JPEG encoder (version 1) with
> > > enhanced descriptor-based configuration capabilities.
> > >
> > > The hardware version can be determined by reading the
> > > version register.
> > >
> > > The v1 encoder uses an expanded descriptor format that allows
> > > configuring all encoding parameters, including JPEG quality,
> > > directly in the descriptor. This eliminates the manual
> > > configuration phase required by v0 and reduces the interrupt
> > > count from two to one per frame.
> > >
> > > V0 encoding flow:
> > > 1. Write quality to registers -> trigger config interrupt
> > > 2. Start encoding -> trigger completion interrupt
> > >
> > > V1 encoding flow:
> > > 1. Configure descriptor with all parameters including quality
> > > 2. Start encoding -> trigger completion interrupt
> >
...
> > > + /* Manual configuration (v0 hardware) - two-phase process */
> > > + void (*enter_config_mode)(struct mxc_jpeg_ctx *ctx);
> > > + void (*exit_config_mode)(struct mxc_jpeg_ctx *ctx);
> > > +
> > > + /* Descriptor-based configuration (v1 hardware) - single-phase */
> > > + void (*setup_desc)(struct mxc_jpeg_ctx *ctx);
> >
> > You use callback, suppose callback name should be the same for v0 and v1.
> >
> > for example:
> >
> > void (*setup_config)()
> > void (*clean_config)()
> >
> > v0 enter_config_mode() -> .setup_config
> > exit_config_mode() -> .clean_config
> >
> > v1
> > setup_desc -> .setup_config
> > NULL -> .clean_config.
> >
> > Frank
> >
>
> However, the flow for calling the callback in v0 and v1 are different.
> If use the same callback name, then additional checks will be required
> during the call.
> Therefore, I prefer to use different names to handle the different flow.
Okay, you use hidden null pointer check. Generanlly, if no reuse for
callback, simple direct call to function.
But it is not big deal. This ways is also okay.
Frank
>
> Regards,
> Ming
>
> > > +};
> > > +
> > > struct mxc_jpeg_dev {
> > > spinlock_t hw_lock; /* hardware access lock */
> > > unsigned int mode;
> > > @@ -142,6 +163,7 @@ struct mxc_jpeg_dev {
> > > struct device **pd_dev;
> > > struct device_link **pd_link;
> > > struct gen_pool *sram_pool;
> > > + const struct mxc_jpeg_enc_ops *enc_cfg_ops;
> > > };
> > >
> > > /**
> > >
> > > base-commit: c824345288d11e269ce41b36c105715bc2286050
> > > prerequisite-patch-id: 0000000000000000000000000000000000000000
> > > --
> > > 2.52.0
> > >
prev parent reply other threads:[~2026-01-29 16:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-27 7:37 ming.qian
2026-01-28 20:48 ` Frank Li
2026-01-29 1:42 ` Ming Qian(OSS)
2026-01-29 16:22 ` Frank Li [this message]
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=aXuJUhFEmhjBbulb@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=eagle.zhou@nxp.com \
--cc=festevam@gmail.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ming.qian@oss.nxp.com \
--cc=mirela.rabulea@oss.nxp.com \
--cc=nicolas@ndufresne.ca \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=xiahong.bao@nxp.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®