linux/drivers/gpu/drm/amd/display/amdgpu_dm
Nicholas Kazlauskas 46659a83e4 drm/amd/display: Support reading hw state from debugfs file
[Why]

Logging hardware state can be done by triggering a write to the
debugfs file. It would also be useful to be able to read the hardware
state from the debugfs file to be able to generate a clean log without
timestamps.

[How]

Usage: cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log

Threading is an obvious concern when dealing with multiple debugfs
operations and blocking on global state in dm or dc seems unfavorable.

Adding an extra parameter for the debugfs log context state is the
implementation done here. Existing code that made use of DTN_INFO
and its associated macros needed to be refactored to support this.

We don't know the size of the log in advance so it reallocates the
log string dynamically. Once the log has been generated it's copied
into the user supplied buffer for the debugfs. This allows for seeking
support but it's worth nothing that unlike triggering output via
dmesg the hardware state might change in-between reads if your buffer
size is too small.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-08-27 15:20:49 -05:00
..
amdgpu_dm_color.c drm/amd/display: Use DGAM ROM or RAM 2018-08-27 11:09:58 -05:00
amdgpu_dm_crc.c drm/amd/display: Guard against null crtc in CRC IRQ 2018-08-13 17:29:44 -05:00
amdgpu_dm_debugfs.c drm/amd/display: Support reading hw state from debugfs file 2018-08-27 15:20:49 -05:00
amdgpu_dm_debugfs.h drm/amd/display: Add support for hw_state logging via debugfs 2018-08-27 15:20:17 -05:00
amdgpu_dm_helpers.c drm/amd/display: Support reading hw state from debugfs file 2018-08-27 15:20:49 -05:00
amdgpu_dm_irq.c drm/amd/display: Do not program interrupt status on disabled crtc 2018-05-29 13:30:38 -05:00
amdgpu_dm_irq.h
amdgpu_dm_mst_types.c drm/amd/display: Refactor FreeSync module 2018-08-27 11:10:51 -05:00
amdgpu_dm_mst_types.h drm/amd/display: Fix rehook MST display not light back on 2017-12-20 14:46:38 -05:00
amdgpu_dm_pp_smu.c drm/amd/display: Move PME to function pointer call semantics 2018-08-27 11:09:48 -05:00
amdgpu_dm_services.c BackMerge v4.18-rc7 into drm-next 2018-07-30 10:39:22 +10:00
amdgpu_dm.c drm/amd/display: Improve spelling, grammar, and formatting of amdgpu_dm.c comments 2018-08-27 15:20:41 -05:00
amdgpu_dm.h drm/amd/display: Refactor FreeSync module 2018-08-27 11:10:51 -05:00
Makefile drm/amd/display: Moving powerplay functions to a separate class 2018-07-05 16:38:41 -05:00