GNOME Bugzilla – Bug 772512
90/270 rotation modes don't work on skylake
Last modified: 2016-10-07 15:35:52 UTC
Rotating to 90/270 on skylake is greeted with no UI updates and warnings like this on stderr: ... Failed to set CRTC mode "HxW": No space left on device I saw this happening when we create a CoglOnscreen/gbm surface with the wrong w/h given the current mode. Making it pass WxH when creating the onscreen fools mutter enough to successfully apply the mode, just to see that besides the obviously wrong stage view size, there is no 90/270 HW rotation applied at all. TBH I don't know if I interpreted rotation modes wrongly and rotation must be still done client side, but it'd look like a huge departure from how rotate-180 is handled. Or if (gut feeling says it is) it is a broken/untested feature on just-too-recent hardware. Either way, screen rotation to portrait mode is broken on mutter with skylake HW, I'm attaching a patch that makes us fallback to the GL paths despite drm offering rotate-90/270, to be possibly reverted in the future.
Created attachment 337068 [details] [review] backends/native: Ignore 90/270 rotation modes announced by DRM Support for such modes is broken, at least on skylake HW (supposedly capable of these). Applying the mode fails with: Failed to set CRTC mode "HxW": No space left on device This usually happens when mutter creates a CoglOnscreen that doesn't fit on the CRTC mode. Even after "fixing" this issue, the output has no rotation despite the DRM 90/270 rotation property being applied. This means we're ATM better off by doing 90/270 rotation through our fallback code.
so it seems that drmModeObjectSetProperty() with 90/270 transform property/value fails with "Invalid argument", we can better use that to detect failure to set a mode, and blacklisting the HW property so we handle this gracefully.
Created attachment 337178 [details] [review] backends: Check return value after applying DRM plane rotation And blacklist the HW mode so we fallback gracefully to our own paths.
Review of attachment 337178 [details] [review]: Looks good, only a minor nit: Commit subject should probably say "Use fallback rotation if native failed" or something, since this is the effect we get.
Review of attachment 337178 [details] [review]: It's unfortunate that when we get a hotplug and _read_current() we'll have to go through this failure again, but this is a bit better anyway
Review of attachment 337178 [details] [review]: ups
Pushed with the suggested log wording change.