dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE
  2014-01-31 13:49   ` [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE Jani Nikula
@ 2014-01-31 13:48     ` Chris Wilson
  2014-02-04 20:09       ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2014-01-31 13:48 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel

On Fri, Jan 31, 2014 at 03:49:08PM +0200, Jani Nikula wrote:
> The WARN_ONCE is a bit too verbose, make it a DRM_INFO_ONCE.
> 
> While at it, add a #define for MAX_DSLP and make the message a bit more
> informative.
> 
> v2: use DRM_INFO_ONCE, add MAX_DSLP, pimp the message.
> 
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Both Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

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

* [PATCH 1/2] drm: add DRM_INFO_ONCE() to print a one-time DRM_INFO() message
       [not found] <1391168468-9072-1-git-send-email-jani.nikula@intel.com>
@ 2014-01-31 13:49 ` Jani Nikula
  2014-01-31 13:49   ` [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE Jani Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2014-01-31 13:49 UTC (permalink / raw)
  To: intel-gfx, dri-devel

Just like DRM_INFO(), but only do it once.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 include/drm/drmP.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 04086c5be930..04a7f31301f8 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -199,6 +199,9 @@ int drm_err(const char *func, const char *format, ...);
 #define DRM_INFO(fmt, ...)				\
 	printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
 
+#define DRM_INFO_ONCE(fmt, ...)				\
+	printk_once(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
+
 /**
  * Debug output.
  *
-- 
1.7.9.5

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

* [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE
  2014-01-31 13:49 ` [PATCH 1/2] drm: add DRM_INFO_ONCE() to print a one-time DRM_INFO() message Jani Nikula
@ 2014-01-31 13:49   ` Jani Nikula
  2014-01-31 13:48     ` Chris Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2014-01-31 13:49 UTC (permalink / raw)
  To: intel-gfx, dri-devel

The WARN_ONCE is a bit too verbose, make it a DRM_INFO_ONCE.

While at it, add a #define for MAX_DSLP and make the message a bit more
informative.

v2: use DRM_INFO_ONCE, add MAX_DSLP, pimp the message.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_opregion.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
index 46d288055345..68459605bd12 100644
--- a/drivers/gpu/drm/i915/intel_opregion.c
+++ b/drivers/gpu/drm/i915/intel_opregion.c
@@ -227,6 +227,8 @@ struct opregion_asle {
 #define ACPI_DIGITAL_OUTPUT (3<<8)
 #define ACPI_LVDS_OUTPUT (4<<8)
 
+#define MAX_DSLP	1500
+
 #ifdef CONFIG_ACPI
 static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 {
@@ -261,10 +263,11 @@ static int swsci(struct drm_device *dev, u32 function, u32 parm, u32 *parm_out)
 		/* The spec says 2ms should be the default, but it's too small
 		 * for some machines. */
 		dslp = 50;
-	} else if (dslp > 1500) {
+	} else if (dslp > MAX_DSLP) {
 		/* Hey bios, trust must be earned. */
-		WARN_ONCE(1, "excessive driver sleep timeout (DSPL) %u\n", dslp);
-		dslp = 1500;
+		DRM_INFO_ONCE("ACPI BIOS requests an excessive sleep of %u ms, "
+			      "using %u ms instead\n", dslp, MAX_DSLP);
+		dslp = MAX_DSLP;
 	}
 
 	/* The spec tells us to do this, but we are the only user... */
-- 
1.7.9.5

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

* Re: [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE
  2014-01-31 13:48     ` Chris Wilson
@ 2014-02-04 20:09       ` Daniel Vetter
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Vetter @ 2014-02-04 20:09 UTC (permalink / raw)
  To: Chris Wilson, Jani Nikula, intel-gfx, dri-devel, daniel,
	ville.syrjala

On Fri, Jan 31, 2014 at 01:48:39PM +0000, Chris Wilson wrote:
> On Fri, Jan 31, 2014 at 03:49:08PM +0200, Jani Nikula wrote:
> > The WARN_ONCE is a bit too verbose, make it a DRM_INFO_ONCE.
> > 
> > While at it, add a #define for MAX_DSLP and make the message a bit more
> > informative.
> > 
> > v2: use DRM_INFO_ONCE, add MAX_DSLP, pimp the message.
> > 
> > Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> Both Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Both merged to -fixes with Dave's ack on the drm pach.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

end of thread, other threads:[~2014-02-04 20:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1391168468-9072-1-git-send-email-jani.nikula@intel.com>
2014-01-31 13:49 ` [PATCH 1/2] drm: add DRM_INFO_ONCE() to print a one-time DRM_INFO() message Jani Nikula
2014-01-31 13:49   ` [PATCH 2/2] drm/i915: demote opregion excessive timeout WARN_ONCE to DRM_INFO_ONCE Jani Nikula
2014-01-31 13:48     ` Chris Wilson
2014-02-04 20:09       ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox