|
Lines 1002-1009
void* ATI_API_CALL __ke_high_memory(void
Link Here
|
| 1002 |
return high_memory; |
1002 |
return high_memory; |
| 1003 |
} |
1003 |
} |
| 1004 |
|
1004 |
|
|
|
1005 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) |
| 1006 |
/* Saved pci_dev pointer for the new agpgart API */ |
| 1007 |
static struct pci_dev *fglrx_pci_dev; |
| 1008 |
#endif |
| 1009 |
|
| 1005 |
int ATI_API_CALL __ke_pci_enable_device(__ke_pci_dev_t* dev) |
1010 |
int ATI_API_CALL __ke_pci_enable_device(__ke_pci_dev_t* dev) |
| 1006 |
{ |
1011 |
{ |
|
|
1012 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) |
| 1013 |
fglrx_pci_dev = (struct pci_dev *)dev; |
| 1014 |
#endif |
| 1007 |
return (pci_enable_device( (struct pci_dev*)(void *)dev )); |
1015 |
return (pci_enable_device( (struct pci_dev*)(void *)dev )); |
| 1008 |
} |
1016 |
} |
| 1009 |
|
1017 |
|
|
Lines 2865-2870
typedef struct {
Link Here
|
| 2865 |
int (*copy_info)(struct agp_kern_info *); |
2873 |
int (*copy_info)(struct agp_kern_info *); |
| 2866 |
} drm_agp_t; |
2874 |
} drm_agp_t; |
| 2867 |
|
2875 |
|
|
|
2876 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12) |
| 2877 |
/* |
| 2878 |
* Kernel 2.6.12 has new agpgart API with support for multiple AGP bridges, but |
| 2879 |
* the fglrx core does not know about this yet. For now, just emulate the old |
| 2880 |
* API. |
| 2881 |
*/ |
| 2882 |
|
| 2883 |
static struct agp_bridge_data *fglrx_agp_bridge; |
| 2884 |
|
| 2885 |
static int fglrx_compat_agp_backend_acquire(void) |
| 2886 |
{ |
| 2887 |
fglrx_agp_bridge = agp_backend_acquire(fglrx_pci_dev); |
| 2888 |
if (!fglrx_agp_bridge) |
| 2889 |
return -ENODEV; |
| 2890 |
return 0; |
| 2891 |
} |
| 2892 |
|
| 2893 |
static void fglrx_compat_agp_backend_release(void) |
| 2894 |
{ |
| 2895 |
agp_backend_release(fglrx_agp_bridge); |
| 2896 |
} |
| 2897 |
|
| 2898 |
static struct agp_memory *fglrx_compat_agp_allocate_memory(size_t page_count, |
| 2899 |
u32 type) |
| 2900 |
{ |
| 2901 |
return agp_allocate_memory(fglrx_agp_bridge, page_count, type); |
| 2902 |
} |
| 2903 |
|
| 2904 |
static void fglrx_compat_agp_enable(u32 mode) |
| 2905 |
{ |
| 2906 |
agp_enable(fglrx_agp_bridge, mode); |
| 2907 |
} |
| 2908 |
|
| 2909 |
static int fglrx_compat_agp_copy_info(struct agp_kern_info *info) |
| 2910 |
{ |
| 2911 |
if (!fglrx_agp_bridge) { |
| 2912 |
fglrx_agp_bridge = agp_find_bridge(fglrx_pci_dev); |
| 2913 |
if (!fglrx_agp_bridge) { |
| 2914 |
memset(info, 0, sizeof(struct agp_kern_info)); |
| 2915 |
info->chipset = NOT_SUPPORTED; |
| 2916 |
return -ENODEV; |
| 2917 |
} |
| 2918 |
} |
| 2919 |
return agp_copy_info(fglrx_agp_bridge, info); |
| 2920 |
} |
| 2921 |
|
| 2922 |
static const drm_agp_t drm_agp = { |
| 2923 |
&agp_free_memory, |
| 2924 |
&fglrx_compat_agp_allocate_memory, |
| 2925 |
&agp_bind_memory, |
| 2926 |
&agp_unbind_memory, |
| 2927 |
&fglrx_compat_agp_enable, |
| 2928 |
&fglrx_compat_agp_backend_acquire, |
| 2929 |
&fglrx_compat_agp_backend_release, |
| 2930 |
&fglrx_compat_agp_copy_info |
| 2931 |
}; |
| 2932 |
|
| 2933 |
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) */ |
| 2934 |
/* |
| 2935 |
* For 2.6.11 we can just use the agpgart functions directly. |
| 2936 |
*/ |
| 2937 |
|
| 2868 |
static const drm_agp_t drm_agp = { |
2938 |
static const drm_agp_t drm_agp = { |
| 2869 |
&agp_free_memory, |
2939 |
&agp_free_memory, |
| 2870 |
&agp_allocate_memory, |
2940 |
&agp_allocate_memory, |
|
Lines 2875-2880
static const drm_agp_t drm_agp = {
Link Here
|
| 2875 |
&agp_backend_release, |
2945 |
&agp_backend_release, |
| 2876 |
&agp_copy_info |
2946 |
&agp_copy_info |
| 2877 |
}; |
2947 |
}; |
|
|
2948 |
|
| 2949 |
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) */ |
| 2950 |
|
| 2878 |
#undef DRM_AGP_MODULE_GET |
2951 |
#undef DRM_AGP_MODULE_GET |
| 2879 |
#undef DRM_AGP_MODULE_PUT |
2952 |
#undef DRM_AGP_MODULE_PUT |
| 2880 |
|
2953 |
|