My modification to miilenium.c for Matrox Millenium in svgalib-1.9.10

Search this archive.

From: Kousei Hamanaka (hamanaka@elc.nias.ac.jp)
Date: Sun 22 Jul 2001 - 22:46:57 IDT


Hello. Konnichiwa.  I am a new comer.
This is a long mail (or report).

I have a Matrox Millennium 4MB PCI graphic card.
I found that svgalib-1.9.10 supports this graphic card.
And so I wrote same program code as "Simple tutrial" page
and executed it. But on screen, I could only see a black screen
with a single small white square like a prompt. Within this square,
I could see the letter "y". Exactly speaking, it was not a simple "y", but
it was "y" with a umlaut symbol.
I read this mailing list archive hard to solve my ploblem. And I got
the information that the position of framebuffer base registor of
the Matrox Millennium card is reversed.
But When I checked for the output from "cat /proc/pci" and
"lspci -vv -n",it was not reversed. the output is following.

---------------------------------------------------
$ cat /proc/pci |grep -A5 -B2 VGA
      Non-prefetchable 32 bit memory at 0xe0000000 [0xe0000000].
  Bus  0, device  11, function  0:
    VGA compatible controller: Matrox Millennium II (rev 0).
      Medium devsel.  Fast back-to-back capable.  IRQ 10.  Master Capable.
Latency=32.
      Prefetchable 32 bit memory at 0xe2000000 [0xe2000008].
      Non-prefetchable 32 bit memory at 0xdf800000 [0xdf800000].
      Non-prefetchable 32 bit memory at 0xdf000000 [0xdf000000].
  Bus  0, device  12, function  0:

$ /sbin/lspci -vv -n |grep -A10 -B2 102b
        Region 1: Memory at e0000000 (32-bit, non-prefetchable)

00:0b.0 Class 0300: 102b:051b
        Subsystem: 102b:0000
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR-
        Latency: 32
        Interrupt: pin A routed to IRQ 10
        Region 0: Memory at e2000000 (32-bit, prefetchable)
        Region 1: Memory at df800000 (32-bit, non-prefetchable)
        Region 2: Memory at df000000 (32-bit, non-prefetchable)
        Expansion ROM at 000c0000 [disabled]

00:0c.0 Class 0200: 1011:0009 (rev 22)
----------------------------------------------------------------------

So I tried to check for the source file "millennium.c", and found
the part processing the mmio registor and framebuffer registor base
 addresses. I guessed this part is my bottleneck and modified it.
Now I can see colorful screen based on my program code. I did it !!
The following is the part which I have modified.
------------------------------------------------------------
$ grep -n -A30 "mil_linear_base=0" /svgalib-1.9.10/src/millennium.c
861:    mil_linear_base=0;
862-    id=(buf[0]>>16)&0xffff;
863-    if(found != -1) {
864-        mil_pciposition=found;
865-        switch(id) {
866-            case 0x519: /* Millennium */
867-            case 0x51b: /* Millennium II */
868-            case 0x51f: /* Millennium II */
869-                break;
870-
871-            default:
872-                return 1;
873-        }
874-    } else {
875-        return 1;
876-    }
877-    /*
878-    mil_linear_base = buf[5]&0xffffff00;
879-    mil_mmio_base = buf[4]&0xffffff00;
880-    */
881-    /** Changed By Hamanaka **/
882-    mil_linear_base = buf[4]&0xffffff00;
883-    mil_mmio_base = buf[5]&0xffffff00;
884-
885-
__svgalib_vgammbase=mmap(0,0x1000,PROT_READ|PROT_WRITE,MAP_SHARED,__svgalib_
mem_fd,mil_mmio_base+0x1000) + 0xc00;
886-    __svgalib_mm_io_mapio();
887-
888-    __svgalib_inpal=__svgalib_mil_inpal;
889-    __svgalib_outpal=__svgalib_mil_outpal;
890-
891-    if (__svgalib_driver_report) {
----------------------------------------------------------

Thank you very much for providing such a useful library to us.
This library helps me.
Good luck. Good Bye.

Hamanaka


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST