gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Black screen on mouse move on Intel Iris Xe

Open DocMAX opened this issue 2 years ago • 20 comments

Please read https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17182#note_1450392

The author says it a gamescope issue. I can confirm that i get a black screen on mouse move.

DocMAX avatar Aug 19 '22 22:08 DocMAX

can you try to change the 0 in this line to 1.0? https://github.com/Plagman/gamescope/blob/master/src/shaders/cs_composite_blit.comp#L58

DadSchoorse avatar Oct 04 '22 17:10 DadSchoorse

can you try to change the 0 in this line to 1.0? https://github.com/Plagman/gamescope/blob/master/src/shaders/cs_composite_blit.comp#L58

I'll test this now.

ruineka avatar Oct 06 '22 22:10 ruineka

can you try to change the 0 in this line to 1.0? https://github.com/Plagman/gamescope/blob/master/src/shaders/cs_composite_blit.comp#L58

Yes, this works. When changing that value to 1.0 the cursor no longer causes the black screen.

ruineka avatar Oct 06 '22 22:10 ruineka

Mhm, I guess we can change that, but as far as I understand scanout should ignore alpha. Some game also output non opaque alpha, so if it isn't ignore that might cause issues for the direct scanout path too. Maybe @emersion has an idea if we are maybe configuring something on the drm side wrong.

DadSchoorse avatar Oct 08 '22 10:10 DadSchoorse

scanout should ignore alpha

It depends on the DRM format used. If XRGB is used then alpha is ignored, if ARGB is used then it's not.

Our conversion table is https://github.com/Plagman/gamescope/blob/647e1d96d0c2e8ab3f36704e5345d0604c9830aa/src/rendervulkan.cpp#L219-L233

emersion avatar Oct 08 '22 10:10 emersion

Looks to me like the main plane should always use XRGB though: https://github.com/Plagman/gamescope/blob/cd31090733c0517ce786bcb32574d42daa81130f/src/drm.cpp#L172-L174

Unless intel doesn't support XRGB at all?

DadSchoorse avatar Oct 08 '22 11:10 DadSchoorse

Yeah, Intel should support that…

@DocMAX, can you share a drm_info dump captured when the bug is being reproduced?

emersion avatar Oct 08 '22 11:10 emersion

Yeah, Intel should support that…

@DocMAX, can you share a drm_info dump captured when the bug is being reproduced?

I can get this for you today.

ruineka avatar Oct 08 '22 11:10 ruineka

@emersion drm_info.txt

ruineka avatar Oct 08 '22 11:10 ruineka

Hm yeah this should ignore alpha…

    │       ├───"FB_ID" (atomic): object framebuffer = 357
    │       │   ├───Object ID: 357
    │       │   ├───Size: 1600x2560
    │       │   ├───Pitch: 6400
    │       │   ├───Bits per pixel: 32
    │       │   └───Depth: 24

emersion avatar Oct 08 '22 11:10 emersion

Hm yeah this should ignore alpha…

    │       ├───"FB_ID" (atomic): object framebuffer = 357
    │       │   ├───Object ID: 357
    │       │   ├───Size: 1600x2560
    │       │   ├───Pitch: 6400
    │       │   ├───Bits per pixel: 32
    │       │   └───Depth: 24

Interesting, are there any conditions that could effect the information in this dump? I had the desktop running on a separate TTY than gamescope. I dumped the information the moment I moved the cursor and the screen went black.

ruineka avatar Oct 08 '22 12:10 ruineka

I tested to see if changing that value would do anything for Intel UHD 630 graphics and it didn't do anything unfortunately. It only helps with the black screen with Iris Xe Graphics.

ruineka avatar Oct 10 '22 16:10 ruineka

I have the same issue with an i7-1185G7 (TigerLake-LP GT2) with Iris Xe graphics

device id for the graphics adapter is 8086:9a49

Happy to help provide logs/debug however I can!

ImanolBarba avatar Oct 15 '22 22:10 ImanolBarba

Interestingly enough I ran into issues where the game would launch with a blackscreen and audio playing in the background. Using that change @DadSchoorse mentioned not only fixed the cursor issue it fixed the games as well...

ruineka avatar Oct 20 '22 02:10 ruineka

Mhm, I guess we can change that, but as far as I understand scanout should ignore alpha. Some game also output non opaque alpha, so if it isn't ignore that might cause issues for the direct scanout path too. Maybe @emersion has an idea if we are maybe configuring something on the drm side wrong.

I may be completely off base here, but should we be using vec3 for XRGB instead of vec4 and use vec4 for ARGB? The bisect results came to this commit that caused the black screen. https://github.com/Plagman/gamescope/commit/2d537df252bce2e8d80237f20d7ee86b963e9bb9

Edit: Nevermind I see that vec4 is actually by spec.

ruineka avatar Oct 21 '22 19:10 ruineka

Hello, does anyone have a set of steps to apply this patch to a Holo-ISO (https://github.com/theVakhovskeIsTaken/holoiso) installation? I'm new to arch-based distros, I've tried the following steps however I get a blank screen instead of seeing the steam compositor come up (both with and without the patch applied)...

for package in meson vulkan-headers; do
  yay ${package}
done

mkdir ~/source
cd ~/source
git clone https://github.com/Plagman/gamescope/
cd gamescope/

git submodule update --init

# Patch
sed -i 's/vec4(outputValue, 0)/vec4(outputValue, 1.0)/' src/shaders/cs_composite_blit.comp 

# Build
meson build/
ninja -C build/

# Install
sudo mv $(which gamescope) $(which gamescope).$(date +%Y-%m-%d_%H%M.%S)
sudo cp build/gamescope /usr/bin

# Restart
sudo reboot

Maybe I should see if I can trackdown one of the commits HoloISO released off of and try to patch a build made from that? :thinking:

deftdawg avatar Oct 25 '22 17:10 deftdawg

Hello, does anyone have a set of steps to apply this patch to a Holo-ISO (https://github.com/theVakhovskeIsTaken/holoiso) installation? I'm new to arch-based distros, I've tried the following steps however I get a blank screen instead of seeing the steam compositor come up (both with and without the patch applied)...

for package in meson vulkan-headers; do
  yay ${package}
done

mkdir ~/source
cd ~/source
git clone https://github.com/Plagman/gamescope/
cd gamescope/

git submodule update --init

# Patch
sed -i 's/vec4(outputValue, 0)/vec4(outputValue, 1.0)/' src/shaders/cs_composite_blit.comp 

# Build
meson build/
ninja -C build/

# Install
sudo mv $(which gamescope) $(which gamescope).$(date +%Y-%m-%d_%H%M.%S)
sudo cp build/gamescope /usr/bin

# Restart
sudo reboot

Maybe I should see if I can trackdown one of the commits HoloISO released off of and try to patch a build made from that? thinking

That looks all correct to me. This is pretty much unrelated to the topic at hand though. For HoloISO, if I were you I would run gamescope-session on a VT and see what error pops out.

ImanolBarba avatar Oct 25 '22 19:10 ImanolBarba

That looks all correct to me. This is pretty much unrelated to the topic at hand though. For HoloISO, if I were you I would run gamescope-session on a VT and see what error pops out.

Ok thanks, I should've mentioned the reason I'm applying the patch is because I also see this screen blanking on every mouse movement on a Tigerlake nuc 1165g7 with Xe... The issue is present in the "downgraded" gamescope (Intel GPUs/iGPUs require a Gamescope downgrade in order to boot into Steam Deck session.) used by HoloISO:

holoiso/gamescope 3.11.33.beta1.snapshot20220921.2057-4 (379.9 KiB 901.2 KiB) (Installed)
    gaming shell based on Xwayland, powered by Vulkan and DRM. with fixes from Samsagax for screen orientation

After some digging around it looks like the Arch meta data used pick a tag and patch gamescope is in this repo (https://github.com/theVakhovskeIsTaken/gamescope-steamos-pkgbuild), so I'll try applying the patch and rebuilding from there.

deftdawg avatar Oct 25 '22 19:10 deftdawg

It's requiring some study and troubleshooting, but I'm trying my best to figure out a proper solution to this issue as well as the color corruption issue found on Arc GPUs/UHD (Non Iris) graphics.

I'm not entirely sure why alpha isn't being ignored since XRGB seems to be available...

A report mentioned that using SRGB instead of UNORMs fixed the corruption issue and it doesn't have the black screen like Iris has.

ruineka avatar Oct 25 '22 20:10 ruineka

Tested the workaround, stops the screen blanking when the mouse moves. :grinning:

Here are the instructions to build the Xe workaround on a HoloISO installation:

sudo pacman -S base-devel asp
git clone https://github.com/theVakhovskeIsTaken/gamescope-steamos-pkgbuild
cd gamescope-steamos-pkgbuild
makepkg
sudo mv $(which gamescope) $(which gamescope).$(date +%Y-%m-%d_%H%M.%S)
sudo cp pkg/gamescope/usr/bin/gamescope /usr/bin
sudo reboot

Update: the workaround has been merged to the theVakhovskeIsTaken/gamescope-steamos-pkgbuild, instructions above updated to reflect using that one.

deftdawg avatar Oct 25 '22 20:10 deftdawg