On 2002.04.04 18:47 Tony Rogvall wrote:
> "José Fonseca" wrote:
> 
> > On 2002.04.04 11:46 Tony Rogvall wrote:
> > > ...
> > >
> > > Found it, I assumed it was a printk and removed DRM_INFO voila it
> started
> > > without
> > > a crash. In mach64_dma there is code for printing AGP_BASE !! Just
> put
> > > some
> > > __REALLY_HAVE_AGP around it.
> > >
> >
> > __REALLY_HAVE_AGP is a constant macro. It must be some variable that
> > indicates wether agpgart is or not loaded.
> 

> well nearly constant it is defined by:
> 
> #define __REALLY_HAVE_AGP       (__HAVE_AGP && (defined(CONFIG_AGP) || \
> 
> defined(CONFIG_AGP_MODULE)))
> 
> And for my system (running redhat) agpgart is compiled into the kernel,
> but
> that
> does not say anything about if I have AGP or not!
> 

I just commited a patch to get over this in the meanwhile:

--- mach64_dma.c        26 Feb 2002 22:02:37 -0000      1.1.6.1
+++ mach64_dma.c        5 Apr 2002 00:59:47 -0000
@@ -93,8 +93,13 @@
  static void dump_engine_info( drm_mach64_private_t *dev_priv )
  {
        DRM_INFO( "\n" );
-       DRM_INFO( "           AGP_BASE = 0x%08x\n", MACH64_READ( 
MACH64_AGP_BASE ) );
-       DRM_INFO( "           AGP_CNTL = 0x%08x\n", MACH64_READ( 
MACH64_AGP_CNTL ) );
+#if 0 /* disable while is_pci is not implemented */
+       if ( !dev_priv->is_pci)
+       {
+               DRM_INFO( "           AGP_BASE = 0x%08x\n", MACH64_READ( 
MACH64_AGP_BASE ) );
+               DRM_INFO( "           AGP_CNTL = 0x%08x\n", MACH64_READ( 
MACH64_AGP_CNTL ) );
+       }
+#endif
        DRM_INFO( "     ALPHA_TST_CNTL = 0x%08x\n", MACH64_READ( 
MACH64_ALPHA_TST_CNTL ) );
        DRM_INFO( "\n" );
        DRM_INFO( "         BM_COMMAND = 0x%08x\n", MACH64_READ( 
MACH64_BM_COMMAND ) );


To definitively fix this is necessary to have a 'is_pci' variable, as the 
rage128 and radeon do.

> One could try read the AGP_BASE and see if it's 0  (as indicated by the
> crash
> :-)
> 
> This should be done in runtime, otherwise we must build different kernel
> modules
> for different systems etc.
> 

Attached is a (reversed) patch from my previous attempt to do this. I 
stopped because the changes were incomplete and they broke the structures 
as seen by the diferent parts of the driver locking X sistematically on 
startup.

My plan is to apply it again more slowly, ensuring that everything is 
being updated simultaneously in the several places (i.e., DRM, DRI and DDX 
modules).

The `is_pci' thing can then be used to guard any AGP related code, such as 
in atidri.c.

> ...
> 
> Regards
> 
> /Tony
> 

Regards,

José Fonseca
diff -u -r -x CVS mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/atidri.c mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/atidri.c
--- mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/atidri.c	Thu Mar  7 14:38:33 2002
+++ mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/atidri.c	Sat Mar 30 14:16:22 2002
@@ -30,7 +30,6 @@
 
 /* Driver data structures */
 #include "ati.h"
-#include "atibus.h"
 #include "atidri.h"
 #include "atiregs.h"
 #include "atistruct.h"
@@ -673,7 +683,6 @@
    drmMach64Init info;
 
    info.sarea_priv_offset	= sizeof(XF86DRISAREARec);
-   info.is_pci			= (pATI->BusType == ATI_BUS_PCI ? TRUE : FALSE);
 
    info.fb_bpp			= pATI->bitsPerPixel;
    info.front_offset		= pATIDRIServer->frontOffset;
diff -u -r -x CVS mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_dma.c mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_dma.c
--- mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_dma.c	Thu Mar  7 11:18:50 2002
+++ mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_dma.c	Tue Feb 26 22:02:37 2002
@@ -324,9 +324,7 @@
 
 	memset( dev_priv, 0, sizeof(drm_mach64_private_t) );
 
-	dev_priv->is_pci	= init->is_pci;
-	
-	dev_priv->fb_bpp	= init->fb_bpp;
+	dev_priv->fb_bpp		= init->fb_bpp;
 	dev_priv->front_offset  = init->front_offset;
 	dev_priv->front_pitch   = init->front_pitch;
 	dev_priv->back_offset   = init->back_offset;
diff -u -r -x CVS mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drm.h mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drm.h
--- mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drm.h	Thu Mar  7 11:12:03 2002
+++ mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drm.h	Tue Feb 26 22:02:37 2002
@@ -148,7 +148,6 @@
 	} func;
 
 	unsigned int sarea_priv_offset;
-	int is_pci;
 
 	unsigned int fb_bpp;
 	unsigned int front_offset, front_pitch;
diff -u -r -x CVS mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drv.h mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drv.h
--- mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drv.h	Thu Mar  7 11:14:29 2002
+++ mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/mach64_drv.h	Tue Mar  5 02:03:31 2002
@@ -44,7 +44,6 @@
 	u32 depth_offset_pitch;
 
 	int usec_timeout;
-	int is_pci;
 
 	drm_map_t *sarea;
 	drm_map_t *fb;
diff -u -r -x CVS mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMach64.c mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMach64.c
--- mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMach64.c	Thu Mar  7 11:21:30 2002
+++ mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmMach64.c	Tue Feb 26 22:02:37 2002
@@ -86,7 +86,6 @@
    init.func = MACH64_INIT_DMA;
 
    init.sarea_priv_offset = info->sarea_priv_offset;
-   init.is_pci		= info->is_pci;
 
    init.fb_bpp		= info->fb_bpp;
    init.front_offset	= info->front_offset;
diff -u -r -x CVS mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/xf86drmMach64.h mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/xf86drmMach64.h
--- mach64-0-0-3-branch.old/xc/xc/programs/Xserver/hw/xfree86/os-support/xf86drmMach64.h	Thu Mar  7 14:46:43 2002
+++ mach64-0-0-3-branch/xc/xc/programs/Xserver/hw/xfree86/os-support/xf86drmMach64.h	Tue Feb 26 22:02:37 2002
@@ -41,7 +41,6 @@
 
 typedef struct {
    unsigned int sarea_priv_offset;
-   int is_pci;
 
    unsigned int fb_bpp;
    unsigned int front_offset, front_pitch;

Reply via email to