summaryrefslogtreecommitdiff
path: root/src/nv50_exa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nv50_exa.c')
-rw-r--r--src/nv50_exa.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/nv50_exa.c b/src/nv50_exa.c
index 6529e74..7c670d4 100644
--- a/src/nv50_exa.c
+++ b/src/nv50_exa.c
@@ -998,13 +998,13 @@ NV50EXADoneComposite(PixmapPtr pdpix)
Bool
NV50EXARectM2MF(NVPtr pNv, int w, int h, int cpp,
- struct nouveau_bo *src, int src_dom, int src_pitch,
- int src_h, int src_x, int src_y, struct nouveau_bo *dst,
- int dst_dom, int dst_pitch, int dst_h, int dst_x, int dst_y)
+ struct nouveau_bo *src, uint32_t src_off, int src_dom,
+ int src_pitch, int src_h, int src_x, int src_y,
+ struct nouveau_bo *dst, uint32_t dst_off, int dst_dom,
+ int dst_pitch, int dst_h, int dst_x, int dst_y)
{
struct nouveau_grobj *m2mf = pNv->NvMemFormat;
struct nouveau_channel *chan = m2mf->channel;
- unsigned src_off = 0, dst_off = 0;
if (src->tile_flags & NOUVEAU_BO_TILE_LAYOUT_MASK) {
BEGIN_NV04(chan, NV50_M2MF(LINEAR_IN), 6);
@@ -1019,6 +1019,7 @@ NV50EXARectM2MF(NVPtr pNv, int w, int h, int cpp,
OUT_RING (chan, 1);
BEGIN_NV04(chan, NV03_M2MF(PITCH_IN), 1);
OUT_RING (chan, src_pitch);
+ src_off += src_y * src_pitch + src_x * cpp;
}
if (dst->tile_flags & NOUVEAU_BO_TILE_LAYOUT_MASK) {
@@ -1034,6 +1035,7 @@ NV50EXARectM2MF(NVPtr pNv, int w, int h, int cpp,
OUT_RING (chan, 1);
BEGIN_NV04(chan, NV03_M2MF(PITCH_OUT), 1);
OUT_RING (chan, dst_pitch);
+ dst_off += dst_y * dst_pitch + dst_x * cpp;
}
while (h) {
@@ -1044,20 +1046,6 @@ NV50EXARectM2MF(NVPtr pNv, int w, int h, int cpp,
if (MARK_RING (chan, 32, 4))
return FALSE;
- if (src->tile_flags & NOUVEAU_BO_TILE_LAYOUT_MASK) {
- BEGIN_NV04(chan, NV50_M2MF(TILING_POSITION_IN), 1);
- OUT_RING (chan, (src_y << 16) | (src_x * cpp));
- } else {
- src_off = src_y * src_pitch + src_x * cpp;
- }
-
- if (dst->tile_flags & NOUVEAU_BO_TILE_LAYOUT_MASK) {
- BEGIN_NV04(chan, NV50_M2MF(TILING_POSITION_OUT), 1);
- OUT_RING (chan, (dst_y << 16) | (dst_x * cpp));
- } else {
- dst_off = dst_y * dst_pitch + dst_x * cpp;
- }
-
BEGIN_NV04(chan, NV50_M2MF(OFFSET_IN_HIGH), 2);
if (OUT_RELOCh(chan, src, src_off, src_dom | NOUVEAU_BO_RD) ||
OUT_RELOCh(chan, dst, dst_off, dst_dom | NOUVEAU_BO_WR)) {
@@ -1072,6 +1060,20 @@ NV50EXARectM2MF(NVPtr pNv, int w, int h, int cpp,
return FALSE;
}
+ if (src->tile_flags & NOUVEAU_BO_TILE_LAYOUT_MASK) {
+ BEGIN_NV04(chan, NV50_M2MF(TILING_POSITION_IN), 1);
+ OUT_RING (chan, (src_y << 16) | (src_x * cpp));
+ } else {
+ src_off += line_count * src_pitch;
+ }
+
+ if (dst->tile_flags & NOUVEAU_BO_TILE_LAYOUT_MASK) {
+ BEGIN_NV04(chan, NV50_M2MF(TILING_POSITION_OUT), 1);
+ OUT_RING (chan, (dst_y << 16) | (dst_x * cpp));
+ } else {
+ dst_off += line_count * dst_pitch;
+ }
+
BEGIN_NV04(chan, NV03_M2MF(LINE_LENGTH_IN), 4);
OUT_RING (chan, w * cpp);
OUT_RING (chan, line_count);