dc68054305
- Restore 29 recipe symlinks (libdrm, qtbase, dbus, sddm, pipewire, etc.) - Restore 33 patches (KDE, libdrm, mesa, pipewire, sddm, wireplumber) - Restore 20+ local/scripts (audit, lint, test, build helpers) - Restore src/cook/scheduler.rs, status.rs, gnu-config/ - Restore scripts/patch-inclusion-gate.sh, run_mini1.sh, validate-collision-log.sh - Recover TLC source from HEAD (was overwritten by 0.2.3 checkout) - Recover 11 local/docs plans from HEAD (were overwritten) - Recover qt6-wayland-smoke symlink from HEAD - Fix MOTD: remove garbled ASCII art, use clean text - Update version: 0.2.0 -> 0.2.4 in os-release, motd, config - Reduce filesystem_size: 1536 -> 512 MiB - Add ABSOLUTE RULE to AGENTS.md: never delete/ignore packages - Reduce pcid scheme log verbosity: info -> debug
39 lines
831 B
C
39 lines
831 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* win_minmax.h: windowed min/max tracker by Kathleen Nichols.
|
|
*
|
|
*/
|
|
#ifndef MINMAX_H
|
|
#define MINMAX_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
/* A single data point for our parameterized min-max tracker */
|
|
struct minmax_sample {
|
|
u32 t; /* time measurement was taken */
|
|
u32 v; /* value measured */
|
|
};
|
|
|
|
/* State for the parameterized min-max tracker */
|
|
struct minmax {
|
|
struct minmax_sample s[3];
|
|
};
|
|
|
|
static inline u32 minmax_get(const struct minmax *m)
|
|
{
|
|
return m->s[0].v;
|
|
}
|
|
|
|
static inline u32 minmax_reset(struct minmax *m, u32 t, u32 meas)
|
|
{
|
|
struct minmax_sample val = { .t = t, .v = meas };
|
|
|
|
m->s[2] = m->s[1] = m->s[0] = val;
|
|
return m->s[0].v;
|
|
}
|
|
|
|
u32 minmax_running_max(struct minmax *m, u32 win, u32 t, u32 meas);
|
|
u32 minmax_running_min(struct minmax *m, u32 win, u32 t, u32 meas);
|
|
|
|
#endif
|