Commit 0bf85735 authored by Wambui Karuga's avatar Wambui Karuga Committed by Jani Nikula

drm/i915/perf: conversion to struct drm_device based logging macros.

Manual conversion of instances of printk based drm logging macros to the
struct drm_device based logging macros in i915/i915_perf.c.
Also involves extraction of the struct drm_i915_private device from
various intel types for use in the macros.

Instances of the DRM_DEBUG printk macro were not converted due to the
lack of an analogous struct drm_device based logging macro.

v2: remove instances of DRM_DEBUG that were converted.

References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.htmlSigned-off-by: default avatarWambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200218173936.19664-1-wambui.karugax@gmail.com
parent 1042b2b9
...@@ -555,8 +555,9 @@ static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream) ...@@ -555,8 +555,9 @@ static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream)
aging_tail = hw_tail; aging_tail = hw_tail;
stream->oa_buffer.aging_timestamp = now; stream->oa_buffer.aging_timestamp = now;
} else { } else {
DRM_ERROR("Ignoring spurious out of range OA buffer tail pointer = %x\n", drm_err(&stream->perf->i915->drm,
hw_tail); "Ignoring spurious out of range OA buffer tail pointer = %x\n",
hw_tail);
} }
} }
...@@ -745,7 +746,8 @@ static int gen8_append_oa_reports(struct i915_perf_stream *stream, ...@@ -745,7 +746,8 @@ static int gen8_append_oa_reports(struct i915_perf_stream *stream,
*/ */
if (drm_WARN_ON(&uncore->i915->drm, if (drm_WARN_ON(&uncore->i915->drm,
(OA_BUFFER_SIZE - head) < report_size)) { (OA_BUFFER_SIZE - head) < report_size)) {
DRM_ERROR("Spurious OA head ptr: non-integral report offset\n"); drm_err(&uncore->i915->drm,
"Spurious OA head ptr: non-integral report offset\n");
break; break;
} }
...@@ -1041,7 +1043,8 @@ static int gen7_append_oa_reports(struct i915_perf_stream *stream, ...@@ -1041,7 +1043,8 @@ static int gen7_append_oa_reports(struct i915_perf_stream *stream,
*/ */
if (drm_WARN_ON(&uncore->i915->drm, if (drm_WARN_ON(&uncore->i915->drm,
(OA_BUFFER_SIZE - head) < report_size)) { (OA_BUFFER_SIZE - head) < report_size)) {
DRM_ERROR("Spurious OA head ptr: non-integral report offset\n"); drm_err(&uncore->i915->drm,
"Spurious OA head ptr: non-integral report offset\n");
break; break;
} }
...@@ -1339,9 +1342,10 @@ static int oa_get_render_ctx_id(struct i915_perf_stream *stream) ...@@ -1339,9 +1342,10 @@ static int oa_get_render_ctx_id(struct i915_perf_stream *stream)
ce->tag = stream->specific_ctx_id; ce->tag = stream->specific_ctx_id;
DRM_DEBUG_DRIVER("filtering on ctx_id=0x%x ctx_id_mask=0x%x\n", drm_dbg(&stream->perf->i915->drm,
stream->specific_ctx_id, "filtering on ctx_id=0x%x ctx_id_mask=0x%x\n",
stream->specific_ctx_id_mask); stream->specific_ctx_id,
stream->specific_ctx_id_mask);
return 0; return 0;
} }
...@@ -2657,7 +2661,8 @@ static void gen7_oa_disable(struct i915_perf_stream *stream) ...@@ -2657,7 +2661,8 @@ static void gen7_oa_disable(struct i915_perf_stream *stream)
if (intel_wait_for_register(uncore, if (intel_wait_for_register(uncore,
GEN7_OACONTROL, GEN7_OACONTROL_ENABLE, 0, GEN7_OACONTROL, GEN7_OACONTROL_ENABLE, 0,
50)) 50))
DRM_ERROR("wait for OA to be disabled timed out\n"); drm_err(&stream->perf->i915->drm,
"wait for OA to be disabled timed out\n");
} }
static void gen8_oa_disable(struct i915_perf_stream *stream) static void gen8_oa_disable(struct i915_perf_stream *stream)
...@@ -2668,7 +2673,8 @@ static void gen8_oa_disable(struct i915_perf_stream *stream) ...@@ -2668,7 +2673,8 @@ static void gen8_oa_disable(struct i915_perf_stream *stream)
if (intel_wait_for_register(uncore, if (intel_wait_for_register(uncore,
GEN8_OACONTROL, GEN8_OA_COUNTER_ENABLE, 0, GEN8_OACONTROL, GEN8_OA_COUNTER_ENABLE, 0,
50)) 50))
DRM_ERROR("wait for OA to be disabled timed out\n"); drm_err(&stream->perf->i915->drm,
"wait for OA to be disabled timed out\n");
} }
static void gen12_oa_disable(struct i915_perf_stream *stream) static void gen12_oa_disable(struct i915_perf_stream *stream)
...@@ -2680,7 +2686,8 @@ static void gen12_oa_disable(struct i915_perf_stream *stream) ...@@ -2680,7 +2686,8 @@ static void gen12_oa_disable(struct i915_perf_stream *stream)
GEN12_OAG_OACONTROL, GEN12_OAG_OACONTROL,
GEN12_OAG_OACONTROL_OA_COUNTER_ENABLE, 0, GEN12_OAG_OACONTROL_OA_COUNTER_ENABLE, 0,
50)) 50))
DRM_ERROR("wait for OA to be disabled timed out\n"); drm_err(&stream->perf->i915->drm,
"wait for OA to be disabled timed out\n");
} }
/** /**
......
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