Commit Graph

389 Commits

Author SHA1 Message Date
Emil Velikov
816d9f6b98 overlay: rework misleading gpu_busy_percent check
Above all, we really don't need the gpu_busy_percent node, if the GPU
exposes a gpu_metrics node,

Although looking closer, the gpu_busy_percent check is meant for
something else - to distinguish between the card node (cardX) and the
card output node (cardX-output-foo).

To top it all up, the check at the very end implies that we can get a
case where gpu_metrics and gpu_busy_perfect is missing ... that's not
possible.

So instead, drop the early gpu_busy_perfect check and properly mandate
it later on.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 20:19:16 +00:00
Emil Velikov
17bfd6ed08 Skip the standalone nodes, when gpu_metrics is present
Currently we open the standalone busy, temp, gpu/memory clock and
power_usage nodes, even if gpu_metrics is present.

At the same time, we correctly ignore them when doing the read-only.
So just avoid opening them all together.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 18:10:31 +00:00
Emil Velikov
5143229bd1 Fix gpu_stats logic check
Currently we can get the load and temp stats either from the standalone
nodes or from the gpu_metrics (binary) sysfs node.

Fix the next to handle that.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 18:10:31 +00:00
Emil Velikov
a7e8ae9417 Remove dummy vendorID overwrite in init_gpu_stats()
We have already enforced that a few lines above just after parsing the
vendor node.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 18:10:30 +00:00
Emil Velikov
2aa49caf52 Remove find_folder() API
Can be trivially replaced with ls()

v2: Move break where it's supposed to.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 18:10:04 +00:00
Emil Velikov
68ce8f81cc Remove libdrm_amdgpu metrics
There are two alternatives - hwmon entries and gpu_metrics sysfs file.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 10:28:18 +00:00
Emil Velikov
7ad24b4c0a Simplify cpu/mem/os/glxinfo parsing
Currently we pipeline a bunch of commands alike cat | grep | sed, there
we can do all that job with a single sed invocation - use that.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 10:28:18 +00:00
jackun
822bb66629
Fix confusing vendorID with deviceID
OpenGL still needs some work to select the actual render device >:(
2022-03-06 22:06:48 +02:00
jackun
8e21b52acf
Make get_device_name return GPU name 2022-03-06 22:02:09 +02:00
Emil Velikov
597f78cbee Fixup device/vendor node handling
Currently we readout the data as string only to convert it to hex. In
the error case, we leak the fd for the given nodes.

Read the data as hex directly, error out if that fails and avoid the
leaks.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-06 19:03:35 +00:00
FlightlessMango
ae7c5f0f24 Fix hud benchmark 2022-02-24 22:26:28 +01:00
jackun
a029dfaaf2
Don't hide gpu_metrics behind HAVE_LIBDRM_AMDGPU 2022-02-18 17:35:11 +02:00
FlightlessMango
93f389dd62 clean up frametime_data 2022-02-18 16:08:14 +01:00
FlightlessMango
3a667ab66b Revert FPS calc 2022-02-18 16:08:14 +01:00
jackun
e555a942fb
Use single IO stats instance 2022-02-18 16:44:10 +02:00
FlightlessMango
fa133940c8 Fix min/max frametime 2022-02-17 12:36:04 +01:00
FlightlessMango
316914da8d mangoapp: fixed mangoapp not respecting no_display 2022-02-15 19:16:45 +01:00
FlightlessMango
c708b1a8a8 disable deviceid check for now 2022-02-11 08:52:04 +01:00
FlightlessMango
6983c2ec39 Use gpu_metrics instead of libdrm when available 2022-02-04 19:55:00 +01:00
FlightlessMango
fb1cae9cc9 display min/max frametime for period 2022-01-25 12:37:58 +01:00
FlightlessMango
46730b572a permit starting a new log even if previous is rendering 2022-01-21 13:33:39 +01:00
flightlessmango
0f49c5796a
Merge pull request #671 from Joshua-Ashton/empty_crash
Fix crash when no frames were recorded
2022-01-19 01:57:03 +01:00
Joshua Ashton
437563fa77 Fix crash when no frames were recorded
This can happen with MangoApp + the Steam Deck UI as it doesn't commit when there is nothing going on
2022-01-19 00:51:50 +00:00
FlightlessMango
3d3916247a mangoapp: force benchmark underneath 2022-01-19 01:35:46 +01:00
flightlessmango
1f94e0af4d
Merge pull request #657 from ishitatsuyuki/quad
overlay: avoid quadratic behavior
2022-01-17 08:18:25 +01:00
FlightlessMango
37e18279e7 mangoapp: use amdgpu metrics 2022-01-14 22:41:38 +01:00
FlightlessMango
3366120364 Move calc benchmark into logger 2022-01-06 14:54:45 +01:00
FlightlessMango
a1b7b55a54 Use hudelements params in logging 2022-01-05 11:27:39 +01:00
jackun
4a33838bcd
Add extra parentheses to make compiler happy 2022-01-04 18:20:33 +02:00
FlightlessMango
9758d2a286 Try to get correct amd gpu when multiple 2022-01-02 12:04:22 +01:00
FlightlessMango
cfd802c063 Incorrect param used in calc benchmark 2021-12-30 02:27:21 +01:00
FlightlessMango
7212c79feb Logging: push param to benchmark calc 2021-12-19 14:40:27 +01:00
Tatsuyuki Ishi
ada173e67f overlay: avoid quadratic behavior
Using a vector with erase(begin()) results in a copy of the full array
every time. This is inefficient and in the case of HUD graphs, was having
quadratic complexity which can noticeably affect performance.

This patch replaces most of the operations with an O(1) alternative,
keeping the total cost under a linear bound. While on this, also refactor
the size of graph array into a constant.
2021-12-19 00:20:54 +09:00
FlightlessMango
ee7f3fbfd2 Mangoapp: frametime message queue 2021-12-13 14:38:50 +01:00
FlightlessMango
9434033083 Don't use read_line as it causes issue with splitgate 2021-12-10 11:27:12 +01:00
FlightlessMango
23ed317536 mangoapp: shm struct + gamescope engine 2021-11-18 08:25:30 +01:00
Stephan Lachnit
4983056600 fix regression in hw_info_updater
Calling std::unique_lock in update() will cause a delay if
update_hw_info() takes longer than the period when update() is called.
To fix this, a try_to_lock tag is added. update() will only update if
the lock is aquired, else the update call is skipped.

Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2021-11-10 08:55:02 +02:00
FlightlessMango
5fee3bc5e3 Change _params to pointer 2021-11-04 02:07:38 +01:00
FlightlessMango
b001eb4714 Move _params init to overlay.cpp 2021-10-18 17:50:58 +02:00
FlightlessMango
4e3a40c6ef mangoapp + gamescope shm 2021-10-18 17:50:58 +02:00
jackun
abf146f73c
Set correct swapchain_stats etc references for hw updater 2021-10-02 16:42:37 +03:00
jackun
9b6a39dfe9
sed s/gnu_linux/linux/g 2021-10-02 15:25:07 +03:00
jackun
90e48f95ca
Use unversioned fmt::format_error 2021-10-02 15:25:07 +03:00
jackun
6584f23a6c
Use ghc::filesystem to iterate over /proc/self/map_files 2021-10-02 15:25:07 +03:00
jackun
c452609718
Fix hw update thread waiting for initial update signal 2021-09-27 14:52:47 +03:00
FlightlessMango
947f287a5e
Only create hw_info_thread once 2021-09-24 22:16:47 +03:00
jackun
729ccc83bd
Use spdlog's 'fmt' to format media player metadata
Usage:
  media_player_format={title};{artist};{album}

Semi-colon breaks to new line, might change.
2021-09-23 14:54:22 +03:00
FlightlessMango
3ac7772a55 Add universal param 2021-09-18 17:21:20 +02:00
jackun
d1617818cd
Fix OpenGL gpu_name 2021-08-12 18:18:39 +03:00
jackun
866fd8bc24
Add per process memory usage (procmem etc) 2021-08-07 15:56:27 +03:00
jackun
a82e27d978
Use spdlog macros so logging can be completely disabled during compile-time 2021-07-27 16:16:39 +03:00
jackun
2f807a4c0d
Add spdlog wrap and logging 2021-07-16 04:06:09 +03:00
jackun
c093f9823e
Use libdrm_amdgpu for amdgpu sensor info, if available
Using plain `open` as `drmOpen` needs bus id check which needs interface 1.4 ioctl which gives EPERM cause only DRM_MASTER can call it :(

https://github.com/clbr/radeontop/issues/48#issuecomment-493792404
2021-07-13 19:54:24 +03:00
jackun
88d801bd7e
Move functions not directly related to vulkan from vulkan.cpp to overlay.cpp 2021-07-13 17:08:16 +03:00
Joshua Martin
3b0b6fbc42
Add position options to place the overlay halfway down the screen (#561) 2021-07-04 22:17:43 +03:00
Lukáš Horáček
213953089d
Detect ToGL 2021-06-27 16:35:07 +02:00
jackun
750d2cddb5
Make engine type per instance 2021-06-27 16:31:19 +03:00
FlightlessMango
3f120b1fc5 don't set engine to vulkan if already set 2021-06-23 19:53:07 +02:00
Alessandro Toia
570bef468b Cosmetic changes to engine detection 2021-06-19 15:58:01 -07:00
FlightlessMango
5330573c8c don't rely on std in engine detection 2021-06-17 00:49:46 +02:00
jackun
0ee101e0ac
Fix MPRIS ticker, microseconds to nanoseconds 2021-06-11 20:14:03 +03:00
flightlessmango
428ddf4e8a
Merge pull request #536 from flightlessmango/battery_test
Battery info and font awesome icons
2021-06-10 20:52:58 +00:00
FlightlessMango
92282bcec2 convert frametime from ns to us 2021-06-10 19:40:15 +02:00
Joshua Ashton
815097718e Use nanoseconds to calculate fps
No need to round this earlier on.

Removes an unnecessary implicit float -> double conversion in the calculation also
2021-06-10 19:40:15 +02:00
Alessandro Toia
5c48b4729c Change param to battery, add param for icon, hide power when plugged in 2021-06-08 16:04:33 -07:00
jackun
a0a57038c1
Fix redefinition of 'open'
musl pulls in fcntl.h from somewhere
2021-06-03 09:55:33 +03:00
Alessandro Toia
a533883a39 Check if there are battieres before attempting to retrieve stats 2021-05-27 15:40:33 -07:00
Alessandro Toia
552a85aaaa Only update battery stats if a battery is present 2021-05-27 15:40:33 -07:00
FlightlessMango
a90c897feb Check battery info 2021-05-27 15:40:33 -07:00
jackun
f77a73ce8a
Fix scoped_lock clash with >= c++17 2021-03-02 13:01:04 +02:00
FlightlessMango
6286313478 MSVC building fixes 2021-02-20 11:58:11 +01:00
FlightlessMango
1a8689fbba Add gpu power to logs 2021-02-07 07:18:54 +01:00
flightlessmango
e57be394d7
Merge pull request #428 from flgx16/swap
Add swap
2021-01-05 23:40:43 +01:00
FlightlessMango
90ce1c5778 ImGui wrap 2020-12-18 16:14:05 +01:00
FlightlessMango
0162fb913c Always try to update exec's 2020-12-16 03:43:14 +01:00
flightlessmango
214bb83d40 Moved update_exec() into a thread 2020-12-14 20:21:33 +01:00
FlightlessMango
c54f8bec5d Hud elements exec function 2020-12-14 06:54:29 +01:00
Lukáš Horáček
f11a49ae8b
Add swap 2020-12-13 11:07:17 +01:00
Alessandro Toia
c479694735 Use SetCursorPosX() instead of SameLine() to center text 2020-12-07 18:35:08 -08:00
Alessandro Toia
b77517501c Add new param custom_header 2020-12-07 18:35:08 -08:00
Alessandro Toia
8e873fe547 Remove more "not" and "and" in if statments
Rename dbus_helpers.hpp to dbus_helpers.h
2020-12-03 22:00:18 -08:00
FlightlessMango
c20b06c851 Remove more ram related things for windows 2020-12-03 21:26:00 +01:00
FlightlessMango
a4a5950ddf Make sure graphs have data without enabling elems 2020-11-27 19:15:51 +01:00
FlightlessMango
3827fe96d4 Add autostart_log param 2020-11-27 15:12:38 +01:00
jackun
0474c93800
Change change_on_load_temp's current param to unsigned 2020-11-17 20:25:20 +02:00
jackun
1e8487c991
Move color conversion to HudElements; move some overlay related functions back to overlay.cpp 2020-11-17 20:23:33 +02:00
flightlessmango
ce6a87823b
Merge pull request #388 from flgx16/cpu_power
Add cpu_power
2020-11-17 14:48:27 +01:00
Lukáš Horáček
02a34ba890 Fix cpu_mhz when core_load is disabled 2020-11-12 23:50:49 +02:00
Lukáš Horáček
3726c90c7a
Add cpu_power 2020-11-12 22:27:35 +01:00
FlightlessMango
cc38924997 Added graphs 2020-11-09 19:37:37 +01:00
FlightlessMango
cb8d992bfe Use real_font_size for padding 2020-09-23 12:23:29 +02:00
ZakMcKrack3n
73e6e31301
toggle fps limiter via hotkey, fps_limit may be set to multiple values
(e.g. 0,30,60).
fps toggle toggles between entries where zero means unlimited
2020-09-19 12:45:59 +03:00
FlightlessMango
cbd87585b4 Win32 cpu usage 2020-09-06 13:52:18 +02:00
FlightlessMango
21e8d8c402 Move calc benchmark into overlay 2020-09-06 10:58:16 +02:00
FlightlessMango
c3fc0f10b0 Start separating vulkan, keybinds, overlay and font 2020-09-06 10:30:57 +02:00
FlightlessMango
1c5baef992 Move try_log into update_hud() and fix formatting 2020-09-06 07:56:29 +02:00
FlightlessMango
c337fddc58 Move try_log() into render_imgui 2020-09-02 09:44:39 +02:00
FlightlessMango
c4a7d3002b Moved try_log() outside of no_display 2020-09-02 07:52:28 +02:00
FlightlessMango
9ddd075b18 Get actual frametime for logs 2020-09-02 07:50:26 +02:00
jackun
cec98369ae
Include array, explicitly 2020-08-25 07:58:56 +03:00