From: Sakari Ailus <sakari.ailus@iki.fi>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH v3 9/9] omap3isp: preview: Shorten shadow update delay
Date: Tue, 17 Apr 2012 21:41:01 +0300 [thread overview]
Message-ID: <20120417184100.GH5356@valkosipuli.localdomain> (raw)
In-Reply-To: <2049798.AIViuaqhSZ@avalon>
Hi Laurent,
On Tue, Apr 17, 2012 at 06:09:27PM +0200, Laurent Pinchart wrote:
> Hi Sakari,
>
> On Tuesday 17 April 2012 17:26:00 Sakari Ailus wrote:
> > Hi Laurent,
> >
> > Many thanks for the patch!!
>
> And thank you for the review.
>
> > On Mon, Apr 16, 2012 at 03:29:54PM +0200, Laurent Pinchart wrote:
> > > When applications modify preview engine parameters, the new values are
> > > applied to the hardware by the preview engine interrupt handler during
> > > vertical blanking. If the parameters are being changed when the
> > > interrupt handler is called, it just delays applying the parameters
> > > until the next frame.
> > >
> > > If an application modifies the parameters for every frame, and the
> > > preview engine interrupt is triggerred synchronously, the parameters are
> > > never applied to the hardware.
> > >
> > > Fix this by storing new parameters in a shadow copy, and switch the
> > > active parameters with the shadow values atomically.
> > >
> > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > ---
> > >
> > > drivers/media/video/omap3isp/isppreview.c | 298 +++++++++++++++---------
> > > drivers/media/video/omap3isp/isppreview.h | 21 ++-
> > > 2 files changed, 212 insertions(+), 107 deletions(-)
> > >
> > > diff --git a/drivers/media/video/omap3isp/isppreview.c
> > > b/drivers/media/video/omap3isp/isppreview.c index e12df2c..5ccfe46 100644
> > > --- a/drivers/media/video/omap3isp/isppreview.c
> > > +++ b/drivers/media/video/omap3isp/isppreview.c
> > > @@ -649,12 +649,18 @@ preview_config_rgb_to_ycbcr(struct isp_prev_device
> > > *prev, const void *prev_csc)
> >
> > Not related to this patch, but shouldn't the above function be called
> > preview_config_csc()?
>
> That would make sense, yes. I'll add a patch for that.
>
> > > static void
> > > preview_update_contrast(struct isp_prev_device *prev, u8 contrast)
> > > {
> > > - struct prev_params *params = &prev->params;
> > > + struct prev_params *params;
> > > + unsigned long flags;
> > > +
> > > + spin_lock_irqsave(&prev->params.lock, flags);
> > > + params = (prev->params.active & OMAP3ISP_PREV_CONTRAST)
> > > + ? &prev->params.params[0] : &prev->params.params[1];
> > >
> > > if (params->contrast != (contrast * ISPPRV_CONTRAST_UNITS)) {
> > > params->contrast = contrast * ISPPRV_CONTRAST_UNITS;
> > > - prev->update |= OMAP3ISP_PREV_CONTRAST;
> > > + params->update |= OMAP3ISP_PREV_CONTRAST;
> > > }
> > > + spin_unlock_irqrestore(&prev->params.lock, flags);
> > > }
> > >
> > > /*
> > > @@ -681,12 +687,18 @@ preview_config_contrast(struct isp_prev_device
> > > *prev, const void *params)
> > > static void
> > > preview_update_brightness(struct isp_prev_device *prev, u8 brightness)
> > > {
> > > - struct prev_params *params = &prev->params;
> > > + struct prev_params *params;
> > > + unsigned long flags;
> > > +
> > > + spin_lock_irqsave(&prev->params.lock, flags);
> > > + params = (prev->params.active & OMAP3ISP_PREV_CONTRAST)
> > > + ? &prev->params.params[0] : &prev->params.params[1];
> >
> > params = prev->params.params[!(prev->params.active &
> > OMAP3ISP_PREV_CONTRAST)];
>
> I've thought about that, but it doesn't fit on a single line. After being
> split in two lines the result is less readable in my opinion. Do you think I
> should change it nonetheless ?
I would do it as you use similar constructs elsewhere. It's up to you.
Cheers,
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi jabber/XMPP/Gmail: sailus@retiisi.org.uk
prev parent reply other threads:[~2012-04-17 18:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 13:29 [PATCH v3 0/9] OMAP3 ISP preview engine configuration improvement Laurent Pinchart
2012-04-16 13:29 ` [PATCH v3 1/9] omap3isp: preview: Skip brightness and contrast in configuration ioctl Laurent Pinchart
2012-04-16 13:29 ` [PATCH v3 2/9] omap3isp: preview: Optimize parameters setup for the common case Laurent Pinchart
2012-04-16 17:03 ` Sakari Ailus
2012-04-16 13:29 ` [PATCH v3 3/9] omap3isp: preview: Remove averager parameter update flag Laurent Pinchart
2012-04-16 13:29 ` [PATCH v3 4/9] omap3isp: preview: Remove unused isptables_update structure definition Laurent Pinchart
2012-04-16 13:29 ` [PATCH v3 5/9] omap3isp: preview: Merge configuration and feature bits Laurent Pinchart
2012-04-16 17:08 ` Sakari Ailus
2012-04-16 13:29 ` [PATCH v3 6/9] omap3isp: preview: Remove update_attrs feature_bit field Laurent Pinchart
2012-04-16 18:00 ` Sakari Ailus
2012-04-16 13:29 ` [PATCH v3 7/9] omap3isp: preview: Rename prev_params fields to match userspace API Laurent Pinchart
2012-04-16 18:46 ` Sakari Ailus
2012-04-16 13:29 ` [PATCH v3 8/9] omap3isp: preview: Simplify configuration parameters access Laurent Pinchart
2012-04-16 20:01 ` Sakari Ailus
2012-04-16 13:29 ` [PATCH v3 9/9] omap3isp: preview: Shorten shadow update delay Laurent Pinchart
2012-04-17 14:26 ` Sakari Ailus
2012-04-17 16:09 ` Laurent Pinchart
2012-04-17 18:41 ` Sakari Ailus [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=20120417184100.GH5356@valkosipuli.localdomain \
--to=sakari.ailus@iki.fi \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
/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