mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
Don't hardcode fps for fake screen
Currently, when main hardware screen is powered-off, X server initializes fake screen's timer with 1 second update interval. Streaming software like Nomachine or Vnc, as well as desktop input automation suffers from it, since it will forever be stuck on 1 fps until the display is turned back on. This commit adds command line option -fakescreenfps <int> that allows the user to change the default fake screen timer. Signed-off-by: Baranin Alexander <ismailsiege@gmail.com>
This commit is contained in:
committed by
Povilas Kanapickas
parent
8836b9d243
commit
16571b8926
@@ -162,4 +162,6 @@ present_register_complete_notify(present_complete_notify_proc proc);
|
||||
extern _X_EXPORT Bool
|
||||
present_can_window_flip(WindowPtr window);
|
||||
|
||||
extern _X_EXPORT uint32_t FakeScreenFps;
|
||||
|
||||
#endif /* _PRESENT_H_ */
|
||||
|
||||
@@ -113,21 +113,29 @@ present_fake_queue_vblank(ScreenPtr screen,
|
||||
return Success;
|
||||
}
|
||||
|
||||
uint32_t FakeScreenFps = 0;
|
||||
|
||||
void
|
||||
present_fake_screen_init(ScreenPtr screen)
|
||||
{
|
||||
uint32_t fake_fps;
|
||||
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
|
||||
|
||||
/* For screens with hardware vblank support, the fake code
|
||||
* will be used for off-screen windows and while screens are blanked,
|
||||
* in which case we want a slow interval here
|
||||
*
|
||||
* Otherwise, pretend that the screen runs at 60Hz
|
||||
*/
|
||||
if (screen_priv->info && screen_priv->info->get_crtc)
|
||||
screen_priv->fake_interval = 1000000;
|
||||
else
|
||||
screen_priv->fake_interval = 16667;
|
||||
if (FakeScreenFps)
|
||||
fake_fps = FakeScreenFps;
|
||||
else {
|
||||
/* For screens with hardware vblank support, the fake code
|
||||
* will be used for off-screen windows and while screens are blanked,
|
||||
* in which case we want a large interval here: 1Hz
|
||||
*
|
||||
* Otherwise, pretend that the screen runs at 60Hz
|
||||
*/
|
||||
if (screen_priv->info && screen_priv->info->get_crtc)
|
||||
fake_fps = 1;
|
||||
else
|
||||
fake_fps = 60;
|
||||
}
|
||||
screen_priv->fake_interval = 1000000 / fake_fps;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user