1.1 --- a/pkg/devices/lcd/include/lcd-device.h Fri Feb 16 23:11:25 2024 +0100
1.2 +++ b/pkg/devices/lcd/include/lcd-device.h Sat Feb 17 23:04:12 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * LCD device support.
1.6 *
1.7 - * Copyright (C) 2018, 2020, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2018, 2020, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -21,6 +21,7 @@
1.13
1.14 #pragma once
1.15
1.16 +#include <l4/devices/dma.h>
1.17 #include <l4/devices/lcd/activation_interface.h>
1.18 #include <l4/devices/lcd.h>
1.19
1.20 @@ -45,14 +46,10 @@
1.21
1.22 Activation *_display;
1.23
1.24 - /* Framebuffer virtual and physical addresses. */
1.25 + /* Framebuffer region providing virtual and physical addresses plus the memory
1.26 + capability for the framebuffer. */
1.27
1.28 - l4_addr_t fb_vaddr;
1.29 - l4re_dma_space_dma_addr_t fb_paddr;
1.30 -
1.31 - /* Memory capability for the framebuffer. */
1.32 -
1.33 - l4re_ds_t _fbmem;
1.34 + struct dma_region _fb_region;
1.35
1.36 /* Display operations. */
1.37
1.38 @@ -66,18 +63,21 @@
1.39 : _chip(chip), _display(display)
1.40 {
1.41 /* Subclasses must set up any memory. */
1.42 +
1.43 + _fb_region.vaddr = 0;
1.44 + _fb_region.mem = L4_INVALID_CAP;
1.45 }
1.46
1.47 /* Framebuffer operations. */
1.48
1.49 virtual l4_addr_t get_framebuffer()
1.50 {
1.51 - return fb_vaddr;
1.52 + return _fb_region.vaddr;
1.53 }
1.54
1.55 virtual l4re_ds_t get_framebuffer_cap()
1.56 {
1.57 - return _fbmem;
1.58 + return _fb_region.mem;
1.59 }
1.60
1.61 /* Querying operations. */