mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-01-02 13:30:17 +01:00
SetPageLocked only defined in 2.5.x (x=?), use LockPage for 2.4.x (x>=9).
Also apply build fixes from i810_dma.c to i830_dma.c
This commit is contained in:
parent
18d3fac990
commit
2febcafd66
4 changed files with 20 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue