https://bugs.winehq.org/show_bug.cgi?id=38879
Bug ID: 38879 Summary: wbemprox fill_videocontroller calls are expensive Product: Wine Version: 1.7.41 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wmi&wbemprox Assignee: wine-bugs@winehq.org Reporter: c10ud.dev@gmail.com Distribution: ---
Created attachment 51812 --> https://bugs.winehq.org/attachment.cgi?id=51812 wbemprox: cache videocontroller queries
Specifically League of Legends likes to continuously ask for video controller specs while in game (every 4 seconds or so).
On my (old?) box this leads to a pretty big framedrop (~15fps when capped at 60) due to dxgi being initialized every time (and thus wined3d) by the fill_videocontroller function.
The proposed solution caches results for subsequent calls, but I'm not sure about the implications (i.e. do we expect any of those fields to change in the lifespan of a wine application?)
Comments welcome
Greets
https://bugs.winehq.org/show_bug.cgi?id=38879
--- Comment #1 from Riccardo c10ud.dev@gmail.com --- Created attachment 51813 --> https://bugs.winehq.org/attachment.cgi?id=51813 sample log of a single call
https://bugs.winehq.org/show_bug.cgi?id=38879
Riccardo c10ud.dev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #51812|0 |1 is obsolete| |
--- Comment #2 from Riccardo c10ud.dev@gmail.com --- Created attachment 51814 --> https://bugs.winehq.org/attachment.cgi?id=51814 wbemprox: cache videocontroller queries
https://bugs.winehq.org/show_bug.cgi?id=38879
--- Comment #3 from Henri Verbeet hverbeet@gmail.com --- Note that in principle you can use IDXGIFactory1::IsCurrent() to check when you need to invalidate the cache. (Currently that always returns TRUE on Wine, but it would be the correct way to do this.)
https://bugs.winehq.org/show_bug.cgi?id=38879
--- Comment #4 from Riccardo c10ud.dev@gmail.com --- (In reply to Henri Verbeet from comment #3)
Note that in principle you can use IDXGIFactory1::IsCurrent() to check when you need to invalidate the cache. (Currently that always returns TRUE on Wine, but it would be the correct way to do this.)
Well, yes, but this would still mean we keep a dxgi instance around (with its wined3d etc.), right?
So we could still keep the current code and skip only instancing as I think the expensive part is that one (I didn't measure it but..).
I really don't think there's a _good_ way of solving this, maybe apps shouldn't just use wbemprox services for continuous querying.. (in this case the informations requested are really weird: ram, driver version and desc...???).
Also I'm not sure if other apps follow the same pattern.
Last note: I may have phrased the issue wrong, it's not really a frame drop, it's more of a ~100ms freeze (as you can see from logs).
Riccardo
https://bugs.winehq.org/show_bug.cgi?id=38879
dj-max_payne@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dj-max_payne@hotmail.com
https://bugs.winehq.org/show_bug.cgi?id=38879
Riccardo c10ud.dev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #51813|0 |1 is obsolete| | Attachment #51814|0 |1 is obsolete| |
--- Comment #5 from Riccardo c10ud.dev@gmail.com --- Created attachment 52616 --> https://bugs.winehq.org/attachment.cgi?id=52616 wbemprox: cache videocontroller queries (v2)
This version of the patch makes use of IDXGIFactory1_IsCurrent and caches the DXGI instance along with the videocontroller struct.
However as of latest patch (5.something) it looks like League isn't (ab)using this wbemprox query anymore so this may be not needed.
I attached an updated patch in case someone runs into this in future.
Ciao, Riccardo
https://bugs.winehq.org/show_bug.cgi?id=38879
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
https://bugs.winehq.org/show_bug.cgi?id=38879
bitfreak bitfreak25@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |bitfreak25@gmx.de
--- Comment #6 from bitfreak bitfreak25@gmx.de --- It seems to be, that this is maybe valid for the newest League of Legends, where some people (not only me) getting a framedrop after some time. I did not now exactly, how I can test your patch @Riccardo. Can someone give me an advice?
bitfreak
https://bugs.winehq.org/show_bug.cgi?id=38879
fjfrackiewicz@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fjfrackiewicz@gmail.com
--- Comment #7 from fjfrackiewicz@gmail.com --- (In reply to bitfreak from comment #6)
It seems to be, that this is maybe valid for the newest League of Legends, where some people (not only me) getting a framedrop after some time. I did not now exactly, how I can test your patch @Riccardo. Can someone give me an advice?
bitfreak
The Wiki goes into some detail about how to patch your local version of Wine:
https://wiki.winehq.org/Regression_Testing#Patching_your_git_tree
You apply the patch and recompile Wine with the patch and test if everything works :)
https://bugs.winehq.org/show_bug.cgi?id=38879
--- Comment #8 from bitfreak@icqmail.com --- The patch Riccardo attached does not work -> "error: patch failed: dlls/wbemprox/builtin.c:2837". I expect many things have changed to wine during the last time, so the patch have to be adjusted.
https://bugs.winehq.org/show_bug.cgi?id=38879
--- Comment #9 from bitfreak@icqmail.com --- I could include the Patch into the newest Wine-Version 2.1 manually. But the Bug in League of Legends (Bug #42460) still exists.