From patchwork Fri Aug 4 16:27:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wajdeczko X-Patchwork-Id: 9881677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 78361602B8 for ; Fri, 4 Aug 2017 16:28:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 666CA284B5 for ; Fri, 4 Aug 2017 16:28:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B5032891B; Fri, 4 Aug 2017 16:28:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF293284B5 for ; Fri, 4 Aug 2017 16:28:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 250086E51F; Fri, 4 Aug 2017 16:27:47 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB9A76E51F for ; Fri, 4 Aug 2017 16:27:46 +0000 (UTC) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Aug 2017 09:27:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,321,1498546800"; d="scan'208";a="135587412" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga005.fm.intel.com with ESMTP; 04 Aug 2017 09:27:45 -0700 Received: from mwajdecz-MOBL1.ger.corp.intel.com (mwajdecz-mobl1.ger.corp.intel.com [172.28.174.25]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id v74GRMdY010586; Fri, 4 Aug 2017 17:27:44 +0100 From: Michal Wajdeczko To: intel-gfx@lists.freedesktop.org Date: Fri, 4 Aug 2017 16:27:12 +0000 Message-Id: <20170804162712.20468-16-michal.wajdeczko@intel.com> X-Mailer: git-send-email 2.10.1.windows.1 In-Reply-To: <20170804162712.20468-1-michal.wajdeczko@intel.com> References: <20170804162712.20468-1-michal.wajdeczko@intel.com> Subject: [Intel-gfx] [PATCH 15/15] drm/i915/guc: Trace messages from CT while in debug X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP During debug we may want to investigate all communication from the Guc. Add proper tracing macros in debug config. Signed-off-by: Michal Wajdeczko --- drivers/gpu/drm/i915/intel_guc_ct.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c index 9f7fc5e..71daad3 100644 --- a/drivers/gpu/drm/i915/intel_guc_ct.c +++ b/drivers/gpu/drm/i915/intel_guc_ct.c @@ -24,6 +24,12 @@ #include "i915_drv.h" #include "intel_guc_ct.h" +#ifdef CONFIG_DRM_I915_DEBUG +#define CT_DEBUG_DRIVER(...) DRM_DEBUG_DRIVER(__VA_ARGS__) +#else +#define CT_DEBUG_DRIVER(...) +#endif + struct ct_request { struct list_head link; u32 fence; @@ -325,6 +331,10 @@ static int ctb_write(struct intel_guc_ct_buffer *ctb, (send_response ? GUC_CT_MSG_SEND_STATUS : 0) | (action[0] << GUC_CT_MSG_ACTION_SHIFT); + CT_DEBUG_DRIVER("CT: writing %*phn %*phn %*phn\n", + 4, &header, 4, &fence, + 4*(len - 1), &action[1]); + cmds[tail] = header; tail = (tail + 1) % size; @@ -496,6 +506,9 @@ static int intel_guc_send_ct(struct intel_guc *guc, const u32 *action, u32 len, if (unlikely(ret < 0)) { DRM_ERROR("CT: send action %#X failed; err=%d status=%#X\n", action[0], ret, status); + } else if (unlikely(ret)) { + CT_DEBUG_DRIVER("CT: send action %#x returned %d (%#x)\n", + action[0], ret, ret); } mutex_unlock(&guc->send_mutex); @@ -542,10 +555,12 @@ static int ctb_read(struct intel_guc_ct_buffer *ctb, u32 *data) /* beware of buffer wrap case */ if (available < 0) available += size; + CT_DEBUG_DRIVER("CT: available %d (%u:%u)\n", available, head, tail); GEM_BUG_ON(available < 0); data[0] = cmds[head]; head = (head + 1) % size; + CT_DEBUG_DRIVER("CT: header %#x\n", data[0]); /* message len with header */ len = ct_header_get_len(data[0]) + 1; @@ -563,6 +578,7 @@ static int ctb_read(struct intel_guc_ct_buffer *ctb, u32 *data) data[i] = cmds[head]; head = (head + 1) % size; } + CT_DEBUG_DRIVER("CT: received %*phn\n", 4*len, data); desc->head = head * 4; return 0; @@ -584,6 +600,7 @@ static int guc_handle_response(struct intel_guc *guc, const u32 *data) DRM_ERROR("CT: corrupted response %*phn\n", 4*len, data); return -EPROTO; } + CT_DEBUG_DRIVER("CT: response fence %u status %#x\n", fence, status); spin_lock_irqsave(&guc->ct.lock, flags); list_for_each_entry(req, &guc->ct.pending_requests, link) { @@ -615,6 +632,7 @@ static int guc_handle_request(struct intel_guc *guc, const u32 *data) GEM_BUG_ON(ct_header_is_response(header)); /* data layout beyond header is request specific */ + CT_DEBUG_DRIVER("CT: request %#x\n", ct_header_get_action(header)); request = kmalloc(sizeof(*request), GFP_ATOMIC); if (unlikely(!request)) { @@ -656,6 +674,7 @@ static bool guc_process_incoming_requests(struct intel_guc *guc) header = request->data[0]; action = ct_header_get_action(header); len = ct_header_get_len(header) + 1; /* also count header dw */ + CT_DEBUG_DRIVER("CT: processing request %*phn\n", 4*len, request->data); switch (action) { case INTEL_GUC_ACTION_DEFAULT: