From patchwork Wed Jul 8 14:24:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Manna, Animesh" X-Patchwork-Id: 6747811 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 D11F49F2F0 for ; Wed, 8 Jul 2015 14:24:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEE2120604 for ; Wed, 8 Jul 2015 14:24:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 17D55205FE for ; Wed, 8 Jul 2015 14:24:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADD3F6E6B9; Wed, 8 Jul 2015 07:24:17 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D9086E6B9 for ; Wed, 8 Jul 2015 07:24:16 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 08 Jul 2015 07:24:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,431,1432623600"; d="scan'208";a="758381773" Received: from amanna-desktop.iind.intel.com ([10.223.25.39]) by fmsmga002.fm.intel.com with ESMTP; 08 Jul 2015 07:24:14 -0700 From: Animesh Manna To: intel-gfx@lists.freedesktop.org Date: Wed, 8 Jul 2015 19:54:45 +0530 Message-Id: <1436365487-19242-5-git-send-email-animesh.manna@intel.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1436365487-19242-1-git-send-email-animesh.manna@intel.com> References: <20150707131823.GT7568@phenom.ffwll.local> <1436365487-19242-1-git-send-email-animesh.manna@intel.com> Subject: [Intel-gfx] [PATCH 4/6] drm/i915/gen9: Added dmc_present flag to check firmware loading status. 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Firmware loading can be optimized by setting the dmc_present flag for the first time and later internallly stored firmware data can be used. Signed-off-by: Animesh Manna --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_csr.c | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5ae45bd..4870666 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -746,6 +746,7 @@ struct intel_csr { uint32_t mmio_count; uint32_t mmioaddr[8]; uint32_t mmiodata[8]; + bool dmc_present; }; #define DEV_INFO_FOR_EACH_FLAG(func, sep) \ diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index 8e9395f..d600640 100644 --- a/drivers/gpu/drm/i915/intel_csr.c +++ b/drivers/gpu/drm/i915/intel_csr.c @@ -333,6 +333,7 @@ static void finish_csr_load(const struct firmware *fw, /* load csr program during system boot, as needed for DC states */ intel_csr_load_program(dev); + dev_priv->csr.dmc_present = true; DRM_DEBUG_KMS("Finished loading %s\n", dev_priv->csr.fw_path); } @@ -352,18 +353,22 @@ void intel_display_load_csr(struct drm_i915_private *dev_priv) const struct firmware *fw; int ret; - /* CSR supported for platform, load firmware */ - ret = request_firmware(&fw, csr->fw_path, - &dev_priv->dev->pdev->dev); + if (dev_priv->csr.dmc_present) + intel_csr_load_program(dev_priv->dev); + else { + /* CSR supported for platform, load firmware */ + ret = request_firmware(&fw, csr->fw_path, + &dev_priv->dev->pdev->dev); - DRM_DEBUG_KMS("Loading %s\n", csr->fw_path); + DRM_DEBUG_KMS("Loading %s\n", csr->fw_path); - if (ret) { - i915_firmware_load_error_print(csr->fw_path, ret); - return; + if (ret) { + i915_firmware_load_error_print(csr->fw_path, ret); + return; + } + finish_csr_load(fw, dev_priv); + release_firmware(fw); } - finish_csr_load(fw, dev_priv); - release_firmware(fw); } /** @@ -408,6 +413,7 @@ void intel_csr_ucode_fini(struct drm_device *dev) return; flush_work(&dev_priv->csr.csr_work); + dev_priv->csr.dmc_present = false; kfree(dev_priv->csr.dmc_payload); }