Bug 372739

Summary: Vsync disabled: slowmotion effects or wrong fps?
Product: [Plasma] kwin Reporter: Antonio Orefice <kokoko3k>
Component: effects-variousAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.8.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: supportinformation from kwin when running without vsync enabled

Description Antonio Orefice 2016-11-21 15:17:40 UTC
Since i found that enabling nvidia internal full composition pipeline gives me stuttering free playback in dual head setups, i decided to use it instead of kwin's internal vsync logics.
Since i disabled kwin vsync, dragging windows has become very, very slow, and it seems even fadein/fade out effects are slower.
The affected effects are not jerky or stuttering, they move just as slow-motion.

Other effects seems unaffected, like magic lamp.
Since then, i reverted to xrender.
Comment 1 Antonio Orefice 2016-11-21 16:03:35 UTC
Ok, i've to add several information to this report, sorry.
The slowness was due to a setting i have in my kwinrc:
MaxFPS=300

I have to specify it because:
1) with vsync disabled, kwin render frames at 60hz, why? i don't know.
2) i switch between 60hz and 75hz and 300 is the closer multiple integer to both.
Comment 2 Martin Flöser 2016-11-21 16:51:51 UTC
Custom misconfiguration too high max frame per second. If you need support please use a support channel like forum.kde.org, but bugs.kde.org is not a support forum.
Comment 3 Antonio Orefice 2016-11-21 17:14:00 UTC
Hi Martin, thanks for answering.
The real issue here, is that kwin is unable to detect the right refresh rate when vsync is disabled.
Can we continue here or should i open another bug report about that?
Or maybe even that would be marked as invalid?
Comment 4 Martin Flöser 2016-11-21 20:37:06 UTC
KWin is able to detect the refresh rate. If you configure your driver in a way that it breaks KWin that is hardly a problem we care about. Just don't do it then.
Comment 5 Antonio Orefice 2016-11-22 08:40:34 UTC
Hi again,
maybe there is a misunderstanding here, sorry.
The problem i have with limited framerate does not depend on the driver settings,

I'm able to reproduce it even without nvidia's ForceFullCompositionPipeline=On

What happens, is that if i remove MaxFPS= line from kwinrc and disable any "tearing prevention" in the compositor settings, kwin seems to render things at 60..62fps.

I gather this information:
1- From the kwin's "Show FPS" effect:
it shows 60..62 fps

2- by observing the windows edges while i drag it:
If kwin's render rate were close to the display refresh, i'd expect to see smooth window dragging with a single "tearing" line, and this is indeed what happens if i specify MaxFPS=75 OR if i switch to a 60hz mode.
But what happens is that the movement is jerky and there are several tearing lines/artifacts.

As soon as i enable kwin's Tearing prevention ON (the method doesn't matter), the fps effect jumps to 75, i repeat, this happens with AND without any special driver configuration.

Thanks for your attention.
Comment 6 Martin Flöser 2016-11-22 09:49:52 UTC
> I gather this information:
> 1- From the kwin's "Show FPS" effect:
> it shows 60..62 fps

The effect clearly states that it's not a benchmark. The number doesn't say 
anything.

The way to check what kwin picks is in the supportInformation.
Comment 7 Antonio Orefice 2016-11-22 10:05:35 UTC
Created attachment 102386 [details]
supportinformation from kwin when running without vsync enabled
Comment 8 Antonio Orefice 2016-11-22 10:05:46 UTC
and it picks: 
Refresh Rate: 75.0247 for both monitors with and without tearing prevention enabled, which should be fine...

What puzzles me is why window movements are:
*jerky:
  with vsync disabled and screen at 75hz
*smooth:
  with vsync enabled at any refresh rate
  with vsync disabled and screen at 60hz
  with vsync disabled and screen at 75hz but MaxFPS=75 specified in kwinrc