From patchwork Thu Jan 17 20:45:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 1998331 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id F03F93FC85 for ; Thu, 17 Jan 2013 20:52:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DDE95E6D1D for ; Thu, 17 Jan 2013 12:52:03 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.chad-versace.us (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id DA77DE6D5F for ; Thu, 17 Jan 2013 12:45:36 -0800 (PST) Received: by shiva.chad-versace.us (Postfix, from userid 1005) id 8D6EF8811F; Thu, 17 Jan 2013 20:48:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable version=3.3.2 Received: from lundgren.jf.intel.com (unknown [134.134.139.76]) by shiva.chad-versace.us (Postfix) with ESMTPSA id 3330788526; Thu, 17 Jan 2013 20:46:51 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Thu, 17 Jan 2013 12:45:24 -0800 Message-Id: <1358455524-5331-14-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.1.1 In-Reply-To: <1358455524-5331-1-git-send-email-ben@bwidawsk.net> References: <1358455524-5331-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 13/13] drm/i915: Finally kill off struct intel_gtt 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 Nothing is shared anymore between AGP and drm/i915 driver. Pre-GEN6 still uses AGP, but all necessary info is encapsulated per driver. v2: Conflict resolution from earlier rebase Reviewed-by: Rodrigo Vivi Signed-off-by: Ben Widawsky --- drivers/char/agp/intel-gtt.c | 7 ------- drivers/gpu/drm/i915/i915_gem_gtt.c | 21 +-------------------- include/drm/intel-gtt.h | 3 --- 3 files changed, 1 insertion(+), 30 deletions(-) diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 773ce8b..53086a2 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c @@ -60,7 +60,6 @@ struct intel_gtt_driver { }; static struct _intel_private { - struct intel_gtt base; const struct intel_gtt_driver *driver; struct pci_dev *pcidev; /* device one */ struct pci_dev *bridge_dev; @@ -1372,12 +1371,6 @@ int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, } EXPORT_SYMBOL(intel_gmch_probe); -struct intel_gtt *intel_gtt_get(void) -{ - return &intel_private.base; -} -EXPORT_SYMBOL(intel_gtt_get); - void intel_gtt_chipset_flush(void) { if (intel_private.driver->chipset_flush) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 33e7bbc..5354720 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -713,28 +713,10 @@ int i915_gem_gtt_init(struct drm_device *dev) * hostbridge query stuff. Skip it entirely */ if (INTEL_INFO(dev)->gen < 6) { - ret = intel_gmch_probe(dev_priv->bridge_dev, dev->pdev, NULL); - if (!ret) { - DRM_ERROR("failed to set up gmch\n"); - return -EIO; - } - - dev_priv->mm.gtt = intel_gtt_get(); - if (!dev_priv->mm.gtt) { - DRM_ERROR("Failed to initialize GTT\n"); - intel_gmch_remove(); - return -ENODEV; - } - dev_priv->gtt.do_idle_maps = needs_idle_maps(dev); - - return 0; + return intel_gmch_probe(dev_priv->bridge_dev, dev->pdev, NULL); } - dev_priv->mm.gtt = kzalloc(sizeof(*dev_priv->mm.gtt), GFP_KERNEL); - if (!dev_priv->mm.gtt) - return -ENOMEM; - /* For GEN6+ the PTEs for the ggtt live at 2MB + BAR0 */ gtt_bus_addr = pci_resource_start(dev->pdev, 0) + (2<<20); @@ -791,5 +773,4 @@ void i915_gem_gtt_fini(struct drm_device *dev) teardown_scratch_page(dev); if (INTEL_INFO(dev)->gen < 6) intel_gmch_remove(); - kfree(dev_priv->mm.gtt); } diff --git a/include/drm/intel-gtt.h b/include/drm/intel-gtt.h index ae55605..8b546ee 100644 --- a/include/drm/intel-gtt.h +++ b/include/drm/intel-gtt.h @@ -3,9 +3,6 @@ #ifndef _DRM_INTEL_GTT_H #define _DRM_INTEL_GTT_H -struct intel_gtt { -} *intel_gtt_get(void); - int intel_gmch_probe(struct pci_dev *bridge_pdev, struct pci_dev *gpu_pdev, struct agp_bridge_data *bridge); void intel_gmch_remove(void);