public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] video: cfb_console: flush dcache for frame buffer in DRAM
Date: Mon, 30 Apr 2012 17:19:05 +0200	[thread overview]
Message-ID: <20120430171905.154f4661@wker> (raw)
In-Reply-To: <201204300425.51019.marex@denx.de>

Hi,

On Mon, 30 Apr 2012 04:25:50 +0200
Marek Vasut <marex@denx.de> wrote:
...
> > observed with cfb on beageboard and N900 when running with data
> > cache enabled.
> 
> beagleboard ;-)

Thanks for catching that!!

...
> > @@ -553,6 +557,8 @@ static void video_drawchars(int xx, int yy, unsigned
> > char *s, int count) SWAP32((video_font_draw_table32
> >  						[bits & 15][3] & eorx) ^ bgx);
> >  			}
> > +			if (cfb_do_flush_cache)
> > +				flush_cache((ulong)dest0, 32);
> 
> flush_dcache_range() ?

I would have to calculate the end address, then. flush_cache() already
does it for me :-)

...
> > @@ -1651,6 +1661,29 @@ static void *video_logo(void)
> >  }
> >  #endif
> > 
> > +static int cfb_fb_is_in_dram(void)
> > +{
> > +	bd_t *bd = gd->bd;
> > +	ulong start, end;
> > +	int i;
> > +
> > +	for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
> > +#if defined(CONFIG_ARM) || defined(CONFIG_AVR32) || defined(COFNIG_NDS32)
> > || \ +defined(CONFIG_SANDBOX) || defined(CONFIG_X86)
> > +		start = bd->bi_dram[i].start;
> > +		end = bd->bi_dram[i].start + bd->bi_dram[i].size - 1;
> > +#else
> > +		start = bd->bi_memstart;
> > +		end = bd->bi_memsize;
> > +#endif
> > +
> > +		if ((ulong)video_fb_address >= start &&
> > +		    (ulong)video_fb_address < end)
> > +			return 1;
> > +	}
> > +	return 0;
> > +}
> 
> Can't you have SRAM cached too? ;-)

I do not know. But who will put the framebuffer into SRAM?
It is not big enough.

Thanks,
Anatolij

  parent reply	other threads:[~2012-04-30 15:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2012-09-18  2:49 Eric Nelson

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=20120430171905.154f4661@wker \
    --to=agust@denx.de \
    --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