summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/radeon_object.h
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2012-05-09 17:34:49 +0400
committerDave Airlie <airlied@redhat.com>2012-05-09 20:22:31 +0400
commitdd8bea2111ab80ecb640183d00c383e03554509d (patch)
treed8aaab132b65d5a14fea7f1084c9a2b806a10395 /drivers/gpu/drm/radeon/radeon_object.h
parent8a47cc9ec1249eefd600adb273148c62879a560d (diff)
downloadlinux-dd8bea2111ab80ecb640183d00c383e03554509d.tar.xz
drm/radeon: use inline functions to calc sa_bo addr
Instead of hacking the calculation multiple times. Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_object.h')
-rw-r--r--drivers/gpu/drm/radeon/radeon_object.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_object.h b/drivers/gpu/drm/radeon/radeon_object.h
index f9104be88d7c..c120ab9e457b 100644
--- a/drivers/gpu/drm/radeon/radeon_object.h
+++ b/drivers/gpu/drm/radeon/radeon_object.h
@@ -146,6 +146,17 @@ extern struct radeon_bo_va *radeon_bo_va(struct radeon_bo *rbo,
/*
* sub allocation
*/
+
+static inline uint64_t radeon_sa_bo_gpu_addr(struct radeon_sa_bo *sa_bo)
+{
+ return sa_bo->manager->gpu_addr + sa_bo->offset;
+}
+
+static inline void * radeon_sa_bo_cpu_addr(struct radeon_sa_bo *sa_bo)
+{
+ return sa_bo->manager->cpu_ptr + sa_bo->offset;
+}
+
extern int radeon_sa_bo_manager_init(struct radeon_device *rdev,
struct radeon_sa_manager *sa_manager,
unsigned size, u32 domain);