summaryrefslogtreecommitdiff
path: root/shared-core/radeon_state.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2004-08-10 06:30:28 +0000
committerDave Airlie <airlied@linux.ie>2004-08-10 06:30:28 +0000
commitc9bcc4a6d90c0f2e9c712185a56727a55c11f4e0 (patch)
tree583fcc164c676b40f0fd63230d3965083a876859 /shared-core/radeon_state.c
parent67eae63e8947e06d7ee42d7e23796b8597e23d83 (diff)
dump: DRIVER_CTX_[CD]TOR, HAVE_KERNEL_CTX_SWITCH, DRIVER_BUF_PRIV_T,
DRIVER_AGP_BUFFERS_MAP
Diffstat (limited to 'shared-core/radeon_state.c')
-rw-r--r--shared-core/radeon_state.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c
index 659f9e9da..57274174d 100644
--- a/shared-core/radeon_state.c
+++ b/shared-core/radeon_state.c
@@ -1247,7 +1247,7 @@ static void radeon_cp_dispatch_indirect( drm_device_t *dev,
*/
if ( dwords & 1 ) {
u32 *data = (u32 *)
- ((char *)dev_priv->buffers->handle
+ ((char *)dev->agp_buffer_map->handle
+ buf->offset + start);
data[dwords++] = RADEON_CP_PACKET2;
}
@@ -1301,7 +1301,7 @@ static void radeon_cp_dispatch_indices( drm_device_t *dev,
dwords = (prim->finish - prim->start + 3) / sizeof(u32);
- data = (u32 *)((char *)dev_priv->buffers->handle +
+ data = (u32 *)((char *)dev->agp_buffer_map->handle +
elt_buf->offset + prim->start);
data[0] = CP_PACKET3( RADEON_3D_RNDR_GEN_INDX_PRIM, dwords-2 );
@@ -1445,7 +1445,7 @@ static int radeon_cp_dispatch_texture( DRMFILE filp,
/* Dispatch the indirect buffer.
*/
- buffer = (u32*)((char*)dev_priv->buffers->handle + buf->offset);
+ buffer = (u32*)((char*)dev->agp_buffer_map->handle + buf->offset);
dwords = size / 4;
buffer[0] = CP_PACKET3( RADEON_CNTL_HOSTDATA_BLT, dwords + 6 );
buffer[1] = (RADEON_GMC_DST_PITCH_OFFSET_CNTL |
@@ -2548,7 +2548,13 @@ int radeon_cp_setparam( DRM_IOCTL_ARGS ) {
return 0;
}
-static void radeon_driver_prerelease(drm_device_t *dev, DRMFILE *filp)
+/* When a client dies:
+ * - Check for and clean up flipped page state
+ * - Free any alloced GART memory.
+ *
+ * DRM infrastructure takes care of reclaiming dma buffers.
+ */
+static void radeon_driver_prerelease(drm_device_t *dev, DRMFILE filp)
{
if ( dev->dev_private ) {
drm_radeon_private_t *dev_priv = dev->dev_private;
@@ -2576,6 +2582,7 @@ static void radeon_driver_open_helper(drm_device_t *dev, drm_file_t *filp_priv)
void radeon_driver_register_fns(struct drm_device *dev)
{
+ dev->dev_priv_size = sizeof(drm_radeon_buf_priv_t);
dev->fn_tbl.prerelease = radeon_driver_prerelease;
dev->fn_tbl.pretakedown = radeon_driver_pretakedown;
dev->fn_tbl.open_helper = radeon_driver_open_helper;