aboutsummaryrefslogtreecommitdiffstats
path: root/hw/display/edid-region.c
diff options
context:
space:
mode:
authorTimos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>2023-10-10 11:40:56 +0000
committerTimos Ampelikiotis <t.ampelikiotis@virtualopensystems.com>2023-10-10 11:40:56 +0000
commite02cda008591317b1625707ff8e115a4841aa889 (patch)
treeaee302e3cf8b59ec2d32ec481be3d1afddfc8968 /hw/display/edid-region.c
parentcc668e6b7e0ffd8c9d130513d12053cf5eda1d3b (diff)
Introduce Virtio-loopback epsilon release:
Epsilon release introduces a new compatibility layer which make virtio-loopback design to work with QEMU and rust-vmm vhost-user backend without require any changes. Signed-off-by: Timos Ampelikiotis <t.ampelikiotis@virtualopensystems.com> Change-Id: I52e57563e08a7d0bdc002f8e928ee61ba0c53dd9
Diffstat (limited to 'hw/display/edid-region.c')
-rw-r--r--hw/display/edid-region.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/hw/display/edid-region.c b/hw/display/edid-region.c
new file mode 100644
index 000000000..675429dc1
--- /dev/null
+++ b/hw/display/edid-region.c
@@ -0,0 +1,33 @@
+#include "qemu/osdep.h"
+#include "exec/memory.h"
+#include "hw/display/edid.h"
+
+static uint64_t edid_region_read(void *ptr, hwaddr addr, unsigned size)
+{
+ uint8_t *edid = ptr;
+
+ return edid[addr];
+}
+
+static void edid_region_write(void *ptr, hwaddr addr,
+ uint64_t val, unsigned size)
+{
+ /* read only */
+}
+
+static const MemoryRegionOps edid_region_ops = {
+ .read = edid_region_read,
+ .write = edid_region_write,
+ .valid.min_access_size = 1,
+ .valid.max_access_size = 4,
+ .impl.min_access_size = 1,
+ .impl.max_access_size = 1,
+ .endianness = DEVICE_LITTLE_ENDIAN,
+};
+
+void qemu_edid_region_io(MemoryRegion *region, Object *owner,
+ uint8_t *edid, size_t size)
+{
+ memory_region_init_io(region, owner, &edid_region_ops,
+ edid, "edid", size);
+}