From 2febcafd66adfe0728f93e4b9b2954d793f71459 Mon Sep 17 00:00:00 2001 From: Leif Delgass Date: Thu, 22 Aug 2002 18:43:39 +0000 Subject: =?UTF-8?q?SetPageLocked=20only=20defined=20in=202.5.x=20(x=3D=3F)?= =?UTF-8?q?,=20use=20LockPage=20for=202.4.x=20(x>=3D9).=20=20=20=20=20Also?= =?UTF-8?q?=20apply=20build=20fixes=20from=20i810=5Fdma.c=20to=20i830=5Fdm?= =?UTF-8?q?a.c?= --- linux/i810_dma.c | 4 ++++ linux/i830_dma.c | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'linux') diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 79ea3baf..f4eef3a3 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -276,7 +276,11 @@ static unsigned long i810_alloc_page(drm_device_t *dev) set_bit(PG_locked, &virt_to_page(address)->flags); #else get_page(virt_to_page(address)); +#if LINUX_VERSION_CODE < 0x020500 + LockPage(virt_to_page(address)); +#else SetPageLocked(virt_to_page(address)); +#endif #endif return address; } diff --git a/linux/i830_dma.c b/linux/i830_dma.c index 34a9c2e3..643259fc 100644 --- a/linux/i830_dma.c +++ b/linux/i830_dma.c @@ -303,12 +303,16 @@ static unsigned long i830_alloc_page(drm_device_t *dev) if(address == 0UL) return 0; -#if LINUX_VERSION_CODE < 0x020500 +#if LINUX_VERSION_CODE < 0x020409 atomic_inc(&virt_to_page(address)->count); set_bit(PG_locked, &virt_to_page(address)->flags); #else get_page(virt_to_page(address)); +#if LINUX_VERSION_CODE < 0x020500 + LockPage(virt_to_page(address)); +#else SetPageLocked(virt_to_page(address)); +#endif #endif return address; } @@ -316,7 +320,7 @@ static unsigned long i830_alloc_page(drm_device_t *dev) static void i830_free_page(drm_device_t *dev, unsigned long page) { if (page) { -#if LINUX_VERSION_CODE < 0x020500 +#if LINUX_VERSION_CODE < 0x020409 atomic_dec(&virt_to_page(page)->count); clear_bit(PG_locked, &virt_to_page(page)->flags); wake_up(&virt_to_page(page)->wait); -- cgit v1.2.3