From ec3d489d5b70686359030dcca542ff979cfd50ff Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 28 Jan 2017 13:14:09 +1000 Subject: nvc0: copy engine surface params are only relevant for tiled surfaces Aside from reducing pushbuf usage in some situations, this commit should have no other effect, and is just to make it somewhat obvious that those methods have zero effect on linear surfaces. Signed-off-by: Ben Skeggs Acked-by: Ilia Mirkin --- src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c | 37 ++++++++++++------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c b/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c index 14fb53cb8f7..0b06236b3eb 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c @@ -128,33 +128,34 @@ nve4_m2mf_transfer_rect(struct nvc0_context *nvc0, exec = 0x200 /* 2D_ENABLE */ | 0x6 /* UNK */; - if (!nouveau_bo_memtype(dst->bo)) { + if (nouveau_bo_memtype(dst->bo)) { + BEGIN_NVC0(push, SUBC_COPY(0x070c), 6); + PUSH_DATA (push, 0x1000 | dst->tile_mode); + PUSH_DATA (push, dst->pitch); + PUSH_DATA (push, dst->height); + PUSH_DATA (push, dst->depth); + PUSH_DATA (push, dst->z); + PUSH_DATA (push, (dst->y << 16) | (dst->x * cpp)); + } else { assert(!dst->z); dst_base += dst->y * dst->pitch + dst->x * cpp; exec |= 0x100; /* DST_MODE_2D_LINEAR */ } - if (!nouveau_bo_memtype(src->bo)) { + + if (nouveau_bo_memtype(src->bo)) { + BEGIN_NVC0(push, SUBC_COPY(0x0728), 6); + PUSH_DATA (push, 0x1000 | src->tile_mode); + PUSH_DATA (push, src->pitch); + PUSH_DATA (push, src->height); + PUSH_DATA (push, src->depth); + PUSH_DATA (push, src->z); + PUSH_DATA (push, (src->y << 16) | (src->x * cpp)); + } else { assert(!src->z); src_base += src->y * src->pitch + src->x * cpp; exec |= 0x080; /* SRC_MODE_2D_LINEAR */ } - BEGIN_NVC0(push, SUBC_COPY(0x070c), 6); - PUSH_DATA (push, 0x1000 | dst->tile_mode); - PUSH_DATA (push, dst->pitch); - PUSH_DATA (push, dst->height); - PUSH_DATA (push, dst->depth); - PUSH_DATA (push, dst->z); - PUSH_DATA (push, (dst->y << 16) | (dst->x * cpp)); - - BEGIN_NVC0(push, SUBC_COPY(0x0728), 6); - PUSH_DATA (push, 0x1000 | src->tile_mode); - PUSH_DATA (push, src->pitch); - PUSH_DATA (push, src->height); - PUSH_DATA (push, src->depth); - PUSH_DATA (push, src->z); - PUSH_DATA (push, (src->y << 16) | (src->x * cpp)); - BEGIN_NVC0(push, SUBC_COPY(0x0400), 8); PUSH_DATAh(push, src->bo->offset + src_base); PUSH_DATA (push, src->bo->offset + src_base); -- cgit v1.2.3