patch-2.4.19 linux-2.4.19/drivers/char/drm/i810_dma.c

Next file: linux-2.4.19/drivers/char/drm/radeon_state.c
Previous file: linux-2.4.19/drivers/char/drm/drm_agpsupport.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/char/drm/i810_dma.c linux-2.4.19/drivers/char/drm/i810_dma.c
@@ -286,22 +286,20 @@
 	if(address == 0UL)
 		return 0;
 
-	atomic_inc(&virt_to_page(address)->count);
-	set_bit(PG_locked, &virt_to_page(address)->flags);
+	get_page(virt_to_page(address));
+	LockPage(virt_to_page(address));
 
 	return address;
 }
 
 static void i810_free_page(drm_device_t *dev, unsigned long page)
 {
-	if(page == 0UL)
-		return;
-
-	atomic_dec(&virt_to_page(page)->count);
-	clear_bit(PG_locked, &virt_to_page(page)->flags);
-	wake_up(&virt_to_page(page)->wait);
-	free_page(page);
-	return;
+	if (page) {
+		struct page *p = virt_to_page(page);
+		put_page(p);
+		UnlockPage(p);
+		free_page(page);
+	}
 }
 
 static int i810_dma_cleanup(drm_device_t *dev)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)