From patchwork Tue Dec 18 18:31:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1893461 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 34676DF2F6 for ; Tue, 18 Dec 2012 18:47:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 298C2E5F01 for ; Tue, 18 Dec 2012 10:47:58 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fmsmga101.fm.intel.com (mga05.intel.com [192.55.52.89]) by gabe.freedesktop.org (Postfix) with ESMTP id 20365E63AC for ; Tue, 18 Dec 2012 10:35:22 -0800 (PST) Received: from mail-da0-f71.google.com ([209.85.210.71]) by mga01.intel.com with ESMTP/TLS/RC4-SHA; 18 Dec 2012 10:35:21 -0800 Received: by mail-da0-f71.google.com with SMTP id n41so829773dak.6 for ; Tue, 18 Dec 2012 10:35:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=mF3mb/OsXWts5XPyrQnu2mphWudNjB8sg9h37H6Mtp0=; b=RtnVF/nk5ShsOysIl+s4PsoI5LAmyAh1I7jb+gNMGg3ocCHJvh39Sk0jgVtlY/Cwnx m667U4ENPR6+DstZIec2541ObXXA2EBhbbJeYTnP0NL6BA5gz41R3Na/5MTRx7U71jPO 3spHnO9RWMLXqh0UEnW/nlbBoJKC94T5Kr+9DRBGvHTI546k6d+4wkR/sDAjw3Fkfycc vS/GbZjl6ezAaHdw0BUJ44WJLEPLP8jjf6pcyUQEoOn/v7GLreO9I2Fh3QJm9/kdexdn j2M2RVw5Jms5gEpL2zxZ/181d/eT4zTlCZoDpOHjuEbg2XJhPIdIf3wEOSC1C44m+V+b BxRw== X-Received: by 10.68.197.68 with SMTP id is4mr9528728pbc.30.1355855721566; Tue, 18 Dec 2012 10:35:21 -0800 (PST) X-Received: by 10.68.197.68 with SMTP id is4mr9528711pbc.30.1355855721446; Tue, 18 Dec 2012 10:35:21 -0800 (PST) Received: from norris.jf.intel.com ([192.55.55.41]) by mx.google.com with ESMTPS id ip8sm1552525pbc.36.2012.12.18.10.35.20 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Dec 2012 10:35:20 -0800 (PST) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Tue, 18 Dec 2012 10:31:27 -0800 Message-Id: <1355855487-20424-6-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.0.1 In-Reply-To: <1355855487-20424-1-git-send-email-ben@bwidawsk.net> References: <1355855487-20424-1-git-send-email-ben@bwidawsk.net> X-Gm-Message-State: ALoCoQlM/nk4bmhxsTEQbcetJln6V78UaD3ajLNDCAYJc9BtkxnqPlt3AHI2u3PA0Y8l+JYv+yOA9JcL6Sq55l9MNqDPNzgpIwy6vGr0nOKU58H/FQ7YGGv2+CWgf/Uyl/3BijO9DF+0LhxG3TQ4oAFPV8vBPvRWB61OUuJIiujPNVLAn3iSRLc= X-Mailman-Approved-At: Tue, 18 Dec 2012 10:45:20 -0800 Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 6/6 v2] drm/i915: Make GSM void X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org The iomapping of the register region has historically been a uint32_t for the obvious reason that our PTE size was always 4b. In the future however, we cannot make this assumption. By making the type void, it makes the upcoming pointer math we will do much easier, and hopefully gives the compiler opportunities to warn us when we do stupid things. v2: Cast to __iomem, caught by Ville Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_drv.h | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 49f465a..90dfbd5 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -800,7 +800,7 @@ typedef struct drm_i915_private { unsigned long stolen_base; /* limited to low memory (32-bit) */ /** "Graphics Stolen Memory" holds the global PTEs */ - uint32_t __iomem *gsm; + void __iomem *gsm; struct io_mapping *gtt_mapping; phys_addr_t gtt_base_addr; diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index b4c1e34..a52e784 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -290,7 +290,7 @@ void i915_gem_init_ppgtt(struct drm_device *dev) return; - pd_addr = dev_priv->mm.gsm + ppgtt->pd_offset/sizeof(gtt_pte_t); + pd_addr = (gtt_pte_t *)dev_priv->mm.gsm + ppgtt->pd_offset/sizeof(gtt_pte_t); for (i = 0; i < ppgtt->num_pd_entries; i++) { dma_addr_t pt_addr; @@ -432,7 +432,8 @@ static void gen6_ggtt_bind_object(struct drm_i915_gem_object *obj, struct scatterlist *sg = st->sgl; const int first_entry = obj->gtt_space->start >> PAGE_SHIFT; const int max_entries = dev_priv->mm.gtt->gtt_total_entries - first_entry; - gtt_pte_t __iomem *gtt_entries = dev_priv->mm.gsm + first_entry; + gtt_pte_t __iomem *gtt_entries = + (gtt_pte_t __iomem *)dev_priv->mm.gsm + first_entry; int unused, i = 0; unsigned int len, m = 0; dma_addr_t addr;