Skip to content

Nvidia drivers: Refresh background and screen corners (#21)#330

Merged
cassidyjames merged 7 commits into
masterfrom
nvidia-fixes
Oct 20, 2018
Merged

Nvidia drivers: Refresh background and screen corners (#21)#330
cassidyjames merged 7 commits into
masterfrom
nvidia-fixes

Conversation

@jlnr

@jlnr jlnr commented Sep 8, 2018

Copy link
Copy Markdown
Contributor

The proprietary Nvidia drivers discard FBOs when the system suspends from resume (maybe on all sorts of modesets?). The current workaround for this was added in Feb 2016:

4b001ca

This correctly causes the wallpaper images to be reloaded when resuming from sleep mode, but the multitasking background (SystemBackground) and the round corners are still garbled here (see screenshots in #21).

The Bugzilla issue for the same issue in GNOME Shell has more details:

https://bugzilla.gnome.org/show_bug.cgi?id=739178

There's now a Display.gl_video_memory_purged signal that allows us to handle the loss of OpenGL resources without parsing Nvidia vendor strings. I've used this signal to fix wallpaper images and the rounded corners plugin.

This did not fix the SystemBackground. Looking at meta-background.c, I think the issue is that G_DESKTOP_BACKGROUND_STYLE_WALLPAPER backgrounds are not fully discarded by Meta.Background.refresh_all. Either way, simply calling the color setter seems to fix the issue.

All tested on Juno with a GTX 1080 (not mobile) and the Nvidia 390 drivers from AppCenter. Without this patch, I can reproduce garbled textures after every sleep-resume cycle. Now everything seems to work fine.

@jlnr jlnr changed the title Nvidia drivers: Refresh background (#208) and screen corners (#21) Nvidia drivers: Refresh background and screen corners (#21) Sep 8, 2018
@jlnr

jlnr commented Sep 8, 2018

Copy link
Copy Markdown
Contributor Author

Testing this required a few reboots because gala --replace stopped working for me (not just on this branch, also on master). The wingpanel never came back afterwards. Anyone else seeing that?

cassidyjames
cassidyjames previously approved these changes Sep 13, 2018

@cassidyjames cassidyjames left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UX-wise this appears to fix the corruption issues for me here on Juno with an NVIDIA GTX 1050Ti and the 390 driver from AppCenter. I'll still want to get a code sign-off.

@danirabbit danirabbit requested a review from ricotz September 19, 2018 00:32

@donadigo donadigo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment.

Comment thread src/WindowManager.vala Outdated
}

Bus.watch_name (BusType.SESSION, DAEMON_DBUS_NAME, BusNameWatcherFlags.NONE, daemon_appeared, lost_daemon);
void refresh_backgrounds ()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should be static as well as compiled when HAS_MUTTER322.

@jlnr

jlnr commented Oct 20, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for the review @donadigo.

Instead of having two #ifdef blocks right next to each other, I've turned the whole refresh_backgrounds method into a closure, which I find easier to parse. What do you think?

(I can't re-test this branch right now because I'm travelling without my Nvidia box.)

@donadigo donadigo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jlnr yes, I'm fine with that. Looks good to me now.

@cassidyjames cassidyjames merged commit a1bad26 into master Oct 20, 2018
@cassidyjames cassidyjames deleted the nvidia-fixes branch October 20, 2018 16:02
ricotz pushed a commit that referenced this pull request Dec 16, 2018
This was accidentally removed in #330 and is the major reason
why window menus aren't appearing.
@peteruithoven peteruithoven mentioned this pull request Feb 28, 2019
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.

3 participants