aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_gem.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_gem.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index 201b52b750dd..ca5397beb357 100644
--- a/drivers/gpu/drm/nouveau/nouveau_gem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
@@ -175,11 +175,11 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
175} 175}
176 176
177int 177int
178nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain, 178nouveau_gem_new(struct nouveau_cli *cli, u64 size, int align, uint32_t domain,
179 uint32_t tile_mode, uint32_t tile_flags, 179 uint32_t tile_mode, uint32_t tile_flags,
180 struct nouveau_bo **pnvbo) 180 struct nouveau_bo **pnvbo)
181{ 181{
182 struct nouveau_drm *drm = nouveau_drm(dev); 182 struct nouveau_drm *drm = nouveau_drm(cli->dev);
183 struct nouveau_bo *nvbo; 183 struct nouveau_bo *nvbo;
184 u32 flags = 0; 184 u32 flags = 0;
185 int ret; 185 int ret;
@@ -194,7 +194,7 @@ nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain,
194 if (domain & NOUVEAU_GEM_DOMAIN_COHERENT) 194 if (domain & NOUVEAU_GEM_DOMAIN_COHERENT)
195 flags |= TTM_PL_FLAG_UNCACHED; 195 flags |= TTM_PL_FLAG_UNCACHED;
196 196
197 ret = nouveau_bo_new(dev, size, align, flags, tile_mode, 197 ret = nouveau_bo_new(cli, size, align, flags, tile_mode,
198 tile_flags, NULL, NULL, pnvbo); 198 tile_flags, NULL, NULL, pnvbo);
199 if (ret) 199 if (ret)
200 return ret; 200 return ret;
@@ -206,12 +206,12 @@ nouveau_gem_new(struct drm_device *dev, int size, int align, uint32_t domain,
206 */ 206 */
207 nvbo->valid_domains = NOUVEAU_GEM_DOMAIN_VRAM | 207 nvbo->valid_domains = NOUVEAU_GEM_DOMAIN_VRAM |
208 NOUVEAU_GEM_DOMAIN_GART; 208 NOUVEAU_GEM_DOMAIN_GART;
209 if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) 209 if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA)
210 nvbo->valid_domains &= domain; 210 nvbo->valid_domains &= domain;
211 211
212 /* Initialize the embedded gem-object. We return a single gem-reference 212 /* Initialize the embedded gem-object. We return a single gem-reference
213 * to the caller, instead of a normal nouveau_bo ttm reference. */ 213 * to the caller, instead of a normal nouveau_bo ttm reference. */
214 ret = drm_gem_object_init(dev, &nvbo->gem, nvbo->bo.mem.size); 214 ret = drm_gem_object_init(drm->dev, &nvbo->gem, nvbo->bo.mem.size);
215 if (ret) { 215 if (ret) {
216 nouveau_bo_ref(NULL, pnvbo); 216 nouveau_bo_ref(NULL, pnvbo);
217 return -ENOMEM; 217 return -ENOMEM;
@@ -257,7 +257,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data,
257{ 257{
258 struct nouveau_drm *drm = nouveau_drm(dev); 258 struct nouveau_drm *drm = nouveau_drm(dev);
259 struct nouveau_cli *cli = nouveau_cli(file_priv); 259 struct nouveau_cli *cli = nouveau_cli(file_priv);
260 struct nvkm_fb *fb = nvxx_fb(&drm->device); 260 struct nvkm_fb *fb = nvxx_fb(&drm->client.device);
261 struct drm_nouveau_gem_new *req = data; 261 struct drm_nouveau_gem_new *req = data;
262 struct nouveau_bo *nvbo = NULL; 262 struct nouveau_bo *nvbo = NULL;
263 int ret = 0; 263 int ret = 0;
@@ -267,7 +267,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data,
267 return -EINVAL; 267 return -EINVAL;
268 } 268 }
269 269
270 ret = nouveau_gem_new(dev, req->info.size, req->align, 270 ret = nouveau_gem_new(cli, req->info.size, req->align,
271 req->info.domain, req->info.tile_mode, 271 req->info.domain, req->info.tile_mode,
272 req->info.tile_flags, &nvbo); 272 req->info.tile_flags, &nvbo);
273 if (ret) 273 if (ret)
@@ -496,7 +496,7 @@ validate_list(struct nouveau_channel *chan, struct nouveau_cli *cli,
496 return ret; 496 return ret;
497 } 497 }
498 498
499 if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { 499 if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) {
500 if (nvbo->bo.offset == b->presumed.offset && 500 if (nvbo->bo.offset == b->presumed.offset &&
501 ((nvbo->bo.mem.mem_type == TTM_PL_VRAM && 501 ((nvbo->bo.mem.mem_type == TTM_PL_VRAM &&
502 b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) || 502 b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) ||
@@ -767,7 +767,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
767 push[i].length); 767 push[i].length);
768 } 768 }
769 } else 769 } else
770 if (drm->device.info.chipset >= 0x25) { 770 if (drm->client.device.info.chipset >= 0x25) {
771 ret = RING_SPACE(chan, req->nr_push * 2); 771 ret = RING_SPACE(chan, req->nr_push * 2);
772 if (ret) { 772 if (ret) {
773 NV_PRINTK(err, cli, "cal_space: %d\n", ret); 773 NV_PRINTK(err, cli, "cal_space: %d\n", ret);
@@ -840,7 +840,7 @@ out_next:
840 req->suffix0 = 0x00000000; 840 req->suffix0 = 0x00000000;
841 req->suffix1 = 0x00000000; 841 req->suffix1 = 0x00000000;
842 } else 842 } else
843 if (drm->device.info.chipset >= 0x25) { 843 if (drm->client.device.info.chipset >= 0x25) {
844 req->suffix0 = 0x00020000; 844 req->suffix0 = 0x00020000;
845 req->suffix1 = 0x00000000; 845 req->suffix1 = 0x00000000;
846 } else { 846 } else {