options: add a no-frame-pacing option

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2023-06-10 14:28:43 +01:00
parent 7d9692360b
commit 6a69cdb002
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
6 changed files with 14 additions and 3 deletions

View File

@ -109,6 +109,9 @@ OPTIONS
*--rounded-corners-exclude* 'CONDITION'::
Exclude conditions for rounded corners.
*--no-frame-pacing*::
Disable vsync-aware frame pacing. By default, the compositor tries to make sure it only renders once per vblank interval, and also the render happens as late as possible to minimize the latency from updates to the screen. However this can sometimes cause stuttering, or even lowered frame rate. This option can be used to disable frame pacing.
*--mark-wmwin-focused*::
Try to detect WM windows (a non-override-redirect window with no child that has 'WM_STATE') and mark them as active.

View File

@ -742,6 +742,7 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
.logpath = NULL,
.use_damage = true,
.no_frame_pacing = false,
.shadow_red = 0.0,
.shadow_green = 0.0,

View File

@ -140,6 +140,8 @@ typedef struct options {
bool vsync_use_glfinish;
/// Whether use damage information to help limit the area to paint
bool use_damage;
/// Disable frame pacing
bool no_frame_pacing;
// === Shadow ===
/// Red, green and blue tone of the shadow.

View File

@ -363,6 +363,9 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
// --corner-radius-rules
parse_cfg_condlst_corner(opt, &cfg, "corner-radius-rules");
// --no-frame-pacing
lcfg_lookup_bool(&cfg, "no-frame-pacing", &opt->no_frame_pacing);
// -e (frame_opacity)
config_lookup_float(&cfg, "frame-opacity", &opt->frame_opacity);
// -c (shadow_enable)

View File

@ -176,6 +176,7 @@ static const struct picom_option picom_options[] = {
"rendered screen. Reduces banding artifacts, but might cause performance "
"degradation. Only works with OpenGL."},
// 340 is corner-radius-rules
{"no-frame-pacing" , no_argument , 341, NULL , "Disable frame pacing. This might increase the latency."},
{"legacy-backends" , no_argument , 733, NULL , "Use deprecated version of the backends."},
{"monitor-repaint" , no_argument , 800, NULL , "Highlight the updated area of the screen. For debugging."},
{"diagnostics" , no_argument , 801, NULL , "Print diagnostic information"},
@ -738,6 +739,7 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
// --dithered-present
opt->dithered_present = true;
break;
P_CASEBOOL(341, no_frame_pacing);
P_CASEBOOL(733, legacy_backends);
P_CASEBOOL(800, monitor_repaint);
case 801:

View File

@ -1445,9 +1445,9 @@ static bool redirect_start(session_t *ps) {
pixman_region32_init(&ps->damage_ring[i]);
}
ps->frame_pacing = true;
if (ps->o.legacy_backends || ps->o.benchmark ||
!ps->backend_data->ops->last_render_time) {
ps->frame_pacing = !ps->o.no_frame_pacing;
if ((ps->o.legacy_backends || ps->o.benchmark || !ps->backend_data->ops->last_render_time) &&
ps->frame_pacing) {
// Disable frame pacing if we are using a legacy backend or if we are in
// benchmark mode, or if the backend doesn't report render time
log_info("Disabling frame pacing.");