Path: blob/21.2-virgl/src/gallium/drivers/radeonsi/si_cp_dma.c
4570 views
/*1* Copyright 2013 Advanced Micro Devices, Inc.2* All Rights Reserved.3*4* Permission is hereby granted, free of charge, to any person obtaining a5* copy of this software and associated documentation files (the "Software"),6* to deal in the Software without restriction, including without limitation7* on the rights to use, copy, modify, merge, publish, distribute, sub8* license, and/or sell copies of the Software, and to permit persons to whom9* the Software is furnished to do so, subject to the following conditions:10*11* The above copyright notice and this permission notice (including the next12* paragraph) shall be included in all copies or substantial portions of the13* Software.14*15* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR16* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,17* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL18* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,19* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR20* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE21* USE OR OTHER DEALINGS IN THE SOFTWARE.22*/2324#include "si_pipe.h"25#include "sid.h"26#include "si_build_pm4.h"2728/* Set this if you want the ME to wait until CP DMA is done.29* It should be set on the last CP DMA packet. */30#define CP_DMA_SYNC (1 << 0)3132/* Set this if the source data was used as a destination in a previous CP DMA33* packet. It's for preventing a read-after-write (RAW) hazard between two34* CP DMA packets. */35#define CP_DMA_RAW_WAIT (1 << 1)36#define CP_DMA_DST_IS_GDS (1 << 2)37#define CP_DMA_CLEAR (1 << 3)38#define CP_DMA_PFP_SYNC_ME (1 << 4)39#define CP_DMA_SRC_IS_GDS (1 << 5)4041/* The max number of bytes that can be copied per packet. */42static inline unsigned cp_dma_max_byte_count(struct si_context *sctx)43{44unsigned max =45sctx->chip_class >= GFX9 ? S_415_BYTE_COUNT_GFX9(~0u) : S_415_BYTE_COUNT_GFX6(~0u);4647/* make it aligned for optimal performance */48return max & ~(SI_CPDMA_ALIGNMENT - 1);49}5051/* Emit a CP DMA packet to do a copy from one buffer to another, or to clear52* a buffer. The size must fit in bits [20:0]. If CP_DMA_CLEAR is set, src_va is a 32-bit53* clear value.54*/55static void si_emit_cp_dma(struct si_context *sctx, struct radeon_cmdbuf *cs, uint64_t dst_va,56uint64_t src_va, unsigned size, unsigned flags,57enum si_cache_policy cache_policy)58{59uint32_t header = 0, command = 0;6061assert(size <= cp_dma_max_byte_count(sctx));62assert(sctx->chip_class != GFX6 || cache_policy == L2_BYPASS);6364if (sctx->chip_class >= GFX9)65command |= S_415_BYTE_COUNT_GFX9(size);66else67command |= S_415_BYTE_COUNT_GFX6(size);6869/* Sync flags. */70if (flags & CP_DMA_SYNC)71header |= S_411_CP_SYNC(1);7273if (flags & CP_DMA_RAW_WAIT)74command |= S_415_RAW_WAIT(1);7576/* Src and dst flags. */77if (sctx->chip_class >= GFX9 && !(flags & CP_DMA_CLEAR) && src_va == dst_va) {78header |= S_411_DST_SEL(V_411_NOWHERE); /* prefetch only */79} else if (flags & CP_DMA_DST_IS_GDS) {80header |= S_411_DST_SEL(V_411_GDS);81/* GDS increments the address, not CP. */82command |= S_415_DAS(V_415_REGISTER) | S_415_DAIC(V_415_NO_INCREMENT);83} else if (sctx->chip_class >= GFX7 && cache_policy != L2_BYPASS) {84header |=85S_411_DST_SEL(V_411_DST_ADDR_TC_L2) | S_500_DST_CACHE_POLICY(cache_policy == L2_STREAM);86}8788if (flags & CP_DMA_CLEAR) {89header |= S_411_SRC_SEL(V_411_DATA);90} else if (flags & CP_DMA_SRC_IS_GDS) {91header |= S_411_SRC_SEL(V_411_GDS);92/* Both of these are required for GDS. It does increment the address. */93command |= S_415_SAS(V_415_REGISTER) | S_415_SAIC(V_415_NO_INCREMENT);94} else if (sctx->chip_class >= GFX7 && cache_policy != L2_BYPASS) {95header |=96S_411_SRC_SEL(V_411_SRC_ADDR_TC_L2) | S_500_SRC_CACHE_POLICY(cache_policy == L2_STREAM);97}9899radeon_begin(cs);100101if (sctx->chip_class >= GFX7) {102radeon_emit(cs, PKT3(PKT3_DMA_DATA, 5, 0));103radeon_emit(cs, header);104radeon_emit(cs, src_va); /* SRC_ADDR_LO [31:0] */105radeon_emit(cs, src_va >> 32); /* SRC_ADDR_HI [31:0] */106radeon_emit(cs, dst_va); /* DST_ADDR_LO [31:0] */107radeon_emit(cs, dst_va >> 32); /* DST_ADDR_HI [31:0] */108radeon_emit(cs, command);109} else {110header |= S_411_SRC_ADDR_HI(src_va >> 32);111112radeon_emit(cs, PKT3(PKT3_CP_DMA, 4, 0));113radeon_emit(cs, src_va); /* SRC_ADDR_LO [31:0] */114radeon_emit(cs, header); /* SRC_ADDR_HI [15:0] + flags. */115radeon_emit(cs, dst_va); /* DST_ADDR_LO [31:0] */116radeon_emit(cs, (dst_va >> 32) & 0xffff); /* DST_ADDR_HI [15:0] */117radeon_emit(cs, command);118}119120/* CP DMA is executed in ME, but index buffers are read by PFP.121* This ensures that ME (CP DMA) is idle before PFP starts fetching122* indices. If we wanted to execute CP DMA in PFP, this packet123* should precede it.124*/125if (sctx->has_graphics && flags & CP_DMA_PFP_SYNC_ME) {126radeon_emit(cs, PKT3(PKT3_PFP_SYNC_ME, 0, 0));127radeon_emit(cs, 0);128}129radeon_end();130}131132void si_cp_dma_wait_for_idle(struct si_context *sctx, struct radeon_cmdbuf *cs)133{134/* Issue a dummy DMA that copies zero bytes.135*136* The DMA engine will see that there's no work to do and skip this137* DMA request, however, the CP will see the sync flag and still wait138* for all DMAs to complete.139*/140si_emit_cp_dma(sctx, cs, 0, 0, 0, CP_DMA_SYNC, L2_BYPASS);141}142143static void si_cp_dma_prepare(struct si_context *sctx, struct pipe_resource *dst,144struct pipe_resource *src, unsigned byte_count,145uint64_t remaining_size, unsigned user_flags, enum si_coherency coher,146bool *is_first, unsigned *packet_flags)147{148/* Count memory usage in so that need_cs_space can take it into account. */149if (dst)150si_context_add_resource_size(sctx, dst);151if (src)152si_context_add_resource_size(sctx, src);153154if (!(user_flags & SI_OP_CPDMA_SKIP_CHECK_CS_SPACE))155si_need_gfx_cs_space(sctx, 0);156157/* This must be done after need_cs_space. */158if (dst)159radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, si_resource(dst), RADEON_USAGE_WRITE,160RADEON_PRIO_CP_DMA);161if (src)162radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, si_resource(src), RADEON_USAGE_READ,163RADEON_PRIO_CP_DMA);164165/* Flush the caches for the first copy only.166* Also wait for the previous CP DMA operations.167*/168if (*is_first && sctx->flags)169sctx->emit_cache_flush(sctx, &sctx->gfx_cs);170171if (user_flags & SI_OP_SYNC_CPDMA_BEFORE && *is_first && !(*packet_flags & CP_DMA_CLEAR))172*packet_flags |= CP_DMA_RAW_WAIT;173174*is_first = false;175176/* Do the synchronization after the last dma, so that all data177* is written to memory.178*/179if (user_flags & SI_OP_SYNC_AFTER && byte_count == remaining_size) {180*packet_flags |= CP_DMA_SYNC;181182if (coher == SI_COHERENCY_SHADER)183*packet_flags |= CP_DMA_PFP_SYNC_ME;184}185}186187void si_cp_dma_clear_buffer(struct si_context *sctx, struct radeon_cmdbuf *cs,188struct pipe_resource *dst, uint64_t offset, uint64_t size,189unsigned value, unsigned user_flags, enum si_coherency coher,190enum si_cache_policy cache_policy)191{192struct si_resource *sdst = si_resource(dst);193uint64_t va = (sdst ? sdst->gpu_address : 0) + offset;194bool is_first = true;195196assert(size && size % 4 == 0);197198if (user_flags & SI_OP_SYNC_CS_BEFORE)199sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH | SI_CONTEXT_PFP_SYNC_ME;200201if (user_flags & SI_OP_SYNC_PS_BEFORE)202sctx->flags |= SI_CONTEXT_PS_PARTIAL_FLUSH | SI_CONTEXT_PFP_SYNC_ME;203204/* Mark the buffer range of destination as valid (initialized),205* so that transfer_map knows it should wait for the GPU when mapping206* that range. */207if (sdst) {208util_range_add(dst, &sdst->valid_buffer_range, offset, offset + size);209210if (!(user_flags & SI_OP_SKIP_CACHE_INV_BEFORE))211sctx->flags |= si_get_flush_flags(sctx, coher, cache_policy);212}213214while (size) {215unsigned byte_count = MIN2(size, cp_dma_max_byte_count(sctx));216unsigned dma_flags = CP_DMA_CLEAR | (sdst ? 0 : CP_DMA_DST_IS_GDS);217218si_cp_dma_prepare(sctx, dst, NULL, byte_count, size, user_flags, coher, &is_first,219&dma_flags);220221/* Emit the clear packet. */222si_emit_cp_dma(sctx, cs, va, value, byte_count, dma_flags, cache_policy);223224size -= byte_count;225va += byte_count;226}227228if (sdst && cache_policy != L2_BYPASS)229sdst->TC_L2_dirty = true;230231/* If it's not a framebuffer fast clear... */232if (coher == SI_COHERENCY_SHADER) {233sctx->num_cp_dma_calls++;234si_prim_discard_signal_next_compute_ib_start(sctx);235}236}237238/**239* Realign the CP DMA engine. This must be done after a copy with an unaligned240* size.241*242* \param size Remaining size to the CP DMA alignment.243*/244static void si_cp_dma_realign_engine(struct si_context *sctx, unsigned size, unsigned user_flags,245enum si_coherency coher, enum si_cache_policy cache_policy,246bool *is_first)247{248uint64_t va;249unsigned dma_flags = 0;250unsigned scratch_size = SI_CPDMA_ALIGNMENT * 2;251252assert(size < SI_CPDMA_ALIGNMENT);253254/* Use the scratch buffer as the dummy buffer. The 3D engine should be255* idle at this point.256*/257if (!sctx->scratch_buffer || sctx->scratch_buffer->b.b.width0 < scratch_size) {258si_resource_reference(&sctx->scratch_buffer, NULL);259sctx->scratch_buffer = si_aligned_buffer_create(&sctx->screen->b,260SI_RESOURCE_FLAG_UNMAPPABLE | SI_RESOURCE_FLAG_DRIVER_INTERNAL,261PIPE_USAGE_DEFAULT, scratch_size, 256);262if (!sctx->scratch_buffer)263return;264265si_mark_atom_dirty(sctx, &sctx->atoms.s.scratch_state);266}267268si_cp_dma_prepare(sctx, &sctx->scratch_buffer->b.b, &sctx->scratch_buffer->b.b, size, size,269user_flags, coher, is_first, &dma_flags);270271va = sctx->scratch_buffer->gpu_address;272si_emit_cp_dma(sctx, &sctx->gfx_cs, va, va + SI_CPDMA_ALIGNMENT, size, dma_flags, cache_policy);273}274275/**276* Do memcpy between buffers using CP DMA.277* If src or dst is NULL, it means read or write GDS, respectively.278*279* \param user_flags bitmask of SI_CPDMA_*280*/281void si_cp_dma_copy_buffer(struct si_context *sctx, struct pipe_resource *dst,282struct pipe_resource *src, uint64_t dst_offset, uint64_t src_offset,283unsigned size, unsigned user_flags, enum si_coherency coher,284enum si_cache_policy cache_policy)285{286uint64_t main_dst_offset, main_src_offset;287unsigned skipped_size = 0;288unsigned realign_size = 0;289unsigned gds_flags = (dst ? 0 : CP_DMA_DST_IS_GDS) | (src ? 0 : CP_DMA_SRC_IS_GDS);290bool is_first = true;291292assert(size);293294if (dst) {295/* Skip this for the L2 prefetch. */296if (dst != src || dst_offset != src_offset) {297/* Mark the buffer range of destination as valid (initialized),298* so that transfer_map knows it should wait for the GPU when mapping299* that range. */300util_range_add(dst, &si_resource(dst)->valid_buffer_range, dst_offset, dst_offset + size);301}302303dst_offset += si_resource(dst)->gpu_address;304}305if (src)306src_offset += si_resource(src)->gpu_address;307308/* The workarounds aren't needed on Fiji and beyond. */309if (sctx->family <= CHIP_CARRIZO || sctx->family == CHIP_STONEY) {310/* If the size is not aligned, we must add a dummy copy at the end311* just to align the internal counter. Otherwise, the DMA engine312* would slow down by an order of magnitude for following copies.313*/314if (size % SI_CPDMA_ALIGNMENT)315realign_size = SI_CPDMA_ALIGNMENT - (size % SI_CPDMA_ALIGNMENT);316317/* If the copy begins unaligned, we must start copying from the next318* aligned block and the skipped part should be copied after everything319* else has been copied. Only the src alignment matters, not dst.320*321* GDS doesn't need the source address to be aligned.322*/323if (src && src_offset % SI_CPDMA_ALIGNMENT) {324skipped_size = SI_CPDMA_ALIGNMENT - (src_offset % SI_CPDMA_ALIGNMENT);325/* The main part will be skipped if the size is too small. */326skipped_size = MIN2(skipped_size, size);327size -= skipped_size;328}329}330331/* TMZ handling */332if (unlikely(radeon_uses_secure_bos(sctx->ws))) {333bool secure = src && (si_resource(src)->flags & RADEON_FLAG_ENCRYPTED);334assert(!secure || (!dst || (si_resource(dst)->flags & RADEON_FLAG_ENCRYPTED)));335if (secure != sctx->ws->cs_is_secure(&sctx->gfx_cs)) {336si_flush_gfx_cs(sctx, RADEON_FLUSH_ASYNC_START_NEXT_GFX_IB_NOW |337RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION, NULL);338}339}340341if (user_flags & SI_OP_SYNC_CS_BEFORE)342sctx->flags |= SI_CONTEXT_CS_PARTIAL_FLUSH | SI_CONTEXT_PFP_SYNC_ME;343344if (user_flags & SI_OP_SYNC_PS_BEFORE)345sctx->flags |= SI_CONTEXT_PS_PARTIAL_FLUSH | SI_CONTEXT_PFP_SYNC_ME;346347if ((dst || src) && !(user_flags & SI_OP_SKIP_CACHE_INV_BEFORE))348sctx->flags |= si_get_flush_flags(sctx, coher, cache_policy);349350/* This is the main part doing the copying. Src is always aligned. */351main_dst_offset = dst_offset + skipped_size;352main_src_offset = src_offset + skipped_size;353354while (size) {355unsigned byte_count = MIN2(size, cp_dma_max_byte_count(sctx));356unsigned dma_flags = gds_flags;357358si_cp_dma_prepare(sctx, dst, src, byte_count, size + skipped_size + realign_size, user_flags,359coher, &is_first, &dma_flags);360361si_emit_cp_dma(sctx, &sctx->gfx_cs, main_dst_offset, main_src_offset, byte_count, dma_flags,362cache_policy);363364size -= byte_count;365main_src_offset += byte_count;366main_dst_offset += byte_count;367}368369/* Copy the part we skipped because src wasn't aligned. */370if (skipped_size) {371unsigned dma_flags = gds_flags;372373si_cp_dma_prepare(sctx, dst, src, skipped_size, skipped_size + realign_size, user_flags,374coher, &is_first, &dma_flags);375376si_emit_cp_dma(sctx, &sctx->gfx_cs, dst_offset, src_offset, skipped_size, dma_flags,377cache_policy);378}379380/* Finally, realign the engine if the size wasn't aligned. */381if (realign_size) {382si_cp_dma_realign_engine(sctx, realign_size, user_flags, coher, cache_policy, &is_first);383}384385if (dst && cache_policy != L2_BYPASS)386si_resource(dst)->TC_L2_dirty = true;387388/* If it's not a prefetch or GDS copy... */389if (dst && src && (dst != src || dst_offset != src_offset)) {390sctx->num_cp_dma_calls++;391si_prim_discard_signal_next_compute_ib_start(sctx);392}393}394395void si_cp_dma_prefetch(struct si_context *sctx, struct pipe_resource *buf,396unsigned offset, unsigned size)397{398uint64_t address = si_resource(buf)->gpu_address + offset;399400assert(sctx->chip_class >= GFX7);401402/* The prefetch address and size must be aligned, so that we don't have to apply403* the complicated hw bug workaround.404*405* The size should also be less than 2 MB, so that we don't have to use a loop.406* Callers shouldn't need to prefetch more than 2 MB.407*/408assert(size % SI_CPDMA_ALIGNMENT == 0);409assert(address % SI_CPDMA_ALIGNMENT == 0);410assert(size < S_415_BYTE_COUNT_GFX6(~0u));411412uint32_t header = S_411_SRC_SEL(V_411_SRC_ADDR_TC_L2);413uint32_t command = S_415_BYTE_COUNT_GFX6(size);414415if (sctx->chip_class >= GFX9) {416command |= S_415_DISABLE_WR_CONFIRM_GFX9(1);417header |= S_411_DST_SEL(V_411_NOWHERE);418} else {419command |= S_415_DISABLE_WR_CONFIRM_GFX6(1);420header |= S_411_DST_SEL(V_411_DST_ADDR_TC_L2);421}422423struct radeon_cmdbuf *cs = &sctx->gfx_cs;424radeon_begin(cs);425radeon_emit(cs, PKT3(PKT3_DMA_DATA, 5, 0));426radeon_emit(cs, header);427radeon_emit(cs, address); /* SRC_ADDR_LO [31:0] */428radeon_emit(cs, address >> 32); /* SRC_ADDR_HI [31:0] */429radeon_emit(cs, address); /* DST_ADDR_LO [31:0] */430radeon_emit(cs, address >> 32); /* DST_ADDR_HI [31:0] */431radeon_emit(cs, command);432radeon_end();433}434435void si_test_gds(struct si_context *sctx)436{437struct pipe_context *ctx = &sctx->b;438struct pipe_resource *src, *dst;439unsigned r[4] = {};440unsigned offset = debug_get_num_option("OFFSET", 16);441442src = pipe_buffer_create(ctx->screen, 0, PIPE_USAGE_DEFAULT, 16);443dst = pipe_buffer_create(ctx->screen, 0, PIPE_USAGE_DEFAULT, 16);444si_cp_dma_clear_buffer(sctx, &sctx->gfx_cs, src, 0, 4, 0xabcdef01, SI_OP_SYNC_BEFORE_AFTER,445SI_COHERENCY_SHADER, L2_BYPASS);446si_cp_dma_clear_buffer(sctx, &sctx->gfx_cs, src, 4, 4, 0x23456789, SI_OP_SYNC_BEFORE_AFTER,447SI_COHERENCY_SHADER, L2_BYPASS);448si_cp_dma_clear_buffer(sctx, &sctx->gfx_cs, src, 8, 4, 0x87654321, SI_OP_SYNC_BEFORE_AFTER,449SI_COHERENCY_SHADER, L2_BYPASS);450si_cp_dma_clear_buffer(sctx, &sctx->gfx_cs, src, 12, 4, 0xfedcba98, SI_OP_SYNC_BEFORE_AFTER,451SI_COHERENCY_SHADER, L2_BYPASS);452si_cp_dma_clear_buffer(sctx, &sctx->gfx_cs, dst, 0, 16, 0xdeadbeef, SI_OP_SYNC_BEFORE_AFTER,453SI_COHERENCY_SHADER, L2_BYPASS);454455si_cp_dma_copy_buffer(sctx, NULL, src, offset, 0, 16, SI_OP_SYNC_BEFORE_AFTER,456SI_COHERENCY_NONE, L2_BYPASS);457si_cp_dma_copy_buffer(sctx, dst, NULL, 0, offset, 16, SI_OP_SYNC_BEFORE_AFTER,458SI_COHERENCY_NONE, L2_BYPASS);459460pipe_buffer_read(ctx, dst, 0, sizeof(r), r);461printf("GDS copy = %08x %08x %08x %08x -> %s\n", r[0], r[1], r[2], r[3],462r[0] == 0xabcdef01 && r[1] == 0x23456789 && r[2] == 0x87654321 && r[3] == 0xfedcba98463? "pass"464: "fail");465466si_cp_dma_clear_buffer(sctx, &sctx->gfx_cs, NULL, offset, 16, 0xc1ea4146,467SI_OP_SYNC_BEFORE_AFTER, SI_COHERENCY_NONE, L2_BYPASS);468si_cp_dma_copy_buffer(sctx, dst, NULL, 0, offset, 16, SI_OP_SYNC_BEFORE_AFTER,469SI_COHERENCY_NONE, L2_BYPASS);470471pipe_buffer_read(ctx, dst, 0, sizeof(r), r);472printf("GDS clear = %08x %08x %08x %08x -> %s\n", r[0], r[1], r[2], r[3],473r[0] == 0xc1ea4146 && r[1] == 0xc1ea4146 && r[2] == 0xc1ea4146 && r[3] == 0xc1ea4146474? "pass"475: "fail");476477pipe_resource_reference(&src, NULL);478pipe_resource_reference(&dst, NULL);479exit(0);480}481482void si_cp_write_data(struct si_context *sctx, struct si_resource *buf, unsigned offset,483unsigned size, unsigned dst_sel, unsigned engine, const void *data)484{485struct radeon_cmdbuf *cs = &sctx->gfx_cs;486487assert(offset % 4 == 0);488assert(size % 4 == 0);489490if (sctx->chip_class == GFX6 && dst_sel == V_370_MEM)491dst_sel = V_370_MEM_GRBM;492493radeon_add_to_buffer_list(sctx, cs, buf, RADEON_USAGE_WRITE, RADEON_PRIO_CP_DMA);494uint64_t va = buf->gpu_address + offset;495496radeon_begin(cs);497radeon_emit(cs, PKT3(PKT3_WRITE_DATA, 2 + size / 4, 0));498radeon_emit(cs, S_370_DST_SEL(dst_sel) | S_370_WR_CONFIRM(1) | S_370_ENGINE_SEL(engine));499radeon_emit(cs, va);500radeon_emit(cs, va >> 32);501radeon_emit_array(cs, (const uint32_t *)data, size / 4);502radeon_end();503}504505void si_cp_copy_data(struct si_context *sctx, struct radeon_cmdbuf *cs, unsigned dst_sel,506struct si_resource *dst, unsigned dst_offset, unsigned src_sel,507struct si_resource *src, unsigned src_offset)508{509/* cs can point to the compute IB, which has the buffer list in gfx_cs. */510if (dst) {511radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, dst, RADEON_USAGE_WRITE, RADEON_PRIO_CP_DMA);512}513if (src) {514radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, src, RADEON_USAGE_READ, RADEON_PRIO_CP_DMA);515}516517uint64_t dst_va = (dst ? dst->gpu_address : 0ull) + dst_offset;518uint64_t src_va = (src ? src->gpu_address : 0ull) + src_offset;519520radeon_begin(cs);521radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));522radeon_emit(cs, COPY_DATA_SRC_SEL(src_sel) | COPY_DATA_DST_SEL(dst_sel) | COPY_DATA_WR_CONFIRM);523radeon_emit(cs, src_va);524radeon_emit(cs, src_va >> 32);525radeon_emit(cs, dst_va);526radeon_emit(cs, dst_va >> 32);527radeon_end();528}529530531