Skip to content

Commit

Permalink
drm/host1x: stop casting VMA offsets to 32bit
Browse files Browse the repository at this point in the history
VMA offsets are 64bit so do not cast them to "unsigned int". Also remove
the (now useless) offset-retrieval helper. The VMA manager provides simple
enough helpers.

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: "Terje Bergström" <tbergstrom@nvidia.com>
Cc: Arto Merilainen <amerilainen@nvidia.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
David Herrmann authored and Dave Airlie committed Aug 19, 2013
1 parent b21e3af commit 2bc7b0c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/host1x/drm/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static int tegra_gem_mmap(struct drm_device *drm, void *data,

bo = to_tegra_bo(gem);

args->offset = tegra_bo_get_mmap_offset(bo);
args->offset = drm_vma_node_offset_addr(&bo->gem.vma_node);

drm_gem_object_unreference(gem);

Expand Down
7 changes: 1 addition & 6 deletions drivers/gpu/host1x/drm/gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ static void tegra_bo_destroy(struct drm_device *drm, struct tegra_bo *bo)
dma_free_writecombine(drm->dev, bo->gem.size, bo->vaddr, bo->paddr);
}

unsigned int tegra_bo_get_mmap_offset(struct tegra_bo *bo)
{
return (unsigned int)drm_vma_node_offset_addr(&bo->gem.vma_node);
}

struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size)
{
struct tegra_bo *bo;
Expand Down Expand Up @@ -227,7 +222,7 @@ int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,

bo = to_tegra_bo(gem);

*offset = tegra_bo_get_mmap_offset(bo);
*offset = drm_vma_node_offset_addr(&bo->gem.vma_node);

drm_gem_object_unreference(gem);

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/host1x/drm/gem.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file,
unsigned int size,
unsigned int *handle);
void tegra_bo_free_object(struct drm_gem_object *gem);
unsigned int tegra_bo_get_mmap_offset(struct tegra_bo *bo);
int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
struct drm_mode_create_dumb *args);
int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
Expand Down

0 comments on commit 2bc7b0c

Please sign in to comment.