From patchwork Tue Nov 3 12:31:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 7542111 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8C36A9F399 for ; Tue, 3 Nov 2015 12:31:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B5D0A206D0 for ; Tue, 3 Nov 2015 12:31:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D9BCF206BD for ; Tue, 3 Nov 2015 12:31:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CD726E715; Tue, 3 Nov 2015 04:31:49 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 300C46E64B for ; Tue, 3 Nov 2015 04:31:42 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 03 Nov 2015 04:31:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,238,1444719600"; d="scan'208";a="677363576" Received: from patrik-desktop.isw.intel.com ([10.237.180.146]) by orsmga003.jf.intel.com with ESMTP; 03 Nov 2015 04:31:26 -0800 From: Patrik Jakobsson To: intel-gfx@lists.freedesktop.org Date: Tue, 3 Nov 2015 13:31:14 +0100 Message-Id: <1446553874-22986-9-git-send-email-patrik.jakobsson@linux.intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1446553874-22986-1-git-send-email-patrik.jakobsson@linux.intel.com> References: <1446553874-22986-1-git-send-email-patrik.jakobsson@linux.intel.com> Subject: [Intel-gfx] [PATCH 8/8] drm/i915: Force loading of csr program at boot 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When booting (warm or cold) we must always program the csr. Previously we checked if the CSR program memory matched with the firmware data but this turned out to fail on warm boots. Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/i915/i915_drv.c | 2 +- drivers/gpu/drm/i915/intel_csr.c | 6 +++--- drivers/gpu/drm/i915/intel_drv.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index e190237..7e08f3f 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -1114,7 +1114,7 @@ static int bxt_resume_prepare(struct drm_i915_private *dev_priv) static int skl_resume_prepare(struct drm_i915_private *dev_priv) { skl_init_cdclk(dev_priv); - intel_csr_load_program(dev_priv); + intel_csr_load_program(dev_priv, false); return 0; } diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index ecb7c70..586ea55 100644 --- a/drivers/gpu/drm/i915/intel_csr.c +++ b/drivers/gpu/drm/i915/intel_csr.c @@ -210,7 +210,7 @@ static char intel_get_substepping(struct drm_device *dev) * Everytime display comes back from low power state this function is called to * copy the firmware from internal memory to registers. */ -void intel_csr_load_program(struct drm_i915_private *dev_priv) +void intel_csr_load_program(struct drm_i915_private *dev_priv, bool force) { u32 *payload = dev_priv->csr.dmc_payload; uint32_t i, fw_size; @@ -226,7 +226,7 @@ void intel_csr_load_program(struct drm_i915_private *dev_priv) * Unfortunately the ACPI subsystem doesn't yet give us a way to * differentiate this, hence figure it out with this hack. */ - if ((!dev_priv->csr.dmc_payload) || I915_READ(CSR_PROGRAM(0))) + if (!force && (!dev_priv->csr.dmc_payload || I915_READ(CSR_PROGRAM(0)))) return; fw_size = dev_priv->csr.dmc_fw_size; @@ -384,7 +384,7 @@ static void csr_load_work_fn(struct work_struct *work) goto out; /* load csr program during system boot, as needed for DC states */ - intel_csr_load_program(dev_priv); + intel_csr_load_program(dev_priv, true); out: if (dev_priv->csr.dmc_payload) { diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index d110555..58cd63a3 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -1208,7 +1208,7 @@ u32 skl_plane_ctl_rotation(unsigned int rotation); /* intel_csr.c */ void intel_csr_ucode_init(struct drm_i915_private *); -void intel_csr_load_program(struct drm_i915_private *); +void intel_csr_load_program(struct drm_i915_private *, bool); void intel_csr_ucode_fini(struct drm_i915_private *); /* intel_dp.c */