From patchwork Thu Feb 16 22:50:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9578483 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 9A65F6049F for ; Thu, 16 Feb 2017 22:51:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8767C2867F for ; Thu, 16 Feb 2017 22:51:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78AFF28697; Thu, 16 Feb 2017 22:51:48 +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 029C22867F for ; Thu, 16 Feb 2017 22:51:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D7AF96E004; Thu, 16 Feb 2017 22:51:44 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [109.228.58.192]) by gabe.freedesktop.org (Postfix) with ESMTPS id B22716E004 for ; Thu, 16 Feb 2017 22:51:43 +0000 (UTC) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from nuc-i3427.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 5472106-1500050 for multiple; Thu, 16 Feb 2017 22:50:50 +0000 Received: by nuc-i3427.alporthouse.com (sSMTP sendmail emulation); Thu, 16 Feb 2017 22:50:49 +0000 Date: Thu, 16 Feb 2017 22:50:49 +0000 From: Chris Wilson To: Oscar Mateo Message-ID: <20170216225049.GB12673@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Oscar Mateo , intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com, daniele.ceraolospurio@intel.com References: <1487162264.8490.18.camel@linux.intel.com> <1487254505-26423-1-git-send-email-oscar.mateo@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1487254505-26423-1-git-send-email-oscar.mateo@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] [PATCH v2] drm/i915/guc: Keep the ctx_pool_vaddr mapped, for easy access 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Feb 16, 2017 at 06:15:05AM -0800, Oscar Mateo wrote: > static void guc_ctx_desc_init(struct intel_guc *guc, > struct i915_guc_client *client) > { > struct drm_i915_private *dev_priv = guc_to_i915(guc); > struct intel_engine_cs *engine; > struct i915_gem_context *ctx = client->owner; > - struct guc_context_desc desc; > - struct sg_table *sg; > + struct guc_context_desc *desc; > unsigned int tmp; > u32 gfx_addr; > > - memset(&desc, 0, sizeof(desc)); > + desc = __get_context_desc(client); Do you want to make the assumption that these are zeroed-on-create objects? We could switch to using non-swappable (internal) objects that are not cleared on create. i.e. Or do we write the entire desc? It doesn't look like we do, but do we do enough? Other than that potential booby trap for later, Reviewed-by: Chris Wilson -Chris diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c index 4a752f2b6e24..4128e8937b45 100644 --- a/drivers/gpu/drm/i915/i915_guc_submission.c +++ b/drivers/gpu/drm/i915/i915_guc_submission.c @@ -650,7 +650,7 @@ struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size) struct i915_vma *vma; int ret; - obj = i915_gem_object_create(dev_priv, size); + obj = i915_gem_object_create_internal(dev_priv, size); if (IS_ERR(obj)) return ERR_CAST(obj);