Skip to content

drm: skip modifiers already in the plane format list - #499

Open
dar1k-ness wants to merge 1 commit into
hyprwm:mainfrom
dar1k-ness:drm-dedup-plane-modifiers
Open

dar1k-ness wants to merge 1 commit into
hyprwm:mainfrom
dar1k-ness:drm-dedup-plane-modifiers

Conversation

@dar1k-ness

Copy link
Copy Markdown

Fixes #476

Since 7.3 amdgpu exposes IN_FORMATS on the cursor plane for older cards too, so LINEAR ends up in the list twice. The gbm fallback only handles the list being exactly LINEAR, so with the dup the cursor bo gets allocated with DRM_FORMAT_MOD_INVALID, which aquamarine then refuses to commit to the cursor plane, so the cursor is just gone.

This just checks if the modifier is already there before adding it.

Hit this on an RX 580, same thing on an RX 570 here: #476 (comment)
Fine on 7.2.15 (with aquamarine 0.15.1), broken on 7.3.4.

before:

GBM: Allocating with modifiers failed, falling back to implicit

cursor bo is INVALID, no fb on the cursor plane, no cursor

after:

GBM: Allocating with modifiers failed, falling back to modifier-less allocation

cursor bo is LINEAR, cursor plane has an fb, cursor is back

Tested on Arch, linux 7.3.4-arch1-1, Hyprland 0.57.2, aquamarine 0.16.0, Mesa 26.2.7

Since 7.3 amdgpu exposes IN_FORMATS on the cursor plane for older
cards too (hit this on an RX 580), so LINEAR ends up in the list
twice. The gbm fallback only handles the list being exactly LINEAR,
so with the dup the cursor bo gets allocated with
DRM_FORMAT_MOD_INVALID, which can't go on the cursor plane and the
cursor is just gone.
@umbrageodotus

Copy link
Copy Markdown
Contributor

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardware cursor invisible on RX 580 with kernel 7.3

2 participants