intel/display: adjust reported/set xml nodes

'<connector mode_id=3 ...' becomes '<connector mode="3" ...'

'<mode mode_id="2" ... ' becomes '<mode id="2" ...'

'<mode unavailable="true" ...' becomes '<mode usable="false" ...'
This commit is contained in:
Alexander Boettcher 2024-10-24 12:07:05 +02:00 committed by Christian Helmuth
parent 71f3e5f82a
commit f7689a473c
2 changed files with 18 additions and 17 deletions

View File

@ -31,14 +31,14 @@ The exported report has the following format:
! <connectors>
! <connector name="eDP-1" connected="true" brightness="50" width_mm="290" height_mm="170">
! <mode width="1920" height="1080" hz="60" mode_id="1" preferred="true" used="true" width_mm="288" height_mm="165"/>
! <mode width="1920" height="1080" hz="60" id="1" preferred="true" used="true" width_mm="288" height_mm="165"/>
! ...
! </connector>
! <connector name="DP-1" connected="true" width_mm="280" height_mm="160">
! <mode width="1920" height="1200" hz="60" mode_id="1" preferred="true" width_mm="280" height_mm="160"/>
! <mode width="1920" height="1080" hz="60" mode_id="2" used="true" width_mm="278" height_mm="158"/>
! <mode width="1280" height="1024" hz="60" mode_id="3"/>
! <mode width="1024" height="768" hz="60" mode_id="4"/>
! <mode width="1920" height="1200" hz="60" id="1" preferred="true" width_mm="280" height_mm="160"/>
! <mode width="1920" height="1080" hz="60" id="2" used="true" width_mm="278" height_mm="158"/>
! <mode width="1280" height="1024" hz="60" id="3"/>
! <mode width="1024" height="768" hz="60" id="4"/>
! ...
! </connector>
! <connector name="HDMI-A-1" connected="false"/>
@ -54,12 +54,13 @@ whether it should be enabled or not. This looks like the following:
! <config>
! <connector name="eDP-1" enabled="true" width="1920" height="1080" hz="60" brightness="75"/>
! <connector name="DP-1" enabled="true" mode_id="2"/>
! <connector name="DP-1" enabled="true" mode="2"/>
! </config>
The resolution can be configured exactly by the reported mode_id or by
the width/height/hz attributes. In the latter case the driver will take the
first matching mode out of multiple matching modes potentially.
The resolution can be configured exactly by setting the 'mode' attribute
to one of the 'id' values of the reported modes or by setting the
width/height/hz attributes. In the latter case the driver will take the first
matching mode out of multiple matching modes potentially.
The brightness value is in percent and takes effect only if supported by
the hardware.
@ -70,7 +71,7 @@ The maximal physical resolution across all connectors can be restricted by:
! </config>
Note: All larger modes still will be reported, but are marked as unusable
by an additional attribute 'unavailable' set to true.
by an additional attribute 'usable' set to false.
The amount of memory used by the driver for the accounting of its available
buffer space is set by:

View File

@ -398,7 +398,7 @@ void Framebuffer::Driver::lookup_config(char const * const name,
mode.width = node.attribute_value("width" , 0U);
mode.height = node.attribute_value("height" , 0U);
mode.hz = node.attribute_value("hz" , 0U);
mode.id = node.attribute_value("mode_id", 0U);
mode.id = node.attribute_value("mode" , 0U);
mode.brightness = node.attribute_value("brightness",
unsigned(MAX_BRIGHTNESS + 1));
};
@ -546,17 +546,17 @@ void lx_emul_i915_report_modes(void * genode_xml, struct genode_mode *mode)
xml.node("mode", [&] ()
{
xml.attribute("width", mode->width);
xml.attribute("height", mode->height);
xml.attribute("hz", mode->hz);
xml.attribute("mode_id", mode->id);
xml.attribute("mode_name", mode->name);
xml.attribute("width", mode->width);
xml.attribute("height", mode->height);
xml.attribute("hz", mode->hz);
xml.attribute("id", mode->id);
xml.attribute("name", mode->name);
if (mode->width_mm)
xml.attribute("width_mm", mode->width_mm);
if (mode->height_mm)
xml.attribute("height_mm", mode->height_mm);
if (!mode->enabled)
xml.attribute("unavailable", true);
xml.attribute("usable", false);
if (mode->preferred)
xml.attribute("preferred", true);
if (mode->inuse)