All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: [PATCH 07/49] gma500: nuke the last bits of TTM code
Date: Tue, 05 Jul 2011 15:35:18 +0100	[thread overview]
Message-ID: <20110705143516.23872.82321.stgit@localhost.localdomain> (raw)
In-Reply-To: <20110705141038.23872.55303.stgit@localhost.localdomain>

From: Alan Cox <alan@linux.intel.com>

We don't seem to need this for our task.

Signed-off-by: Alan Cox <alan@linux.intel.com>
---

 drivers/staging/gma500/psb_drv.c |    6 ----
 drivers/staging/gma500/psb_gtt.c |   62 ++++++++++++--------------------------
 2 files changed, 19 insertions(+), 49 deletions(-)

diff --git a/drivers/staging/gma500/psb_drv.c b/drivers/staging/gma500/psb_drv.c
index 9bd0a5d..ab1da30 100644
--- a/drivers/staging/gma500/psb_drv.c
+++ b/drivers/staging/gma500/psb_drv.c
@@ -409,8 +409,6 @@ static int psb_do_init(struct drm_device *dev)
 	struct psb_gtt *pg = dev_priv->pg;
 
 	uint32_t stolen_gtt;
-	uint32_t tt_start;
-	uint32_t tt_pages;
 
 	int ret = -ENOMEM;
 
@@ -449,10 +447,6 @@ static int psb_do_init(struct drm_device *dev)
 
 	spin_lock_init(&dev_priv->irqmask_lock);
 
-	tt_pages = (pg->gatt_pages < PSB_TT_PRIV0_PLIMIT) ?
-	    pg->gatt_pages : PSB_TT_PRIV0_PLIMIT;
-	tt_start = dev_priv->gatt_free_offset - pg->mmu_gatt_start;
-	tt_pages -= tt_start >> PAGE_SHIFT;
 	/* FIXME: can we kill ta_mem_size ? */
 	dev_priv->sizes.ta_mem_size = 0;
 
diff --git a/drivers/staging/gma500/psb_gtt.c b/drivers/staging/gma500/psb_gtt.c
index 5a296e1..8fcb833 100644
--- a/drivers/staging/gma500/psb_gtt.c
+++ b/drivers/staging/gma500/psb_gtt.c
@@ -138,8 +138,6 @@ static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r)
  *
  *	Pin and build an in kernel list of the pages that back our GEM object.
  *	While we hold this the pages cannot be swapped out
- *
- *	FIXME: Do we need to cache flush when we update the GTT
  */
 static int psb_gtt_attach_pages(struct gtt_range *gt)
 {
@@ -185,8 +183,6 @@ err:
  *	Undo the effect of psb_gtt_attach_pages. At this point the pages
  *	must have been removed from the GTT as they could now be paged out
  *	and move bus address.
- *
- *	FIXME: Do we need to cache flush when we update the GTT
  */
 static void psb_gtt_detach_pages(struct gtt_range *gt)
 {
@@ -194,7 +190,6 @@ static void psb_gtt_detach_pages(struct gtt_range *gt)
 	for (i = 0; i < gt->npage; i++) {
 		/* FIXME: do we need to force dirty */
 		set_page_dirty(gt->pages[i]);
-		/* Undo the reference we took when populating the table */
 		page_cache_release(gt->pages[i]);
 	}
 	kfree(gt->pages);
@@ -384,7 +379,6 @@ void psb_gtt_takedown(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
 
-	/* FIXME: iounmap dev_priv->vram_addr etc */
 	if (dev_priv->gtt_map) {
 		iounmap(dev_priv->gtt_map);
 		dev_priv->gtt_map = NULL;
@@ -395,6 +389,8 @@ void psb_gtt_takedown(struct drm_device *dev)
 		PSB_WVDC32(dev_priv->pge_ctl, PSB_PGETBL_CTL);
 		(void) PSB_RVDC32(PSB_PGETBL_CTL);
 	}
+	if (dev_priv->vram_addr)
+		iounmap(dev_priv->gtt_map);
 	kfree(dev_priv->pg);
 	dev_priv->pg = NULL;
 }
@@ -407,8 +403,6 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 	unsigned i, num_pages;
 	unsigned pfn_base;
 	uint32_t vram_pages;
-	uint32_t tt_pages;
-	uint32_t *ttm_gtt_map;
 	uint32_t dvmt_mode = 0;
 	struct psb_gtt *pg;
 
@@ -421,6 +415,7 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 	if (pg == NULL)
 		return -ENOMEM;
 
+        /* Enable the GTT */
 	pci_read_config_word(dev->pdev, PSB_GMCH_CTRL, &dev_priv->gmch_ctrl);
 	pci_write_config_word(dev->pdev, PSB_GMCH_CTRL,
 			      dev_priv->gmch_ctrl | _PSB_GMCH_ENABLED);
@@ -431,30 +426,26 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 
 	/* The root resource we allocate address space from */
 	dev_priv->gtt_mem = &dev->pdev->resource[PSB_GATT_RESOURCE];
-
 	dev_priv->gtt_initialized = 1;
 
 	pg->gtt_phys_start = dev_priv->pge_ctl & PAGE_MASK;
 
 	pg->gatt_start = pci_resource_start(dev->pdev, PSB_GATT_RESOURCE);
-	/* fix me: video mmu has hw bug to access 0x0D0000000,
-	 * then make gatt start at 0x0e000,0000 */
+	/* 
+	 *	FIXME: video mmu has hw bug to access 0x0D0000000,
+	 *	then make gatt start at 0x0e000,0000
+	 */
 	pg->mmu_gatt_start = 0xE0000000;
+
 	pg->gtt_start = pci_resource_start(dev->pdev, PSB_GTT_RESOURCE);
-	gtt_pages =
-	    pci_resource_len(dev->pdev, PSB_GTT_RESOURCE) >> PAGE_SHIFT;
-	pg->gatt_pages = pci_resource_len(dev->pdev, PSB_GATT_RESOURCE)
-	    >> PAGE_SHIFT;
+	gtt_pages = pci_resource_len(dev->pdev, PSB_GTT_RESOURCE) >> PAGE_SHIFT;
+	pg->gatt_pages = pci_resource_len(dev->pdev, PSB_GATT_RESOURCE) >> PAGE_SHIFT;
 
 	pci_read_config_dword(dev->pdev, PSB_BSM, &dev_priv->stolen_base);
 	vram_stolen_size = pg->gtt_phys_start - dev_priv->stolen_base - PAGE_SIZE;
 
 	stolen_size = vram_stolen_size;
 
-	printk(KERN_INFO"GMMADR(region 0) start: 0x%08x (%dM).\n",
-		pg->gatt_start, pg->gatt_pages/256);
-	printk(KERN_INFO"GTTADR(region 3) start: 0x%08x (can map %dM RAM), and actual RAM base 0x%08x.\n",
-		pg->gtt_start, gtt_pages * 4, pg->gtt_phys_start);
 	printk(KERN_INFO "Stolen memory information\n");
 	printk(KERN_INFO "       base in RAM: 0x%x\n", dev_priv->stolen_base);
 	printk(KERN_INFO "       size: %luK, calculated by (GTT RAM base) - (Stolen base), seems wrong\n",
@@ -473,8 +464,11 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 	pg->gtt_pages = gtt_pages;
 	pg->stolen_size = stolen_size;
 	dev_priv->vram_stolen_size = vram_stolen_size;
-	dev_priv->gtt_map =
-	    ioremap_nocache(pg->gtt_phys_start, gtt_pages << PAGE_SHIFT);
+
+	/*
+	 *	Map the GTT and the stolen memory area
+	 */
+	dev_priv->gtt_map = ioremap_nocache(pg->gtt_phys_start, gtt_pages << PAGE_SHIFT);
 	if (!dev_priv->gtt_map) {
 		DRM_ERROR("Failure to map gtt.\n");
 		ret = -ENOMEM;
@@ -488,15 +482,8 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 		goto out_err;
 	}
 
-	DRM_DEBUG("gma500: vram kernel virtual address %p\n", dev_priv->vram_addr);
-
-	tt_pages = (pg->gatt_pages < PSB_TT_PRIV0_PLIMIT) ?
-		(pg->gatt_pages) : PSB_TT_PRIV0_PLIMIT;
-
-	ttm_gtt_map = dev_priv->gtt_map + tt_pages / 2;
-
 	/*
-	 * insert vram stolen pages.
+	 * Insert vram stolen pages into the GTT
 	 */
 
 	pfn_base = dev_priv->stolen_base >> PAGE_SHIFT;
@@ -509,26 +496,15 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 	}
 
 	/*
-	 * Init rest of gtt managed by IMG.
-	 */
-	pfn_base = page_to_pfn(dev_priv->scratch_page);
-	pte = psb_gtt_mask_pte(pfn_base, 0);
-	for (; i < tt_pages / 2 - 1; ++i)
-		iowrite32(pte, dev_priv->gtt_map + i);
-
-	/*
-	 * Init rest of gtt managed by TTM.
+	 * Init rest of GTT to the scratch page to avoid accidents or scribbles
 	 */
 
 	pfn_base = page_to_pfn(dev_priv->scratch_page);
 	pte = psb_gtt_mask_pte(pfn_base, 0);
-	PSB_DEBUG_INIT("Initializing the rest of a total "
-		       "of %d gtt pages.\n", pg->gatt_pages);
+	for (; i < gtt_pages; ++i)
+		iowrite32(pte, dev_priv->gtt_map + i);
 
-	for (; i < pg->gatt_pages - tt_pages / 2; ++i)
-		iowrite32(pte, ttm_gtt_map + i);
 	(void) ioread32(dev_priv->gtt_map + i - 1);
-
 	return 0;
 
 out_err:


  parent reply	other threads:[~2011-07-05 14:45 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 14:33 [PATCH 00/49] GMA50 series update Alan Cox
2011-07-05 14:34 ` [PATCH 01/49] gma500: Ensure the frame buffer has a linear virtual mapping Alan Cox
2011-07-05 14:34 ` [PATCH 02/49] gma500: revamp frame buffer creation and handling Alan Cox
2011-07-05 14:34 ` [PATCH 03/49] gma500: Do sane FB cleanup Alan Cox
2011-07-05 14:34 ` [PATCH 04/49] gma500: trim some of the debug Alan Cox
2011-07-05 14:34 ` [PATCH 05/49] gma500: polish for completion of this phase Alan Cox
2011-07-05 14:35 ` [PATCH 06/49] gma500: 2D acceleration tidying Alan Cox
2011-07-05 14:35 ` Alan Cox [this message]
2011-07-05 14:35 ` [PATCH 08/49] gma500: nuke the PSB debug stuff Alan Cox
2011-07-05 14:35 ` [PATCH 09/49] gma500: Kill spare kref Alan Cox
2011-07-05 14:35 ` [PATCH 10/49] gma500: GEM glue Alan Cox
2011-07-05 14:36 ` [PATCH 11/49] gma500: Use the GEM tweaks to provide a GEM frame buffer Alan Cox
2011-07-05 14:36 ` [PATCH 12/49] gma500: CodingStyle pass Alan Cox
2011-07-05 14:36 ` [PATCH 13/49] gma500: 2D polish Alan Cox
2011-07-05 14:36 ` [PATCH 14/49] gma500: Medfield support Alan Cox
2011-07-05 14:37 ` [PATCH 15/49] gma500: Move our other GEM helper into the bits want to push into GEM Alan Cox
2011-07-05 14:37 ` [PATCH 16/49] gma500: Extract BIOSisy stuff from psb_drv Alan Cox
2011-07-05 14:37 ` [PATCH 17/49] gma500: psb_fb tidy/cleanup pass Alan Cox
2011-07-05 14:37 ` [PATCH 18/49] gma500: Update the GEM todo Alan Cox
2011-07-05 14:38 ` [PATCH 19/49] gma500: Only fiddle with clock gating on PSB Alan Cox
2011-07-05 14:38 ` [PATCH 20/49] gma500: being abstracting out devices a bit more Alan Cox
2011-07-05 14:38 ` [PATCH 21/49] gma500: continue abstracting platform specific code Alan Cox
2011-07-05 14:38 ` [PATCH 22/49] gma500: Fix early Medfield crash Alan Cox
2011-07-05 14:39 ` [PATCH 23/49] gma500: Read the GCT panel type information for Medfield Alan Cox
2011-07-05 14:39 ` [PATCH 24/49] gma500: enable Medfield CRTC support Alan Cox
2011-07-05 14:39 ` [PATCH 25/49] commit ee12661199b82934552c7636b10217a9aa42958a Alan Cox
2011-07-05 15:55   ` Greg KH
2011-07-05 14:39 ` [PATCH 26/49] gma500: add more ops Alan Cox
2011-07-05 14:40 ` [PATCH 27/49] gma500: remove an un-needed check Alan Cox
2011-07-05 14:40 ` [PATCH 28/49] gma500: move configuration bits into the psb_ops structure Alan Cox
2011-07-05 14:40 ` [PATCH 29/49] gma500: Add the beginnings of Cedarview support Alan Cox
2011-07-05 14:40 ` [PATCH 30/49] gma500: the 'mrst' BIOS is actually MID generic Alan Cox
2011-07-05 14:40 ` [PATCH 31/49] gma500: tidy the framebuffer fixme and oddments Alan Cox
2011-07-05 14:41 ` [PATCH 32/49] gma500: move framebuffer file Alan Cox
2011-07-05 14:41 ` [PATCH 33/49] gma500: The 2D code is now also device independent Alan Cox
2011-07-05 14:41 ` [PATCH 34/49] gma500: the GEM and GTT code is device independant Alan Cox
2011-07-08  1:14   ` Hugh Dickins
2011-07-08  8:38     ` Alan Cox
2011-07-08 17:06       ` Hugh Dickins
2011-07-11 16:25         ` Alan Cox
2011-07-11 17:49           ` Hugh Dickins
2011-09-12 23:19             ` Konrad Rzeszutek Wilk
2011-09-13  8:15               ` Alan Cox
2011-10-09 20:15             ` Patrik Jakobsson
2011-10-10 18:37               ` Hugh Dickins
2011-10-12 12:03                 ` Patrik Jakobsson
2011-10-15 14:30                 ` Rob Clark
2011-10-17 17:48                   ` Hugh Dickins
2011-10-17 21:39                     ` Alan Cox
2011-10-17 22:34                       ` Hugh Dickins
2011-10-17 23:32                         ` Rob Clark
2011-10-18 10:45                           ` Alan Cox
2011-10-18 11:59                             ` Rob Clark
2011-10-18 12:08                               ` Alan Cox
2011-10-18 13:36                                 ` Rob Clark
2011-10-18 11:16                       ` Patrik Jakobsson
2011-07-05 14:41 ` [PATCH 35/49] gma500: begin the config based split Alan Cox
2011-07-05 14:42 ` [PATCH 36/49] gma500: Rename the psb_intel_bios code Alan Cox
2011-07-05 14:42 ` [PATCH 37/49] gma500: tidy up the opregion and lid code Alan Cox
2011-07-05 14:42 ` [PATCH 38/49] gma500: move opregion files Alan Cox
2011-07-05 14:42 ` [PATCH 39/49] gma500: the MMU code is also generic Alan Cox
2011-07-05 14:43 ` [PATCH 40/49] gma500: move the i2c code Alan Cox
2011-07-05 14:43 ` [PATCH 41/49] gma500: tidying up the power stuff a spot Alan Cox
2011-07-05 14:43 ` [PATCH 42/49] gma500: move the BIOS header Alan Cox
2011-07-05 14:43 ` [PATCH 43/49] gma500: move the power header Alan Cox
2011-07-05 14:44 ` [PATCH 44/49] gma500: begin adding CDV specific code Alan Cox
2011-07-05 14:44 ` [PATCH 45/49] gma500: Add the HDMI bits Alan Cox
2011-07-05 14:44 ` [PATCH 46/49] gma500: Fix backlight crash Alan Cox
2011-07-05 14:44 ` [PATCH 47/49] gma500: Workaround for Medfield/Cedarview cursor bug Alan Cox
2011-07-05 14:45 ` [PATCH 48/49] gma500: Fix missing memory check Alan Cox
2011-07-05 14:45 ` [PATCH 49/49] gma500: power can be touched in IRQ state Alan Cox
2011-07-05 15:23 ` [PATCH 00/49] GMA50 series update Greg KH
2011-07-05 15:36   ` Greg KH
2011-07-05 18:03   ` Alan Cox
2011-07-06  2:44     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110705143516.23872.82321.stgit@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.