فهرست منبع

drm/i915: Use snprintf to avoid line-break when pretty-printing engines

When printing the execlist ports, we first print the ELSP header then
follow it with the pretty-printed request. Since switching to
drm_printer and show the output via printk, it automatically appends a
newline to each call (unlike the old seq_printf output). To avoid the
unwanted line break, construct the ELSP request header in a temporary
buffer.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171208012303.25504-1-chris@chris-wilson.co.uk
Chris Wilson 7 سال پیش
والد
کامیت
e8a70cab25
1فایلهای تغییر یافته به همراه6 افزوده شده و 5 حذف شده
  1. 6 5
      drivers/gpu/drm/i915/intel_engine_cs.c

+ 6 - 5
drivers/gpu/drm/i915/intel_engine_cs.c

@@ -1674,6 +1674,7 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
 	struct drm_i915_private *dev_priv = engine->i915;
 	struct drm_i915_private *dev_priv = engine->i915;
 	struct drm_i915_gem_request *rq;
 	struct drm_i915_gem_request *rq;
 	struct rb_node *rb;
 	struct rb_node *rb;
+	char hdr[80];
 	u64 addr;
 	u64 addr;
 
 
 	drm_printf(m, "%s\n", engine->name);
 	drm_printf(m, "%s\n", engine->name);
@@ -1786,12 +1787,12 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m)
 
 
 			rq = port_unpack(&execlists->port[idx], &count);
 			rq = port_unpack(&execlists->port[idx], &count);
 			if (rq) {
 			if (rq) {
-				drm_printf(m, "\t\tELSP[%d] count=%d, ",
-					   idx, count);
-				print_request(m, rq, "rq: ");
+				snprintf(hdr, sizeof(hdr),
+					 "\t\tELSP[%d] count=%d, rq: ",
+					 idx, count);
+				print_request(m, rq, hdr);
 			} else {
 			} else {
-				drm_printf(m, "\t\tELSP[%d] idle\n",
-					   idx);
+				drm_printf(m, "\t\tELSP[%d] idle\n", idx);
 			}
 			}
 		}
 		}
 		drm_printf(m, "\t\tHW active? 0x%x\n", execlists->active);
 		drm_printf(m, "\t\tHW active? 0x%x\n", execlists->active);