Bradley Chapman <[EMAIL PROTECTED]> wrote:
>
> > --- fix/include/linux/agp_backend.h 2003-11-06 00:50:03.247046605 +0100
> > +++ linux-2.6.0-test9-mm2/include/linux/agp_backend.h       2003-11-06
> > 00:42:38.936727765 +0100
> > @@ -108,8 +108,7 @@ typedef struct {
> >     int                     (*copy_info)(struct agp_kern_info *);
> >  } drm_agp_t;
> >  
> > -/* Used by drm. */
> > -extern const drm_agp_t agp_drm;
> > +extern const drm_agp_t *drm_agp_p;
> >  
> >  #endif                             /* __KERNEL__ */
> >  #endif                             /* _AGP_BACKEND_H */
> > 
> 
> This patch has fixed the bug introduced by the original module dependency fix
> in 2.6.0-test9-mm2.
> 

But it still generates a warning:

drivers/char/drm/drm_agpsupport.h: In function `i810_agp_init':
drivers/char/drm/drm_agpsupport.h:398: warning: assignment from incompatible pointer 
type

Because DRM_AGP_GET returns a `const drm_agp_t **' and tries to assign that
to a `const drm_agp_t *'.

Here's the patch which I currently have.  I must say that I'm getting
rather bored of it :(  

Maybe the problem lies in symbol_get().  It is strange that it adds an
extra pointer-to in the return type.





From: Rusty Russell <[EMAIL PROTECTED]>,
      "Ronny V. Vindenes" <[EMAIL PROTECTED]>

DRM has a soft dependency on AGP (it will use it if it's there).  Instead
of using inter_module_register et.  al, simply export the symbol from agp,
and use symbol_get() and symbol_put in DRM.



 drivers/char/agp/backend.c        |    7 ++-----
 drivers/char/drm/drm_agpsupport.h |    4 ++--
 include/linux/agp_backend.h       |    6 +-----
 3 files changed, 5 insertions(+), 12 deletions(-)

diff -puN drivers/char/agp/backend.c~drm-agp-module-dependency-fix 
drivers/char/agp/backend.c
--- 25/drivers/char/agp/backend.c~drm-agp-module-dependency-fix 2003-11-09 
22:58:13.000000000 -0800
+++ 25-akpm/drivers/char/agp/backend.c  2003-11-09 22:58:13.000000000 -0800
@@ -214,7 +214,7 @@ static void agp_backend_cleanup(struct a
                                phys_to_virt(bridge->scratch_page_real));
 }
 
-static const drm_agp_t drm_agp = {
+const drm_agp_t drm_agp = {
        &agp_free_memory,
        &agp_allocate_memory,
        &agp_bind_memory,
@@ -224,6 +224,7 @@ static const drm_agp_t drm_agp = {
        &agp_backend_release,
        &agp_copy_info
 };
+EXPORT_SYMBOL(drm_agp);
 
 /* XXX Kludge alert: agpgart isn't ready for multiple bridges yet */
 struct agp_bridge_data *agp_alloc_bridge(void)
@@ -274,9 +275,6 @@ int agp_add_bridge(struct agp_bridge_dat
                goto frontend_err;
        }
 
-       /* FIXME: What to do with this? */
-       inter_module_register("drm_agp", THIS_MODULE, &drm_agp);
-
        agp_count++;
        return 0;
 
@@ -295,7 +293,6 @@ void agp_remove_bridge(struct agp_bridge
        bridge->type = NOT_SUPPORTED;
        agp_frontend_cleanup();
        agp_backend_cleanup(bridge);
-       inter_module_unregister("drm_agp");
        agp_count--;
        module_put(bridge->driver->owner);
 }
diff -puN drivers/char/drm/drm_agpsupport.h~drm-agp-module-dependency-fix 
drivers/char/drm/drm_agpsupport.h
--- 25/drivers/char/drm/drm_agpsupport.h~drm-agp-module-dependency-fix  2003-11-09 
22:58:13.000000000 -0800
+++ 25-akpm/drivers/char/drm/drm_agpsupport.h   2003-11-10 00:14:34.000000000 -0800
@@ -37,8 +37,8 @@
 #if __REALLY_HAVE_AGP
 
 
-#define DRM_AGP_GET (drm_agp_t *)inter_module_get("drm_agp")
-#define DRM_AGP_PUT inter_module_put("drm_agp")
+#define DRM_AGP_GET symbol_get(drm_agp)
+#define DRM_AGP_PUT symbol_put(drm_agp)
 
 /**
  * Pointer to the drm_agp_t structure made available by the agpgart module.
diff -puN include/linux/agp_backend.h~drm-agp-module-dependency-fix 
include/linux/agp_backend.h
--- 25/include/linux/agp_backend.h~drm-agp-module-dependency-fix        2003-11-09 
22:58:13.000000000 -0800
+++ 25-akpm/include/linux/agp_backend.h 2003-11-10 00:14:34.000000000 -0800
@@ -96,11 +96,7 @@ extern void agp_enable(u32);
 extern int agp_backend_acquire(void);
 extern void agp_backend_release(void);
 
-/*
- * Interface between drm and agp code.  When agp initializes, it makes
- * the below structure available via inter_module_register(), drm might
- * use it.  Keith Owens <[EMAIL PROTECTED]> 28 Oct 2000.
- */
+/* Interface between drm and agp code. */
 typedef struct {
        void                    (*free_memory)(struct agp_memory *);
        struct agp_memory *     (*allocate_memory)(size_t, u32);

_



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to