Skip to contentSkip to conversation

drm/nouveau: Add DRM_NOUVEAU_DEBUG option

PATCH In review Matt Parnell 3 participants 3 messages Oct 8, 2009 – Oct 11, 2009 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: Add DRM_NOUVEAU_DEBUG option

From: Matt Parnell <[email protected]>

Sometimes we have DEBUG_FS enabled, but don't want output from certain modules. Most modules make this an option, so I figured that Nouveau needed it too.

---
 drivers/gpu/drm/Kconfig                   |   11 +++++++++++
 drivers/gpu/drm/nouveau/Makefile          |    2 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c |    2 --
 drivers/gpu/drm/nouveau/nouveau_drv.c     |    2 +-
 drivers/gpu/drm/nouveau/nouveau_drv.h     |    2 +-
 5 files changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/Kconfig +11 -0
index 7fe8a4c..62dd13c 100644
@@ -176,6 +176,9 @@ config DRM_NOUVEAU_KMS
 	and you have a new enough userspace to support this. Running old
 	userspaces with this enabled will cause pain.
 
+	NOTICE: if you plan on using the text based console outside of X, enable
+	FRAMEBUFFER_CONSOLE or else the console will be unusable.
+
 config DRM_NOUVEAU_BACKLIGHT
 	bool "Support for backlight control"
 	depends on DRM_NOUVEAU
@@ -184,6 +187,14 @@ config DRM_NOUVEAU_BACKLIGHT
 	  Say Y here if you want to control the backlight of your display
 	  (e.g. a laptop panel).
 
+config DRM_NOUVEAU_DEBUG
+	bool "Build in Nouveau's debugfs support"
+	depends on DRM_NOUVEAU && DEBUG_FS
+	default y
+	help
+	  Say Y here if you want Nouveau to output debugging information
+	  via debugfs.
+
 menu "I2C encoder or helper chips"
      depends on DRM
 
drivers/gpu/drm/nouveau/Makefile +1 -1
index ab46e3a..e12b4ff 100644
@@ -9,7 +9,6 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \
              nouveau_bo.o nouveau_fence.o nouveau_gem.o nouveau_ttm.o \
              nouveau_hw.o nouveau_calc.o nouveau_bios.o nouveau_i2c.o \
 	     nouveau_display.o nouveau_connector.o nouveau_fbcon.o \
-	     nouveau_debugfs.o \
              nv04_timer.o \
              nv04_mc.o nv40_mc.o nv50_mc.o \
              nv04_fb.o nv10_fb.o nv40_fb.o \
@@ -22,6 +21,7 @@ nouveau-y := nouveau_drv.o nouveau_state.o nouveau_channel.o nouveau_mem.o \
              nv04_dac.o nv04_dfp.o nv04_tv.o nv17_tv.o nv17_tv_modes.o \
              nv04_crtc.o nv04_display.o nv04_cursor.o nv04_fbcon.o
 
+nouveau-$(CONFIG_DRM_NOUVEAU_DEBUG) += nouveau_debugfs.o
 nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
 nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o
 nouveau-$(CONFIG_ACPI) += nouveau_acpi.o
drivers/gpu/drm/nouveau/nouveau_debugfs.c +0 -2
index 1ac871b..6ccafd3 100644
@@ -33,7 +33,6 @@
 #include "drmP.h"
 #include "nouveau_drv.h"
 
-#if defined(CONFIG_DEBUG_FS)
 static int
 nouveau_debugfs_channel_info(struct seq_file *m, void *data)
 {
@@ -154,4 +153,3 @@ nouveau_debugfs_takedown(struct drm_minor *minor)
 	drm_debugfs_remove_files(nouveau_debugfs_list, NOUVEAU_DEBUGFS_ENTRIES,
 				 minor);
 }
-#endif
drivers/gpu/drm/nouveau/nouveau_drv.c +1 -1
index 327f01a..5e9d38a 100644
@@ -325,7 +325,7 @@ static struct drm_driver driver = {
 	.lastclose = nouveau_lastclose,
 	.unload = nouveau_unload,
 	.preclose = nouveau_preclose,
-#if defined(CONFIG_DEBUG_FS)
+#if defined(CONFIG_DRM_NOUVEAU_DEBUG)
 	.debugfs_init = nouveau_debugfs_init,
 	.debugfs_cleanup = nouveau_debugfs_takedown,
 #endif
drivers/gpu/drm/nouveau/nouveau_drv.h +1 -1
index 2ecfb25..46436ce 100644
@@ -765,7 +765,7 @@ extern int nouveau_sgdma_get_page(struct drm_device *, uint32_t offset,
 extern struct ttm_backend *nouveau_sgdma_init_ttm(struct drm_device *);
 
 /* nouveau_debugfs.c */
-#if defined(CONFIG_DEBUG_FS)
+#if defined(CONFIG_DRM_NOUVEAU_DEBUG)
 extern int  nouveau_debugfs_init(struct drm_minor *);
 extern void nouveau_debugfs_takedown(struct drm_minor *);
 extern int  nouveau_debugfs_channel_init(struct nouveau_channel *);
Signature · 1 line
1.6.4.4

A message that is not in the archive (sent off-list or not yet received): 1255037211-5992-1-git-send-email-parwok-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

Ignore the previous patch thread I started. This is the correct one.

Quoted 115 lines · Matt Parnell

From: Matt Parnell <[email protected]>

Sometimes we have DEBUG_FS enabled, but don't want output from certain modules.
Most modules make this an option, so I figured that Nouveau needed it too.

---
 drivers/gpu/drm/Kconfig                   |   11 +++++++++++
 drivers/gpu/drm/nouveau/Makefile          |    2 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c |    2 --
 drivers/gpu/drm/nouveau/nouveau_drv.c     |    2 +-
 drivers/gpu/drm/nouveau/nouveau_drv.h     |    2 +-
 5 files changed, 14 insertions(+), 5 deletions(-)
drivers/gpu/drm/Kconfig +1 -0
index 7fe8a4c..62dd13c 100644
@@ -176,6 +176,9 @@ config DRM_NOUVEAU_KMS
       and you have a new enough userspace to support this. Running old
       userspaces with this enabled will cause pain.
 
+       NOTICE: if you plan on using the text based console outside of X,

enable

drivers/gpu/drm/Kconfig +10 -0
+       FRAMEBUFFER_CONSOLE or else the console will be unusable.
+
 config DRM_NOUVEAU_BACKLIGHT
       bool "Support for backlight control"
       depends on DRM_NOUVEAU
@@ -184,6 +187,14 @@ config DRM_NOUVEAU_BACKLIGHT
         Say Y here if you want to control the backlight of your display
         (e.g. a laptop panel).
 
+config DRM_NOUVEAU_DEBUG
+       bool "Build in Nouveau's debugfs support"
+       depends on DRM_NOUVEAU && DEBUG_FS
+       default y
+       help
+         Say Y here if you want Nouveau to output debugging information
+         via debugfs.
+
 menu "I2C encoder or helper chips"
     depends on DRM
 
drivers/gpu/drm/nouveau/Makefile +0 -1
index ab46e3a..e12b4ff 100644
@@ -9,7 +9,6 @@ nouveau-y := nouveau_drv.o nouveau_state.o
 nouveau_channel.o nouveau_mem.o \
             nouveau_bo.o nouveau_fence.o nouveau_gem.o nouveau_ttm.o \
             nouveau_hw.o nouveau_calc.o nouveau_bios.o nouveau_i2c.o \
            nouveau_display.o nouveau_connector.o nouveau_fbcon.o \
-            nouveau_debugfs.o \
             nv04_timer.o \
             nv04_mc.o nv40_mc.o nv50_mc.o \
             nv04_fb.o nv10_fb.o nv40_fb.o \
drivers/gpu/drm/nouveau/Makefile +1 -0
@@ -22,6 +21,7 @@ nouveau-y := nouveau_drv.o nouveau_state.o
 nouveau_channel.o nouveau_mem.o \
             nv04_dac.o nv04_dfp.o nv04_tv.o nv17_tv.o nv17_tv_modes.o \
             nv04_crtc.o nv04_display.o nv04_cursor.o nv04_fbcon.o
 
+nouveau-$(CONFIG_DRM_NOUVEAU_DEBUG) += nouveau_debugfs.o
 nouveau-$(CONFIG_COMPAT) += nouveau_ioc32.o
 nouveau-$(CONFIG_DRM_NOUVEAU_BACKLIGHT) += nouveau_backlight.o

nouveau-$(CONFIG_ACPI) += nouveau_acpi.o

drivers/gpu/drm/nouveau/nouveau_debugfs.c +0 -2
index 1ac871b..6ccafd3 100644
@@ -33,7 +33,6 @@
 #include "drmP.h"
 #include "nouveau_drv.h"
 
-#if defined(CONFIG_DEBUG_FS)
 static int
 nouveau_debugfs_channel_info(struct seq_file *m, void *data)
 {
@@ -154,4 +153,3 @@ nouveau_debugfs_takedown(struct drm_minor *minor)
       drm_debugfs_remove_files(nouveau_debugfs_list,
 NOUVEAU_DEBUGFS_ENTRIES,
                                minor);
 }
-#endif
drivers/gpu/drm/nouveau/nouveau_drv.c +1 -1
index 327f01a..5e9d38a 100644
@@ -325,7 +325,7 @@ static struct drm_driver driver = {
       .lastclose = nouveau_lastclose,
       .unload = nouveau_unload,
       .preclose = nouveau_preclose,
-#if defined(CONFIG_DEBUG_FS)
+#if defined(CONFIG_DRM_NOUVEAU_DEBUG)
       .debugfs_init = nouveau_debugfs_init,
       .debugfs_cleanup = nouveau_debugfs_takedown,
 #endif
drivers/gpu/drm/nouveau/nouveau_drv.h +1 -1
index 2ecfb25..46436ce 100644
@@ -765,7 +765,7 @@ extern int nouveau_sgdma_get_page(struct drm_device *,
 uint32_t offset,
 extern struct ttm_backend *nouveau_sgdma_init_ttm(struct drm_device *);
 
 /* nouveau_debugfs.c */
-#if defined(CONFIG_DEBUG_FS)
+#if defined(CONFIG_DRM_NOUVEAU_DEBUG)
 extern int  nouveau_debugfs_init(struct drm_minor *);
 extern void nouveau_debugfs_takedown(struct drm_minor *);
Quoted 5 lines

extern int nouveau_debugfs_channel_init(struct nouveau_channel *);
--
1.6.4.4

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#3 lore raw
In reply to a message not in the archive
Quoted 6 lines · On Thu, 8 Oct 2009 16:26:51 -0500 Matt Parnell…

From: Matt Parnell <[email protected]>

Sometimes we have DEBUG_FS enabled, but don't want output from certain modules. Most modules make this an option, so I figured that Nouveau needed it too.

Quoted 8 lines
---
 drivers/gpu/drm/Kconfig                   |   11 +++++++++++
 drivers/gpu/drm/nouveau/Makefile          |    2 +-
 drivers/gpu/drm/nouveau/nouveau_debugfs.c |    2 --
 drivers/gpu/drm/nouveau/nouveau_drv.c     |    2 +-
 drivers/gpu/drm/nouveau/nouveau_drv.h     |    2 +-
 5 files changed, 14 insertions(+), 5 deletions(-)

Pushed, thanks.

Signature · 2 lines
Pekka Paalanen
http://www.iki.fi/pq/