From patchwork Tue Dec 20 11:55:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Wajdeczko X-Patchwork-Id: 9481475 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 2D00F601C0 for ; Tue, 20 Dec 2016 11:55:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1544628427 for ; Tue, 20 Dec 2016 11:55:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09FF528476; Tue, 20 Dec 2016 11:55:40 +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 95FA428427 for ; Tue, 20 Dec 2016 11:55:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1FCFB6E96C; Tue, 20 Dec 2016 11:55:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id A071D6E96C for ; Tue, 20 Dec 2016 11:55:34 +0000 (UTC) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP; 20 Dec 2016 03:55:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,378,1477983600"; d="scan'208";a="45132792" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga006.fm.intel.com with ESMTP; 20 Dec 2016 03:55:32 -0800 Received: from mwajdecz-MOBL1.ger.corp.intel.com (mwajdecz-mobl1.ger.corp.intel.com [172.28.174.169]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id uBKBtV4U008395; Tue, 20 Dec 2016 11:55:31 GMT From: Michal Wajdeczko To: intel-gfx@lists.freedesktop.org Date: Tue, 20 Dec 2016 11:55:31 +0000 Message-Id: <20161220115531.76120-1-michal.wajdeczko@intel.com> X-Mailer: git-send-email 2.10.1.windows.1 Subject: [Intel-gfx] [PATCH] drm/i915/guc: Make intel_guc_recv static. 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 This function is only used by intel_guc_send() and it doesn't need to be exposed outside of intel_uc.o file. Also when defined as static, compiler will generate smaller code. Additionally let it take guc param instead dev_priv to match function name. Signed-off-by: Michal Wajdeczko Cc: Joonas Lahtinen Cc: Arkadiusz Hiler Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_uc.c | 8 +++++--- drivers/gpu/drm/i915/intel_uc.h | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c index 8ae6795..c6be352 100644 --- a/drivers/gpu/drm/i915/intel_uc.c +++ b/drivers/gpu/drm/i915/intel_uc.c @@ -34,8 +34,10 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv) * Read GuC command/status register (SOFT_SCRATCH_0) * Return true if it contains a response rather than a command */ -bool intel_guc_recv(struct drm_i915_private *dev_priv, u32 *status) +static bool intel_guc_recv(struct intel_guc *guc, u32 *status) { + struct drm_i915_private *dev_priv = guc_to_i915(guc); + u32 val = I915_READ(SOFT_SCRATCH(0)); *status = val; return INTEL_GUC_RECV_IS_RESPONSE(val); @@ -69,9 +71,9 @@ int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len) * up to that length of time, then switch to a slower sleep-wait loop. * No inte_guc_send command should ever take longer than 10ms. */ - ret = wait_for_us(intel_guc_recv(dev_priv, &status), 10); + ret = wait_for_us(intel_guc_recv(guc, &status), 10); if (ret) - ret = wait_for(intel_guc_recv(dev_priv, &status), 10); + ret = wait_for(intel_guc_recv(guc, &status), 10); if (status != INTEL_GUC_STATUS_SUCCESS) { /* * Either the GuC explicitly returned an error (which diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h index 11f5608..406b06a 100644 --- a/drivers/gpu/drm/i915/intel_uc.h +++ b/drivers/gpu/drm/i915/intel_uc.h @@ -170,7 +170,6 @@ struct intel_guc { /* intel_uc.c */ void intel_uc_init_early(struct drm_i915_private *dev_priv); -bool intel_guc_recv(struct drm_i915_private *dev_priv, u32 *status); int intel_guc_send(struct intel_guc *guc, const u32 *action, u32 len); int intel_guc_sample_forcewake(struct intel_guc *guc); int intel_guc_log_flush_complete(struct intel_guc *guc);