clutter: Add a flag to disable heuristic max render time

Debugging purposes: allows to check if frame drops are caused by
heuristic max render time or if they are there even with the old
behavior.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762>
This commit is contained in:
Ivan Molodetskikh 2020-11-28 16:46:03 +03:00 committed by Marge Bot
parent 592fbee065
commit 565e34b4d2
3 changed files with 15 additions and 10 deletions

View File

@ -19,6 +19,7 @@
#include "clutter/clutter-frame-clock.h" #include "clutter/clutter-frame-clock.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-main.h" #include "clutter/clutter-main.h"
#include "clutter/clutter-private.h" #include "clutter/clutter-private.h"
#include "clutter/clutter-timeline-private.h" #include "clutter/clutter-timeline-private.h"
@ -307,7 +308,9 @@ clutter_frame_clock_compute_max_render_time_us (ClutterFrameClock *frame_clock)
refresh_interval_us = refresh_interval_us =
(int64_t) (0.5 + G_USEC_PER_SEC / frame_clock->refresh_rate); (int64_t) (0.5 + G_USEC_PER_SEC / frame_clock->refresh_rate);
if (!frame_clock->got_measurements_last_frame) if (!frame_clock->got_measurements_last_frame ||
G_UNLIKELY (clutter_paint_debug_flags &
CLUTTER_DEBUG_DISABLE_DYNAMIC_MAX_RENDER_TIME))
return refresh_interval_us - SYNC_DELAY_FALLBACK_US; return refresh_interval_us - SYNC_DELAY_FALLBACK_US;
for (i = 0; i < ESTIMATE_QUEUE_LENGTH; ++i) for (i = 0; i < ESTIMATE_QUEUE_LENGTH; ++i)

View File

@ -130,6 +130,7 @@ static const GDebugKey clutter_paint_debug_keys[] = {
{ "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW }, { "continuous-redraw", CLUTTER_DEBUG_CONTINUOUS_REDRAW },
{ "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES }, { "paint-deform-tiles", CLUTTER_DEBUG_PAINT_DEFORM_TILES },
{ "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION }, { "damage-region", CLUTTER_DEBUG_PAINT_DAMAGE_REGION },
{ "disable-dynamic-max-render-time", CLUTTER_DEBUG_DISABLE_DYNAMIC_MAX_RENDER_TIME },
}; };
gboolean gboolean

View File

@ -63,15 +63,16 @@ typedef enum
typedef enum typedef enum
{ {
CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0, CLUTTER_DEBUG_DISABLE_SWAP_EVENTS = 1 << 0,
CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1, CLUTTER_DEBUG_DISABLE_CLIPPED_REDRAWS = 1 << 1,
CLUTTER_DEBUG_REDRAWS = 1 << 2, CLUTTER_DEBUG_REDRAWS = 1 << 2,
CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3, CLUTTER_DEBUG_PAINT_VOLUMES = 1 << 3,
CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4, CLUTTER_DEBUG_DISABLE_CULLING = 1 << 4,
CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5, CLUTTER_DEBUG_DISABLE_OFFSCREEN_REDIRECT = 1 << 5,
CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6, CLUTTER_DEBUG_CONTINUOUS_REDRAW = 1 << 6,
CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7, CLUTTER_DEBUG_PAINT_DEFORM_TILES = 1 << 7,
CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8, CLUTTER_DEBUG_PAINT_DAMAGE_REGION = 1 << 8,
CLUTTER_DEBUG_DISABLE_DYNAMIC_MAX_RENDER_TIME = 1 << 9,
} ClutterDrawDebugFlag; } ClutterDrawDebugFlag;
/** /**