Magellan Linux

Annotation of /trunk/ati-drivers/patches/fglrx-8.14.13-alt-2.6.12-agp.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 144 - (hide annotations) (download)
Tue May 8 20:06:05 2007 UTC (17 years ago) by niro
File size: 2586 byte(s)
-import

1 niro 144 --- build_mod/firegl_public.c.alt-2.6.12-agp 2005-06-26 19:35:34 +0400
2     +++ build_mod/firegl_public.c 2005-06-26 19:41:28 +0400
3     @@ -1002,8 +1002,16 @@ void* ATI_API_CALL __ke_high_memory(void
4     return high_memory;
5     }
6    
7     +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
8     +/* Saved pci_dev pointer for the new agpgart API */
9     +static struct pci_dev *fglrx_pci_dev;
10     +#endif
11     +
12     int ATI_API_CALL __ke_pci_enable_device(__ke_pci_dev_t* dev)
13     {
14     +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
15     + fglrx_pci_dev = (struct pci_dev *)dev;
16     +#endif
17     return (pci_enable_device( (struct pci_dev*)(void *)dev ));
18     }
19    
20     @@ -2865,6 +2873,68 @@ typedef struct {
21     int (*copy_info)(struct agp_kern_info *);
22     } drm_agp_t;
23    
24     +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
25     +/*
26     + * Kernel 2.6.12 has new agpgart API with support for multiple AGP bridges, but
27     + * the fglrx core does not know about this yet. For now, just emulate the old
28     + * API.
29     + */
30     +
31     +static struct agp_bridge_data *fglrx_agp_bridge;
32     +
33     +static int fglrx_compat_agp_backend_acquire(void)
34     +{
35     + fglrx_agp_bridge = agp_backend_acquire(fglrx_pci_dev);
36     + if (!fglrx_agp_bridge)
37     + return -ENODEV;
38     + return 0;
39     +}
40     +
41     +static void fglrx_compat_agp_backend_release(void)
42     +{
43     + agp_backend_release(fglrx_agp_bridge);
44     +}
45     +
46     +static struct agp_memory *fglrx_compat_agp_allocate_memory(size_t page_count,
47     + u32 type)
48     +{
49     + return agp_allocate_memory(fglrx_agp_bridge, page_count, type);
50     +}
51     +
52     +static void fglrx_compat_agp_enable(u32 mode)
53     +{
54     + agp_enable(fglrx_agp_bridge, mode);
55     +}
56     +
57     +static int fglrx_compat_agp_copy_info(struct agp_kern_info *info)
58     +{
59     + if (!fglrx_agp_bridge) {
60     + fglrx_agp_bridge = agp_find_bridge(fglrx_pci_dev);
61     + if (!fglrx_agp_bridge) {
62     + memset(info, 0, sizeof(struct agp_kern_info));
63     + info->chipset = NOT_SUPPORTED;
64     + return -ENODEV;
65     + }
66     + }
67     + return agp_copy_info(fglrx_agp_bridge, info);
68     +}
69     +
70     +static const drm_agp_t drm_agp = {
71     + &agp_free_memory,
72     + &fglrx_compat_agp_allocate_memory,
73     + &agp_bind_memory,
74     + &agp_unbind_memory,
75     + &fglrx_compat_agp_enable,
76     + &fglrx_compat_agp_backend_acquire,
77     + &fglrx_compat_agp_backend_release,
78     + &fglrx_compat_agp_copy_info
79     +};
80     +
81     +#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) */
82     +/*
83     + * For 2.6.11 we can just use the agpgart functions directly.
84     + */
85     +
86     static const drm_agp_t drm_agp = {
87     &agp_free_memory,
88     &agp_allocate_memory,
89     @@ -2875,6 +2945,9 @@ static const drm_agp_t drm_agp = {
90     &agp_backend_release,
91     &agp_copy_info
92     };
93     +
94     +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) */
95     +
96     #undef DRM_AGP_MODULE_GET
97     #undef DRM_AGP_MODULE_PUT
98    

Properties

Name Value
svn:executable *