From: <ag...@ke...> - 2009-02-17 00:38:05
|
shared-core/r600_cp.c | 26 +++++++++++--------------- shared-core/radeon_cp.c | 6 +++++- 2 files changed, 16 insertions(+), 16 deletions(-) New commits: commit 7d3f64a41daf464b428cf7caa13c1256e582be24 Author: Alex Deucher <ale...@gm...> Date: Mon Feb 16 19:27:19 2009 -0500 radeon: pad r6xx/r7xx ring submissions to 8 dwords diff --git a/shared-core/r600_cp.c b/shared-core/r600_cp.c index fbec531..d26f51f 100644 --- a/shared-core/r600_cp.c +++ b/shared-core/r600_cp.c @@ -2505,7 +2505,7 @@ void r600_do_cp_start(drm_radeon_private_t * dev_priv) RING_LOCALS; DRM_DEBUG("\n"); - BEGIN_RING(16); + BEGIN_RING(8); OUT_RING(CP_PACKET3(R600_IT_ME_INITIALIZE, 5)); OUT_RING(0x00000001); if (((dev_priv->flags & RADEON_FAMILY_MASK) < CHIP_RV770)) @@ -2516,15 +2516,7 @@ void r600_do_cp_start(drm_radeon_private_t * dev_priv) OUT_RING(R600_ME_INITIALIZE_DEVICE_ID(1)); OUT_RING(0x00000000); OUT_RING(0x00000000); - OUT_RING(CP_PACKET2()); //[NOP] - OUT_RING(CP_PACKET2()); //[NOP] - OUT_RING(CP_PACKET2()); //[NOP] - OUT_RING(CP_PACKET2()); //[NOP] - OUT_RING(CP_PACKET2()); //[NOP] - OUT_RING(CP_PACKET2()); //[NOP] - OUT_RING(CP_PACKET0(R600_SCRATCH_REG0, 1)); //[TYPE0] - OUT_RING(0x00000001); //[mmSCRATCH_REG0] - OUT_RING(0x00000000); //[mmSCRATCH_REG1] + OUT_RING(CP_PACKET2()); ADVANCE_RING(); COMMIT_RING(); @@ -2608,10 +2600,10 @@ int r600_cp_indirect(struct drm_device *dev, struct drm_buf *buf, drm_radeon_ind DRM_DEBUG("offset 0x%lx\n", offset); - /* Indirect buffer data must be modulo 4. + /* Indirect buffer data must be modulo 8. * pad the data with a Type-2 CP packet. */ - while (dwords & 3) { + while (dwords & 7) { u32 *data = (u32 *) ((char *)dev->agp_buffer_map->handle + buf->offset + start); @@ -2619,11 +2611,15 @@ int r600_cp_indirect(struct drm_device *dev, struct drm_buf *buf, drm_radeon_ind } /* Fire off the indirect buffer */ - BEGIN_RING(4); + BEGIN_RING(8); OUT_RING(CP_PACKET3(R600_IT_INDIRECT_BUFFER, 2)); OUT_RING((offset & 0xfffffffc)); OUT_RING((upper_32_bits(offset) & 0xff)); OUT_RING(dwords); + OUT_RING(CP_PACKET2()); + OUT_RING(CP_PACKET2()); + OUT_RING(CP_PACKET2()); + OUT_RING(CP_PACKET2()); ADVANCE_RING(); } if (indirect->discard) diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 70debbe..c18289b 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -494,7 +494,7 @@ int radeon_do_cp_idle(drm_radeon_private_t * dev_priv) DRM_DEBUG("\n"); if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) { - BEGIN_RING(6); + BEGIN_RING(8); OUT_RING(CP_PACKET3(R600_IT_EVENT_WRITE, 0)); OUT_RING(R600_CACHE_FLUSH_AND_INV_EVENT); @@ -502,7 +502,9 @@ int radeon_do_cp_idle(drm_radeon_private_t * dev_priv) OUT_RING(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); OUT_RING((R600_WAIT_UNTIL - R600_SET_CONFIG_REG_OFFSET) >> 2); OUT_RING(RADEON_WAIT_3D_IDLE | RADEON_WAIT_3D_IDLECLEAN); - OUT_RING(CP_PACKET2()); /* probably not needed */ + OUT_RING(CP_PACKET2()); + OUT_RING(CP_PACKET2()); + OUT_RING(CP_PACKET2()); } else { commit 4fa339c4806b50de7a0955563697895e916f4137 Author: Alex Deucher <ale...@gm...> Date: Mon Feb 16 19:11:38 2009 -0500 radeon: r6xx/r7xx cleanups - clean up some magic numbers - add padding to flush/idle in CP_IDLE ioctl (probably not needed) diff --git a/shared-core/r600_cp.c b/shared-core/r600_cp.c index c7cc13d..fbec531 100644 --- a/shared-core/r600_cp.c +++ b/shared-core/r600_cp.c @@ -2516,17 +2516,17 @@ void r600_do_cp_start(drm_radeon_private_t * dev_priv) OUT_RING(R600_ME_INITIALIZE_DEVICE_ID(1)); OUT_RING(0x00000000); OUT_RING(0x00000000); - OUT_RING(0x80000000); //[NOP] - OUT_RING(0x80000000); //[NOP] - OUT_RING(0x80000000); //[NOP] - OUT_RING(0x80000000); //[NOP] - OUT_RING(0x80000000); //[NOP] - OUT_RING(0x80000000); //[NOP] - OUT_RING(0x00012140); //[TYPE0] + OUT_RING(CP_PACKET2()); //[NOP] + OUT_RING(CP_PACKET2()); //[NOP] + OUT_RING(CP_PACKET2()); //[NOP] + OUT_RING(CP_PACKET2()); //[NOP] + OUT_RING(CP_PACKET2()); //[NOP] + OUT_RING(CP_PACKET2()); //[NOP] + OUT_RING(CP_PACKET0(R600_SCRATCH_REG0, 1)); //[TYPE0] OUT_RING(0x00000001); //[mmSCRATCH_REG0] OUT_RING(0x00000000); //[mmSCRATCH_REG1] ADVANCE_RING(); - R600_COMMIT_RING(); + COMMIT_RING(); /* set the mux and reset the halt bit */ cp_me = 0xff; @@ -2629,6 +2629,6 @@ int r600_cp_indirect(struct drm_device *dev, struct drm_buf *buf, drm_radeon_ind if (indirect->discard) r600_cp_discard_buffer(dev, buf); - R600_COMMIT_RING(); + COMMIT_RING(); return 0; } diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c index 89172e4..70debbe 100644 --- a/shared-core/radeon_cp.c +++ b/shared-core/radeon_cp.c @@ -494,13 +494,15 @@ int radeon_do_cp_idle(drm_radeon_private_t * dev_priv) DRM_DEBUG("\n"); if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) { - BEGIN_RING(5); + BEGIN_RING(6); + OUT_RING(CP_PACKET3(R600_IT_EVENT_WRITE, 0)); OUT_RING(R600_CACHE_FLUSH_AND_INV_EVENT); // wait for 3D idle clean OUT_RING(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); OUT_RING((R600_WAIT_UNTIL - R600_SET_CONFIG_REG_OFFSET) >> 2); OUT_RING(RADEON_WAIT_3D_IDLE | RADEON_WAIT_3D_IDLECLEAN); + OUT_RING(CP_PACKET2()); /* probably not needed */ } else { |