diff options
author | Mika Kuoppala <mika.kuoppala@linux.intel.com> | 2015-06-25 18:35:12 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-06-26 10:53:50 +0200 |
commit | 567047be2a7ede082d29f45524c287b87bd75e53 (patch) | |
tree | 120a3f58c0b504ff4f81562f0eade8450149d0d2 /drivers/gpu/drm/i915/i915_gem_gtt.h | |
parent | d1c54acd67dc6518629224b68cac17cd5cff1dc3 (diff) | |
download | blackbird-obmc-linux-567047be2a7ede082d29f45524c287b87bd75e53.tar.gz blackbird-obmc-linux-567047be2a7ede082d29f45524c287b87bd75e53.zip |
drm/i915/gtt: Use macros to access dma mapped pages
Make paging structure type agnostic *_px macros to access
page dma struct, the backing page and the dma address.
This makes the code less cluttered on internals of
i915_page_dma.
v2: Superfluous const -> nonconst removed
v3: Rebased
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Michel Thierry <michel.thierry@intel.com> (v2)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_gtt.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h index c681573b4005..f4bcec2b389a 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.h +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h @@ -219,6 +219,10 @@ struct i915_page_dma { }; }; +#define px_base(px) (&(px)->base) +#define px_page(px) (px_base(px)->page) +#define px_dma(px) (px_base(px)->daddr) + struct i915_page_table { struct i915_page_dma base; @@ -481,8 +485,8 @@ static inline dma_addr_t i915_page_dir_dma_addr(const struct i915_hw_ppgtt *ppgtt, const unsigned n) { return test_bit(n, ppgtt->pdp.used_pdpes) ? - ppgtt->pdp.page_directory[n]->base.daddr : - ppgtt->scratch_pd->base.daddr; + px_dma(ppgtt->pdp.page_directory[n]) : + px_dma(ppgtt->scratch_pd); } int i915_gem_gtt_init(struct drm_device *dev); |