2 * Tegra host1x GEM implementation
4 * Copyright (c) 2012-2013, NVIDIA Corporation.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 #ifndef __HOST1X_GEM_H
12 #define __HOST1X_GEM_H
14 #include <linux/host1x.h>
19 #define TEGRA_BO_TILED (1 << 0)
20 #define TEGRA_BO_BOTTOM_UP (1 << 1)
23 struct drm_gem_object gem;
24 struct host1x_bo base;
31 static inline struct tegra_bo *to_tegra_bo(struct drm_gem_object *gem)
33 return container_of(gem, struct tegra_bo, gem);
36 struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size,
38 struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file,
39 struct drm_device *drm,
42 unsigned int *handle);
43 void tegra_bo_free_object(struct drm_gem_object *gem);
44 int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm,
45 struct drm_mode_create_dumb *args);
46 int tegra_bo_dumb_map_offset(struct drm_file *file, struct drm_device *drm,
47 uint32_t handle, uint64_t *offset);
49 int tegra_drm_mmap(struct file *file, struct vm_area_struct *vma);
51 extern const struct vm_operations_struct tegra_bo_vm_ops;
53 struct dma_buf *tegra_gem_prime_export(struct drm_device *drm,
54 struct drm_gem_object *gem,
56 struct drm_gem_object *tegra_gem_prime_import(struct drm_device *drm,