gfx: drv: Improve warning messages
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 20 Mar 2012 14:46:17 +0000 (16:46 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:30:42 +0000 (12:30 +0300)
Use dev_warn() instead of WARN_ON() to provide better information what
went wrong. The message is the important part, the backtrace isn't
really useful.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
drivers/staging/mrst/drv/psb_page_flip.c

index 18abb98..e4c339f 100644 (file)
@@ -86,7 +86,10 @@ static u32 get_vbl_count(struct drm_crtc *crtc)
                low2 = ioread32(reg_pixel) >> PIPE_FRAME_LOW_SHIFT;
        } while (low1 != low2 && timeout++ < PSB_VBL_CNT_TIMEOUT);
 
-       WARN_ON(timeout >= PSB_VBL_CNT_TIMEOUT);
+       if (timeout >= PSB_VBL_CNT_TIMEOUT)
+               dev_warn(crtc->dev->dev,
+                        "Timed out while determining VBL count for pipe %d\n",
+                        psb_intel_crtc->pipe);
 
        /*
         * The frame counter seems to increment at the beginning of the
@@ -149,7 +152,10 @@ static void avoid_danger_zone(struct drm_crtc *crtc)
 
        drm_vblank_put(dev, pipe);
 
-       WARN_ON(val >= min && val <= max);
+       if (val >= min && val <= max)
+               dev_warn(dev->dev,
+                        "Page flipping close to vblank start (DSL=%u, VBL=%u)\n",
+                        val, crtc->hwmode.crtc_vdisplay);
 }
 
 void