From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756115AbdESSRa (ORCPT ); Fri, 19 May 2017 14:17:30 -0400 Received: from anholt.net ([50.246.234.109]:60672 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750881AbdESSRP (ORCPT ); Fri, 19 May 2017 14:17:15 -0400 From: Eric Anholt To: Eric Engestrom Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/pl111: Add a debugfs node to dump our registers. In-Reply-To: <20170518100804.vnqomuzeligkltby@imgtec.com> References: <20170518005640.10310-1-eric@anholt.net> <20170518100804.vnqomuzeligkltby@imgtec.com> User-Agent: Notmuch/0.22.2+1~gb0bcfaa (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 19 May 2017 11:17:11 -0700 Message-ID: <87pof4g194.fsf@eliezer.anholt.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eric Engestrom writes: > On Wednesday, 2017-05-17 17:56:40 -0700, Eric Anholt wrote: >> While debugging an X11 display failure, I wanted to see where we were >> actually scanning out from. This is probably generally useful to >> others that might be working on this device. >>=20 >> Signed-off-by: Eric Anholt >> --- >> drivers/gpu/drm/pl111/Makefile | 2 ++ >> drivers/gpu/drm/pl111/pl111_debugfs.c | 55 ++++++++++++++++++++++++++++= +++++++ >> drivers/gpu/drm/pl111/pl111_drm.h | 3 ++ >> drivers/gpu/drm/pl111/pl111_drv.c | 4 +++ >> 4 files changed, 64 insertions(+) >> create mode 100644 drivers/gpu/drm/pl111/pl111_debugfs.c >>=20 >> diff --git a/drivers/gpu/drm/pl111/Makefile b/drivers/gpu/drm/pl111/Make= file >> index 01caee727c13..59483d610ef5 100644 >> --- a/drivers/gpu/drm/pl111/Makefile >> +++ b/drivers/gpu/drm/pl111/Makefile >> @@ -2,4 +2,6 @@ pl111_drm-y +=3D pl111_connector.o \ >> pl111_display.o \ >> pl111_drv.o >>=20=20 >> +pl111_drm-$(CONFIG_DEBUG_FS) +=3D pl111_debugfs.o >> + >> obj-$(CONFIG_DRM_PL111) +=3D pl111_drm.o >> diff --git a/drivers/gpu/drm/pl111/pl111_debugfs.c b/drivers/gpu/drm/pl1= 11/pl111_debugfs.c >> new file mode 100644 >> index 000000000000..ee13a060cddf >> --- /dev/null >> +++ b/drivers/gpu/drm/pl111/pl111_debugfs.c >> @@ -0,0 +1,55 @@ >> +/* >> + * Copyright =C2=A9 2017 Broadcom >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 as >> + * published by the Free Software Foundation. >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include "pl111_drm.h" >> + >> +#define REGDEF(reg) { reg, #reg } >> +static const struct { >> + uint32_t reg; >> + const char *name; >> +} pl111_reg_defs[] =3D { >> + REGDEF(CLCD_TIM0), >> + REGDEF(CLCD_TIM1), >> + REGDEF(CLCD_TIM2), >> + REGDEF(CLCD_TIM3), >> + REGDEF(CLCD_UBAS), >> + REGDEF(CLCD_PL111_CNTL), >> + REGDEF(CLCD_PL111_IENB), >> +}; >> + >> +int pl111_debugfs_regs(struct seq_file *m, void *unused) >> +{ >> + struct drm_info_node *node =3D (struct drm_info_node *)m->private; >> + struct drm_device *dev =3D node->minor->dev; >> + struct pl111_drm_dev_private *priv =3D dev->dev_private; >> + int i; > > nit: this will print a warning; s/int/unsigned/ ? I don't see any. I think the warning is only for non-constant expressions -- we do i < ARRAY_SIZE all over the place. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAlkfNqcACgkQtdYpNtH8 nuhdcBAAtGLJsxsVeF7sijRc74Fy3AlmehibaZw4c/hCbGsRddzRfOQNuhMRBiBi lraXwq7gJPvUI4qPElBKWKahmBBg30vsJI2ad6nordED11ym6nHwlgO6s1aqxG8p /vVm96cRMCTDWFsMLwAA7v9etgsGuSFKY98qDoL4kaQnHHw+TmwVox2CkgCyPlZt hHnAvXymG1xxvR5EmPiKJrydOxeypOgTqIqv6mYa0JtYvZohnWZ16jzRZPaoDplT gXKnfMkIOM/wDrbpPDJJy06lN1Ywvh+pZx+C7L9iECXkq2CtAhEDNNzS8N/EkuDQ 8M9V4h43YY+66gqnWZEKVTmkNu34Ppwz5UBoByUnBpSRtWQtqgvtl/TC8KzUtw5p v1zZGZ1jJ/+qz+cKS5STsVzzz3IT/x67BT+5K71/O0Qeeh5po6ihj/2OoY1tUbSj HBuci2VvXUAyj4WUjfOMOzY9l4fyXZ6fCZTzCNJ+PSGutNg7QfSWZrbeK5wsPKxS kKniX/U2kYliZ/ZaKomD7JKyIsjfGZjoSzi8WyX3nqTknroeHEr3mgoxfVe/pGX2 6xmE/SYKxan8lARXGYLuDjUC5pFv5v6OMA3wGuav3Y/is/qlIx0zhi5B8f6KFw4/ D8Y+JA9+0ZkiDqbKhOGFl7orYQqqGJt0z51E4+mREzHmoVKsRQg= =1+ON -----END PGP SIGNATURE----- --=-=-=--