Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • xserver xserver
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 922
    • Issues 922
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 130
    • Merge requests 130
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • xserverxserver
  • Merge requests
  • !567

modesetting: apply transforms in PRIME shared pixmap updates

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Simo Melenius requested to merge smelenius/xserver:master into master Dec 03, 2020
  • Overview 8
  • Commits 1
  • Pipelines 2
  • Changes 4

For reverse PRIME heads, with 'modesetting' as the source, scaling was broken as the compositing of the shared pixmaps wasn't properly configured to take into account scaling (and other transformations). For example, by scaling a reverse PRIME head by 2x2 the user would only see the top-left quadrant of the 2x2 screenspace instead of the full screenspace scaled down to the size of the shared pixmap.

This change brings the RandR transformation available for tracking and updating of dirty regions in the modesetting driver, and subsequently the CompositeRotate() function which renders the transformed screen to the shared pixmap. For transforms with simple translations only a separate execution path is tracked so that direct copying can be used.

These changes should fix scaling, and to some extent, arbitrary transformations, for all heads that are reverse PRIME sinks driven from 'modesetting' source.

Note that these changes only clean up certain parts of the viewport transformation and composition pipeline. A more thorough overhaul of how all the offsets and transformations are managed would be in order to make all combinations of randr screen configurations work seamlessly. I tried to be careful not to break existing functionality but there are things that were broken in the first place and remain to be so.

As a quick test, basic scaling like this should now work properly with reverse PRIME outputs:

xrandr --output --scale 0.5x0.5 xrandr --output --scale 2x2

Arbitrary transforms still exhibit various quirks and artifacts but something like a basic free rotation should now behave a bit better than before with reverse PRIME outputs:

xrandr --output --transform 0.707,-0.707,0,0.707,0.707,0,0,0,1

With this change, this command yields a screen that is at least now rotated yet still wrongly clipped as it was also before this change.

Edited Dec 16, 2020 by Simo Melenius
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: master