Commit 3be82743 authored by Thierry Reding's avatar Thierry Reding

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: default avatarThierry Reding <treding@nvidia.com>
parent a137ce34
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
#include "gem.h" #include "gem.h"
static inline struct tegra_bo *host1x_to_drm_bo(struct host1x_bo *bo) static inline struct tegra_bo *host1x_to_tegra_bo(struct host1x_bo *bo)
{ {
return container_of(bo, struct tegra_bo, base); return container_of(bo, struct tegra_bo, base);
} }
static void tegra_bo_put(struct host1x_bo *bo) static void tegra_bo_put(struct host1x_bo *bo)
{ {
struct tegra_bo *obj = host1x_to_drm_bo(bo); struct tegra_bo *obj = host1x_to_tegra_bo(bo);
struct drm_device *drm = obj->gem.dev; struct drm_device *drm = obj->gem.dev;
mutex_lock(&drm->struct_mutex); mutex_lock(&drm->struct_mutex);
...@@ -37,7 +37,7 @@ static void tegra_bo_put(struct host1x_bo *bo) ...@@ -37,7 +37,7 @@ static void tegra_bo_put(struct host1x_bo *bo)
static dma_addr_t tegra_bo_pin(struct host1x_bo *bo, struct sg_table **sgt) static dma_addr_t tegra_bo_pin(struct host1x_bo *bo, struct sg_table **sgt)
{ {
struct tegra_bo *obj = host1x_to_drm_bo(bo); struct tegra_bo *obj = host1x_to_tegra_bo(bo);
return obj->paddr; return obj->paddr;
} }
...@@ -48,7 +48,7 @@ static void tegra_bo_unpin(struct host1x_bo *bo, struct sg_table *sgt) ...@@ -48,7 +48,7 @@ static void tegra_bo_unpin(struct host1x_bo *bo, struct sg_table *sgt)
static void *tegra_bo_mmap(struct host1x_bo *bo) static void *tegra_bo_mmap(struct host1x_bo *bo)
{ {
struct tegra_bo *obj = host1x_to_drm_bo(bo); struct tegra_bo *obj = host1x_to_tegra_bo(bo);
return obj->vaddr; return obj->vaddr;
} }
...@@ -59,7 +59,7 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr) ...@@ -59,7 +59,7 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr)
static void *tegra_bo_kmap(struct host1x_bo *bo, unsigned int page) static void *tegra_bo_kmap(struct host1x_bo *bo, unsigned int page)
{ {
struct tegra_bo *obj = host1x_to_drm_bo(bo); struct tegra_bo *obj = host1x_to_tegra_bo(bo);
return obj->vaddr + page * PAGE_SIZE; return obj->vaddr + page * PAGE_SIZE;
} }
...@@ -71,7 +71,7 @@ static void tegra_bo_kunmap(struct host1x_bo *bo, unsigned int page, ...@@ -71,7 +71,7 @@ static void tegra_bo_kunmap(struct host1x_bo *bo, unsigned int page,
static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo) static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo)
{ {
struct tegra_bo *obj = host1x_to_drm_bo(bo); struct tegra_bo *obj = host1x_to_tegra_bo(bo);
struct drm_device *drm = obj->gem.dev; struct drm_device *drm = obj->gem.dev;
mutex_lock(&drm->struct_mutex); mutex_lock(&drm->struct_mutex);
...@@ -140,9 +140,9 @@ struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size) ...@@ -140,9 +140,9 @@ struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size)
} }
struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file,
struct drm_device *drm, struct drm_device *drm,
unsigned int size, unsigned int size,
unsigned int *handle) unsigned int *handle)
{ {
struct tegra_bo *bo; struct tegra_bo *bo;
int ret; int ret;
...@@ -169,7 +169,6 @@ void tegra_bo_free_object(struct drm_gem_object *gem) ...@@ -169,7 +169,6 @@ void tegra_bo_free_object(struct drm_gem_object *gem)
struct tegra_bo *bo = to_tegra_bo(gem); struct tegra_bo *bo = to_tegra_bo(gem);
drm_gem_free_mmap_offset(gem); drm_gem_free_mmap_offset(gem);
drm_gem_object_release(gem); drm_gem_object_release(gem);
tegra_bo_destroy(gem->dev, bo); tegra_bo_destroy(gem->dev, bo);
...@@ -189,7 +188,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, ...@@ -189,7 +188,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
args->size = args->pitch * args->height; args->size = args->pitch * args->height;
bo = tegra_bo_create_with_handle(file, drm, args->size, bo = tegra_bo_create_with_handle(file, drm, args->size,
&args->handle); &args->handle);
if (IS_ERR(bo)) if (IS_ERR(bo))
return PTR_ERR(bo); return PTR_ERR(bo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment