diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-01-18 13:20:00 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-01-28 14:24:52 +0100 |
commit | 2ec6bd67b76ea0afc97eaa22f369738f1a7ad7f3 (patch) | |
tree | 76a9b332993b92e1d44b862958c987c6477cd8a1 /drivers/gpu/drm/qxl/qxl_drv.h | |
parent | drm/qxl: drop unused qxl_fb_virtual_address (diff) | |
download | linux-2ec6bd67b76ea0afc97eaa22f369738f1a7ad7f3.tar.xz linux-2ec6bd67b76ea0afc97eaa22f369738f1a7ad7f3.zip |
drm/qxl: simplify slot management
Drop pointless indirection, remove the mem_slots array and index
variables, drop dynamic allocation. Store memslots in qxl_device
instead.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Noralf Trønnes <noralf@tronnes.org>
Link: http://patchwork.freedesktop.org/patch/msgid/20190118122020.27596-4-kraxel@redhat.com
Diffstat (limited to 'drivers/gpu/drm/qxl/qxl_drv.h')
-rw-r--r-- | drivers/gpu/drm/qxl/qxl_drv.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index 7eabf4a9ed14..f9dddfe7d988 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.h +++ b/drivers/gpu/drm/qxl/qxl_drv.h @@ -130,9 +130,11 @@ struct qxl_mman { }; struct qxl_memslot { + int index; + const char *name; uint8_t generation; uint64_t start_phys_addr; - uint64_t end_phys_addr; + uint64_t size; uint64_t high_bits; }; @@ -228,11 +230,8 @@ struct qxl_device { unsigned int primary_created:1; - struct qxl_memslot *mem_slots; - uint8_t n_mem_slots; - - uint8_t main_mem_slot; - uint8_t surfaces_mem_slot; + struct qxl_memslot main_slot; + struct qxl_memslot surfaces_slot; uint8_t slot_id_bits; uint8_t slot_gen_bits; uint64_t va_slot_mask; @@ -312,8 +311,8 @@ static inline uint64_t qxl_bo_physical_address(struct qxl_device *qdev, struct qxl_bo *bo, unsigned long offset) { - int slot_id = bo->type == QXL_GEM_DOMAIN_VRAM ? qdev->main_mem_slot : qdev->surfaces_mem_slot; - struct qxl_memslot *slot = &(qdev->mem_slots[slot_id]); + struct qxl_memslot *slot = bo->type == QXL_GEM_DOMAIN_VRAM + ? &qdev->main_slot : &qdev->surfaces_slot; /* TODO - need to hold one of the locks to read tbo.offset */ return slot->high_bits | (bo->tbo.offset + offset); |