diff options
author | Alon Levy <alevy@redhat.com> | 2011-04-27 14:22:09 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2011-07-22 03:47:27 +0300 |
commit | 141154b6b5cf3abf7855477b72edc1618a0188e1 (patch) | |
tree | 9f68e95a74c1016c84888e367f1a22fa7731f2e6 | |
parent | e59bb1a7ea16751c185a9ab33d93f7242118cb4c (diff) |
partially replace outb with ioport_write
replace everywhere it is needed for xspice - places left out are ifdefed
out later based on the same define mentioned in qxl.h, XSPICE.
-rw-r--r-- | src/qxl.h | 5 | ||||
-rw-r--r-- | src/qxl_driver.c | 10 | ||||
-rw-r--r-- | src/qxl_ring.c | 5 | ||||
-rw-r--r-- | src/qxl_surface.c | 4 |
4 files changed, 15 insertions, 9 deletions
@@ -336,4 +336,9 @@ void * qxl_allocnf (qxl_screen_t *qxl, unsigned long size); int qxl_garbage_collect (qxl_screen_t *qxl); +static inline void ioport_write(qxl_screen_t *qxl, int port, int val) +{ + outb(qxl->io_base + port, val); +} + #endif // QXL_H diff --git a/src/qxl_driver.c b/src/qxl_driver.c index 6099923..a206ae7 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -130,7 +130,7 @@ qxl_usleep (int useconds) int qxl_handle_oom (qxl_screen_t *qxl) { - outb (qxl->io_base + QXL_IO_NOTIFY_OOM, 0); + ioport_write(qxl, QXL_IO_NOTIFY_OOM, 0); #if 0 ErrorF ("."); @@ -168,7 +168,7 @@ qxl_allocnf (qxl_screen_t *qxl, unsigned long size) ram_header->update_area.right = qxl->virtual_x; ram_header->update_surface = 0; /* Only primary for now */ - outb (qxl->io_base + QXL_IO_UPDATE_AREA, 0); + ioport_write(qxl, QXL_IO_UPDATE_AREA, 0); #if 0 ErrorF ("eliminated memory (%d)\n", nth_oom++); @@ -342,7 +342,7 @@ qxl_reset (qxl_screen_t *qxl) uint64_t high_bits; struct QXLRam *ram_header; - outb(qxl->io_base + QXL_IO_RESET, 0); + ioport_write(qxl, QXL_IO_RESET, 0); ram_header = (void *)((unsigned long)qxl->ram + (unsigned long)qxl->rom->ram_header_offset); @@ -370,7 +370,7 @@ qxl_reset (qxl_screen_t *qxl) ram_header->mem_slot.mem_start = slot->start_phys_addr; ram_header->mem_slot.mem_end = slot->end_phys_addr; - outb (qxl->io_base + QXL_IO_MEMSLOT_ADD, qxl->main_mem_slot); + ioport_write(qxl, QXL_IO_MEMSLOT_ADD, qxl->main_mem_slot); slot->generation = qxl->rom->slot_generation; @@ -390,7 +390,7 @@ qxl_reset (qxl_screen_t *qxl) ram_header->mem_slot.mem_start = slot->start_phys_addr; ram_header->mem_slot.mem_end = slot->end_phys_addr; - outb (qxl->io_base + QXL_IO_MEMSLOT_ADD, qxl->vram_mem_slot); + ioport_write(qxl, QXL_IO_MEMSLOT_ADD, qxl->vram_mem_slot); slot->generation = qxl->rom->slot_generation; diff --git a/src/qxl_ring.c b/src/qxl_ring.c index 22d98ea..0870ef1 100644 --- a/src/qxl_ring.c +++ b/src/qxl_ring.c @@ -88,8 +88,9 @@ qxl_ring_push (struct qxl_ring *ring, mem_barrier(); - if (header->prod == header->notify_on_prod) - outb (ring->qxl->io_base + ring->io_port_prod_notify, 0); + if (header->prod == header->notify_on_prod) { + ioport_write (ring->qxl, ring->io_port_prod_notify, 0); + } } Bool diff --git a/src/qxl_surface.c b/src/qxl_surface.c index f8dbebc..047b35a 100644 --- a/src/qxl_surface.c +++ b/src/qxl_surface.c @@ -378,7 +378,7 @@ qxl_surface_cache_create_primary (surface_cache_t *cache, create->type = QXL_SURF_TYPE_PRIMARY; create->mem = physical_address (cache->qxl, cache->qxl->ram, cache->qxl->main_mem_slot); - outb (qxl->io_base + QXL_IO_CREATE_PRIMARY, 0); + ioport_write(qxl, QXL_IO_CREATE_PRIMARY, 0); dev_addr = (uint8_t *)qxl->ram + mode->stride * (mode->y_res - 1); @@ -920,7 +920,7 @@ download_box (qxl_surface_t *surface, int x1, int y1, int x2, int y2) ErrorF ("Issuing update command for %d\n", surface->id); #endif - outb (surface->cache->qxl->io_base + QXL_IO_UPDATE_AREA, 0); + ioport_write(surface->cache->qxl, QXL_IO_UPDATE_AREA, 0); pixman_image_composite (PIXMAN_OP_SRC, surface->dev_image, |