[Intel-gfx] [PATCH] drm/i915: make i915_stolen_to_physical() return phys_addr_t

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 27 14:20:52 UTC 2017


On Fri, Jan 27, 2017 at 03:59:19PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 26, 2017 at 06:19:07PM -0200, Paulo Zanoni wrote:
> > The i915_stolen_to_physical() function has 'unsigned long' as its
> > return type but it returns the 'base' variable, which is of type
> > 'u32'. The only place where this function is called assigns the
> > returned value to dev_priv->mm.stolen_base, which is of type
> > 'phys_addr_t'. The return value is actually a physical address and
> > everything else in the stolen memory code seems to be using
> > phys_addr_t, so fix i915_stolen_to_physical() to use phys_addr_t.
> 
> Size of phys_addr_t depends on PAE no? So what if someone were to boot
> a !PAE kernel on a machine where stolen lives somewhere >4GiB?

dma_addr_t should be correct there, right? And in effect we do regard
this as only dma accessible, so the white lie would have some nice
semantic benefits.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list