Implement support for KMS cursor plane capture#1981
Merged
cgutman merged 5 commits intoLizardByte:nightlyfrom Jan 6, 2024
Merged
Implement support for KMS cursor plane capture#1981cgutman merged 5 commits intoLizardByte:nightlyfrom
cgutman merged 5 commits intoLizardByte:nightlyfrom
Conversation
KuleRucket
pushed a commit
to KuleRucket/Sunshine
that referenced
this pull request
Jun 6, 2024
e-dong
pushed a commit
to e-dong/Sunshine
that referenced
this pull request
Jul 26, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR implements cursor plane capture for the kmsgrab codepath to allow cursor capture when hardware cursor support is in use. This new code replaces the old code that used XFixes to capture the cursor and removes the "off by default" cursor display behavior now that we're not relying on XFixes for cursor capture.
The code has the following restrictions/limitations:
CRTC_W/CRTC_H != SRC_W/SRC_H) in the VAAPI encoding path but not the software encoding pathFB_IDwill not be captured, though using it as a texture atlas and adjusting theSRC_*properties to switch between cursors will workThe first restriction seems to be satisfied by every driver I checked on drmdb. The second restriction is satisfied by all desktop GPU drivers (i915, amdgpu, nouveau, and nvidia-drm) and probably nobody actually uses non-ARGB8888 buffers on embedded devices that support other formats.
The latter two will depend on the compositor. I doubt the last restriction will be violated by any modern compositors because it could lead to visible tearing if a half-updated cursor image is scanned out by the display hardware. However, I'm unsure if some compositors may rely on scaling for displaying cursors in some cases.
Compositors tested:
GPU vendors tested:
Screenshot
Issues Fixed or Closed
Fixes #93
Type of Change
.github/...)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.