Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/nouveau: pass nvif_client to nouveau_bo_new() instead of drm_device

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>

+20 -15
+3 -2
drivers/gpu/drm/nouveau/dispnv04/crtc.c
··· 1124 1124 drm_crtc_helper_add(&nv_crtc->base, &nv04_crtc_helper_funcs); 1125 1125 drm_mode_crtc_set_gamma_size(&nv_crtc->base, 256); 1126 1126 1127 - ret = nouveau_bo_new(dev, 64*64*4, 0x100, TTM_PL_FLAG_VRAM, 1128 - 0, 0x0000, NULL, NULL, &nv_crtc->cursor.nvbo); 1127 + ret = nouveau_bo_new(&nouveau_drm(dev)->client, 64*64*4, 0x100, 1128 + TTM_PL_FLAG_VRAM, 0, 0x0000, NULL, NULL, 1129 + &nv_crtc->cursor.nvbo); 1129 1130 if (!ret) { 1130 1131 ret = nouveau_bo_pin(nv_crtc->cursor.nvbo, TTM_PL_FLAG_VRAM, false); 1131 1132 if (!ret) {
+3 -2
drivers/gpu/drm/nouveau/nouveau_bo.c
··· 174 174 } 175 175 176 176 int 177 - nouveau_bo_new(struct drm_device *dev, int size, int align, 177 + nouveau_bo_new(struct nouveau_cli *cli, int size, int align, 178 178 uint32_t flags, uint32_t tile_mode, uint32_t tile_flags, 179 179 struct sg_table *sg, struct reservation_object *robj, 180 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 183 struct nouveau_bo *nvbo; 184 184 size_t acc_size; 185 185 int ret; ··· 208 208 nvbo->tile_mode = tile_mode; 209 209 nvbo->tile_flags = tile_flags; 210 210 nvbo->bo.bdev = &drm->ttm.bdev; 211 + nvbo->cli = cli; 211 212 212 213 if (!nvxx_device(&drm->device)->func->cpu_coherent) 213 214 nvbo->force_coherent = flags & TTM_PL_FLAG_UNCACHED;
+3 -1
drivers/gpu/drm/nouveau/nouveau_bo.h
··· 26 26 struct list_head vma_list; 27 27 unsigned page_shift; 28 28 29 + struct nouveau_cli *cli; 30 + 29 31 u32 tile_mode; 30 32 u32 tile_flags; 31 33 struct nouveau_drm_tile *tile; ··· 71 69 extern struct ttm_bo_driver nouveau_bo_driver; 72 70 73 71 void nouveau_bo_move_init(struct nouveau_drm *); 74 - int nouveau_bo_new(struct drm_device *, int size, int align, u32 flags, 72 + int nouveau_bo_new(struct nouveau_cli *, int size, int align, u32 flags, 75 73 u32 tile_mode, u32 tile_flags, struct sg_table *sg, 76 74 struct reservation_object *robj, 77 75 struct nouveau_bo **);
+1 -1
drivers/gpu/drm/nouveau/nouveau_chan.c
··· 113 113 if (nouveau_vram_pushbuf) 114 114 target = TTM_PL_FLAG_VRAM; 115 115 116 - ret = nouveau_bo_new(drm->dev, size, 0, target, 0, 0, NULL, NULL, 116 + ret = nouveau_bo_new(cli, size, 0, target, 0, 0, NULL, NULL, 117 117 &chan->push.buffer); 118 118 if (ret == 0) { 119 119 ret = nouveau_bo_pin(chan->push.buffer, target, false);
+1 -1
drivers/gpu/drm/nouveau/nouveau_gem.c
··· 194 194 if (domain & NOUVEAU_GEM_DOMAIN_COHERENT) 195 195 flags |= TTM_PL_FLAG_UNCACHED; 196 196 197 - ret = nouveau_bo_new(dev, size, align, flags, tile_mode, 197 + ret = nouveau_bo_new(&drm->client, size, align, flags, tile_mode, 198 198 tile_flags, NULL, NULL, pnvbo); 199 199 if (ret) 200 200 return ret;
+2 -1
drivers/gpu/drm/nouveau/nouveau_prime.c
··· 60 60 struct dma_buf_attachment *attach, 61 61 struct sg_table *sg) 62 62 { 63 + struct nouveau_drm *drm = nouveau_drm(dev); 63 64 struct nouveau_bo *nvbo; 64 65 struct reservation_object *robj = attach->dmabuf->resv; 65 66 u32 flags = 0; ··· 69 68 flags = TTM_PL_FLAG_TT; 70 69 71 70 ww_mutex_lock(&robj->lock, NULL); 72 - ret = nouveau_bo_new(dev, attach->dmabuf->size, 0, flags, 0, 0, 71 + ret = nouveau_bo_new(&drm->client, attach->dmabuf->size, 0, flags, 0, 0, 73 72 sg, robj, &nvbo); 74 73 ww_mutex_unlock(&robj->lock); 75 74 if (ret)
+1 -1
drivers/gpu/drm/nouveau/nv17_fence.c
··· 129 129 priv->base.context_base = dma_fence_context_alloc(priv->base.contexts); 130 130 spin_lock_init(&priv->lock); 131 131 132 - ret = nouveau_bo_new(drm->dev, 4096, 0x1000, TTM_PL_FLAG_VRAM, 132 + ret = nouveau_bo_new(&drm->client, 4096, 0x1000, TTM_PL_FLAG_VRAM, 133 133 0, 0x0000, NULL, NULL, &priv->bo); 134 134 if (!ret) { 135 135 ret = nouveau_bo_pin(priv->bo, TTM_PL_FLAG_VRAM, false);
+2 -2
drivers/gpu/drm/nouveau/nv50_display.c
··· 2428 2428 drm_crtc_helper_add(crtc, &nv50_head_help); 2429 2429 drm_mode_crtc_set_gamma_size(crtc, 256); 2430 2430 2431 - ret = nouveau_bo_new(dev, 8192, 0x100, TTM_PL_FLAG_VRAM, 2431 + ret = nouveau_bo_new(&drm->client, 8192, 0x100, TTM_PL_FLAG_VRAM, 2432 2432 0, 0x0000, NULL, NULL, &head->base.lut.nvbo); 2433 2433 if (!ret) { 2434 2434 ret = nouveau_bo_pin(head->base.lut.nvbo, TTM_PL_FLAG_VRAM, true); ··· 4451 4451 dev->driver->driver_features |= DRIVER_ATOMIC; 4452 4452 4453 4453 /* small shared memory area we use for notifiers and semaphores */ 4454 - ret = nouveau_bo_new(dev, 4096, 0x1000, TTM_PL_FLAG_VRAM, 4454 + ret = nouveau_bo_new(&drm->client, 4096, 0x1000, TTM_PL_FLAG_VRAM, 4455 4455 0, 0x0000, NULL, NULL, &disp->sync); 4456 4456 if (!ret) { 4457 4457 ret = nouveau_bo_pin(disp->sync, TTM_PL_FLAG_VRAM, true);
+1 -1
drivers/gpu/drm/nouveau/nv50_fence.c
··· 82 82 priv->base.context_base = dma_fence_context_alloc(priv->base.contexts); 83 83 spin_lock_init(&priv->lock); 84 84 85 - ret = nouveau_bo_new(drm->dev, 4096, 0x1000, TTM_PL_FLAG_VRAM, 85 + ret = nouveau_bo_new(&drm->client, 4096, 0x1000, TTM_PL_FLAG_VRAM, 86 86 0, 0x0000, NULL, NULL, &priv->bo); 87 87 if (!ret) { 88 88 ret = nouveau_bo_pin(priv->bo, TTM_PL_FLAG_VRAM, false);
+3 -3
drivers/gpu/drm/nouveau/nv84_fence.c
··· 219 219 * will lose CPU/GPU coherency! 220 220 */ 221 221 TTM_PL_FLAG_TT | TTM_PL_FLAG_UNCACHED; 222 - ret = nouveau_bo_new(drm->dev, 16 * priv->base.contexts, 0, domain, 0, 223 - 0, NULL, NULL, &priv->bo); 222 + ret = nouveau_bo_new(&drm->client, 16 * priv->base.contexts, 0, 223 + domain, 0, 0, NULL, NULL, &priv->bo); 224 224 if (ret == 0) { 225 225 ret = nouveau_bo_pin(priv->bo, domain, false); 226 226 if (ret == 0) { ··· 233 233 } 234 234 235 235 if (ret == 0) 236 - ret = nouveau_bo_new(drm->dev, 16 * priv->base.contexts, 0, 236 + ret = nouveau_bo_new(&drm->client, 16 * priv->base.contexts, 0, 237 237 TTM_PL_FLAG_TT | TTM_PL_FLAG_UNCACHED, 0, 238 238 0, NULL, NULL, &priv->bo_gart); 239 239 if (ret == 0) {