diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-10 14:29:45 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-10 14:29:45 +0000 |
commit | 5c130f659b20d53667e07957ebaa3e656f72b276 (patch) | |
tree | 1fce52bae1cfdb3f46599277634769cd50782cb0 /hw/omap_dss.c | |
parent | d397abbdbe68715ec86b4392e4e6384db64d029d (diff) |
Yet more phys_ram_base elimination.
Signed-off-by: Paul Brook <paul@cofdesourcery.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7067 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/omap_dss.c')
-rw-r--r-- | hw/omap_dss.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/hw/omap_dss.c b/hw/omap_dss.c index 67b2b022fe..4917c59c86 100644 --- a/hw/omap_dss.c +++ b/hw/omap_dss.c @@ -582,25 +582,6 @@ static CPUWriteMemoryFunc *omap_disc1_writefn[] = { omap_disc_write, }; -static void *omap_rfbi_get_buffer(struct omap_dss_s *s) -{ - target_phys_addr_t fb; - uint32_t pd; - - /* TODO */ - fb = s->dispc.l[0].addr[0]; - - pd = cpu_get_physical_page_desc(fb); - if ((pd & ~TARGET_PAGE_MASK) != IO_MEM_RAM) - /* TODO */ - cpu_abort(cpu_single_env, "%s: framebuffer outside RAM!\n", - __FUNCTION__); - else - return phys_ram_base + - (pd & TARGET_PAGE_MASK) + - (fb & ~TARGET_PAGE_MASK); -} - static void omap_rfbi_transfer_stop(struct omap_dss_s *s) { if (!s->rfbi.busy) @@ -614,8 +595,11 @@ static void omap_rfbi_transfer_stop(struct omap_dss_s *s) static void omap_rfbi_transfer_start(struct omap_dss_s *s) { void *data; - size_t len; + target_phys_addr_t len; + target_phys_addr_t data_addr; int pitch; + static void *bounce_buffer; + static target_phys_addr_t bounce_len; if (!s->rfbi.enable || s->rfbi.busy) return; @@ -633,10 +617,24 @@ static void omap_rfbi_transfer_start(struct omap_dss_s *s) s->rfbi.busy = 1; - data = omap_rfbi_get_buffer(s); + len = s->rfbi.pixels * 2; + + data_addr = s->dispc.l[0].addr[0]; + data = cpu_physical_memory_map(data_addr, &len, 0); + if (data && len != s->rfbi.pixels * 2) { + cpu_physical_memory_unmap(data, len, 0, 0); + data = NULL; + len = s->rfbi.pixels * 2; + } + if (!data) { + if (len > bounce_len) { + bounce_buffer = qemu_realloc(bounce_buffer, len); + } + data = bounce_buffer; + cpu_physical_memory_read(data_addr, data, len); + } /* TODO bpp */ - len = s->rfbi.pixels * 2; s->rfbi.pixels = 0; /* TODO: negative values */ @@ -647,6 +645,10 @@ static void omap_rfbi_transfer_start(struct omap_dss_s *s) if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1]) s->rfbi.chip[1]->block(s->rfbi.chip[1]->opaque, 1, data, len, pitch); + if (data != bounce_buffer) { + cpu_physical_memory_unmap(data, len, 0, len); + } + omap_rfbi_transfer_stop(s); /* TODO */ |