diff mbox

[1/2] drm/i915: stolen_reserved_base is also dma_addr_t

Message ID 20170926192908.28055-1-paulo.r.zanoni@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Zanoni, Paulo R Sept. 26, 2017, 7:29 p.m. UTC
The chunk added by this patch was missed by these commits:
* 920bcd1820a6 ("drm/i915: make i915_stolen_to_physical() return phys_addr_t")
* c88473878d47 ("drm/i915: Treat stolen memory as DMA addresses")

The stolen_reserved_base variable contains a memory address for stolen
memory and our code uses dma_addr_t for pointers to stolen, so it
makes sense to make it also be dma_addr_t. Notice that the local
variable inside i915_gem_init_stolen() that stores this pointer is
even already dma_addr_t.

This change essentially converts the size to 64 bits where applicable,
making sure things work in case we ever get crazy enough to put stolen
that far in memory.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_gtt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Wilson Sept. 26, 2017, 8:10 p.m. UTC | #1
Quoting Paulo Zanoni (2017-09-26 20:29:07)
> The chunk added by this patch was missed by these commits:
> * 920bcd1820a6 ("drm/i915: make i915_stolen_to_physical() return phys_addr_t")
> * c88473878d47 ("drm/i915: Treat stolen memory as DMA addresses")
> 
> The stolen_reserved_base variable contains a memory address for stolen
> memory and our code uses dma_addr_t for pointers to stolen, so it
> makes sense to make it also be dma_addr_t. Notice that the local
> variable inside i915_gem_init_stolen() that stores this pointer is
> even already dma_addr_t.
> 
> This change essentially converts the size to 64 bits where applicable,
> making sure things work in case we ever get crazy enough to put stolen
> that far in memory.

It's defined as residing in the low 4G. Do you have a platform in mind?
-Chris
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
index f62fb90..dd2ef5b 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -365,7 +365,7 @@  struct i915_ggtt {
 	 */
 	u32 stolen_size;		/* Total size of stolen memory */
 	u32 stolen_usable_size;	/* Total size minus reserved ranges */
-	u32 stolen_reserved_base;
+	dma_addr_t stolen_reserved_base;
 	u32 stolen_reserved_size;
 
 	/** "Graphics Stolen Memory" holds the global PTEs */