From patchwork Fri Mar 10 16:28:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: oscar.mateo@intel.com X-Patchwork-Id: 9618233 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 43D8C60417 for ; Sat, 11 Mar 2017 00:28:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36A2F287B4 for ; Sat, 11 Mar 2017 00:28:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2BB06287B7; Sat, 11 Mar 2017 00:28:53 +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=-2.7 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, 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 D8617287B4 for ; Sat, 11 Mar 2017 00:28:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B50396E11A; Sat, 11 Mar 2017 00:28:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id EA7CD6E2CD for ; Sat, 11 Mar 2017 00:28:48 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Mar 2017 16:28:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,143,1486454400"; d="scan'208";a="58835766" Received: from omateolo-linux.fm.intel.com ([10.1.27.55]) by orsmga002.jf.intel.com with ESMTP; 10 Mar 2017 16:28:48 -0800 From: Oscar Mateo To: intel-gfx@lists.freedesktop.org Date: Fri, 10 Mar 2017 08:28:51 -0800 Message-Id: <1489163337-36080-5-git-send-email-oscar.mateo@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1489163337-36080-1-git-send-email-oscar.mateo@intel.com> References: <1489163337-36080-1-git-send-email-oscar.mateo@intel.com> Subject: [Intel-gfx] [04/11 v2] drm/i915/guc: s/ads_vma/addon 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 vma contains much more than just the additional data struct (ads) and since we were already using the word "addon" as an object in guc_addon_create, make it the preffered one. No need for the vma suffix either, as that dependency is given by the type. While at it, add an explanation of what things go inside the addon object. v2: Move the explanation to the header of the file (Joonas). Cc: Daniele Ceraolo Spurio Signed-off-by: Oscar Mateo Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/i915_guc_submission.c | 14 ++++++++++---- drivers/gpu/drm/i915/intel_guc_loader.c | 4 ++-- drivers/gpu/drm/i915/intel_uc.h | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c index f33c659..996e9f3 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.c +++ b/drivers/gpu/drm/i915/i915_guc_submission.c @@ -60,6 +60,13 @@ * ELSP context descriptor dword into Work Item. * See guc_wq_item_append() * + * Addon object: + * The additional data struct (ADS) has pointers for different buffers used by + * the GuC. One single gem object, the "addon" object, contains the ADS itself\ + * (guc_ads), the scheduling policies (guc_policies), a structure describing + * a collection of register sets (guc_mmio_reg_state) and some extra + * pages for the GuC to save its internal state for sleep. + * */ static inline bool is_high_priority(struct i915_guc_client* client) @@ -846,9 +853,8 @@ static int guc_addon_create(struct intel_guc *guc) struct page *page; u32 size; - GEM_BUG_ON(guc->ads_vma); + GEM_BUG_ON(guc->addon); - /* The ads obj includes the struct itself and buffers passed to GuC */ size = sizeof(struct guc_ads) + sizeof(struct guc_policies) + sizeof(struct guc_mmio_reg_state) + GUC_S3_SAVE_SPACE_PAGES * PAGE_SIZE; @@ -857,7 +863,7 @@ static int guc_addon_create(struct intel_guc *guc) if (IS_ERR(vma)) return PTR_ERR(vma); - guc->ads_vma = vma; + guc->addon = vma; page = i915_vma_first_page(vma); ads = kmap(page); @@ -906,7 +912,7 @@ static int guc_addon_create(struct intel_guc *guc) static void guc_addon_destroy(struct intel_guc *guc) { - i915_vma_unpin_and_release(&guc->ads_vma); + i915_vma_unpin_and_release(&guc->addon); } /* diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c index f9e183a..3c59528 100644 --- a/drivers/gpu/drm/i915/intel_guc_loader.c +++ b/drivers/gpu/drm/i915/intel_guc_loader.c @@ -167,8 +167,8 @@ static void guc_params_init(struct drm_i915_private *dev_priv) } else params[GUC_CTL_DEBUG] = GUC_LOG_DISABLED; - if (guc->ads_vma) { - u32 ads = guc_ggtt_offset(guc->ads_vma) >> PAGE_SHIFT; + if (guc->addon) { + u32 ads = guc_ggtt_offset(guc->addon) >> PAGE_SHIFT; params[GUC_CTL_DEBUG] |= ads << GUC_ADS_ADDR_SHIFT; params[GUC_CTL_DEBUG] |= GUC_ADS_ENABLED; } diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h index 1a75ef2..6c4d189 100644 --- a/drivers/gpu/drm/i915/intel_uc.h +++ b/drivers/gpu/drm/i915/intel_uc.h @@ -152,7 +152,7 @@ struct intel_guc { /* intel_guc_recv interrupt related state */ bool interrupts_enabled; - struct i915_vma *ads_vma; + struct i915_vma *addon; struct i915_vma *ctx_pool; void *ctx_pool_vaddr; struct ida ctx_ids;