summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2017-01-28 13:14:09 +1000
committerIlia Mirkin <[email protected]>2017-06-20 20:18:54 -0400
commitec3d489d5b70686359030dcca542ff979cfd50ff (patch)
tree8c9eda163d800ac1788abb69b4bbf6c91aa2f515 /src/gallium
parent72c8c684582095fffb45457ab6bcc73742a871c4 (diff)
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 <[email protected]> Acked-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c37
1 files changed, 19 insertions, 18 deletions
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);