All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: j.glisse@gmail.com
Cc: thellstrom@vmware.com, dri-devel@lists.freedesktop.org
Subject: Re: ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator [FULL]
Date: Tue, 8 Nov 2011 10:15:07 -0500	[thread overview]
Message-ID: <20111108151507.GE10913@phenom.dumpdata.com> (raw)
In-Reply-To: <1320709232-29477-1-git-send-email-j.glisse@gmail.com>

On Mon, Nov 07, 2011 at 06:40:20PM -0500, j.glisse@gmail.com wrote:
> Ok so here is full patchset, including nouveau support, Ben if you
> could review (if change to nouveau in patch 7 are correct then others
> change to nouveau are more than likely 100% correct :)).

You are missing one patch (thought I think the 'dma_bits = 32' part can easily
be moved to the "drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on" patch.


>From 0a96588b9e0793952548f0c4dd7aac7c243c1bed Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Thu, 25 Aug 2011 16:18:45 -0400
Subject: [PATCH] nouveau/radeon: Set coherent DMA mask

All the storage devices that use the dmapool set the coherent DMA
mask so they can properly use the dmapool. Since the TTM DMA pool
code is based on that and dma_alloc_coherent checks the
'coherent_dma_mask' and not 'dma_mask' we want to set it.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 drivers/gpu/drm/nouveau/nouveau_mem.c  |    5 +++++
 drivers/gpu/drm/radeon/radeon_device.c |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 36bec48..6740cf6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -408,6 +408,11 @@ nouveau_mem_vram_init(struct drm_device *dev)
 	if (ret)
 		return ret;
 
+	ret = pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(dma_bits));
+	if (ret) {
+		/* Reset to default value. */
+		pci_set_consistent_dma_mask(dev->pdev, DMA_BIT_MASK(32));
+	}
 	ret = nouveau_ttm_global_init(dev_priv);
 	if (ret)
 		return ret;
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 11f6481..7c31321 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -765,6 +765,7 @@ int radeon_device_init(struct radeon_device *rdev,
 	r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
 	if (r) {
 		rdev->need_dma32 = true;
+		dma_bits = 32;
 		printk(KERN_WARNING "radeon: No suitable DMA available.\n");
 	}
 	r = pci_set_consistent_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
-- 
1.7.7.1

      parent reply	other threads:[~2011-11-08 15:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 23:40 ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator [FULL] j.glisse
2011-11-07 23:40 ` [PATCH 01/12] drm/ttm: remove userspace backed ttm object support j.glisse
2011-11-08  7:22   ` Thomas Hellstrom
2011-11-09 20:34     ` Jerome Glisse
2011-11-08  7:44   ` Thomas Hellstrom
2011-11-07 23:40 ` [PATCH 02/12] drm/ttm: remove split btw highmen and lowmem page j.glisse
2011-11-08  7:56   ` Thomas Hellstrom
2011-11-08 15:13     ` Konrad Rzeszutek Wilk
2011-11-07 23:40 ` [PATCH 03/12] drm/ttm: remove unused backend flags field j.glisse
2011-11-08  7:56   ` Thomas Hellstrom
2011-11-07 23:40 ` [PATCH 04/12] drm/ttm: use ttm put pages function to properly restore cache attribute j.glisse
2011-11-08  7:57   ` Thomas Hellstrom
2011-11-07 23:40 ` [PATCH 05/12] drm/ttm: convert page allocation to use page ptr array instead of list V3 j.glisse
2011-11-08  8:11   ` Thomas Hellstrom
2011-11-08 16:19     ` Jerome Glisse
2011-11-07 23:40 ` [PATCH 06/12] drm/ttm: test for dma_address array allocation failure j.glisse
2011-11-08  8:12   ` Thomas Hellstrom
2011-11-07 23:40 ` [PATCH 07/12] drm/ttm: merge ttm_backend and ttm_tt j.glisse
2011-11-08  8:48   ` Thomas Hellstrom
2011-11-07 23:40 ` [PATCH 08/12] drm/ttm: introduce callback for ttm_tt populate & unpopulate j.glisse
2011-11-08  8:29   ` Thomas Hellstrom
2011-11-07 23:40 ` [PATCH 09/12] ttm: Provide DMA aware TTM page pool code j.glisse
2011-11-08  8:51   ` Thomas Hellstrom
2011-11-07 23:40 ` [PATCH 10/12] swiotlb: Expose swiotlb_nr_tlb function to modules j.glisse
2011-11-07 23:40 ` [PATCH 11/12] drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on j.glisse
2011-11-07 23:40 ` [PATCH 12/12] nouveau/ttm/dma: Enable the TTM DMA pool if device can only do 32-bit DMA j.glisse
2011-11-08 15:15 ` Konrad Rzeszutek Wilk [this message]

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=20111108151507.GE10913@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j.glisse@gmail.com \
    --cc=thellstrom@vmware.com \
    /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.