* [PATCH 1/2] drm: remove address mask param for drm_pci_alloc()
@ 2010-01-05 3:25 Zhenyu Wang
2010-01-05 3:25 ` [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page Zhenyu Wang
0 siblings, 1 reply; 6+ messages in thread
From: Zhenyu Wang @ 2010-01-05 3:25 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx, Zhenyu Wang
From: Zhenyu Wang <zhenyu.z.wang@intel.com>
drm_pci_alloc() has input of address mask for setting pci dma
mask on the device, which should be properly setup by drm driver.
And leave it as a param for drm_pci_alloc() would cause confusion
or mistake would corrupt the correct dma mask setting, as seen on
intel hw which set wrong dma mask for hw status page. So remove
it from drm_pci_alloc() function.
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
drivers/gpu/drm/ati_pcigart.c | 10 ++++++++--
drivers/gpu/drm/drm_bufs.c | 4 ++--
drivers/gpu/drm/drm_pci.c | 8 +-------
drivers/gpu/drm/i915/i915_dma.c | 2 +-
drivers/gpu/drm/i915/i915_gem.c | 2 +-
include/drm/drmP.h | 2 +-
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
index 628eae3..a1fce68 100644
--- a/drivers/gpu/drm/ati_pcigart.c
+++ b/drivers/gpu/drm/ati_pcigart.c
@@ -39,8 +39,7 @@ static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
struct drm_ati_pcigart_info *gart_info)
{
gart_info->table_handle = drm_pci_alloc(dev, gart_info->table_size,
- PAGE_SIZE,
- gart_info->table_mask);
+ PAGE_SIZE);
if (gart_info->table_handle == NULL)
return -ENOMEM;
@@ -112,6 +111,13 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
+ if (pci_set_dma_mask(dev->pdev, gart_info->table_mask)) {
+ DRM_ERROR("fail to set dma mask to 0x%Lx\n",
+ gart_info->table_mask);
+ ret = 1;
+ goto done;
+ }
+
ret = drm_ati_alloc_pcigart_table(dev, gart_info);
if (ret) {
DRM_ERROR("cannot allocate PCI GART page!\n");
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index 3d09e30..8417cc4 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -326,7 +326,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
* As we're limiting the address to 2^32-1 (or less),
* casting it down to 32 bits is no problem, but we
* need to point to a 64bit variable first. */
- dmah = drm_pci_alloc(dev, map->size, map->size, 0xffffffffUL);
+ dmah = drm_pci_alloc(dev, map->size, map->size);
if (!dmah) {
kfree(map);
return -ENOMEM;
@@ -885,7 +885,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
while (entry->buf_count < count) {
- dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000, 0xfffffffful);
+ dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000);
if (!dmah) {
/* Set count correctly so we free the proper amount. */
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c
index 577094f..e68ebf9 100644
--- a/drivers/gpu/drm/drm_pci.c
+++ b/drivers/gpu/drm/drm_pci.c
@@ -47,8 +47,7 @@
/**
* \brief Allocate a PCI consistent memory block, for DMA.
*/
-drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align,
- dma_addr_t maxaddr)
+drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align)
{
drm_dma_handle_t *dmah;
#if 1
@@ -63,11 +62,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
if (align > size)
return NULL;
- if (pci_set_dma_mask(dev->pdev, maxaddr) != 0) {
- DRM_ERROR("Setting pci dma mask failed\n");
- return NULL;
- }
-
dmah = kmalloc(sizeof(drm_dma_handle_t), GFP_KERNEL);
if (!dmah)
return NULL;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 701bfea..02607ed 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -123,7 +123,7 @@ static int i915_init_phys_hws(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private;
/* Program Hardware Status Page */
dev_priv->status_page_dmah =
- drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff);
+ drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE);
if (!dev_priv->status_page_dmah) {
DRM_ERROR("Can not allocate hardware status page\n");
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8c463cf..0d81f88 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -4708,7 +4708,7 @@ int i915_gem_init_phys_object(struct drm_device *dev,
phys_obj->id = id;
- phys_obj->handle = drm_pci_alloc(dev, size, 0, 0xffffffff);
+ phys_obj->handle = drm_pci_alloc(dev, size, 0);
if (!phys_obj->handle) {
ret = -ENOMEM;
goto kfree_obj;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 71dafb6..ffac157 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -1408,7 +1408,7 @@ extern int drm_ati_pcigart_cleanup(struct drm_device *dev,
struct drm_ati_pcigart_info * gart_info);
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
- size_t align, dma_addr_t maxaddr);
+ size_t align);
extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
--
1.6.5.7
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page
2010-01-05 3:25 [PATCH 1/2] drm: remove address mask param for drm_pci_alloc() Zhenyu Wang
@ 2010-01-05 3:25 ` Zhenyu Wang
2010-01-05 5:37 ` [Intel-gfx] " ykzhao
2010-01-15 22:51 ` Eric Anholt
0 siblings, 2 replies; 6+ messages in thread
From: Zhenyu Wang @ 2010-01-05 3:25 UTC (permalink / raw)
To: dri-devel; +Cc: intel-gfx
This enables possible 36bit address mask on 965G that use physical
address for hw status page.
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
---
drivers/char/agp/intel-agp.c | 6 +++++-
drivers/gpu/drm/i915/i915_dma.c | 4 ++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 30c36ac..3999a5f 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -2460,10 +2460,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
&bridge->mode);
}
- if (bridge->driver->mask_memory == intel_i965_mask_memory)
+ if (bridge->driver->mask_memory == intel_i965_mask_memory) {
if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36)))
dev_err(&intel_private.pcidev->dev,
"set gfx device dma mask 36bit failed!\n");
+ else
+ pci_set_consistent_dma_mask(intel_private.pcidev,
+ DMA_BIT_MASK(36));
+ }
pci_set_drvdata(pdev, bridge);
return agp_add_bridge(bridge);
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 02607ed..750f6c8 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -134,6 +134,10 @@ static int i915_init_phys_hws(struct drm_device *dev)
memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
+ if (IS_I965G(dev))
+ dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) &
+ 0xf0;
+
I915_WRITE(HWS_PGA, dev_priv->dma_status_page);
DRM_DEBUG_DRIVER("Enabled hardware status page\n");
return 0;
--
1.6.5.7
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
--
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page
2010-01-05 3:25 ` [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page Zhenyu Wang
@ 2010-01-05 5:37 ` ykzhao
2010-01-05 9:25 ` Zhenyu Wang
2010-01-15 22:51 ` Eric Anholt
1 sibling, 1 reply; 6+ messages in thread
From: ykzhao @ 2010-01-05 5:37 UTC (permalink / raw)
To: Zhenyu Wang
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.sourceforge.net
On Tue, 2010-01-05 at 11:25 +0800, Zhenyu Wang wrote:
> This enables possible 36bit address mask on 965G that use physical
> address for hw status page.
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> ---
> drivers/char/agp/intel-agp.c | 6 +++++-
> drivers/gpu/drm/i915/i915_dma.c | 4 ++++
> 2 files changed, 9 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
> index 30c36ac..3999a5f 100644
> --- a/drivers/char/agp/intel-agp.c
> +++ b/drivers/char/agp/intel-agp.c
> @@ -2460,10 +2460,14 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
> &bridge->mode);
> }
>
> - if (bridge->driver->mask_memory == intel_i965_mask_memory)
> + if (bridge->driver->mask_memory == intel_i965_mask_memory) {
> if (pci_set_dma_mask(intel_private.pcidev, DMA_BIT_MASK(36)))
> dev_err(&intel_private.pcidev->dev,
> "set gfx device dma mask 36bit failed!\n");
> + else
> + pci_set_consistent_dma_mask(intel_private.pcidev,
> + DMA_BIT_MASK(36));
> + }
It seems that both pci_set_dma_mask/set_consistent_dma_mask will be
called when the DMA mask is set correctly.
Can we use the following format so that it is easy to understand?
if (!pci_set_dma_mask() && !pci_set_consistent_dma_mask()) {
success;
} else
failure;
Do we need to add the explicit DMA mask for using 32bit DMA mask?
>
> pci_set_drvdata(pdev, bridge);
> return agp_add_bridge(bridge);
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 02607ed..750f6c8 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -134,6 +134,10 @@ static int i915_init_phys_hws(struct drm_device *dev)
>
> memset(dev_priv->hw_status_page, 0, PAGE_SIZE);
>
> + if (IS_I965G(dev))
> + dev_priv->dma_status_page |= (dev_priv->dma_status_page >> 28) &
> + 0xf0;
> +
> I915_WRITE(HWS_PGA, dev_priv->dma_status_page);
> DRM_DEBUG_DRIVER("Enabled hardware status page\n");
> return 0;
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page
2010-01-05 5:37 ` [Intel-gfx] " ykzhao
@ 2010-01-05 9:25 ` Zhenyu Wang
0 siblings, 0 replies; 6+ messages in thread
From: Zhenyu Wang @ 2010-01-05 9:25 UTC (permalink / raw)
To: ykzhao; +Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.sourceforge.net
[-- Attachment #1.1: Type: text/plain, Size: 266 bytes --]
On 2010.01.05 13:37:00 +0800, ykzhao wrote:
>
> Do we need to add the explicit DMA mask for using 32bit DMA mask?
>
No, 32bit mask is the default.
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 390 bytes --]
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
[-- Attachment #3: Type: text/plain, Size: 161 bytes --]
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page
2010-01-05 3:25 ` [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page Zhenyu Wang
2010-01-05 5:37 ` [Intel-gfx] " ykzhao
@ 2010-01-15 22:51 ` Eric Anholt
2010-01-18 0:47 ` Zhenyu Wang
1 sibling, 1 reply; 6+ messages in thread
From: Eric Anholt @ 2010-01-15 22:51 UTC (permalink / raw)
To: Zhenyu Wang, dri-devel; +Cc: intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 412 bytes --]
On Tue, 5 Jan 2010 11:25:06 +0800, Zhenyu Wang <zhenyuw@linux.intel.com> wrote:
> This enables possible 36bit address mask on 965G that use physical
> address for hw status page.
>
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Applied to for-linus. Thanks!
My understanding is that with the current 2 patches applied, the other
swiotlb stuff in intel-agp is not required. Is that right?
[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
[-- Attachment #3: Type: text/plain, Size: 161 bytes --]
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Intel-gfx] [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page
2010-01-15 22:51 ` Eric Anholt
@ 2010-01-18 0:47 ` Zhenyu Wang
0 siblings, 0 replies; 6+ messages in thread
From: Zhenyu Wang @ 2010-01-18 0:47 UTC (permalink / raw)
To: Eric Anholt; +Cc: intel-gfx, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 754 bytes --]
On 2010.01.15 14:51:41 -0800, Eric Anholt wrote:
> On Tue, 5 Jan 2010 11:25:06 +0800, Zhenyu Wang <zhenyuw@linux.intel.com> wrote:
> > This enables possible 36bit address mask on 965G that use physical
> > address for hw status page.
> >
> > Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
>
> Applied to for-linus. Thanks!
>
> My understanding is that with the current 2 patches applied, the other
> swiotlb stuff in intel-agp is not required. Is that right?
Yes.
We've already tried to make dma mapping stuff in intel-agp to work with
any pci mapping implement, so does swiotlb now although we just pass through it.
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 420 bytes --]
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
[-- Attachment #3: Type: text/plain, Size: 161 bytes --]
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-01-18 0:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 3:25 [PATCH 1/2] drm: remove address mask param for drm_pci_alloc() Zhenyu Wang
2010-01-05 3:25 ` [PATCH 2/2] drm/i915: enable 36bit physical address for hardware status page Zhenyu Wang
2010-01-05 5:37 ` [Intel-gfx] " ykzhao
2010-01-05 9:25 ` Zhenyu Wang
2010-01-15 22:51 ` Eric Anholt
2010-01-18 0:47 ` Zhenyu Wang
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.