diff options
Diffstat (limited to 'drivers/gpu/drm/tegra/gem.c')
-rw-r--r-- | drivers/gpu/drm/tegra/gem.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 267c0c21e5cc..d851ec106cf4 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c | |||
@@ -18,6 +18,8 @@ | |||
18 | * GNU General Public License for more details. | 18 | * GNU General Public License for more details. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <drm/tegra_drm.h> | ||
22 | |||
21 | #include "gem.h" | 23 | #include "gem.h" |
22 | 24 | ||
23 | static inline struct tegra_bo *host1x_to_tegra_bo(struct host1x_bo *bo) | 25 | static inline struct tegra_bo *host1x_to_tegra_bo(struct host1x_bo *bo) |
@@ -97,7 +99,8 @@ static void tegra_bo_destroy(struct drm_device *drm, struct tegra_bo *bo) | |||
97 | dma_free_writecombine(drm->dev, bo->gem.size, bo->vaddr, bo->paddr); | 99 | dma_free_writecombine(drm->dev, bo->gem.size, bo->vaddr, bo->paddr); |
98 | } | 100 | } |
99 | 101 | ||
100 | struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size) | 102 | struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size, |
103 | unsigned long flags) | ||
101 | { | 104 | { |
102 | struct tegra_bo *bo; | 105 | struct tegra_bo *bo; |
103 | int err; | 106 | int err; |
@@ -126,6 +129,9 @@ struct tegra_bo *tegra_bo_create(struct drm_device *drm, unsigned int size) | |||
126 | if (err) | 129 | if (err) |
127 | goto err_mmap; | 130 | goto err_mmap; |
128 | 131 | ||
132 | if (flags & DRM_TEGRA_GEM_CREATE_TILED) | ||
133 | bo->flags |= TEGRA_BO_TILED; | ||
134 | |||
129 | return bo; | 135 | return bo; |
130 | 136 | ||
131 | err_mmap: | 137 | err_mmap: |
@@ -142,12 +148,13 @@ err_dma: | |||
142 | struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, | 148 | struct tegra_bo *tegra_bo_create_with_handle(struct drm_file *file, |
143 | struct drm_device *drm, | 149 | struct drm_device *drm, |
144 | unsigned int size, | 150 | unsigned int size, |
151 | unsigned long flags, | ||
145 | unsigned int *handle) | 152 | unsigned int *handle) |
146 | { | 153 | { |
147 | struct tegra_bo *bo; | 154 | struct tegra_bo *bo; |
148 | int ret; | 155 | int ret; |
149 | 156 | ||
150 | bo = tegra_bo_create(drm, size); | 157 | bo = tegra_bo_create(drm, size, flags); |
151 | if (IS_ERR(bo)) | 158 | if (IS_ERR(bo)) |
152 | return bo; | 159 | return bo; |
153 | 160 | ||
@@ -187,7 +194,7 @@ int tegra_bo_dumb_create(struct drm_file *file, struct drm_device *drm, | |||
187 | if (args->size < args->pitch * args->height) | 194 | if (args->size < args->pitch * args->height) |
188 | args->size = args->pitch * args->height; | 195 | args->size = args->pitch * args->height; |
189 | 196 | ||
190 | bo = tegra_bo_create_with_handle(file, drm, args->size, | 197 | bo = tegra_bo_create_with_handle(file, drm, args->size, 0, |
191 | &args->handle); | 198 | &args->handle); |
192 | if (IS_ERR(bo)) | 199 | if (IS_ERR(bo)) |
193 | return PTR_ERR(bo); | 200 | return PTR_ERR(bo); |