362
362
/* stitch together an VCE create msg */
363
363
ib.length_dw = 0;
364
ib.ptr[ib.length_dw++] = 0x0000000c; /* len */
365
ib.ptr[ib.length_dw++] = 0x00000001; /* session cmd */
366
ib.ptr[ib.length_dw++] = handle;
368
ib.ptr[ib.length_dw++] = 0x00000030; /* len */
369
ib.ptr[ib.length_dw++] = 0x01000001; /* create cmd */
370
ib.ptr[ib.length_dw++] = 0x00000000;
371
ib.ptr[ib.length_dw++] = 0x00000042;
372
ib.ptr[ib.length_dw++] = 0x0000000a;
373
ib.ptr[ib.length_dw++] = 0x00000001;
374
ib.ptr[ib.length_dw++] = 0x00000080;
375
ib.ptr[ib.length_dw++] = 0x00000060;
376
ib.ptr[ib.length_dw++] = 0x00000100;
377
ib.ptr[ib.length_dw++] = 0x00000100;
378
ib.ptr[ib.length_dw++] = 0x0000000c;
379
ib.ptr[ib.length_dw++] = 0x00000000;
381
ib.ptr[ib.length_dw++] = 0x00000014; /* len */
382
ib.ptr[ib.length_dw++] = 0x05000005; /* feedback buffer */
383
ib.ptr[ib.length_dw++] = upper_32_bits(dummy);
384
ib.ptr[ib.length_dw++] = dummy;
385
ib.ptr[ib.length_dw++] = 0x00000001;
364
ib.ptr[ib.length_dw++] = cpu_to_le32(0x0000000c); /* len */
365
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000001); /* session cmd */
366
ib.ptr[ib.length_dw++] = cpu_to_le32(handle);
368
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000030); /* len */
369
ib.ptr[ib.length_dw++] = cpu_to_le32(0x01000001); /* create cmd */
370
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000000);
371
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000042);
372
ib.ptr[ib.length_dw++] = cpu_to_le32(0x0000000a);
373
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000001);
374
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000080);
375
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000060);
376
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000100);
377
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000100);
378
ib.ptr[ib.length_dw++] = cpu_to_le32(0x0000000c);
379
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000000);
381
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000014); /* len */
382
ib.ptr[ib.length_dw++] = cpu_to_le32(0x05000005); /* feedback buffer */
383
ib.ptr[ib.length_dw++] = cpu_to_le32(upper_32_bits(dummy));
384
ib.ptr[ib.length_dw++] = cpu_to_le32(dummy);
385
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000001);
387
387
for (i = ib.length_dw; i < ib_size_dw; ++i)
388
ib.ptr[i] = cpu_to_le32(0x0);
390
390
r = radeon_ib_schedule(rdev, &ib, NULL, false);
429
429
/* stitch together an VCE destroy msg */
430
430
ib.length_dw = 0;
431
ib.ptr[ib.length_dw++] = 0x0000000c; /* len */
432
ib.ptr[ib.length_dw++] = 0x00000001; /* session cmd */
433
ib.ptr[ib.length_dw++] = handle;
435
ib.ptr[ib.length_dw++] = 0x00000014; /* len */
436
ib.ptr[ib.length_dw++] = 0x05000005; /* feedback buffer */
437
ib.ptr[ib.length_dw++] = upper_32_bits(dummy);
438
ib.ptr[ib.length_dw++] = dummy;
439
ib.ptr[ib.length_dw++] = 0x00000001;
441
ib.ptr[ib.length_dw++] = 0x00000008; /* len */
442
ib.ptr[ib.length_dw++] = 0x02000001; /* destroy cmd */
431
ib.ptr[ib.length_dw++] = cpu_to_le32(0x0000000c); /* len */
432
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000001); /* session cmd */
433
ib.ptr[ib.length_dw++] = cpu_to_le32(handle);
435
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000014); /* len */
436
ib.ptr[ib.length_dw++] = cpu_to_le32(0x05000005); /* feedback buffer */
437
ib.ptr[ib.length_dw++] = cpu_to_le32(upper_32_bits(dummy));
438
ib.ptr[ib.length_dw++] = cpu_to_le32(dummy);
439
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000001);
441
ib.ptr[ib.length_dw++] = cpu_to_le32(0x00000008); /* len */
442
ib.ptr[ib.length_dw++] = cpu_to_le32(0x02000001); /* destroy cmd */
444
444
for (i = ib.length_dw; i < ib_size_dw; ++i)
445
ib.ptr[i] = cpu_to_le32(0x0);
447
447
r = radeon_ib_schedule(rdev, &ib, NULL, false);
700
700
uint64_t addr = semaphore->gpu_addr;
702
radeon_ring_write(ring, VCE_CMD_SEMAPHORE);
703
radeon_ring_write(ring, (addr >> 3) & 0x000FFFFF);
704
radeon_ring_write(ring, (addr >> 23) & 0x000FFFFF);
705
radeon_ring_write(ring, 0x01003000 | (emit_wait ? 1 : 0));
702
radeon_ring_write(ring, cpu_to_le32(VCE_CMD_SEMAPHORE));
703
radeon_ring_write(ring, cpu_to_le32((addr >> 3) & 0x000FFFFF));
704
radeon_ring_write(ring, cpu_to_le32((addr >> 23) & 0x000FFFFF));
705
radeon_ring_write(ring, cpu_to_le32(0x01003000 | (emit_wait ? 1 : 0)));
707
radeon_ring_write(ring, VCE_CMD_END);
707
radeon_ring_write(ring, cpu_to_le32(VCE_CMD_END));
719
719
void radeon_vce_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib)
721
721
struct radeon_ring *ring = &rdev->ring[ib->ring];
722
radeon_ring_write(ring, VCE_CMD_IB);
723
radeon_ring_write(ring, ib->gpu_addr);
724
radeon_ring_write(ring, upper_32_bits(ib->gpu_addr));
725
radeon_ring_write(ring, ib->length_dw);
722
radeon_ring_write(ring, cpu_to_le32(VCE_CMD_IB));
723
radeon_ring_write(ring, cpu_to_le32(ib->gpu_addr));
724
radeon_ring_write(ring, cpu_to_le32(upper_32_bits(ib->gpu_addr)));
725
radeon_ring_write(ring, cpu_to_le32(ib->length_dw));
738
738
struct radeon_ring *ring = &rdev->ring[fence->ring];
739
739
uint64_t addr = rdev->fence_drv[fence->ring].gpu_addr;
741
radeon_ring_write(ring, VCE_CMD_FENCE);
742
radeon_ring_write(ring, addr);
743
radeon_ring_write(ring, upper_32_bits(addr));
744
radeon_ring_write(ring, fence->seq);
745
radeon_ring_write(ring, VCE_CMD_TRAP);
746
radeon_ring_write(ring, VCE_CMD_END);
741
radeon_ring_write(ring, cpu_to_le32(VCE_CMD_FENCE));
742
radeon_ring_write(ring, cpu_to_le32(addr));
743
radeon_ring_write(ring, cpu_to_le32(upper_32_bits(addr)));
744
radeon_ring_write(ring, cpu_to_le32(fence->seq));
745
radeon_ring_write(ring, cpu_to_le32(VCE_CMD_TRAP));
746
radeon_ring_write(ring, cpu_to_le32(VCE_CMD_END));