All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasily Khoruzhick <anarsoul@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: PXA: Make PXA27x/PXA3xx overlay actually work
Date: Tue, 15 Feb 2011 08:41:21 +0000	[thread overview]
Message-ID: <201102151041.21560.anarsoul@gmail.com> (raw)
In-Reply-To: <AANLkTi=AfxN73pSNZ5RiTiTWfxR7PhcyJUyXzzeaYNWw@mail.gmail.com>

On Tuesday 15 February 2011 09:35:44 Eric Miao wrote:

> Or maybe simply:
> 
> 	if (lcd_readl(ofb->fbi, OVL1C1) & OVLxC1_OEN)
> 		return;

You mean if (!lcd_readl.....) return? Then OK.

> this makes this block of change much cleaner.
> 
> > -       lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] & ~OVLxC1_OEN);
> > +       if (lcd_readl(ofb->fbi, OVL1C1) & OVLxC1_OEN) {
> > +               lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] &

<skip>

> >  static struct pxafb_layer_ops ofb_ops[] = {
> > @@ -720,12 +726,10 @@ static int overlayfb_open(struct fb_info *info, int
> > user) if (user = 0)
> >                return -ENODEV;
> > 
> > -       /* allow only one user at a time */
> > -       if (atomic_inc_and_test(&ofb->usage))
> > -               return -EBUSY;
> > +       if (ofb->usage++ = 0)
> > +               /* unblank the base framebuffer */
> > +               fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
> 
> The change above allows multiple user at a time? Then I guess
> some other places need to be changed accordingly to avoid the
> racing conditions.

For multiple users driver needs some rework indeed.

> If this is a feature request, can we postpone it to subsequent
> patches?

I prefer to fix it later.

> >        lcd_writel(fbi, FDADR0, fbi->fdadr[0]);
> > -       lcd_writel(fbi, FDADR1, fbi->fdadr[1]);
> > +       if (fbi->lccr0 & LCCR0_SDS)
> > +               lcd_writel(fbi, FDADR1, fbi->fdadr[1]);
> 
> My original intention was to simplify the code a bit by ignoring
> LCCR0_SDS, as FDADR1 would not take effect if not enabled even
> if it's being read/written.

It leads to potential race condition when you try to reconfigure main plane 
and overlay1 simultaneously.

> > +#ifdef CONFIG_FB_PXA_OVERLAY
> > +       if (cpu_is_pxa27x())
> > +               fbi->lccr0 |= LCCR0_OUC;
> > +#endif
> > +
> 
> I seem to remember LCCR0_OUC is still valid on pxa3xx, did you
> do some test on pxa3xx as well?

Sorry, I have no any pxa3xx boards.
 
Regards
Vasily

WARNING: multiple messages have this Message-ID (diff)
From: anarsoul@gmail.com (Vasily Khoruzhick)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: PXA: Make PXA27x/PXA3xx overlay actually work
Date: Tue, 15 Feb 2011 10:41:21 +0200	[thread overview]
Message-ID: <201102151041.21560.anarsoul@gmail.com> (raw)
In-Reply-To: <AANLkTi=AfxN73pSNZ5RiTiTWfxR7PhcyJUyXzzeaYNWw@mail.gmail.com>

On Tuesday 15 February 2011 09:35:44 Eric Miao wrote:

> Or maybe simply:
> 
> 	if (lcd_readl(ofb->fbi, OVL1C1) & OVLxC1_OEN)
> 		return;

You mean if (!lcd_readl.....) return? Then OK.

> this makes this block of change much cleaner.
> 
> > -       lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] & ~OVLxC1_OEN);
> > +       if (lcd_readl(ofb->fbi, OVL1C1) & OVLxC1_OEN) {
> > +               lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] &

<skip>

> >  static struct pxafb_layer_ops ofb_ops[] = {
> > @@ -720,12 +726,10 @@ static int overlayfb_open(struct fb_info *info, int
> > user) if (user == 0)
> >                return -ENODEV;
> > 
> > -       /* allow only one user at a time */
> > -       if (atomic_inc_and_test(&ofb->usage))
> > -               return -EBUSY;
> > +       if (ofb->usage++ == 0)
> > +               /* unblank the base framebuffer */
> > +               fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
> 
> The change above allows multiple user at a time? Then I guess
> some other places need to be changed accordingly to avoid the
> racing conditions.

For multiple users driver needs some rework indeed.

> If this is a feature request, can we postpone it to subsequent
> patches?

I prefer to fix it later.

> >        lcd_writel(fbi, FDADR0, fbi->fdadr[0]);
> > -       lcd_writel(fbi, FDADR1, fbi->fdadr[1]);
> > +       if (fbi->lccr0 & LCCR0_SDS)
> > +               lcd_writel(fbi, FDADR1, fbi->fdadr[1]);
> 
> My original intention was to simplify the code a bit by ignoring
> LCCR0_SDS, as FDADR1 would not take effect if not enabled even
> if it's being read/written.

It leads to potential race condition when you try to reconfigure main plane 
and overlay1 simultaneously.

> > +#ifdef CONFIG_FB_PXA_OVERLAY
> > +       if (cpu_is_pxa27x())
> > +               fbi->lccr0 |= LCCR0_OUC;
> > +#endif
> > +
> 
> I seem to remember LCCR0_OUC is still valid on pxa3xx, did you
> do some test on pxa3xx as well?

Sorry, I have no any pxa3xx boards.
 
Regards
Vasily

  reply	other threads:[~2011-02-15  8:41 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 20:46 [PATCH] ARM: PXA: Make PXA27x/PXA3xx overlay actually work Vasily Khoruzhick
2011-02-02 20:46 ` Vasily Khoruzhick
2011-02-13 13:31 ` Russell King - ARM Linux
2011-02-13 13:31   ` Russell King - ARM Linux
2011-02-15  7:35 ` Eric Miao
2011-02-15  7:35   ` Eric Miao
2011-02-15  8:41   ` Vasily Khoruzhick [this message]
2011-02-15  8:41     ` Vasily Khoruzhick
2011-02-15 11:51     ` Eric Miao
2011-02-15 11:51       ` Eric Miao
2011-02-15 11:58       ` Vasily Khoruzhick
2011-02-15 11:58         ` Vasily Khoruzhick
2011-02-15 13:36         ` Eric Miao
2011-02-15 13:36           ` Eric Miao
2011-02-15 13:51           ` Vasily Khoruzhick
2011-02-15 13:51             ` Vasily Khoruzhick
2011-02-15 15:12             ` Eric Miao
2011-02-15 15:12               ` Eric Miao
2011-02-15 15:18               ` Vasily Khoruzhick
2011-02-15 15:18                 ` Vasily Khoruzhick
2011-02-17  7:43                 ` [PATCH 1/2] ARM: PXA: PXAFB: Fix double-free issue Vasily Khoruzhick
2011-02-17  7:43                   ` Vasily Khoruzhick
2011-02-17  7:43                   ` [PATCH 2/2] ARM: PXA: PXAFB: fix plane Z-ordering problem Vasily Khoruzhick
2011-02-17  7:43                     ` Vasily Khoruzhick
2011-02-17 11:03                   ` [PATCH 1/2] ARM: PXA: PXAFB: Fix double-free issue Russell King - ARM Linux
2011-02-17 11:03                     ` Russell King - ARM Linux
2011-02-17 11:06                     ` Vasily Khoruzhick
2011-02-17 11:06                       ` Vasily Khoruzhick
2011-02-20 15:02                     ` [PATCH v2 1/3] " Vasily Khoruzhick
2011-02-20 15:02                       ` Vasily Khoruzhick
2011-02-20 15:02                       ` [PATCH v2 2/3] ARM: PXA: PXAFB: Fix plane Z-ordering problem Vasily Khoruzhick
2011-02-20 15:02                         ` Vasily Khoruzhick
2011-02-20 15:02                       ` [PATCH v2 3/3] ARM: PXA: PXAFB: Fix typo in ypos assignment Vasily Khoruzhick
2011-02-20 15:02                         ` Vasily Khoruzhick
2011-02-20 18:47                         ` Marek Vasut
2011-02-20 18:47                           ` Marek Vasut
2011-02-20 18:46                       ` [PATCH v2 1/3] ARM: PXA: PXAFB: Fix double-free issue Marek Vasut
2011-02-20 18:46                         ` Marek Vasut
2011-02-26 16:39                         ` Vasily Khoruzhick
2011-02-26 16:39                           ` Vasily Khoruzhick
2011-03-05 22:30                       ` Vasily Khoruzhick
2011-03-05 22:30                         ` Vasily Khoruzhick
2011-03-11  9:20                         ` [PATCH 1/4] ARM: PXA: PXAFB: rework pxafb overlay memory management Vasily Khoruzhick
2011-03-11  9:20                           ` Vasily Khoruzhick
2011-03-11  9:20                           ` [PATCH 2/4] ARM: PXA: PXAFB: Fix plane Z-ordering problem Vasily Khoruzhick
2011-03-11  9:20                             ` Vasily Khoruzhick
2011-03-16 13:16                             ` Eric Miao
2011-03-16 13:16                               ` Eric Miao
2011-03-11  9:20                           ` [PATCH 3/4] ARM: PXA: PXAFB: Fix typo in ypos assignment Vasily Khoruzhick
2011-03-11  9:20                             ` Vasily Khoruzhick
2011-03-11 21:35                             ` Marek Vasut
2011-03-11 21:35                               ` Marek Vasut
2011-03-16 13:15                             ` Eric Miao
2011-03-16 13:15                               ` Eric Miao
2011-03-11  9:20                           ` [PATCH 4/4] ARM: PXA: PXAFB: don't disable controller on cpufreq transition if overlay is in use Vasily Khoruzhick
2011-03-11  9:20                             ` Vasily Khoruzhick
2011-03-16 13:16                             ` [PATCH 4/4] ARM: PXA: PXAFB: don't disable controller on cpufreq Eric Miao
2011-03-16 13:16                               ` [PATCH 4/4] ARM: PXA: PXAFB: don't disable controller on cpufreq transition if overlay is in use Eric Miao
2011-03-11 21:34                           ` [PATCH 1/4] ARM: PXA: PXAFB: rework pxafb overlay memory management Marek Vasut
2011-03-11 21:34                             ` Marek Vasut
2011-03-11 21:46                             ` Vasily Khoruzhick
2011-03-11 21:46                               ` Vasily Khoruzhick
2011-03-16 11:17                               ` Eric Miao
2011-03-16 11:17                                 ` Eric Miao
2011-02-17 18:17                   ` [PATCH 1/2] ARM: PXA: PXAFB: Fix double-free issue Marek Vasut
2011-02-17 18:17                     ` Marek Vasut
2011-02-17 18:56                     ` Russell King - ARM Linux
2011-02-17 18:56                       ` Russell King - ARM Linux
2011-02-18  2:24                       ` Eric Miao
2011-02-18  2:24                         ` Eric Miao
2011-02-15  9:48   ` [PATCH] ARM: PXA: Make PXA27x/PXA3xx overlay actually work Russell King - ARM Linux
2011-02-15  9:48     ` Russell King - ARM Linux
2011-02-15 11:43     ` Eric Miao
2011-02-15 11:43       ` Eric Miao
2011-02-18 10:07 ` Sascha Hauer
2011-02-18 10:07   ` Sascha Hauer

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=201102151041.21560.anarsoul@gmail.com \
    --to=anarsoul@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.