diff options
author | Thierry Reding <treding@nvidia.com> | 2013-09-24 10:34:05 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-10-31 04:20:10 -0400 |
commit | 3be8274341499cfc258eddda29f626d7be10dde5 (patch) | |
tree | 180ff9fcf521923bd03d21036a195c5fe3b8b781 /drivers/gpu/host1x | |
parent | a137ce3438cb1f75fc048e751921a4eaceee0123 (diff) |
drm/tegra: gem: Miscellaneous cleanups
Rename the host1x_to_drm_bo() macro to host1x_to_tegra_bo() for
consistency and fixup various stylistic issues.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r-- | drivers/gpu/host1x/drm/gem.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/gpu/host1x/drm/gem.c b/drivers/gpu/host1x/drm/gem.c index 4a21378e5350..267c0c21e5cc 100644 --- a/drivers/gpu/host1x/drm/gem.c +++ b/drivers/gpu/host1x/drm/gem.c | |||
@@ -20,14 +20,14 @@ | |||
20 | 20 | ||
21 | #include "gem.h" | 21 | #include "gem.h" |
22 | 22 | ||
23 | static inline struct tegra_bo *host1x_to_drm_bo(struct host1x_bo *bo) | 23 | static inline struct tegra_bo *host1x_to_tegra_bo(struct host1x_bo *bo) |
24 | { | 24 | { |
25 | return container_of(bo, struct tegra_bo, base); | 25 | return container_of(bo, struct tegra_bo, base); |
26 | } | 26 | } |
27 | 27 | ||
28 | static void tegra_bo_put(struct host1x_bo *bo) | 28 | static void tegra_bo_put(struct host1x_bo *bo) |
29 | { | 29 | { |
30 | struct tegra_bo *obj = host1x_to_drm_bo(bo); | 30 | struct tegra_bo *obj = host1x_to_tegra_bo(bo); |
31 | struct drm_device *drm = obj->gem.dev; | 31 | struct drm_device *drm = obj->gem.dev; |
32 | 32 | ||
33 | mutex_lock(&drm->struct_mutex); | 33 | mutex_lock(&drm->struct_mutex); |
@@ -37,7 +37,7 @@ static void tegra_bo_put(struct host1x_bo *bo) | |||
37 | 37 | ||
38 | static dma_addr_t tegra_bo_pin(struct host1x_bo *bo, struct sg_table **sgt) | 38 | static dma_addr_t tegra_bo_pin(struct host1x_bo *bo, struct sg_table **sgt) |
39 | { | 39 | { |
40 | struct tegra_bo *obj = host1x_to_drm_bo(bo); | 40 | struct tegra_bo *obj = host1x_to_tegra_bo(bo); |
41 | 41 | ||
42 | return obj->paddr; | 42 | return obj->paddr; |
43 | } | 43 | } |
@@ -48,7 +48,7 @@ static void tegra_bo_unpin(struct host1x_bo *bo, struct sg_table *sgt) | |||
48 | 48 | ||
49 | static void *tegra_bo_mmap(struct host1x_bo *bo) | 49 | static void *tegra_bo_mmap(struct host1x_bo *bo) |
50 | { | 50 | { |
51 | struct tegra_bo *obj = host1x_to_drm_bo(bo); | 51 | struct tegra_bo *obj = host1x_to_tegra_bo(bo); |
52 | 52 | ||
53 | return obj->vaddr; | 53 | return obj->vaddr; |
54 | } | 54 | } |
@@ -59,7 +59,7 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr) | |||
59 | 59 | ||
60 | static void *tegra_bo_kmap(struct host1x_bo *bo, unsigned int page) | 60 | static void *tegra_bo_kmap(struct host1x_bo *bo, unsigned int page) |
61 | { | 61 | { |
62 | struct tegra_bo *obj = host1x_to_drm_bo(bo); | 62 | struct tegra_bo *obj = host1x_to_tegra_bo(bo); |
63 | 63 | ||
64 | return obj->vaddr + page * PAGE_SIZE; | 64 | return obj->vaddr + page * PAGE_SIZE; |
65 | } | 65 | } |
@@ -71,7 +71,7 @@ static void tegra_bo_kunmap(struct host1x_bo *bo, unsigned int page, | |||
71 | 71 | ||
72 | static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo) | 72 | static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo) |
73 | { | 73 | { |
74 | struct tegra_bo *obj = host1x_to_drm_bo(bo); | 74 | struct tegra_bo *obj = host1x_to_tegra_bo(bo); |
75 | struct drm_device *drm = obj->gem.dev; | 75 | struct drm_device *drm = obj->gem.dev; |
76 | 76 | ||
77 | mutex_lock(&drm->struct_mutex); | 77 | mutex_lock(&drm->struct_mutex); |
@@ -140,9 +140,9 @@ err_dma: | |||
140 | } | 140 | } |
141 | 141 | ||
142 | struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, | 142 | struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, |
143 | struct drm_device *drm, | 143 | struct drm_device *drm, |
144 | unsigned int size, | 144 | unsigned int size, |
145 | unsigned int *handle) | 145 | unsigned int *handle) |
146 | { | 146 | { |
147 | struct tegra_bo *bo; | 147 | struct tegra_bo *bo; |
148 | int ret; | 148 | int ret; |
@@ -169,7 +169,6 @@ void tegra_bo_free_object(struct drm_gem_object *gem) | |||
169 | struct tegra_bo *bo = to_tegra_bo(gem); | 169 | struct tegra_bo *bo = to_tegra_bo(gem); |
170 | 170 | ||
171 | drm_gem_free_mmap_offset(gem); | 171 | drm_gem_free_mmap_offset(gem); |
172 | |||
173 | drm_gem_object_release(gem); | 172 | drm_gem_object_release(gem); |
174 | tegra_bo_destroy(gem->dev, bo); | 173 | tegra_bo_destroy(gem->dev, bo); |
175 | 174 | ||
@@ -189,7 +188,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, | |||
189 | args->size = args->pitch * args->height; | 188 | args->size = args->pitch * args->height; |
190 | 189 | ||
191 | bo = tegra_bo_create_with_handle(file, drm, args->size, | 190 | bo = tegra_bo_create_with_handle(file, drm, args->size, |
192 | &args->handle); | 191 | &args->handle); |
193 | if (IS_ERR(bo)) | 192 | if (IS_ERR(bo)) |
194 | return PTR_ERR(bo); | 193 | return PTR_ERR(bo); |
195 | 194 | ||