diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-02-09 23:42:08 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-02-24 15:45:40 -0500 |
commit | 6ba9a68317781537d6184d3fdb2d0f20c97da3a4 (patch) | |
tree | 8d4a1335d09868883da891f96e54e624d4209241 /drivers/gpu/drm/nouveau | |
parent | a67047883410ee37d27806bb8415a84673934b4f (diff) |
drm/nouveau: pass domain rather than ttm flags to gem_new()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_gem.c | 23 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_notifier.c | 4 |
4 files changed, 17 insertions, 16 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index f591c84a2792..fce748f0f925 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -1352,7 +1352,7 @@ static inline struct nouveau_fence *nouveau_fence_ref(struct nouveau_fence *obj) | |||
1352 | 1352 | ||
1353 | /* nouveau_gem.c */ | 1353 | /* nouveau_gem.c */ |
1354 | extern int nouveau_gem_new(struct drm_device *, struct nouveau_channel *, | 1354 | extern int nouveau_gem_new(struct drm_device *, struct nouveau_channel *, |
1355 | int size, int align, uint32_t flags, | 1355 | int size, int align, uint32_t domain, |
1356 | uint32_t tile_mode, uint32_t tile_flags, | 1356 | uint32_t tile_mode, uint32_t tile_flags, |
1357 | struct nouveau_bo **); | 1357 | struct nouveau_bo **); |
1358 | extern int nouveau_gem_object_new(struct drm_gem_object *); | 1358 | extern int nouveau_gem_object_new(struct drm_gem_object *); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 9d7a98876074..889c4454682e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
@@ -296,8 +296,8 @@ nouveau_fbcon_create(struct nouveau_fbdev *nfbdev, | |||
296 | size = mode_cmd.pitch * mode_cmd.height; | 296 | size = mode_cmd.pitch * mode_cmd.height; |
297 | size = roundup(size, PAGE_SIZE); | 297 | size = roundup(size, PAGE_SIZE); |
298 | 298 | ||
299 | ret = nouveau_gem_new(dev, dev_priv->channel, size, 0, TTM_PL_FLAG_VRAM, | 299 | ret = nouveau_gem_new(dev, dev_priv->channel, size, 0, |
300 | 0, 0x0000, &nvbo); | 300 | NOUVEAU_GEM_DOMAIN_VRAM, 0, 0x0000, &nvbo); |
301 | if (ret) { | 301 | if (ret) { |
302 | NV_ERROR(dev, "failed to allocate framebuffer\n"); | 302 | NV_ERROR(dev, "failed to allocate framebuffer\n"); |
303 | goto out; | 303 | goto out; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 29ededdee980..cd4ed9e86704 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
@@ -61,12 +61,20 @@ nouveau_gem_object_del(struct drm_gem_object *gem) | |||
61 | 61 | ||
62 | int | 62 | int |
63 | nouveau_gem_new(struct drm_device *dev, struct nouveau_channel *chan, | 63 | nouveau_gem_new(struct drm_device *dev, struct nouveau_channel *chan, |
64 | int size, int align, uint32_t flags, uint32_t tile_mode, | 64 | int size, int align, uint32_t domain, uint32_t tile_mode, |
65 | uint32_t tile_flags, struct nouveau_bo **pnvbo) | 65 | uint32_t tile_flags, struct nouveau_bo **pnvbo) |
66 | { | 66 | { |
67 | struct nouveau_bo *nvbo; | 67 | struct nouveau_bo *nvbo; |
68 | u32 flags = 0; | ||
68 | int ret; | 69 | int ret; |
69 | 70 | ||
71 | if (domain & NOUVEAU_GEM_DOMAIN_VRAM) | ||
72 | flags |= TTM_PL_FLAG_VRAM; | ||
73 | if (domain & NOUVEAU_GEM_DOMAIN_GART) | ||
74 | flags |= TTM_PL_FLAG_TT; | ||
75 | if (!flags || domain & NOUVEAU_GEM_DOMAIN_CPU) | ||
76 | flags |= TTM_PL_FLAG_SYSTEM; | ||
77 | |||
70 | ret = nouveau_bo_new(dev, chan, size, align, flags, tile_mode, | 78 | ret = nouveau_bo_new(dev, chan, size, align, flags, tile_mode, |
71 | tile_flags, pnvbo); | 79 | tile_flags, pnvbo); |
72 | if (ret) | 80 | if (ret) |
@@ -110,19 +118,11 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, | |||
110 | struct drm_nouveau_gem_new *req = data; | 118 | struct drm_nouveau_gem_new *req = data; |
111 | struct nouveau_bo *nvbo = NULL; | 119 | struct nouveau_bo *nvbo = NULL; |
112 | struct nouveau_channel *chan = NULL; | 120 | struct nouveau_channel *chan = NULL; |
113 | uint32_t flags = 0; | ||
114 | int ret = 0; | 121 | int ret = 0; |
115 | 122 | ||
116 | if (unlikely(dev_priv->ttm.bdev.dev_mapping == NULL)) | 123 | if (unlikely(dev_priv->ttm.bdev.dev_mapping == NULL)) |
117 | dev_priv->ttm.bdev.dev_mapping = dev_priv->dev->dev_mapping; | 124 | dev_priv->ttm.bdev.dev_mapping = dev_priv->dev->dev_mapping; |
118 | 125 | ||
119 | if (req->info.domain & NOUVEAU_GEM_DOMAIN_VRAM) | ||
120 | flags |= TTM_PL_FLAG_VRAM; | ||
121 | if (req->info.domain & NOUVEAU_GEM_DOMAIN_GART) | ||
122 | flags |= TTM_PL_FLAG_TT; | ||
123 | if (!flags || req->info.domain & NOUVEAU_GEM_DOMAIN_CPU) | ||
124 | flags |= TTM_PL_FLAG_SYSTEM; | ||
125 | |||
126 | if (!dev_priv->engine.vram.flags_valid(dev, req->info.tile_flags)) { | 126 | if (!dev_priv->engine.vram.flags_valid(dev, req->info.tile_flags)) { |
127 | NV_ERROR(dev, "bad page flags: 0x%08x\n", req->info.tile_flags); | 127 | NV_ERROR(dev, "bad page flags: 0x%08x\n", req->info.tile_flags); |
128 | return -EINVAL; | 128 | return -EINVAL; |
@@ -134,8 +134,9 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, | |||
134 | return PTR_ERR(chan); | 134 | return PTR_ERR(chan); |
135 | } | 135 | } |
136 | 136 | ||
137 | ret = nouveau_gem_new(dev, chan, req->info.size, req->align, flags, | 137 | ret = nouveau_gem_new(dev, chan, req->info.size, req->align, |
138 | req->info.tile_mode, req->info.tile_flags, &nvbo); | 138 | req->info.domain, req->info.tile_mode, |
139 | req->info.tile_flags, &nvbo); | ||
139 | if (chan) | 140 | if (chan) |
140 | nouveau_channel_put(&chan); | 141 | nouveau_channel_put(&chan); |
141 | if (ret) | 142 | if (ret) |
diff --git a/drivers/gpu/drm/nouveau/nouveau_notifier.c b/drivers/gpu/drm/nouveau/nouveau_notifier.c index 92c029920efe..dc8349a3317a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_notifier.c +++ b/drivers/gpu/drm/nouveau/nouveau_notifier.c | |||
@@ -39,9 +39,9 @@ nouveau_notifier_init_channel(struct nouveau_channel *chan) | |||
39 | int ret; | 39 | int ret; |
40 | 40 | ||
41 | if (nouveau_vram_notify) | 41 | if (nouveau_vram_notify) |
42 | flags = TTM_PL_FLAG_VRAM; | 42 | flags = NOUVEAU_GEM_DOMAIN_VRAM; |
43 | else | 43 | else |
44 | flags = TTM_PL_FLAG_TT; | 44 | flags = NOUVEAU_GEM_DOMAIN_GART; |
45 | 45 | ||
46 | ret = nouveau_gem_new(dev, NULL, PAGE_SIZE, 0, flags, 0, 0, &ntfy); | 46 | ret = nouveau_gem_new(dev, NULL, PAGE_SIZE, 0, flags, 0, 0, &ntfy); |
47 | if (ret) | 47 | if (ret) |