Re: Improving Performance
Hi Michael,
On Thu, Mar 13, 2014 at 9:22 AM, schmitz
<schmitz@biophys.uni-duesseldorf.de> wrote:
>> Does the hack below (not even compile-tested) work? It maps pool_size
>> (default 1 MiB) of ST-RAM and makes the pool use that.
>
> Sort of - boots with kernel in ST-RAM, but nothing shown on the screen. SCSI
> appears to allocate DMA-able memory though:
> Ignoring memory chunk at 0x0:0xe00000 before the first chunk
Haha, you still have it in the bootinfo. Fortunately Linux doesn't use it ;-)
> More debugging of atafb needed - I have a hunch that the ioremapped kernel
> virtual address is being used as physical address for atafb.
Indeed, atafb needs the physical address, so the ioremap() should be moved
from atari_stram_init() to atafb.
That'll complicate matters (kernel in ST-RAM vs. not), see further below.
There may be other virt/phys bugs in atafb, as before virt == phys for ST-RAM,
so conversion didn't matter.
screen_info.screen_base should be the virtual address,
fb_fix_info.smem_start should be the physical address.
For comparison, amiga_chip_alloc() always returns virtual addresses.
Conversion is done through ZTWO_VADDR()/ZTWO_PADDR(), which is
just an offset, as we always map the first 16 MiB using transparent translation.
Ah, perhaps you can do something similar? Hence keep the ioremap() in
atari_stram_init(), and provide helpers atari_stram_to_virt() and
atari_stram_to_phys() for phys/virt conversion?
The helpers can be no-ops if ST-RAM is not ioremapped().
That way the drivers don't need to know.
One other thing: for bookkeeping, it would be better if the pool is registered
using the physical addresses, as its resources will show up in /proc/iomem.
Hence:
stram_pool.start = PAGE_SIZE;
stram_pool.end = stram_pool.start + pool_size - 1;
stram_virt_offset = ioremap(stram_pool.start,
resource_len(stram_pool) - stram_pool.start;
and
void *atari_stram_to_virt(unsigned long phys)
{
return (void *)(phys + stram_virt_offset);
}
(if the kernel is in ST-RAM, stram_virt_offset should be 0);
and call atari_stram_to_virt() just before returning from atari_stram_alloc().
Same for the virt to phys conversion in atari_stram_free().
> Need to batten down the hatches now - we expect cyclone Lusi to hit from
> tomorrow.
Keep Lusi out. The only cyclones that belong near a hacker's house are Altera
Cyclones ;-)
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Reply to: