Hello all;

I have an ancient Hercules mono card and monitor that I'd like to use with 4.4.
As with all ISA cards, it needs exclusive access to it's resources, which are currently
claimed by various vga objects. Before putting anything in bugzilla, I thought
listing my proposed changes here would uncover any oversights. The actual hga
driver will come later.


There are two kinds of vga mono, one using a 15 pin analog monitor and the other
using the 9 pin digital monitor used by mda and hercules cards. The analog version
takes it's signal from the green component and from a driver standpoint is a color
device, so modern and even most older cards should not be reserving the mono
resources. The following test:


       if (inb(VGA_IN_STAT_0) & 1)
               return (int)CHIP_VGA_GENERIC_MONO;

Should be enough to identify the true vga digital monochrome configuration.
This would go in the vga driver probe, and possibly others as well. I have an ati
wonder 16 with 9 and 15 pin connectors for testing once I get 4.4 onto that box.
Opinions on other drivers to check are welcome.


To configure multiple isa heads requires keeping track of which resources are used by
each card, as is already done for pci cards. It's still first come, first served, but no
longer first come, only one served.


Most of the changes are in hw/xfree86/common, with the above test added to
hw/xfree86/drivers/vga/generic.c and symbol table changes in hw/xfree86/loader/xf86sym.c


Enjoy
Lee

---------------------------------------------------------------------------------------------------------------

Here are the diffs I think are appropriate:
diff -c xf86Resources.h*
*** xf86Resources.h    Tue Mar 16 08:26:15 2004
--- xf86Resources.h.orig    Fri Feb 13 15:58:38 2004
***************
*** 57,87 ****

 #define _VGA_EXCLUSIVE \
         {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
         {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
         {ResExcIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}

 #define _VGA_SHARED \
         {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
-         {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
-         {ResShrIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}
-
- #define _VGA_EXCLUSIVE_MONO \
-         {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
-         {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
-         {ResExcIoBlock  | ResBios | ResBus,     0x03B0,     0x03BB},\
-         {ResExcIoBlock  | ResBios | ResBus,     0x03C0,     0x03CF}
-
- #define _VGA_SHARED_MONO \
-         {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
         {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
         {ResShrIoBlock  | ResBios | ResBus,     0x03B0,     0x03BB},\
!         {ResShrIoBlock  | ResBios | ResBus,     0x03C0,     0x03CF}

 #define _VGA_SHARED_MEM \
         {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
          {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}

 #define _VGA_SHARED_IO \
         {ResShrIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}

 /*
--- 57,81 ----

 #define _VGA_EXCLUSIVE \
         {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+         {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
         {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+         {ResExcIoBlock  | ResBios | ResBus,     0x03B0,     0x03BB},\
         {ResExcIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}

 #define _VGA_SHARED \
         {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
         {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
+         {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
         {ResShrIoBlock  | ResBios | ResBus,     0x03B0,     0x03BB},\
!         {ResShrIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}

 #define _VGA_SHARED_MEM \
         {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+         {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
          {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF}

 #define _VGA_SHARED_IO \
+         {ResShrIoBlock  | ResBios | ResBus,     0x03B0,     0x03BB},\
         {ResShrIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}

 /*
***************
*** 90,96 ****
--- 84,92 ----
  */
 #define _VGA_EXCLUSIVE_UNUSED \
     {ResExcUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+     {ResExcUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
     {ResExcUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+     {ResExcUusdIoBlock  | ResBios | ResBus,     0x03B0,     0x03BB},\
     {ResExcUusdIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}

 /*
***************
*** 99,105 ****
--- 95,103 ----
  */
 #define _VGA_SHARED_UNUSED \
     {ResShrUusdMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+     {ResShrUusdMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
     {ResShrUusdMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
+     {ResShrUusdIoBlock  | ResBios | ResBus,     0x03B0,     0x03BB},\
     {ResShrUusdIoBlock  | ResBios | ResBus,     0x03C0,     0x03DF}

 /*
***************
*** 108,123 ****
  */
 #define _VGA_EXCLUSIVE_SPARSE \
     {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
     {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
!     {ResExcIoSparse | ResBios | ResBus,     0x03D0,     0x03F8},\
!     {ResExcIoSparse | ResBios | ResBus,     0x03D8,     0x03FC},\
     {ResExcIoSparse | ResBios | ResBus,     0x03C0,     0x03E0}

 #define _VGA_SHARED_SPARSE \
     {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
     {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
!     {ResShrIoSparse | ResBios | ResBus,     0x03D0,     0x03F8},\
!     {ResShrIoSparse | ResBios | ResBus,     0x03D8,     0x03FC},\
     {ResShrIoSparse | ResBios | ResBus,     0x03C0,     0x03E0}

 #define _8514_EXCLUSIVE \
--- 106,123 ----
  */
 #define _VGA_EXCLUSIVE_SPARSE \
     {ResExcMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+     {ResExcMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
     {ResExcMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
!     {ResExcIoSparse | ResBios | ResBus,     0x03B0,     0x03F8},\
!     {ResExcIoSparse | ResBios | ResBus,     0x03B8,     0x03FC},\
     {ResExcIoSparse | ResBios | ResBus,     0x03C0,     0x03E0}

 #define _VGA_SHARED_SPARSE \
     {ResShrMemBlock | ResBios | ResBus, 0x000A0000, 0x000AFFFF},\
+     {ResShrMemBlock | ResBios | ResBus, 0x000B0000, 0x000B7FFF},\
     {ResShrMemBlock | ResBios | ResBus, 0x000B8000, 0x000BFFFF},\
!     {ResShrIoSparse | ResBios | ResBus,     0x03B0,     0x03F8},\
!     {ResShrIoSparse | ResBios | ResBus,     0x03B8,     0x03FC},\
     {ResShrIoSparse | ResBios | ResBus,     0x03C0,     0x03E0}

 #define _8514_EXCLUSIVE \
***************
*** 128,136 ****

 /* Predefined resources */
 extern resRange resVgaExclusive[];
- extern resRange resVgaExclusiveMono[];
 extern resRange resVgaShared[];
- extern resRange resVgaSharedMono[];
 extern resRange resVgaIoShared[];
 extern resRange resVgaMemShared[];
 extern resRange resVgaUnusedExclusive[];
--- 128,134 ----
***************
*** 146,157 ****
 #define resVga    resVgaShared

 /* Old style names */
! #define RES_EXCLUSIVE_VGA       resVgaExclusive
! #define RES_SHARED_VGA          resVgaShared
! #define RES_EXCLUSIVE_VGA_MONO  resVgaExclusiveMono
! #define RES_SHARED_VGA_MONO     resVgaSharedMono
! #define RES_EXCLUSIVE_8514      res8514Exclusive
! #define RES_SHARED_8514         res8514Shared

 #define _PCI_AVOID_PC_STYLE \
     {ResExcIoSparse | ResBus, 0x0100, 0x0300},\
--- 144,153 ----
 #define resVga    resVgaShared

 /* Old style names */
! #define RES_EXCLUSIVE_VGA   resVgaExclusive
! #define RES_SHARED_VGA      resVgaShared
! #define RES_EXCLUSIVE_8514  res8514Exclusive
! #define RES_SHARED_8514     res8514Shared

 #define _PCI_AVOID_PC_STYLE \
     {ResExcIoSparse | ResBus, 0x0100, 0x0300},\

*** xf86Bus.c    Tue Mar 16 08:17:56 2004
--- xf86Bus.c.orig    Fri Feb 13 15:58:36 2004
***************
*** 98,106 ****

 /* predefined special resources */
 resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END};
- resRange resVgaExclusiveMono[] = {_VGA_EXCLUSIVE_MONO, _END};
 resRange resVgaShared[] = {_VGA_SHARED, _END};
- resRange resVgaSharedMono[] = {_VGA_SHARED_MONO, _END};
 resRange resVgaMemShared[] = {_VGA_SHARED_MEM,_END};
 resRange resVgaIoShared[] = {_VGA_SHARED_IO,_END};
 resRange resVgaUnusedExclusive[] = {_VGA_EXCLUSIVE_UNUSED, _END};
--- 98,104 ----

*** xf86Helper.c    Sun Mar 14 20:02:35 2004
--- xf86Helper.c.orig    Fri Feb 13 15:58:37 2004
***************
*** 1746,1752 ****
         if (!xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func))
             continue;
         actualcards++;
!             pGDev = xf86AddBusDeviceToConfigure(drvp->driverName, BUS_PCI,
                          instances[i].pci, -1);
         if (pGDev) {
            /*
--- 1746,1752 ----
         if (!xf86CheckPciSlot(pPci->bus, pPci->device, pPci->func))
             continue;
         actualcards++;
!             pGDev = xf86AddDeviceToConfigure(drvp->driverName,
                          instances[i].pci, -1);
         if (pGDev) {
            /*
***************
*** 2009,2016 ****
     if (xf86DoProbe || (xf86DoConfigure && xf86DoConfigurePass1)) {
     if (FindIsaDevice &&
         ((foundChip = (*FindIsaDevice)(NULL)) != -1)) {
!         xf86AddBusDeviceToConfigure(drvp->driverName, BUS_ISA,
!                 ISAchipsets[foundChip].resList , foundChip);
         return 1;
     }
     return 0;
--- 2009,2015 ----
     if (xf86DoProbe || (xf86DoConfigure && xf86DoConfigurePass1)) {
     if (FindIsaDevice &&
         ((foundChip = (*FindIsaDevice)(NULL)) != -1)) {
!         xf86AddDeviceToConfigure(drvp->driverName, NULL, foundChip);
         return 1;
     }
     return 0;
*** xf86Configure.c    Tue Mar 16 08:21:17 2004
--- xf86Configure.c.orig    Sun Mar 14 15:57:12 2004
***************
*** 40,46 ****
 #include "xf86Config.h"
 #include "xf86Priv.h"
 #include "xf86PciData.h"
- #include "xf86Resources.h"
 #define IN_XSERVER
 #include "xf86Parser.h"
 #include "xf86tokens.h"
--- 40,45 ----
***************
*** 56,62 ****
 typedef struct _DevToConfig {
     GDevRec GDev;
     pciVideoPtr pVideo;
-     resRange    *resList;
 #if defined(__sparc__) && !defined(__OpenBSD__)
     sbusDevicePtr sVideo;
 #endif
--- 55,60 ----
***************
*** 99,105 ****
 {
     int i, j;
     pciVideoPtr pVideo = NULL;
-     resRange    *resList = NULL;
     Bool isPrimary = FALSE;

if (xf86DoProbe || !xf86DoConfigure || !xf86DoConfigurePass1)
--- 97,102 ----
***************
*** 118,140 ****
isPrimary = xf86IsPrimaryPci(pVideo);
break;
case BUS_ISA:
! resList = (resRange *) busData;
for (i = 0; i < nDevToConfig; i++)
- if (DevToConfig[i].resList)
- {
- resRange *candidate, *used;
-
- for (candidate = resList; candidate->type != ResEnd; ++candidate)
- for (used=DevToConfig[i].resList; used->type != ResEnd; ++used)
- if (candidate->type == used->type
- && (candidate->rBegin <= used->rEnd
- && candidate->rEnd >= used->rBegin))
- return NULL;
- }
- isPrimary = xf86IsPrimaryIsa();
- for (i = 0; isPrimary == TRUE && i < nDevToConfig; i++)
if (!DevToConfig[i].pVideo)
! isPrimary = FALSE;
break;
#if defined(__sparc__) && !defined(__OpenBSD__)
case BUS_SBUS:
--- 115,130 ----
isPrimary = xf86IsPrimaryPci(pVideo);
break;
case BUS_ISA:
! /*
! * This needs to be revisited as it doesn't allow for non-PCI
! * multihead.
! */
! if (!xf86IsPrimaryIsa())
! return NULL;
! isPrimary = TRUE;
for (i = 0; i < nDevToConfig; i++)
if (!DevToConfig[i].pVideo)
! return NULL;
break;
#if defined(__sparc__) && !defined(__OpenBSD__)
case BUS_SBUS:
***************
*** 214,220 ****
case BUS_ISA:
NewDevice.GDev.identifier = "ISA Adapter";
NewDevice.GDev.busID = "ISA";
- NewDevice.resList = resList;
break;
#if defined(__sparc__) && !defined(__OpenBSD__)
case BUS_SBUS: {
--- 204,209 ----
***************
*** 251,256 ****
--- 240,255 ----
# undef NewDevice
}


+ /*
+ * Backwards compatibility
+ */
+ GDevPtr
+ xf86AddDeviceToConfigure(const char *driver, pciVideoPtr pVideo, int chipset)
+ {
+ return xf86AddBusDeviceToConfigure(driver, pVideo ? BUS_PCI : BUS_ISA,
+ pVideo, chipset);
+ }
+
static XF86ConfInputPtr
configureInputSection (void)
{



*** drivers/vga/generic.c Sun Mar 14 15:14:39 2004 --- drivers/vga/generic.c.orig Thu Oct 30 09:37:15 2003 *************** *** 216,244 ****

 enum GenericTypes
 {
!     CHIP_VGA_GENERIC,
!     CHIP_VGA_GENERIC_MONO
 };

 /* Supported chipsets */
 static SymTabRec GenericChipsets[] =
 {
!     {CHIP_VGA_GENERIC, "generic color"},
!     {CHIP_VGA_GENERIC, "generic monochrome"},
     {-1,               NULL}
 };

 static PciChipsets GenericPCIchipsets[] =
 {
     {CHIP_VGA_GENERIC, PCI_CHIP_VGA, RES_SHARED_VGA},
-     {CHIP_VGA_GENERIC_MONO, PCI_CHIP_VGA, RES_SHARED_VGA_MONO},
     {-1,               -1,           RES_UNDEFINED},
 };

 static IsaChipsets GenericISAchipsets[] =
 {
     {CHIP_VGA_GENERIC, RES_EXCLUSIVE_VGA},
-     {CHIP_VGA_GENERIC_MONO, RES_EXCLUSIVE_VGA_MONO},
     {-1,               0}
 };

--- 216,240 ----

 enum GenericTypes
 {
!     CHIP_VGA_GENERIC
 };

 /* Supported chipsets */
 static SymTabRec GenericChipsets[] =
 {
!     {CHIP_VGA_GENERIC, "generic"},
     {-1,               NULL}
 };

 static PciChipsets GenericPCIchipsets[] =
 {
     {CHIP_VGA_GENERIC, PCI_CHIP_VGA, RES_SHARED_VGA},
     {-1,               -1,           RES_UNDEFINED},
 };

 static IsaChipsets GenericISAchipsets[] =
 {
     {CHIP_VGA_GENERIC, RES_EXCLUSIVE_VGA},
     {-1,               0}
 };

***************
*** 380,388 ****
     /* Quit now if no VGA is present */
     if ((CurrentValue ^ 0x0F) != TestValue)
         return -1;
-
-     if (inb(VGA_IN_STAT_0) & 1)
-         return (int)CHIP_VGA_GENERIC_MONO;
 #endif

     return (int)CHIP_VGA_GENERIC;
--- 376,381 ----

*** xf86sym.c    Tue Mar 16 09:44:44 2004
--- xf86sym.c.orig    Fri Feb 13 15:58:45 2004
***************
*** 389,394 ****
--- 389,397 ----
     SYMFUNC(xf86AllocateEntityPrivateIndex)
     SYMFUNC(xf86GetEntityPrivate)

+     /* xf86Configure.c */
+     SYMFUNC(xf86AddDeviceToConfigure)
+
     /* xf86Cursor.c */
     SYMFUNC(xf86GetPointerScreenFuncs)

***************
*** 1138,1145 ****
     /* predefined resource lists from xf86Bus.h */
     SYMVAR(resVgaExclusive)
     SYMVAR(resVgaShared)
-     SYMVAR(resVgaExclusiveMono)
-     SYMVAR(resVgaSharedMono)
     SYMVAR(resVgaMemShared)
     SYMVAR(resVgaIoShared)
     SYMVAR(resVgaUnusedExclusive)
--- 1141,1146 ----

End of diffs

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to