18b9d5d63SBen Skeggs /*
28b9d5d63SBen Skeggs * Copyright 2007 Dave Airlied
38b9d5d63SBen Skeggs * All Rights Reserved.
48b9d5d63SBen Skeggs *
58b9d5d63SBen Skeggs * Permission is hereby granted, free of charge, to any person obtaining a
68b9d5d63SBen Skeggs * copy of this software and associated documentation files (the "Software"),
78b9d5d63SBen Skeggs * to deal in the Software without restriction, including without limitation
88b9d5d63SBen Skeggs * the rights to use, copy, modify, merge, publish, distribute, sublicense,
98b9d5d63SBen Skeggs * and/or sell copies of the Software, and to permit persons to whom the
108b9d5d63SBen Skeggs * Software is furnished to do so, subject to the following conditions:
118b9d5d63SBen Skeggs *
128b9d5d63SBen Skeggs * The above copyright notice and this permission notice (including the next
138b9d5d63SBen Skeggs * paragraph) shall be included in all copies or substantial portions of the
148b9d5d63SBen Skeggs * Software.
158b9d5d63SBen Skeggs *
168b9d5d63SBen Skeggs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
178b9d5d63SBen Skeggs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
188b9d5d63SBen Skeggs * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
198b9d5d63SBen Skeggs * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
208b9d5d63SBen Skeggs * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
218b9d5d63SBen Skeggs * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
228b9d5d63SBen Skeggs * OTHER DEALINGS IN THE SOFTWARE.
238b9d5d63SBen Skeggs */
248b9d5d63SBen Skeggs /*
258b9d5d63SBen Skeggs * Authors: Dave Airlied <airlied@linux.ie>
268b9d5d63SBen Skeggs * Ben Skeggs <darktama@iinet.net.au>
278b9d5d63SBen Skeggs * Jeremy Kolb <jkolb@brandeis.edu>
288b9d5d63SBen Skeggs */
298b9d5d63SBen Skeggs #include "nouveau_bo.h"
308b9d5d63SBen Skeggs #include "nouveau_dma.h"
318b9d5d63SBen Skeggs #include "nouveau_mem.h"
328b9d5d63SBen Skeggs
33fe4249afSBen Skeggs #include <nvif/push206e.h>
34fe4249afSBen Skeggs
358b9d5d63SBen Skeggs int
nv84_bo_move_exec(struct nouveau_channel * chan,struct ttm_buffer_object * bo,struct ttm_resource * old_reg,struct ttm_resource * new_reg)368b9d5d63SBen Skeggs nv84_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo,
37534b1f90SThomas Zimmermann struct ttm_resource *old_reg, struct ttm_resource *new_reg)
388b9d5d63SBen Skeggs {
398b9d5d63SBen Skeggs struct nouveau_mem *mem = nouveau_mem(old_reg);
40fe4249afSBen Skeggs struct nvif_push *push = chan->chan.push;
41fe4249afSBen Skeggs int ret;
42fe4249afSBen Skeggs
43fe4249afSBen Skeggs ret = PUSH_WAIT(push, 7);
44fe4249afSBen Skeggs if (ret)
458b9d5d63SBen Skeggs return ret;
46fe4249afSBen Skeggs
47*e3c92eb4SSomalapuram Amaranath PUSH_NVSQ(push, NV74C1, 0x0304, new_reg->size,
48fe4249afSBen Skeggs 0x0308, upper_32_bits(mem->vma[0].addr),
49fe4249afSBen Skeggs 0x030c, lower_32_bits(mem->vma[0].addr),
50fe4249afSBen Skeggs 0x0310, upper_32_bits(mem->vma[1].addr),
51fe4249afSBen Skeggs 0x0314, lower_32_bits(mem->vma[1].addr),
52fe4249afSBen Skeggs 0x0318, 0x00000000 /* MODE_COPY, QUERY_NONE */);
53fe4249afSBen Skeggs return 0;
548b9d5d63SBen Skeggs }
55