All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: convert debugfs creation/destruction to table
@ 2013-07-04 18:39 Daniel Vetter
  2013-07-04 18:49 ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2013-07-04 18:39 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

At least for the common cases where we only need special file
operations. The forcewake file is still rather more special.

v2: Fix up the debugfs unregister code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 94 ++++++++++++-------------------------
 drivers/gpu/drm/i915/i915_irq.c     |  4 --
 2 files changed, 30 insertions(+), 68 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3e36756..0569af3 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2373,61 +2373,35 @@ static struct drm_info_list i915_debugfs_list[] = {
 };
 #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
 
+struct i915_debugfs_files {
+	const char *name;
+	const struct file_operations *fops;
+} i915_debugfs_files[] = {
+	{"i915_wedged", &i915_wedged_fops},
+	{"i915_max_freq", &i915_max_freq_fops},
+	{"i915_min_freq", &i915_min_freq_fops},
+	{"i915_cache_sharing", &i915_cache_sharing_fops},
+	{"i915_ring_stop", &i915_ring_stop_fops},
+	{"i915_gem_drop_caches", &i915_drop_caches_fops},
+	{"i915_error_state", &i915_error_state_fops},
+	{"i915_next_seqno", &i915_next_seqno_fops},
+};
+
 int i915_debugfs_init(struct drm_minor *minor)
 {
-	int ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_wedged",
-				  &i915_wedged_fops);
-	if (ret)
-		return ret;
+	int ret, i;
 
 	ret = i915_forcewake_create(minor->debugfs_root, minor);
 	if (ret)
 		return ret;
 
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_max_freq",
-				  &i915_max_freq_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_min_freq",
-				  &i915_min_freq_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_cache_sharing",
-				  &i915_cache_sharing_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_ring_stop",
-				  &i915_ring_stop_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_gem_drop_caches",
-				  &i915_drop_caches_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_error_state",
-				  &i915_error_state_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				 "i915_next_seqno",
-				 &i915_next_seqno_fops);
-	if (ret)
-		return ret;
+	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
+		ret = i915_debugfs_create(minor->debugfs_root, minor,
+					  i915_debugfs_files[i].name,
+					  i915_debugfs_files[i].fops);
+		if (ret)
+			return ret;
+	}
 
 	return drm_debugfs_create_files(i915_debugfs_list,
 					I915_DEBUGFS_ENTRIES,
@@ -2436,26 +2410,18 @@ int i915_debugfs_init(struct drm_minor *minor)
 
 void i915_debugfs_cleanup(struct drm_minor *minor)
 {
+	int i;
+
 	drm_debugfs_remove_files(i915_debugfs_list,
 				 I915_DEBUGFS_ENTRIES, minor);
 	drm_debugfs_remove_files((struct drm_info_list *) &i915_forcewake_fops,
 				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_wedged_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_max_freq_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_min_freq_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_cache_sharing_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_drop_caches_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_ring_stop_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_error_state_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_next_seqno_fops,
-				 1, minor);
+	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
+		struct drm_info_list *info_list =
+			(struct drm_info_list *) &i915_debugfs_files[i].fops;
+
+		drm_debugfs_remove_files(info_list, 1, minor);
+	}
 }
 
 #endif /* CONFIG_DEBUG_FS */
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 501144b..8de0caf 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -225,10 +225,6 @@ static void cpt_set_fifo_underrun_reporting(struct drm_device *dev,
 		if (!cpt_can_enable_serr_int(dev))
 			return;
 
-		I915_WRITE(SERR_INT, SERR_INT_TRANS_A_FIFO_UNDERRUN |
-				     SERR_INT_TRANS_B_FIFO_UNDERRUN |
-				     SERR_INT_TRANS_C_FIFO_UNDERRUN);
-
 		ibx_enable_display_interrupt(dev_priv, SDE_ERROR_CPT);
 	} else {
 		ibx_disable_display_interrupt(dev_priv, SDE_ERROR_CPT);
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] drm/i915: convert debugfs creation/destruction to table
  2013-07-04 18:39 [PATCH] drm/i915: convert debugfs creation/destruction to table Daniel Vetter
@ 2013-07-04 18:49 ` Daniel Vetter
  2013-07-05 19:29   ` Ben Widawsky
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2013-07-04 18:49 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

At least for the common cases where we only need special file
operations. The forcewake file is still rather more special.

v2: Fix up the debugfs unregister code.

v3: Actually squash in the right fixup.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 94 ++++++++++++-------------------------
 1 file changed, 30 insertions(+), 64 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 3e36756..9106759 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2373,61 +2373,35 @@ static struct drm_info_list i915_debugfs_list[] = {
 };
 #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)
 
+struct i915_debugfs_files {
+	const char *name;
+	const struct file_operations *fops;
+} i915_debugfs_files[] = {
+	{"i915_wedged", &i915_wedged_fops},
+	{"i915_max_freq", &i915_max_freq_fops},
+	{"i915_min_freq", &i915_min_freq_fops},
+	{"i915_cache_sharing", &i915_cache_sharing_fops},
+	{"i915_ring_stop", &i915_ring_stop_fops},
+	{"i915_gem_drop_caches", &i915_drop_caches_fops},
+	{"i915_error_state", &i915_error_state_fops},
+	{"i915_next_seqno", &i915_next_seqno_fops},
+};
+
 int i915_debugfs_init(struct drm_minor *minor)
 {
-	int ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_wedged",
-				  &i915_wedged_fops);
-	if (ret)
-		return ret;
+	int ret, i;
 
 	ret = i915_forcewake_create(minor->debugfs_root, minor);
 	if (ret)
 		return ret;
 
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_max_freq",
-				  &i915_max_freq_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_min_freq",
-				  &i915_min_freq_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_cache_sharing",
-				  &i915_cache_sharing_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_ring_stop",
-				  &i915_ring_stop_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_gem_drop_caches",
-				  &i915_drop_caches_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				  "i915_error_state",
-				  &i915_error_state_fops);
-	if (ret)
-		return ret;
-
-	ret = i915_debugfs_create(minor->debugfs_root, minor,
-				 "i915_next_seqno",
-				 &i915_next_seqno_fops);
-	if (ret)
-		return ret;
+	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
+		ret = i915_debugfs_create(minor->debugfs_root, minor,
+					  i915_debugfs_files[i].name,
+					  i915_debugfs_files[i].fops);
+		if (ret)
+			return ret;
+	}
 
 	return drm_debugfs_create_files(i915_debugfs_list,
 					I915_DEBUGFS_ENTRIES,
@@ -2436,26 +2410,18 @@ int i915_debugfs_init(struct drm_minor *minor)
 
 void i915_debugfs_cleanup(struct drm_minor *minor)
 {
+	int i;
+
 	drm_debugfs_remove_files(i915_debugfs_list,
 				 I915_DEBUGFS_ENTRIES, minor);
 	drm_debugfs_remove_files((struct drm_info_list *) &i915_forcewake_fops,
 				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_wedged_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_max_freq_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_min_freq_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_cache_sharing_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_drop_caches_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_ring_stop_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_error_state_fops,
-				 1, minor);
-	drm_debugfs_remove_files((struct drm_info_list *) &i915_next_seqno_fops,
-				 1, minor);
+	for (i = 0; i < ARRAY_SIZE(i915_debugfs_files); i++) {
+		struct drm_info_list *info_list =
+			(struct drm_info_list *) i915_debugfs_files[i].fops;
+
+		drm_debugfs_remove_files(info_list, 1, minor);
+	}
 }
 
 #endif /* CONFIG_DEBUG_FS */
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: convert debugfs creation/destruction to table
  2013-07-04 18:49 ` Daniel Vetter
@ 2013-07-05 19:29   ` Ben Widawsky
  2013-07-05 21:46     ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Ben Widawsky @ 2013-07-05 19:29 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On Thu, Jul 04, 2013 at 08:49:44PM +0200, Daniel Vetter wrote:
> At least for the common cases where we only need special file
> operations. The forcewake file is still rather more special.
> 
> v2: Fix up the debugfs unregister code.
> 
> v3: Actually squash in the right fixup.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Ben Widawsky <ben@bwidawsk.net>
[snip]

-- 
Ben Widawsky, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: convert debugfs creation/destruction to table
  2013-07-05 19:29   ` Ben Widawsky
@ 2013-07-05 21:46     ` Daniel Vetter
  2013-07-08 14:01       ` Paulo Zanoni
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2013-07-05 21:46 UTC (permalink / raw)
  To: Ben Widawsky; +Cc: Daniel Vetter, Intel Graphics Development

On Fri, Jul 05, 2013 at 12:29:14PM -0700, Ben Widawsky wrote:
> On Thu, Jul 04, 2013 at 08:49:44PM +0200, Daniel Vetter wrote:
> > At least for the common cases where we only need special file
> > operations. The forcewake file is still rather more special.
> > 
> > v2: Fix up the debugfs unregister code.
> > 
> > v3: Actually squash in the right fixup.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Acked-by: Ben Widawsky <ben@bwidawsk.net>

And merged.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: convert debugfs creation/destruction to table
  2013-07-05 21:46     ` Daniel Vetter
@ 2013-07-08 14:01       ` Paulo Zanoni
  2013-07-08 19:44         ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Paulo Zanoni @ 2013-07-08 14:01 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, Ben Widawsky, Intel Graphics Development

2013/7/5 Daniel Vetter <daniel@ffwll.ch>:
> On Fri, Jul 05, 2013 at 12:29:14PM -0700, Ben Widawsky wrote:
>> On Thu, Jul 04, 2013 at 08:49:44PM +0200, Daniel Vetter wrote:
>> > At least for the common cases where we only need special file
>> > operations. The forcewake file is still rather more special.
>> >
>> > v2: Fix up the debugfs unregister code.
>> >
>> > v3: Actually squash in the right fixup.
>> >
>> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Acked-by: Ben Widawsky <ben@bwidawsk.net>
>
> And merged.

And another patch which you decided to abandon got desperate because
it didn't want to die, so it tried to hide inside this patch instead
of being sent to /dev/null:

http://cgit.freedesktop.org/~danvet/drm-intel/commit/drivers/gpu/drm/i915/i915_irq.c?h=drm-intel-next-queued&id=c032d5491a4d8d56d8364f4919364815b55d3437


> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: convert debugfs creation/destruction to table
  2013-07-08 14:01       ` Paulo Zanoni
@ 2013-07-08 19:44         ` Daniel Vetter
  2013-07-08 20:06           ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2013-07-08 19:44 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: Ben Widawsky, Intel Graphics Development

On Mon, Jul 8, 2013 at 4:01 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> 2013/7/5 Daniel Vetter <daniel@ffwll.ch>:
>> On Fri, Jul 05, 2013 at 12:29:14PM -0700, Ben Widawsky wrote:
>>> On Thu, Jul 04, 2013 at 08:49:44PM +0200, Daniel Vetter wrote:
>>> > At least for the common cases where we only need special file
>>> > operations. The forcewake file is still rather more special.
>>> >
>>> > v2: Fix up the debugfs unregister code.
>>> >
>>> > v3: Actually squash in the right fixup.
>>> >
>>> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>> Acked-by: Ben Widawsky <ben@bwidawsk.net>
>>
>> And merged.
>
> And another patch which you decided to abandon got desperate because
> it didn't want to die, so it tried to hide inside this patch instead
> of being sent to /dev/null:
>
> http://cgit.freedesktop.org/~danvet/drm-intel/commit/drivers/gpu/drm/i915/i915_irq.c?h=drm-intel-next-queued&id=c032d5491a4d8d56d8364f4919364815b55d3437

Oops, this seems to be indeed the most mis-laid diff hunk I've ever
written ;-) Thanks for catching it again, I've dropped it from the
patch in dinq.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: convert debugfs creation/destruction to table
  2013-07-08 19:44         ` Daniel Vetter
@ 2013-07-08 20:06           ` Daniel Vetter
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Vetter @ 2013-07-08 20:06 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: Ben Widawsky, Intel Graphics Development

On Mon, Jul 08, 2013 at 09:44:18PM +0200, Daniel Vetter wrote:
> On Mon, Jul 8, 2013 at 4:01 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> > 2013/7/5 Daniel Vetter <daniel@ffwll.ch>:
> >> On Fri, Jul 05, 2013 at 12:29:14PM -0700, Ben Widawsky wrote:
> >>> On Thu, Jul 04, 2013 at 08:49:44PM +0200, Daniel Vetter wrote:
> >>> > At least for the common cases where we only need special file
> >>> > operations. The forcewake file is still rather more special.
> >>> >
> >>> > v2: Fix up the debugfs unregister code.
> >>> >
> >>> > v3: Actually squash in the right fixup.
> >>> >
> >>> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >>> Acked-by: Ben Widawsky <ben@bwidawsk.net>
> >>
> >> And merged.
> >
> > And another patch which you decided to abandon got desperate because
> > it didn't want to die, so it tried to hide inside this patch instead
> > of being sent to /dev/null:
> >
> > http://cgit.freedesktop.org/~danvet/drm-intel/commit/drivers/gpu/drm/i915/i915_irq.c?h=drm-intel-next-queued&id=c032d5491a4d8d56d8364f4919364815b55d3437
> 
> Oops, this seems to be indeed the most mis-laid diff hunk I've ever
> written ;-) Thanks for catching it again, I've dropped it from the
> patch in dinq.

Actually I've merged an old version of the patch, which was broken in
other ways, too (which Ben spotted). Hopefully the right version is now in
dinq.

Thanks, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-07-08 20:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04 18:39 [PATCH] drm/i915: convert debugfs creation/destruction to table Daniel Vetter
2013-07-04 18:49 ` Daniel Vetter
2013-07-05 19:29   ` Ben Widawsky
2013-07-05 21:46     ` Daniel Vetter
2013-07-08 14:01       ` Paulo Zanoni
2013-07-08 19:44         ` Daniel Vetter
2013-07-08 20:06           ` Daniel Vetter

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.