1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
From 97155294fb44c95b305f3aebe98d9e29bbd398fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Sawicz?= <michal@sawicz.net>
Date: Thu, 4 Sep 2025 09:19:11 +0200
Subject: [PATCH] mirserver: update for Mir 2.22
---
include/miroil/edid.h | 27 ----------------------
src/platforms/mirserver/platformscreen.cpp | 8 +++++++
2 files changed, 8 insertions(+), 27 deletions(-)
--- a/include/miroil/edid.h
+++ b/include/miroil/edid.h
@@ -23,6 +23,8 @@
#include <string>
#include <vector>
+#include <mir/version.h>
+
namespace miroil
{
@@ -35,6 +37,7 @@
struct PhysicalSizeMM { int width; int height; };
PhysicalSizeMM size{0,0};
+#if MIR_SERVER_VERSION < MIR_VERSION_NUMBER(2, 22, 0)
struct Descriptor {
enum class Type : uint8_t {
timing_identifiers = 0xfa,
@@ -61,6 +64,8 @@
Descriptor descriptors[4];
Edid& parse_data(std::vector<uint8_t> const&);
+#endif
+
};
}
--- a/src/platforms/mirserver/platformscreen.cpp
+++ b/src/platforms/mirserver/platformscreen.cpp
@@ -260,11 +260,19 @@
// Output data - each output has a unique id and corresponding type. Can be multiple cards.
m_displayId.output_id = screen.id;
+
+#if MIR_SERVER_VERSION < MIR_VERSION_NUMBER(2, 22, 0)
try {
m_displayId.edid.parse_data(reinterpret_cast<std::vector<uint8_t> const&>(screen.edid));
} catch (std::runtime_error const& e) {
printf("Failed to parse EDID - %s\n", e.what());
}
+#else
+ m_displayId.edid.vendor = screen.display_info.vendor.value_or("");
+ m_displayId.edid.product_code = screen.display_info.product_code.value_or(0);
+ m_displayId.edid.serial_number = screen.display_info.serial_number.value_or(0);
+ m_displayId.edid.size = {screen.physical_size_mm.width.as_int(), screen.physical_size_mm.height.as_int()};
+#endif
auto type = static_cast<qtmir::OutputTypes>(screen.type); //FIXME: need compile time check these are equivalent
if (m_type != type) {
|