On 19 Dec 1999, Marcus Sundberg wrote:
> Yes, but not how to fix it...
> Does someone remember what the infamous text ==> dpp change involved
> for the drivers?

Attached is a patch between two old crusty kgi 0.8 vga.c files,
one before the text/dpp change, one after.  It contains
some other cruft, no doubt.  I do remember though that there
is a critical move of a brace in there somewhere, so pay attention
to flow control/block syntax.

Wasn't hgc.c fixed at some point?  Perhaps in the old (deleted)
kgi 0.8 drivers/chipset/ directory?  More to the point -- did it ever
work in the first place?

--
Brian










18a19,39
>  * Revision 1.48  1998/02/19 23:01:27  ursetto
>  * fb_text_len -> fb_graph_len in chipset_check_mode.
>  *
>  * Revision 1.47  1998/02/13 08:05:14  bjulin
>  * Fixed graphics mode mode-check -- no longer examines charsize as it's N/A
>  *
>  * Revision 1.46  1998/02/09 15:26:24  grimrath
>  * New KGI driver Makefile system.  Include faster dependencies, true linking and
>  * a predefined driver constant for checking with #ifdef ... #endif
>  *
>  * VGA, the Mystique driver and kernel files have been adapted to the
>  * text <-> dpp change.
>  *
>  * Revision 1.45  1998/01/22 05:11:08  bjulin
>  * Fixed 16K planes in textmode bug.
>  * Added memory detection (sort of) but didn't use it for anything.
>  *
>  * Revision 1.44  1998/01/22 02:05:43  bjulin
>  * Fixed PEL register in 9-dot font modes
>  * Changed a couple hex numbers to their vga.h define values
>  *
201,203c222
< #define DRIVER_REV    "$Revision: 1.43 $"
< 
< #define DEBUG_LEVEL   0
---
> #define DRIVER_REV    "$Revision: 1.48 $"
209c228
< #undef        CURSOR_HW       /* Hardware cursor */
---
> #define CURSOR_HW     /* Hardware cursor */
222c241
<       0x40000,                /* 256k (quasi-linear) addressable RAM  */
---
>       0,                      /* RAMsize - filled in during detection */
299a319,324
>       /* better memory test would be nice -- actually read/write
>          maybe to detect 128K cards.  Also this assumes
>          SR04_256K_ACCESS has not been altered before insertion */
>       chipinfo.ramsize = (inbSEQ(SEQ_MEMMODE) & SR04_256K_ACCESS) ?
>               (256 * 1024) : (64 * 1024);
> 
345,348c370,371
<               dpy->fb.size.x          = mode->request.virt.x / 
<                       mode->request.text.x;
<               dpy->fb.size.y          = mode->request.virt.y / 
<                       mode->request.text.y;
---
>               dpy->fb.size.x          = mode->request.virt.x;
>               dpy->fb.size.y          = mode->request.virt.y;
391,392c414,415
<               mode->fsize     = (mode->request.virt.x / mode->request.text.x) *
<                       (mode->request.virt.y / mode->request.text.y) * 2;
---
>               mode->fsize     = mode->request.virt.x * 
>                                 mode->request.virt.y * 2;
471,472c494,496
<       ty.syncend      = (reset_state.CRT[0x11] & CR11_VSYNCEND_MASK) |
<                 (reset_state.CRT[0x12] & ~CR11_VSYNCEND_MASK);
---
>       ty.syncend      = 
>         ((reset_state.CRT[CRT_VDISPLAYEND] & ~CR11_VSYNCEND_MASK) |
>          (reset_state.CRT[CRT_VSYNCEND] & CR11_VSYNCEND_MASK)); 
474,478c498,505
<               ty.syncend += 0x10;
<       ty.blankend     = (reset_state.CRT[0x16] | ((ty.width - 1) & ~0xFF)) + 1;
<       ty.total = 2 + (reset_state.CRT[0x06] |
<                       ((reset_state.CRT[0x07] & CR07_VTOTAL_B8) ? 0x100 : 0) |
<                       ((reset_state.CRT[0x07] & CR07_VTOTAL_B9) ? 0x200 : 0));
---
>         ty.syncend += (CR11_VSYNCEND_MASK + 1);
> 
>       ty.blankend     = 
>         (reset_state.CRT[0x16] | ((ty.width - 1) & ~0xFF)) + 1;
>       ty.total = 2 + 
>         (reset_state.CRT[0x06] |
>          ((reset_state.CRT[0x07] & CR07_VTOTAL_B8) ? 0x100 : 0) |
>          ((reset_state.CRT[0x07] & CR07_VTOTAL_B9) ? 0x200 : 0));
484,493c511,520
<       default_ggi_mode.frames         = 1;
<       default_ggi_mode.visible.x      = tx.width;
<       default_ggi_mode.visible.y      = ty.width;
<       default_ggi_mode.virt.x = tx.width;
<       default_ggi_mode.virt.y = ty.width;
<       default_ggi_mode.size.x         = 0;
<       default_ggi_mode.size.y         = 0;
<       default_ggi_mode.graphtype      = gmode;
<       default_ggi_mode.text.x         = DCLKdiv;
<       default_ggi_mode.text.y         = (reset_state.CRT[0x09] & 
CR09_CHARHEIGHT_MASK) + 1;
---
>       default_ggi_mode.dpp.x     = DCLKdiv;
>       default_ggi_mode.dpp.y     = (reset_state.CRT[0x09] & CR09_CHARHEIGHT_MASK) + 
>1;
>       default_ggi_mode.frames    = 1;
>       default_ggi_mode.visible.x = tx.width / default_ggi_mode.dpp.x;
>       default_ggi_mode.visible.y = ty.width / default_ggi_mode.dpp.y;
>       default_ggi_mode.virt.x    = tx.width / default_ggi_mode.dpp.x;
>       default_ggi_mode.virt.y    = ty.width / default_ggi_mode.dpp.y;
>       default_ggi_mode.size.x    = 0;
>       default_ggi_mode.size.y    = 0;
>       default_ggi_mode.graphtype = gmode;
525a553,554
>         NOTICE("Detected %dKBytes of Video RAM",
>                (chipinfo.ramsize/1024));
572c601
<               ? mode->request.text.x : 8;
---
>               ? mode->request.dpp.x : 8;
596a626,642
> /*
> ** rounds up virt and visible fields to the next multiple of 'round'.
> ** Enlarges virt to be at least of size visible.
> */
> static void roundmode(ggi_mode *gm,int roundx,int roundy)
> {
>       gm->visible.x = ((gm->visible.x + roundx - 1) / roundx) * roundx;
>       gm->visible.y = ((gm->visible.y + roundy - 1) / roundy) * roundy;
>       gm->virt.x    = ((gm->virt.x + roundx - 1) / roundx) * roundx;
>       gm->virt.y    = ((gm->virt.y + roundy - 1) / roundy) * roundy;
> 
>       if (gm->visible.x > gm->virt.x)
>               gm->virt.x = gm->visible.x;
>       if (gm->visible.y > gm->virt.y)
>               gm->virt.y = gm->visible.y;
> }
> 
602,603c648,649
<       textx = mode->request.text.x;
<       texty = mode->request.text.y;
---
>       textx = mode->request.dpp.x;
>       texty = mode->request.dpp.y;
635,639d680
<                       mode->request.visible.x -=
<                               (mode->request.visible.x % textx);
<                       mode->request.visible.y -=
<                               (mode->request.visible.y % texty);
< 
644c685
<                               XVIRTUAL = fb_text_len / ((YVIRTUAL / texty) * 2) * 
textx;
---
>                               XVIRTUAL = fb_text_len / (YVIRTUAL * 2);
647c688
<                               YVIRTUAL = fb_text_len / ((XVIRTUAL / textx) * 2) * 
texty;
---
>                               YVIRTUAL = fb_text_len / (XVIRTUAL * 2);
649,650c690,691
<                       if ((2 * (XVIRTUAL / textx)
<                            * (YVIRTUAL / texty)) > fb_text_len) {
---
>                       roundmode(&mode->request, 1, 1);
>                       if ((2 * XVIRTUAL * YVIRTUAL) > fb_text_len) {
653a695,697
>                       mode->x.width = mode->request.visible.x * textx;
>                       mode->y.width = mode->request.visible.y * texty;
> 
660c704
<                               XVIRTUAL = fb_text_len / YVIRTUAL;
---
>                               XVIRTUAL = fb_graph_len / YVIRTUAL;
666a711
>                       roundmode(&mode->request, 8, 1);
682,685d726
<                       if ((textx < 8) || (9 < textx)) {
<                               DEBUG0("Invalid char width (%i)", textx);
<                               return -EINVAL;
<                       }
696a738,741
>                       mode->x.width = mode->request.visible.x * 
>                                       mode->magnify.x;
>                       mode->y.width = mode->request.visible.y * 
>                                       mode->magnify.y;
699,701d743
<               mode->x.width = mode->request.visible.x * mode->magnify.x;
<               mode->y.width = mode->request.visible.y * mode->magnify.y;
< 
739c781,782
<           }
---
>               }
>               DEBUG2("xv %d yv %d\n",XVIRTUAL,YVIRTUAL);
745,746c788
<                           ((2 * (XVIRTUAL / textx) * 
<                             (YVIRTUAL / texty)) > fb_text_len)
---
>                           ((2 * XVIRTUAL * YVIRTUAL) > fb_text_len)
806,807c848,849
<       textx = mode->request.text.x;
<       texty = mode->request.text.y;
---
>       textx = mode->request.dpp.x;
>       texty = mode->request.dpp.y;
813,814c855,856
<               foo = 2 * mode->request.virt.x / textx;
<               foo /= 4;       /* Due to the addressing mode used */
---
>               foo = mode->request.virt.x * 2 / 4;
>                      /* Due to the addressing mode used */
857a900,901
>               setup.SEQ[SEQ_MEMMODE] |= SR04_256K_ACCESS;
> 
865c909,911
<                       setup.ATC[ATC_MODECONTROL] |= AR10_9DOT_CHARS;
---
>                       GGI_POKEBITS(AR10_9DOT_CHARS,
>                                    (AR10_9DOT_CHARS | AR10_TOP_PAN),
>                                    setup.ATC[ATC_MODECONTROL]);
1019c1065
<       foo = mode->y.syncend;                  /* Vertical sync end      */
---
>       foo = mode->y.syncend;                  /* Vertical sync end      */
1022c1068
<       foo = mode->y.blankend + 1;             /* Vertical blank end     */
---
>       foo = mode->y.blankend;                 /* Vertical blank end     */
1111c1157
<       card->chipset =& chipinfo;
---
>       card->chipset = &chipinfo;

Reply via email to