- OUT_RELOCh(chan, bo, offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
- OUT_RELOCl(chan, bo, offset, NOUVEAU_BO_VRAM | NOUVEAU_BO_RDWR);
- OUT_RING (chan, sf->width);
- OUT_RING (chan, sf->height);
- OUT_RING (chan, nvc0_format_table[sf->base.format].rt);
- OUT_RING (chan, (mt->layout_3d << 16) |
- mt->level[sf->base.u.tex.level].tile_mode);
- OUT_RING (chan, sf->base.u.tex.first_layer + sf->depth);
- OUT_RING (chan, mt->layer_stride >> 2);
- OUT_RING (chan, sf->base.u.tex.first_layer);
-
- ms_mode = mt->ms_mode;
-
- if (mt->base.status & NOUVEAU_BUFFER_STATUS_GPU_READING)
+ OUT_RELOCh(chan, res->bo, offset, res->domain | NOUVEAU_BO_RDWR);
+ OUT_RELOCl(chan, res->bo, offset, res->domain | NOUVEAU_BO_RDWR);
+ if (likely(nouveau_bo_tile_layout(bo))) {
+ struct nv50_miptree *mt = nv50_miptree(sf->base.texture);
+
+ assert(sf->base.texture->target != PIPE_BUFFER);
+
+ OUT_RING(chan, sf->width);
+ OUT_RING(chan, sf->height);
+ OUT_RING(chan, nvc0_format_table[sf->base.format].rt);
+ OUT_RING(chan, (mt->layout_3d << 16) |
+ mt->level[sf->base.u.tex.level].tile_mode);
+ OUT_RING(chan, sf->base.u.tex.first_layer + sf->depth);
+ OUT_RING(chan, mt->layer_stride >> 2);
+ OUT_RING(chan, sf->base.u.tex.first_layer);
+
+ ms_mode = mt->ms_mode;
+ } else {
+ if (res->base.target == PIPE_BUFFER) {
+ OUT_RING(chan, 262144);
+ OUT_RING(chan, 1);
+ } else {
+ OUT_RING(chan, nv50_miptree(sf->base.texture)->level[0].pitch);
+ OUT_RING(chan, sf->height);
+ }
+ OUT_RING(chan, nvc0_format_table[sf->base.format].rt);
+ OUT_RING(chan, 1 << 12);
+ OUT_RING(chan, 1);
+ OUT_RING(chan, 0);
+ OUT_RING(chan, 0);
+
+ nvc0_resource_fence(res, NOUVEAU_BO_WR);
+
+ assert(!fb->zsbuf);
+ }
+
+ if (res->status & NOUVEAU_BUFFER_STATUS_GPU_READING)