Skip to content

Commit

Permalink
KLAPSE : Make default flow_freq value configurable at compile time fr…
Browse files Browse the repository at this point in the history
…om klapse.h

- NOTE : Flow freq is a device-dependent timeout value. It depends on how fast KCAL reacts to a change in values, or in other words, how fast can you change colors in KCAL without having them not appear on screen (aka "RGB frame skips")
- NOTE : Flow freq should be reduced if KCAL reacts faster, left at 360 is unsure, increased for very high latencies (usually in MDSS)
- NOTE : Flow freq can be changed at runtime as well, so developers can find the perfect value that isn't too slow and isn't too sudden either
- NOTE : Flow freq is 360 (ms) by default, because of my testing on OnePlus 6 (enchilada) on stock ROM with custom display calibration
- NOTE : More GPU pulses can help most devices refresh KCAL faster, and indirectly "flow" smoother

Signed-off-by: Tanish Manku <tanish2k09.dev@gmail.com>
Signed-off-by: kingbri <bdashore3@gmail.com>
  • Loading branch information
tanish2k09 authored and acuicultor committed Feb 12, 2021
1 parent fea5c46 commit 933e9fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/klapse/klapse.c
Expand Up @@ -28,9 +28,10 @@ static unsigned int bl_upper = UPPER_BL_LVL;
static unsigned int pulse_freq = 30000;
static int fadeback_min = 90;
static int target_minute = 300;
static bool dimmer_auto;
static bool dimmer_auto = 0;
static unsigned int dimmer_start_minute = 1380;
static unsigned int dimmer_stop_minute = 360;
static unsigned int flow_freq = DEFAULT_FLOW_FREQ;

/* Core */
static void pulse(unsigned long data);
Expand All @@ -43,7 +44,6 @@ static unsigned short flow_r = MAX_SCALE;
static unsigned short flow_g = MAX_SCALE;
static unsigned short flow_b = MAX_SCALE;
static unsigned int active_minutes;
static unsigned int flow_freq = 360;
static unsigned int last_bl = MAX_BRIGHTNESS;
static unsigned long local_time;
static struct rtc_time tm;
Expand Down
2 changes: 2 additions & 0 deletions include/linux/klapse.h
Expand Up @@ -41,4 +41,6 @@ typedef unsigned short col_type_t;

#define LOWER_BL_LVL 2 /* Lower target for brightness-dependent mode */

#define DEFAULT_FLOW_FREQ 360 /* Flow delays for rapid pushes in mode 2 */

#endif /* _KLAPSE_H */

0 comments on commit 933e9fb

Please sign in to comment.