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:
parent
8836b9d243
commit
16571b8926
|
@ -164,6 +164,9 @@ a list of accepted extension names is printed.
|
||||||
.B \-f \fIvolume\fP
|
.B \-f \fIvolume\fP
|
||||||
sets beep (bell) volume (allowable range: 0-100).
|
sets beep (bell) volume (allowable range: 0-100).
|
||||||
.TP 8
|
.TP 8
|
||||||
|
.B \-fakescreenfps \fFps\fP
|
||||||
|
sets fake presenter screen default fps (allowable range: 1-600).
|
||||||
|
.TP 8
|
||||||
.B \-fp \fIfontPath\fP
|
.B \-fp \fIfontPath\fP
|
||||||
sets the search path for fonts. This path is a comma separated list
|
sets the search path for fonts. This path is a comma separated list
|
||||||
of directories which the X server searches for font databases.
|
of directories which the X server searches for font databases.
|
||||||
|
|
12
os/utils.c
12
os/utils.c
|
@ -112,6 +112,8 @@ __stdcall unsigned long GetTickCount(void);
|
||||||
|
|
||||||
#include "miinitext.h"
|
#include "miinitext.h"
|
||||||
|
|
||||||
|
#include "present.h"
|
||||||
|
|
||||||
Bool noTestExtensions;
|
Bool noTestExtensions;
|
||||||
|
|
||||||
#ifdef COMPOSITE
|
#ifdef COMPOSITE
|
||||||
|
@ -534,6 +536,7 @@ UseMsg(void)
|
||||||
ErrorF
|
ErrorF
|
||||||
("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n");
|
("-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs\n");
|
||||||
ErrorF("-f # bell base (0-100)\n");
|
ErrorF("-f # bell base (0-100)\n");
|
||||||
|
ErrorF("-fakescreenfps # fake screen default fps (1-600)\n");
|
||||||
ErrorF("-fp string default font path\n");
|
ErrorF("-fp string default font path\n");
|
||||||
ErrorF("-help prints message with these options\n");
|
ErrorF("-help prints message with these options\n");
|
||||||
ErrorF("+iglx Allow creating indirect GLX contexts\n");
|
ErrorF("+iglx Allow creating indirect GLX contexts\n");
|
||||||
|
@ -781,6 +784,15 @@ ProcessCommandLine(int argc, char *argv[])
|
||||||
else
|
else
|
||||||
UseMsg();
|
UseMsg();
|
||||||
}
|
}
|
||||||
|
else if (strcmp(argv[i], "-fakescreenfps") == 0) {
|
||||||
|
if (++i < argc) {
|
||||||
|
FakeScreenFps = (uint32_t) atoi(argv[i]);
|
||||||
|
if (FakeScreenFps < 1 || FakeScreenFps > 600)
|
||||||
|
FatalError("fakescreenfps must be an integer in [1;600] range\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
UseMsg();
|
||||||
|
}
|
||||||
else if (strcmp(argv[i], "-fp") == 0) {
|
else if (strcmp(argv[i], "-fp") == 0) {
|
||||||
if (++i < argc) {
|
if (++i < argc) {
|
||||||
defaultFontPath = argv[i];
|
defaultFontPath = argv[i];
|
||||||
|
|
|
@ -162,4 +162,6 @@ present_register_complete_notify(present_complete_notify_proc proc);
|
||||||
extern _X_EXPORT Bool
|
extern _X_EXPORT Bool
|
||||||
present_can_window_flip(WindowPtr window);
|
present_can_window_flip(WindowPtr window);
|
||||||
|
|
||||||
|
extern _X_EXPORT uint32_t FakeScreenFps;
|
||||||
|
|
||||||
#endif /* _PRESENT_H_ */
|
#endif /* _PRESENT_H_ */
|
||||||
|
|
|
@ -113,21 +113,29 @@ present_fake_queue_vblank(ScreenPtr screen,
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t FakeScreenFps = 0;
|
||||||
|
|
||||||
void
|
void
|
||||||
present_fake_screen_init(ScreenPtr screen)
|
present_fake_screen_init(ScreenPtr screen)
|
||||||
{
|
{
|
||||||
|
uint32_t fake_fps;
|
||||||
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
|
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
|
||||||
|
|
||||||
|
if (FakeScreenFps)
|
||||||
|
fake_fps = FakeScreenFps;
|
||||||
|
else {
|
||||||
/* For screens with hardware vblank support, the fake code
|
/* For screens with hardware vblank support, the fake code
|
||||||
* will be used for off-screen windows and while screens are blanked,
|
* will be used for off-screen windows and while screens are blanked,
|
||||||
* in which case we want a slow interval here
|
* in which case we want a large interval here: 1Hz
|
||||||
*
|
*
|
||||||
* Otherwise, pretend that the screen runs at 60Hz
|
* Otherwise, pretend that the screen runs at 60Hz
|
||||||
*/
|
*/
|
||||||
if (screen_priv->info && screen_priv->info->get_crtc)
|
if (screen_priv->info && screen_priv->info->get_crtc)
|
||||||
screen_priv->fake_interval = 1000000;
|
fake_fps = 1;
|
||||||
else
|
else
|
||||||
screen_priv->fake_interval = 16667;
|
fake_fps = 60;
|
||||||
|
}
|
||||||
|
screen_priv->fake_interval = 1000000 / fake_fps;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user