linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: sh2a 7203 LCDC memory access
Date: Tue, 22 Mar 2011 14:36:45 +0000	[thread overview]
Message-ID: <20110322143645.GA3915@linux-sh.org> (raw)
In-Reply-To: <201103220853.19384.fabio.giovagnini@aurion-tech.com>

On Tue, Mar 22, 2011 at 09:21:48PM +0900, Magnus Damm wrote:
> Hi Fabio,
> 
> On Tue, Mar 22, 2011 at 4:53 PM, Fabio Giovagnini
> <fabio.giovagnini@aurion-tech.com> wrote:
> > Hi All,
> > I'd likt to keep you informed about my last discovering about LCDC of sh2a
> > 7203.
> > If I build the kernel with cache off, the image is clean and stable but the
> > performances are very very poor;
> > if I build with cache write back the performaces are very good but the image
> > is stable but sometimes dirty; fi I build with cache write through the
> > performances seems to be a little bit less than write back but the image is
> > stiil clean and stable.
> > Does this make sense?
> 
> Yes.
> 
> > How can I explain this behaviour?
> 
> The LCDC is an output device looking from the CPU point of view.
> 
> The write-though cache setting is OK for output even though you are
> not flushing the cache. It behaves the same as cache off for writing
> because the data is always written _through_ the cache directly to the
> memory that is read by the LCDC.
> 
> If you use copy-back (write-back) but picture is not OK then this
> means the data is left in the cache and has not been written out to
> memory. The copy-back cache is only writing to memory when running our
> of cache space or your are flushing the data to memory by software
> control.
> 
> You need to make sure your frame buffer is flushed after writing. Or
> use an uncached memory area for the frame buffer - that's even easier.
> 
Note that the vast majority of SH-2/SH-2A development was done on
write-through caches, so it's quite possible that there are still some
outstanding issues with write-back mode.

That being said, the LCDC fb driver at least gets its DMA buffer
management right as we know from other CPU subtypes, so we already get
the cache management logic for free by virtue of the DMA mapping
interface.

  parent reply	other threads:[~2011-03-22 14:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22  7:53 sh2a 7203 LCDC memory access Fabio Giovagnini
2011-03-22 12:21 ` Magnus Damm
2011-03-22 13:50 ` Fabio Giovagnini
2011-03-22 14:36 ` Paul Mundt [this message]
2011-03-22 15:03 ` Fabio Giovagnini
2011-03-22 15:28 ` Paul Mundt
2011-03-22 16:02 ` Fabio Giovagnini
2011-03-22 16:13 ` Paul Mundt
2011-03-22 16:32 ` Fabio Giovagnini

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=20110322143645.GA3915@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@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;
as well as URLs for NNTP newsgroup(s).