Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Fullscreen broken after BO handle table #3185

Closed
sjnewbury opened this issue Sep 8, 2021 · 25 comments
Closed

Fullscreen broken after BO handle table #3185

sjnewbury opened this issue Sep 8, 2021 · 25 comments

Comments

@sjnewbury
Copy link

sjnewbury commented Sep 8, 2021

Since 5dfaf5e fullscreen (super-f) is broken for fullscreen (OpenGL?) surfaces.

AMD POLARIS10 current git mesa/wlroots/sway etc

For example Alacritty appears to display the wrong area of memory

glmark2-wayland is severely corrupted but the tests are kind of visible

Having wdisplays running makes fullscreen work (perhaps due to the overview thumbnail)

Firefox just works though

Proton DXVK and gallium-nine games show corruption when switching to fullscreen, but after creating a vulkan/nine buffer work okay.

Reverting 5dfaf5e makes everything work again.

@frmonteiro
Copy link

Are you using the latest commit?

@sjnewbury
Copy link
Author

Are you using the latest commit?

I was when I submitted the report. The revert did need manual merging after recent changes, but it was minor and still fixed the behaviour.

@emersion emersion added this to the 0.15.0 milestone Sep 11, 2021
@alexarice
Copy link

Just to add to this, I am having the same problems but firefox also doesn't work for me. I get green artifacts all over the screen when fullscreening any firefox video (e.g. youtube video)

@ms178
Copy link

ms178 commented Sep 12, 2021

@alexarice Did it look something like the following? I did encounter that bug as of last weekend when trying out kwinft-git with wlroots-git. At first I thought it was an LLVM14-related bug in mesa, but this could be very well the same bug as mentioned here. The bug only showed in OpenGL apps (that screenshot is from Chrome with --use-gl=desktop), RADV-games were working fine though. But also other OpenGL apps were broken, even the KDE Plasma menues flickered with that pattern when navigating in the menue.

Screenshot_20210904_202207

@Xyene
Copy link
Member

Xyene commented Sep 12, 2021

That looks similar to what I get. The issue goes away if I e.g. open a layer-shell instance like rofi on top of the fullscreen surface, then returns when rofi closes. It also doesn't happen for all apps, so maybe it's related to direct scanout? waves hands vigorously

Note that I'm not able to screenshot the issue; it appears fine in screenshots.

@alexarice
Copy link

My error looked a lot more colourful than that. I also cannot screenshot it.

I observed it happening on firefox, alacritty, and emacs, but think it happened on everything for me. I also bisected it down to the commit in the original post of this issue.

@sjnewbury
Copy link
Author

@alexarice Mine was also more colourful. I think firefox possibly isn't corrupting for me because I'm using the webrender compositor and a nightly build. Menus aren't working though, but that's another bug! ;-)

@K4rakara
Copy link

I'm also encountering this on an AMD RX570.

Like what Xyene experienced, it also disappears when a layer surface is present.

However, I've only had it happen with xwayland apps. Specifically discord and (rarely)alacritty (I have alacritty set to run under xwayland due to a minuscule bug).

Firefox doesn't have this issue for me though; but I'm using MOZ_ENABLE_WAYLAND=1, so that might be why.

@emersion
Copy link
Member

Can you share Sway debug logs?

It seems like I'm only able to reproduce when modifiers aren't supported. With modifiers enabled the bug doesn't appear.

emersion added a commit to emersion/sway that referenced this issue Sep 20, 2021
This can help debugging direct scan-out issues, such as [1].

[1]: swaywm/wlroots#3185
@emersion
Copy link
Member

This amdgpu patch fixes it for me: https://lore.kernel.org/amd-gfx/20210920103133.3573-1-contact@emersion.fr/T/#u

kennylevinsen pushed a commit to swaywm/sway that referenced this issue Sep 20, 2021
This can help debugging direct scan-out issues, such as [1].

[1]: swaywm/wlroots#3185
@ms178
Copy link

ms178 commented Sep 20, 2021

With a fresh wlroots- and kwinft-build as of the past weekend, I can no longer reproduce my issue (on my Vega 56).

@emersion
Copy link
Member

Vega 56 should be recent enough to support modifiers.

@alexarice
Copy link

I still get issues with sway master and wlroots master on an RX 5600 xt. How would I get the debug logs you want?

@emersion
Copy link
Member

sway -d >sway.log 2>&1

@alexarice
Copy link

https://gist.github.com/alexarice/320449c24a70c638937495e63c87fc2a
hopefully this works, I opened sway, opened alacritty, full screened it, saw the problem, unfullscreened it and then closed sway.

@K4rakara
Copy link

Can you share Sway debug logs?

It seems like I'm only able to reproduce when modifiers aren't supported. With modifiers enabled the bug doesn't appear.

How can I build your branch and run it? I use sway-git and wlroots-git from the AUR so when I try to run meson build in your branch, it fails with meson.build:75:1: ERROR: Invalid version of dependency, need 'wlroots' ['<0.11.0'] found '0.15.0'..

@emersion
Copy link
Member

There's no Sway branch to test, just a kernel patch.

If you can grab debug logs, please grab them from Sway master. Just want to check the bug doesn't happen when modifiers are supported.

@K4rakara
Copy link

I grabbed some logs yesterday using sway master-- but I hadn't tried that patch yet. Should I upload those? Or should I wait until I've figured out how to install the kernel patch?

If the former, I'll have till wait until ~4PM EDT because I forgot to systemctl enable sshd on my fresh arch install, so I can't copy the log remotely.

@K4rakara
Copy link

Took a bit longer than expected, but heres the log without the kernel patch: https://hastebin.com/itenuxenoz.yaml

@emersion
Copy link
Member

ADDFB2 modifiers unsupported

OK, matches my setup.

@alexarice
Copy link

So is the fix just to wait for driver updates?

@emersion
Copy link
Member

Yes.

@Emantor
Copy link
Contributor

Emantor commented Sep 22, 2021

You can also use the -Dnoscanout parameter for sway to override it until you get a kernel with the update, AFAICS.

@emersion
Copy link
Member

In the meantime, you can start Sway (needs latest commit) with -Dnoscanout.

FireBurn pushed a commit to FireBurn/linux that referenced this issue Sep 29, 2021
On GFX9+, format modifiers are always enabled and ensure the
frame-buffers can be scanned out at ADDFB2 time.

On GFX8-, format modifiers are not supported and no other check
is performed. This means ADDFB2 IOCTLs will succeed even if the
tiling isn't supported for scan-out, and will result in garbage
displayed on screen [1].

Fix this by adding a check for tiling flags for GFX8 and older.
The check is taken from radeonsi in Mesa (see how is_displayable
is populated in gfx6_compute_surface).

Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel)

[1]: swaywm/wlroots#3185

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
FireBurn pushed a commit to FireBurn/linux that referenced this issue Sep 30, 2021
On GFX9+, format modifiers are always enabled and ensure the
frame-buffers can be scanned out at ADDFB2 time.

On GFX8-, format modifiers are not supported and no other check
is performed. This means ADDFB2 IOCTLs will succeed even if the
tiling isn't supported for scan-out, and will result in garbage
displayed on screen [1].

Fix this by adding a check for tiling flags for GFX8 and older.
The check is taken from radeonsi in Mesa (see how is_displayable
is populated in gfx6_compute_surface).

Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel)

[1]: swaywm/wlroots#3185

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
@emersion
Copy link
Member

emersion commented Oct 3, 2021

Closing because the fix has been merged upstream.

@emersion emersion closed this as completed Oct 3, 2021
jonathangray pushed a commit to jonathangray/openbsd-src that referenced this issue Oct 4, 2021
On GFX9+, format modifiers are always enabled and ensure the
frame-buffers can be scanned out at ADDFB2 time.

On GFX8-, format modifiers are not supported and no other check
is performed. This means ADDFB2 IOCTLs will succeed even if the
tiling isn't supported for scan-out, and will result in garbage
displayed on screen [1].

Fix this by adding a check for tiling flags for GFX8 and older.
The check is taken from radeonsi in Mesa (see how is_displayable
is populated in gfx6_compute_surface).

Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel)

[1]: swaywm/wlroots#3185

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
nareshkamboju pushed a commit to nareshkamboju/linux that referenced this issue Oct 5, 2021
commit 98122e6 upstream.

On GFX9+, format modifiers are always enabled and ensure the
frame-buffers can be scanned out at ADDFB2 time.

On GFX8-, format modifiers are not supported and no other check
is performed. This means ADDFB2 IOCTLs will succeed even if the
tiling isn't supported for scan-out, and will result in garbage
displayed on screen [1].

Fix this by adding a check for tiling flags for GFX8 and older.
The check is taken from radeonsi in Mesa (see how is_displayable
is populated in gfx6_compute_surface).

Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel)

[1]: swaywm/wlroots#3185

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
nareshkamboju pushed a commit to nareshkamboju/linux that referenced this issue Oct 5, 2021
commit 98122e6 upstream.

On GFX9+, format modifiers are always enabled and ensure the
frame-buffers can be scanned out at ADDFB2 time.

On GFX8-, format modifiers are not supported and no other check
is performed. This means ADDFB2 IOCTLs will succeed even if the
tiling isn't supported for scan-out, and will result in garbage
displayed on screen [1].

Fix this by adding a check for tiling flags for GFX8 and older.
The check is taken from radeonsi in Mesa (see how is_displayable
is populated in gfx6_compute_surface).

Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel)

[1]: swaywm/wlroots#3185

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
nareshkamboju pushed a commit to nareshkamboju/linux that referenced this issue Oct 6, 2021
commit 98122e6 upstream.

On GFX9+, format modifiers are always enabled and ensure the
frame-buffers can be scanned out at ADDFB2 time.

On GFX8-, format modifiers are not supported and no other check
is performed. This means ADDFB2 IOCTLs will succeed even if the
tiling isn't supported for scan-out, and will result in garbage
displayed on screen [1].

Fix this by adding a check for tiling flags for GFX8 and older.
The check is taken from radeonsi in Mesa (see how is_displayable
is populated in gfx6_compute_surface).

Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel)

[1]: swaywm/wlroots#3185

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Whissi pushed a commit to Whissi/linux-stable that referenced this issue Oct 7, 2021
commit 98122e6 upstream.

On GFX9+, format modifiers are always enabled and ensure the
frame-buffers can be scanned out at ADDFB2 time.

On GFX8-, format modifiers are not supported and no other check
is performed. This means ADDFB2 IOCTLs will succeed even if the
tiling isn't supported for scan-out, and will result in garbage
displayed on screen [1].

Fix this by adding a check for tiling flags for GFX8 and older.
The check is taken from radeonsi in Mesa (see how is_displayable
is populated in gfx6_compute_surface).

Changes in v2: use drm_WARN_ONCE instead of drm_WARN (Michel)

[1]: swaywm/wlroots#3185

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

8 participants