From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-arm-msm@vger.kernel.org, Rob Clark <robdclark@gmail.com>
Subject: [RFC 0/2] drm/msm: additions for firmware debugging
Date: Wed, 13 Dec 2017 15:12:55 -0500 [thread overview]
Message-ID: <20171213201302.22001-1-robdclark@gmail.com> (raw)
A couple patches aimed in particular at simplifying firmware debugging.
The first patch adds some debugfs to dump out state, as well as a
debugfs file that can be written to trigger GPU reset and firmware
reloading.
The second patch adds a new SUBMIT ioctl flag to allow userspace to
submit cmdstream that is executed from the ringbuffer (RB) instead of
from IB1. *Normally* this isn't something you want to allow userspace
to do, so it is (a) restricted to CAP_SYS_ADMIN and (b) hidden behind
an additional kconfig option. But it *is* quite useful for debugging
since it allows you to execute a single command and then dump out the
PFP and/or ME microcontroller registers/state, without having that state
overwritten by handling of the return-from-CP_INDIRECT_BUFFER or other
commands that the kernel normally writes into RB as part of handling of
a SUBMIT.
Compared to hacking up the kernel to submit different commands and
dumping state, these two patches avoid much kernel rebuilding and
rebooting. Also it makes it much easier to debug commands that have
pointers to other GPU buffers, since it re-uses all the existing SUBMIT
reloc logic.
Maybe I should also add a module_param() to unlock the "sudo" flag on
SUBMIT, or some other mechanism to prevent accidental use? Suggestions
welcome.
So far, the "sudo" flag is only supported on a5xx.. a4xx and before had
different instruction sets for PFP and ME (which seem to closely match
the PFP and ME instruction sets for r600), and I haven't tried to write
an assembler/disassembler for those yet (and therefore haven't needed
this feature).
In case anyone else wants to play with this, see:
https://github.com/freedreno/envytools/tree/afuc/afuc
Rob Clark (2):
drm/msm: add a5xx specific debugfs
drm/msm: add sudo flag to submit ioctl
drivers/gpu/drm/msm/Kconfig | 13 ++
drivers/gpu/drm/msm/Makefile | 2 +
drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 188 +++++++++++++++++++++++++++++
drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 66 ++++++++++
drivers/gpu/drm/msm/adreno/a5xx_gpu.h | 4 +
drivers/gpu/drm/msm/adreno/adreno_device.c | 6 +
drivers/gpu/drm/msm/msm_debugfs.c | 5 +-
drivers/gpu/drm/msm/msm_gem.h | 1 +
drivers/gpu/drm/msm/msm_gem_submit.c | 9 ++
drivers/gpu/drm/msm/msm_gpu.h | 2 +
include/uapi/drm/msm_drm.h | 2 +
11 files changed, 297 insertions(+), 1 deletion(-)
create mode 100644 drivers/gpu/drm/msm/adreno/a5xx_debugfs.c
--
2.13.6
next reply other threads:[~2017-12-13 20:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-13 20:12 Rob Clark [this message]
[not found] ` <20171213201302.22001-1-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-12-13 20:12 ` [RFC 1/2] drm/msm: add a5xx specific debugfs Rob Clark
2017-12-13 20:12 ` [RFC 2/2] drm/msm: add sudo flag to submit ioctl Rob Clark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171213201302.22001-1-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.