[Freedreno] [PATCH 07/13] drm/msm/gpu: Convert the GPU show function to use the GPU state

2018-06-29 Thread Jordan Crouse
Convert the existing GPU show function to use the GPU state to dump the information rather than reading it directly from the hardware. This will require an additional step to capture the state before dumping it for the existing nodes but it will greatly facilitate reusing the same code for dumping

[Freedreno] [PATCH 06/13] drm/msm/gpu: Capture the state of the GPU

2018-06-29 Thread Jordan Crouse
Add the infrastructure to capture the current state of the GPU and store it in memory so that it can be dumped later. For now grab the same basic ringbuffer information and registers that are provided by the debugfs 'gpu' node but obviously this should be extended to capture a much larger set of

[Freedreno] [PATCH 05/13] drm: Add put callback for the coredump printer

2018-06-29 Thread Jordan Crouse
Add a put function for the coredump printer to bypass printf() for constant strings for a speed boost. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/drm_print.c | 42 + include/drm/drm_print.h | 2 ++ 2 files changed, 44 insertions(+) diff --git

[Freedreno] [PATCH 08/13] drm/msm/gpu: Rearrange the code that collects the task during a hang

2018-06-29 Thread Jordan Crouse
Do a bit of cleanup to prepare for upcoming changes to pass the hanging task comm and cmdline to the crash dump function. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_gpu.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git

[Freedreno] [PATCH 02/13] drm: drm_printer: Add printer for devcoredump

2018-06-29 Thread Jordan Crouse
Add a drm printer suitable for use with the read callback for devcoredump or other suitable buffer based output format that isn't otherwise covered by seq_file. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/drm_print.c | 74 + include/drm/drm_print.h |

[Freedreno] [PATCH 03/13] drm: Add drm_puts() to complement drm_printf()

2018-06-29 Thread Jordan Crouse
Add drm_puts() for a much faster path to print constant strings into a drm_printer object with memcpy and friends. This can shave seconds off of really large outputs such as GPU dumps. If the drm_printer object supports a custom puts function then use that otherwise fall back to the slower legacy

[Freedreno] [PATCH 01/13] include: Move ascii85 functions from i915 to linux/ascii85.h

2018-06-29 Thread Jordan Crouse
The i915 DRM driver very cleverly used ascii85 encoding for their GPU state file. Move the encode functions to a general header file to support other drivers that might be interested in the same functionality. v3: Fix error_puts -> err_puts pointed out by the 01.org bot v2: Update API to be

[Freedreno] [PATCH 04/13] drm: Add puts function for the seq_file printer

2018-06-29 Thread Jordan Crouse
Add support for drm_puts() to use seq_puts() to help speed up up print time for constant strings. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/drm_print.c | 6 ++ include/drm/drm_print.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm/drm_print.c

[Freedreno] [PATCH 12/13] drm/msm/adreno: Add a5xx specific registers for the GPU state

2018-06-29 Thread Jordan Crouse
HLSQ, SP and TP registers are only accessible from a special aperture and to make matters worse the aperture is blocked from the CPU on targets that can support secure rendering. Luckily the GPU hardware has its own purpose built register dumper that can access the registers from the aperture. Add

[Freedreno] [PATCH 09/13] drm/msm/gpu: Capture the GPU state on a GPU hang

2018-06-29 Thread Jordan Crouse
Capture the GPU state on a GPU hang and store it for later playback via the devcoredump facility. Only one crash state is stored at a time on the assumption that the first hang is usually the most interesting. The existing crash state can be cleared after capturing it and then a new one will be

[Freedreno] [PATCH 13/13] drm/msm/gpu: Add the buffer objects from the submit to the crash dump

2018-06-29 Thread Jordan Crouse
For hangs, dump copy out the contents of the buffer objects attached to the guilty submission and print them in the crash dump report. Signed-off-by: Jordan Crouse --- Documentation/gpu/drm-msm-crash-dump.txt | 7 +++ drivers/gpu/drm/msm/adreno/adreno_gpu.c | 58

[Freedreno] [PATCH 11/13] drm/msm/adreno: Add ringbuffer data to the GPU state

2018-06-29 Thread Jordan Crouse
Add the contents of each ringbuffer to the GPU state and dump the data in the crash file encoded with ascii85. To save space only the used portions of the ringbuffer are dumped. Signed-off-by: Jordan Crouse --- Documentation/gpu/drm-msm-crash-dump.txt | 5 +++

[Freedreno] [PATCH 10/13] drm/msm/adreno: Convert the show/crash file format

2018-06-29 Thread Jordan Crouse
Convert the format of the 'show' debugfs file and the crash dump to a format resembling YAML. This should be easier to parse and be more flexible for future changes and expansions. Signed-off-by: Jordan Crouse --- Documentation/gpu/drm-msm-crash-dump.txt | 46

Re: [Freedreno] [PATCH] drm/msm/adreno: Remove VLA usage

2018-06-29 Thread Arnd Bergmann
On Fri, Jun 29, 2018 at 8:48 PM, Kees Cook wrote: > In the quest to remove all stack VLA usage from the kernel[1], this > switches to using a kasprintf()ed buffer. Return paths are updated > to free the allocation. > > [1] >

[Freedreno] [PATCH] drm/msm/adreno: Remove VLA usage

2018-06-29 Thread Kees Cook
In the quest to remove all stack VLA usage from the kernel[1], this switches to using a kasprintf()ed buffer. Return paths are updated to free the allocation. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Signed-off-by: Kees Cook ---

Re: [Freedreno] [PATCH 13/13] drm/msm/gpu: Add the buffer objects from the submit to the crash dump

2018-06-29 Thread kbuild test robot
Hi Jordan, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on robclark/msm-next] [also build test WARNING on v4.18-rc2 next-20180629] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com

Re: [Freedreno] [PATCH 09/13] drm/msm/gpu: Capture the GPU state on a GPU hang

2018-06-29 Thread kbuild test robot
Hi Jordan, Thank you for the patch! Yet something to improve: [auto build test ERROR on robclark/msm-next] [also build test ERROR on v4.18-rc2 next-20180629] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci

Re: [Freedreno] [PATCH] drm/msm/adreno: Remove VLA usage

2018-06-29 Thread Jordan Crouse
On Fri, Jun 29, 2018 at 10:47:31PM +0200, Arnd Bergmann wrote: > On Fri, Jun 29, 2018 at 8:48 PM, Kees Cook wrote: > > In the quest to remove all stack VLA usage from the kernel[1], this > > switches to using a kasprintf()ed buffer. Return paths are updated > > to free the allocation. > > > > [1]

Re: [Freedreno] [PATCH] drm/msm/adreno: Remove VLA usage

2018-06-29 Thread Jordan Crouse
On Fri, Jun 29, 2018 at 11:48:18AM -0700, Kees Cook wrote: > In the quest to remove all stack VLA usage from the kernel[1], this > switches to using a kasprintf()ed buffer. Return paths are updated > to free the allocation. > > [1] >