public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Eric Nelson <eric.nelson@boundarydevices.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] video: cfb_console: flush dcache for frame buffer in DRAM
Date: Mon, 17 Sep 2012 19:49:32 -0700	[thread overview]
Message-ID: <5057E13C.2090507@boundarydevices.com> (raw)

Hi Anatolij,

I hate to come in late to the discussion, but while testing [1] with cache 
enabled, I started down the path of fixing up code paths within 
drivers/video/cfb_console.c that are followed by SABRE Lite as you did in [2].

[1]	[PATCH V2 0/2] i.MX6: mx6qsabrelite: Add splash screen	support
	http://lists.denx.de/pipermail/u-boot/2012-September/134241.html
[2]	[PATCH] video: cfb_console: flush dcache for frame buffer in DRAM
	http://lists.denx.de/pipermail/u-boot/2012-April/123333.html

That code essentially looks like this:

void video_drawchars(...)
{
...
        switch (VIDEO_DATA_FORMAT) {
	     case GDF__8BIT_INDEX:
	     case GDF__8BIT_332RGB:
	     case GDF_15BIT_555RGB:
	     case GDF_16BIT_565RGB:
	        ... cache not flushed in these cases

	     case GDF_32BIT_X888RGB:
	        ... cache is flushed here
}

SABRE Lite (ipu3) code happens to use the RGB565 frame buffer format, so
it needs additional fixup.

Continuing this pattern seems to be a mistake though. There are a lot of
cases, with all sorts of different alignments (most of which won't sync
with cache line boundaries) and it seems that there's little to no
benefit in the fine granularity. It seems that by the time we fix up all
of the individual spots where we're writing to a line in the frame
buffer, the cache can never get dirty in the first place.

It seems much more sensible to simply use flush_dcache_range() on the
entire frame buffer in each of the public calls and let the MMU figure
out what needs flushing.

Is there something I'm missing?

My other immediate thought was that we should really place the frame buffer
in un-cacheable memory, but then we really will be doing more memory accesses.

Please advise,


Eric

             reply	other threads:[~2012-09-18  2:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18  2:49 Eric Nelson [this message]
2012-09-22 23:29 ` [U-Boot] [PATCH] cfb_console: flush FB cache at end of public functions Eric Nelson
2013-05-06 13:02   ` Anatolij Gustschin
2013-05-06 15:15     ` Eric Nelson
  -- strict thread matches above, loose matches on Subject: below --
2012-04-28 15:04 [U-Boot] [PATCH] video: cfb_console: flush dcache for frame buffer in DRAM Anatolij Gustschin
2012-04-28 15:58 ` Pali Rohár
2012-04-28 18:16 ` Mike Frysinger
2012-04-30 15:32   ` Anatolij Gustschin
2012-05-01  4:14     ` Mike Frysinger
2012-04-30  2:25 ` Marek Vasut
2012-04-30  5:56   ` Simon Glass
2012-04-30 16:26     ` Anatolij Gustschin
2012-04-30 15:19   ` Anatolij Gustschin
2012-04-30 15:21     ` Marek Vasut
2012-04-30 15:27       ` Anatolij Gustschin
2012-04-30 15:57         ` Marek Vasut
2012-06-05  7:28 ` Anatolij Gustschin
2012-07-19 13:26   ` Mike Frysinger
2012-07-19 15:49     ` Marek Vasut
2012-07-19 16:51       ` Mike Frysinger

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=5057E13C.2090507@boundarydevices.com \
    --to=eric.nelson@boundarydevices.com \
    --cc=u-boot@lists.denx.de \
    /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