Commit bbb0aef5 authored by Joe Perches's avatar Joe Perches Committed by Dave Airlie

drm: Verify debug message arguments

Add __attribute__((format (printf, 4, 5))) to drm_ut_debug_printk
and fix fallout.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 5ad3d883
...@@ -684,10 +684,11 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, ...@@ -684,10 +684,11 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc,
*/ */
*vblank_time = ns_to_timeval(timeval_to_ns(&raw_time) - delta_ns); *vblank_time = ns_to_timeval(timeval_to_ns(&raw_time) - delta_ns);
DRM_DEBUG("crtc %d : v %d p(%d,%d)@ %d.%d -> %d.%d [e %d us, %d rep]\n", DRM_DEBUG("crtc %d : v %d p(%d,%d)@ %ld.%ld -> %ld.%ld [e %d us, %d rep]\n",
crtc, (int) vbl_status, hpos, vpos, raw_time.tv_sec, crtc, (int)vbl_status, hpos, vpos,
raw_time.tv_usec, vblank_time->tv_sec, vblank_time->tv_usec, (long)raw_time.tv_sec, (long)raw_time.tv_usec,
(int) duration_ns/1000, i); (long)vblank_time->tv_sec, (long)vblank_time->tv_usec,
(int)duration_ns/1000, i);
vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD; vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD;
if (invbl) if (invbl)
......
...@@ -214,7 +214,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, ...@@ -214,7 +214,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
i915_lvds_downclock) { i915_lvds_downclock) {
dev_priv->lvds_downclock_avail = 1; dev_priv->lvds_downclock_avail = 1;
dev_priv->lvds_downclock = temp_downclock; dev_priv->lvds_downclock = temp_downclock;
DRM_DEBUG_KMS("LVDS downclock is found in VBT. ", DRM_DEBUG_KMS("LVDS downclock is found in VBT. "
"Normal Clock %dKHz, downclock %dKHz\n", "Normal Clock %dKHz, downclock %dKHz\n",
temp_downclock, panel_fixed_mode->clock); temp_downclock, panel_fixed_mode->clock);
} }
......
...@@ -3497,11 +3497,11 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz, ...@@ -3497,11 +3497,11 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz,
1000; 1000;
entries_required = DIV_ROUND_UP(entries_required, wm->cacheline_size); entries_required = DIV_ROUND_UP(entries_required, wm->cacheline_size);
DRM_DEBUG_KMS("FIFO entries required for mode: %d\n", entries_required); DRM_DEBUG_KMS("FIFO entries required for mode: %ld\n", entries_required);
wm_size = fifo_size - (entries_required + wm->guard_size); wm_size = fifo_size - (entries_required + wm->guard_size);
DRM_DEBUG_KMS("FIFO watermark level: %d\n", wm_size); DRM_DEBUG_KMS("FIFO watermark level: %ld\n", wm_size);
/* Don't promote wm_size to unsigned... */ /* Don't promote wm_size to unsigned... */
if (wm_size > (long)wm->max_wm) if (wm_size > (long)wm->max_wm)
...@@ -3823,13 +3823,13 @@ static bool g4x_check_srwm(struct drm_device *dev, ...@@ -3823,13 +3823,13 @@ static bool g4x_check_srwm(struct drm_device *dev,
display_wm, cursor_wm); display_wm, cursor_wm);
if (display_wm > display->max_wm) { if (display_wm > display->max_wm) {
DRM_DEBUG_KMS("display watermark is too large(%d), disabling\n", DRM_DEBUG_KMS("display watermark is too large(%d/%ld), disabling\n",
display_wm, display->max_wm); display_wm, display->max_wm);
return false; return false;
} }
if (cursor_wm > cursor->max_wm) { if (cursor_wm > cursor->max_wm) {
DRM_DEBUG_KMS("cursor watermark is too large(%d), disabling\n", DRM_DEBUG_KMS("cursor watermark is too large(%d/%ld), disabling\n",
cursor_wm, cursor->max_wm); cursor_wm, cursor->max_wm);
return false; return false;
} }
......
...@@ -1087,8 +1087,9 @@ void radeon_compute_pll_legacy(struct radeon_pll *pll, ...@@ -1087,8 +1087,9 @@ void radeon_compute_pll_legacy(struct radeon_pll *pll,
*frac_fb_div_p = best_frac_feedback_div; *frac_fb_div_p = best_frac_feedback_div;
*ref_div_p = best_ref_div; *ref_div_p = best_ref_div;
*post_div_p = best_post_div; *post_div_p = best_post_div;
DRM_DEBUG_KMS("%d %d, pll dividers - fb: %d.%d ref: %d, post %d\n", DRM_DEBUG_KMS("%lld %d, pll dividers - fb: %d.%d ref: %d, post %d\n",
freq, best_freq / 1000, best_feedback_div, best_frac_feedback_div, (long long)freq,
best_freq / 1000, best_feedback_div, best_frac_feedback_div,
best_ref_div, best_post_div); best_ref_div, best_post_div);
} }
......
...@@ -122,7 +122,8 @@ struct drm_device; ...@@ -122,7 +122,8 @@ struct drm_device;
* using the DRM_DEBUG_KMS and DRM_DEBUG. * using the DRM_DEBUG_KMS and DRM_DEBUG.
*/ */
extern void drm_ut_debug_printk(unsigned int request_level, extern __attribute__((format (printf, 4, 5)))
void drm_ut_debug_printk(unsigned int request_level,
const char *prefix, const char *prefix,
const char *function_name, const char *function_name,
const char *format, ...); const char *format, ...);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment