Steam Deck Gamingmode fix (#711)
This commit is contained in:
parent
9181028bcf
commit
d625dda4ea
1 changed files with 28 additions and 2 deletions
|
|
@ -294,6 +294,18 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::uint32_t get_panel_orientation(std::uint32_t plane_id) {
|
||||||
|
auto props = plane_props(plane_id);
|
||||||
|
for(auto &[prop, val] : props) {
|
||||||
|
if(prop->name == "rotation"sv) {
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_LOG(error) << "Failed to determine panel orientation, defaulting to landscape.";
|
||||||
|
return DRM_MODE_ROTATE_0;
|
||||||
|
}
|
||||||
|
|
||||||
connector_interal_t connector(std::uint32_t id) {
|
connector_interal_t connector(std::uint32_t id) {
|
||||||
return drmModeGetConnector(fd.el, id);
|
return drmModeGetConnector(fd.el, id);
|
||||||
}
|
}
|
||||||
|
|
@ -531,11 +543,25 @@ public:
|
||||||
if(monitor != std::end(pos->crtc_to_monitor)) {
|
if(monitor != std::end(pos->crtc_to_monitor)) {
|
||||||
auto &viewport = monitor->second.viewport;
|
auto &viewport = monitor->second.viewport;
|
||||||
|
|
||||||
width = viewport.width;
|
width = viewport.width;
|
||||||
height = viewport.height;
|
height = viewport.height;
|
||||||
|
|
||||||
|
switch(card.get_panel_orientation(plane->plane_id)) {
|
||||||
|
case DRM_MODE_ROTATE_270:
|
||||||
|
BOOST_LOG(debug) << "Detected panel orientation at 90, swapping width and height.";
|
||||||
|
width = viewport.height;
|
||||||
|
height = viewport.width;
|
||||||
|
break;
|
||||||
|
case DRM_MODE_ROTATE_90:
|
||||||
|
case DRM_MODE_ROTATE_180:
|
||||||
|
BOOST_LOG(warning) << "Panel orientation is unsupported, screen capture may not work correctly.";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
offset_x = viewport.offset_x;
|
offset_x = viewport.offset_x;
|
||||||
offset_y = viewport.offset_y;
|
offset_y = viewport.offset_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This code path shouldn't happend, but it's there just in case.
|
// This code path shouldn't happend, but it's there just in case.
|
||||||
// crtc_to_monitor is part of the guesswork after all.
|
// crtc_to_monitor is part of the guesswork after all.
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue