home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / SVGALIB / SVGALIB1.TAR / svgalib / src / ark.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-15  |  14.3 KB  |  553 lines

  1. /* This library is free software; you can redistribute it and/or   */
  2. /* modify it without any restrictions. This library is distributed */
  3. /* in the hope that it will be useful, but without any warranty.   */
  4.  
  5. /* ARK driver written by Harm Hanemaayer. */
  6.  
  7. /*
  8.  * Jan 1995:
  9.  * Initial ARK driver. Should at least provide 25.175 and 28.322 MHz
  10.  * dot clocks.
  11.  */
  12.  
  13.  
  14. #include <stdlib.h>
  15. #include <stdio.h>
  16. #include "vga.h"
  17. #include "libvga.h"
  18. #include "driver.h"
  19.  
  20. #include "timing.h"
  21. #include "ramdac.h"
  22. #include "vgaregs.h"
  23. #include "interface.h"
  24.  
  25.  
  26. /* Extended registers. */
  27.  
  28. #define ARK_SR10    VGA_TOTAL_REGS + 0
  29. #define ARK_SR11    VGA_TOTAL_REGS + 1
  30. #define ARK_SR12    VGA_TOTAL_REGS + 2
  31. #define ARK_SR13    VGA_TOTAL_REGS + 3
  32. #define ARK_SR14    VGA_TOTAL_REGS + 4
  33. #define ARK_SR15    VGA_TOTAL_REGS + 5
  34. #define ARK_SR16    VGA_TOTAL_REGS + 6
  35. #define ARK_SR17    VGA_TOTAL_REGS + 7
  36. #define ARK_SR18    VGA_TOTAL_REGS + 8
  37. #define ARK_SR19    VGA_TOTAL_REGS + 9
  38. #define ARK_SR1C    VGA_TOTAL_REGS + 10
  39. #define ARK_SR1D    VGA_TOTAL_REGS + 11
  40. #define ARK_CR40    VGA_TOTAL_REGS + 12
  41. #define ARK_CR41    VGA_TOTAL_REGS + 13
  42. #define ARK_CR42    VGA_TOTAL_REGS + 14
  43. #define ARK_CR44    VGA_TOTAL_REGS + 15
  44. #define ARK_CR46    VGA_TOTAL_REGS + 16
  45. #define ARK_CR50    VGA_TOTAL_REGS + 17
  46.  
  47. #define ARK_MEMORY_CONTROL        ARK_SR10
  48. #define ARK_VIDEO_CLOCK_SELECT        ARK_SR11
  49. #define ARK_VLBUS_CONTROL        ARK_SR12    /* Unused */
  50. #define ARK_PAGE_ADDRESS_LOW        ARK_SR13    /* Unused */
  51. #define ARK_PAGE_ADDRESS_HIGH        ARK_SR14    /* Unused */
  52. #define ARK_APERTURE_WRITE_INDEX    ARK_SR15
  53. #define ARK_APERTURE_READ_INDEX        ARK_SR16
  54. #define ARK_COP_FRAMEBUFFER_PITCH    ARK_SR17    /* Unused */
  55. #define ARK_DISPLAY_FIFO_CONTROL    ARK_SR18
  56. #define ARK_HOST_INTERFACE_TYPE        ARK_SR19    /* Read */
  57. #define ARK_DPMS_CONTROL        ARK_SR1C
  58. #define ARK_LOCK_REGISTER        ARK_SR1D
  59. #define ARK_CRTC_VERTICAL_OVERFLOW    ARK_CR40
  60. #define ARK_CRTC_HORIZONTAL_OVERFLOW    ARK_CR41
  61. #define ARK_INTERLACE_RETRACE        ARK_CR42
  62. #define ARK_VGA_ENHANCEMENT        ARK_CR44
  63. #define ARK_PIXEL_CLOCK_CONTROL        ARK_CR46
  64. #define ARK_CHIP_ID            ARK_CR50    /* Read */
  65.  
  66. #define ARK_DAC_OFFSET    VGA_TOTAL_REGS + 18
  67. #define ARK_TOTAL_REGS    VGA_TOTAL_REGS + 18 + 10
  68.  
  69.  
  70. #define ARK1000PV    1
  71. #define ARK2000PV    2
  72.  
  73. static int ark_chip;
  74. static int ark_memory;
  75. static CardSpecs *cardspecs;
  76. static DacMethods *dac_used;
  77.  
  78. static int ark_init(int, int, int);
  79.  
  80.  
  81. static void nothing() { }
  82.  
  83.  
  84. /* Unlock. */
  85.  
  86. static void ark_unlock() {
  87.     /* Set bit 0 of SR1D. */
  88.     outSR(0x1D, inSR(0x1D) | 0x01);
  89. }
  90.  
  91. /* Fill in chipset specific mode information */
  92.  
  93. static int ark_getmodeinfo( int mode, vga_modeinfo *modeinfo ) {
  94.         switch (modeinfo->colors) {
  95.                 case 16 :       /* 4-plane 16 color mode */
  96.                         modeinfo->maxpixels = 65536 * 8;
  97.                         break;
  98.                 default :
  99.                         modeinfo->maxpixels = ark_memory * 1024 /
  100.                                         modeinfo->bytesperpixel;
  101.                         break;
  102.         }
  103.     modeinfo->maxlogicalwidth = 4088;
  104.     modeinfo->startaddressrange = 0x1fffff;
  105.     modeinfo->haveblit = 0;
  106.     modeinfo->flags &= ~HAVE_RWPAGE;
  107.     return 0;
  108. }
  109.  
  110.  
  111. /* Return non-zero if mode is available */
  112.  
  113. static int ark_modeavailable( int mode ) {
  114.     struct info *info;
  115.     ModeInfo *modeinfo;
  116.     ModeTiming *modetiming;
  117.  
  118.     if ((mode < G640x480x256 || mode == G720x348x2)
  119.     && mode != G320x200x256)
  120.         return vga_driverspecs.modeavailable(mode);
  121.  
  122.     /* Enough memory? */
  123.     info = &__svgalib_infotable[mode];
  124.     if (ark_memory * 1024 < info->ydim * info->xbytes)
  125.         return 0;
  126.  
  127.     modeinfo = createModeInfoStructureForSvgalibMode(mode);
  128.  
  129.     modetiming = malloc(sizeof(ModeTiming));
  130.     if (getmodetiming(modetiming, modeinfo, cardspecs)) {
  131.         free(modetiming);
  132.         free(modeinfo);
  133.         return 0;
  134.     }
  135.     free(modetiming);
  136.     free(modeinfo);
  137.  
  138.     return SVGADRV;
  139. }
  140.  
  141.  
  142. static int ark_saveregs( unsigned char regs[] ) {
  143.     ark_unlock();
  144.  
  145.      /* Save extended registers. */
  146.      regs[ARK_SR10] = inSR(0x10);
  147.      regs[ARK_SR11] = inSR(0x11);
  148.      regs[ARK_SR15] = inSR(0x15);
  149.      regs[ARK_SR16] = inSR(0x16);
  150.      regs[ARK_SR18] = inSR(0x18);
  151.      regs[ARK_SR19] = inSR(0x19);
  152.      regs[ARK_SR1C] = inSR(0x1C);
  153.      regs[ARK_SR1D] = inSR(0x1D);
  154.  
  155.      regs[ARK_CR40] = inCR(0x40);
  156.      regs[ARK_CR41] = inCR(0x41);
  157.      regs[ARK_CR42] = inCR(0x42);
  158.      regs[ARK_CR44] = inCR(0x44);
  159.      regs[ARK_CR46] = inCR(0x46);
  160.      regs[ARK_CR50] = inCR(0x50);
  161.  
  162.     dac_used->saveState(regs + ARK_DAC_OFFSET);
  163.     return ARK_DAC_OFFSET - VGA_TOTAL_REGS + dac_used->stateSize;
  164. }
  165.  
  166.  
  167. /* Set chipset-specific registers */
  168.  
  169. static int ark_setregs( const unsigned char regs[], int mode )
  170. {
  171.     ark_unlock();
  172.  
  173.      /* Write extended registers. */
  174.     outSR(0x10, regs[ARK_SR10]);
  175.     outSR(0x11, regs[ARK_SR11]);
  176.     outSR(0x15, regs[ARK_SR15]);
  177.     outSR(0x16, regs[ARK_SR16]);
  178.     outSR(0x18, regs[ARK_SR18]);
  179.     outSR(0x1C, regs[ARK_SR1C]);
  180.     outSR(0x1D, regs[ARK_SR1D]);
  181.  
  182.     outCR(0x40, regs[ARK_CR40]);
  183.     outCR(0x41, regs[ARK_CR41]);
  184.     outCR(0x42, regs[ARK_CR42]);
  185.     outCR(0x44, regs[ARK_CR44]);
  186.     outCR(0x46, regs[ARK_CR46]);
  187.  
  188.     if (dac_used->id == S3_SDAC) {
  189.         unsigned char CR1;
  190.         printf("DAC clock state: 0x%02X 0x%02X\n",
  191.             regs[ARK_DAC_OFFSET + 3],
  192.             regs[ARK_DAC_OFFSET + 4]);
  193.         /* Blank the screen.*/
  194.         CR1 = inCR(0x01);
  195.         outCR(0x01, CR1 | 0x20);
  196.         dac_used->restoreState(regs + ARK_DAC_OFFSET);
  197.         outCR(0x01, CR1);    /* Unblank screen. */
  198.     }
  199.     return 0;
  200. }
  201.  
  202.  
  203. /*
  204.  * Initialize register state for a mode.
  205.  */
  206.  
  207. static void ark_initializemode( unsigned char *moderegs,
  208. ModeTiming *modetiming, ModeInfo *modeinfo) {
  209.  
  210.     /* Get current values. */
  211.     ark_saveregs(moderegs);
  212.  
  213.     /* Set up the standard VGA registers for a generic SVGA. */
  214.     setup_VGA_registers(moderegs, modetiming, modeinfo);
  215.  
  216.     /* Set up the extended register values, including modifications */
  217.     /* of standard VGA registers. */
  218.  
  219.     moderegs[VGA_CR13] = modeinfo->lineWidth >> 3;
  220.  
  221.     moderegs[ARK_MEMORY_CONTROL] &= ~0x0F;
  222.     /* VESA Super VGA memory organisation, no COP. */
  223.     moderegs[ARK_MEMORY_CONTROL] |= 0x03;
  224.  
  225.     moderegs[ARK_VIDEO_CLOCK_SELECT] &= ~0x0F;
  226.     /* Set COP and Giant Shift pixel depth. */
  227.     if (modeinfo->bytesPerPixel == 1)
  228.         moderegs[ARK_VIDEO_CLOCK_SELECT] |= 0x5;
  229.     if (modeinfo->bytesPerPixel == 2)
  230.         moderegs[ARK_VIDEO_CLOCK_SELECT] |= 0xA;
  231.     if (modeinfo->bytesPerPixel >= 3)
  232.         moderegs[ARK_VIDEO_CLOCK_SELECT] |= 0xF;
  233.  
  234.     moderegs[ARK_APERTURE_WRITE_INDEX] = 0;
  235.     moderegs[ARK_APERTURE_READ_INDEX] = 0;
  236.  
  237. /* Display FIFO. */
  238.     {
  239.         int threshold;
  240.         unsigned char val;
  241.         threshold = 4;        /* A guess. */
  242.         val = moderegs[ARK_DISPLAY_FIFO_CONTROL];
  243.         if (ark_chip == ARK1000PV) {
  244.             val |= 0x08;    /* Enable full FIFO. */
  245.             val &= ~0x07;
  246.             val |= threshold;
  247.         }
  248.         if (ark_chip == ARK2000PV) {
  249.             val &= 0x40;
  250.             val |= 0x10;    /* 32-deep FIFO. */
  251.             val |= (threshold & 0x0E) >> 1;
  252.             if (threshold & 0x01)
  253.                 val |= 0x80;
  254.             if (threshold & 0x10)
  255.                 val |= 0x20;
  256.         }
  257.         moderegs[ARK_DISPLAY_FIFO_CONTROL] = val;
  258.     }
  259.  
  260. /* CRTC timing. */
  261.     {
  262.         unsigned char val;
  263.         /* Vertical Overflow. */
  264.         val = 0;
  265.         if ((modetiming->CrtcVTotal - 2) & 0x400)
  266.             val |= 0x80;
  267.         if ((modetiming->VDisplay - 1) & 0x400)
  268.             val |= 0x40;
  269.         /* VBlankStart is equal to VSyncStart + 1. */
  270.         if (modetiming->CrtcVSyncStart & 0x400)
  271.             val |= 0x20;
  272.         /* VRetraceStart is equal to VSyncStart + 1. */
  273.         if (modetiming->CrtcVSyncStart & 0x400)
  274.             val |= 0x10;
  275.         moderegs[ARK_CRTC_VERTICAL_OVERFLOW] = val;
  276.  
  277.         /* Horizontal Overflow. */
  278.         val = moderegs[ARK_CRTC_VERTICAL_OVERFLOW];
  279.         val &= 0x07;
  280.         if ((modetiming->CrtcHTotal / 8 - 5) & 0x100)
  281.             val |= 0x80;
  282.         if ((modetiming->CrtcHDisplay / 8 - 1) & 0x100)
  283.             val |= 0x40;
  284.         /* HBlankStart is equal to HSyncStart - 1. */
  285.         if ((modetiming->CrtcHSyncStart / 8 - 1) & 0x100)
  286.             val |= 0x20;
  287.         /* HRetraceStart is equal to HSyncStart. */
  288.         if ((modetiming->CrtcHSyncStart / 8) & 0x100)
  289.             val |= 0x10;
  290.         if ((modeinfo->lineWidth / 8) & 0x100)
  291.             val |= 0x08;
  292.         moderegs[ARK_CRTC_VERTICAL_OVERFLOW] = val;
  293.     }
  294.     moderegs[ARK_VGA_ENHANCEMENT] &= ~0x04;        /* No interlace. */
  295.     if (modetiming->flags & INTERLACED) {
  296.         /* Set mid-scan vertical retrace start. */
  297.         moderegs[ARK_INTERLACE_RETRACE] =
  298.             (modetiming->CrtcHTotal / 8 - 5) / 2;
  299.         moderegs[ARK_VGA_ENHANCEMENT] |= 0x04;    /* Interlaced. */
  300.     }
  301.  
  302. /* Clocking. */
  303.     /* Select 8 or 16-bit video output to RAMDAC on 2000PV. */
  304.     if (ark_chip == ARK2000PV) {
  305.         int dac16;
  306.          moderegs[ARK_PIXEL_CLOCK_CONTROL] &= ~0x04;    /* 8-bit */
  307.         dac16 = 0;
  308.         if (modeinfo->bitsPerPixel == 8 &&
  309.         cardspecs->mapClock(8, modetiming->pixelClock)
  310.         == modetiming->pixelClock / 2)
  311.             /* Typically high resolution 8bpp (> 110 MHz). */
  312.             dac16 = 1;
  313.         if (modeinfo->bitsPerPixel == 16 &&
  314.         cardspecs->mapClock(16, modetiming->pixelClock)
  315.         == modetiming->pixelClock)
  316.             /* 16bpp at pixel rate. */
  317.             dac16 = 1;
  318.         /* Note: with an 8-bit DAC, 16bpp is Clock * 2. */
  319.         /* 24bpp is always Clock * 3. */
  320.         if (modeinfo->bitsPerPixel == 32 &&
  321.         cardspecs->mapClock(32, modetiming->pixelClock)
  322.         == modetiming->pixelClock * 2)
  323.             /* 32bpp at Clock * 2. */
  324.             dac16 = 1;
  325.         /* Note: with an 8-bit dac, 32bpp is Clock * 4. */
  326.         if (dac16)
  327.             moderegs[ARK_PIXEL_CLOCK_CONTROL] |= 0x04; /* 16-bit */
  328.     }
  329.  
  330.     if (modetiming->flags & USEPROGRCLOCK)
  331.         moderegs[VGA_MISCOUTPUT] |= 0x0C; /* External clock select. */
  332.     else {
  333.         /* Program clock select. */
  334.         moderegs[VGA_MISCOUTPUT] &= ~0x0C;
  335.         moderegs[VGA_MISCOUTPUT] |=
  336.             (modetiming->selectedClockNo & 3) << 2;
  337.         moderegs[ARK_VIDEO_CLOCK_SELECT] &= ~0xC0;
  338.         moderegs[ARK_VIDEO_CLOCK_SELECT] |=
  339.             (modetiming->selectedClockNo & 0xC) << 4;
  340.     }
  341.  
  342.     if (dac_used->id != NORMAL_DAC) {
  343.         dac_used->initializeState(&moderegs[ARK_DAC_OFFSET],
  344.             modeinfo->bitsPerPixel,
  345.             colorbits_to_colormode(modeinfo->colorBits),
  346.             modetiming->pixelClock);
  347.         printf("DAC clock state: 0x%02X 0x%02X\n",
  348.             moderegs[ARK_DAC_OFFSET + 3],
  349.             moderegs[ARK_DAC_OFFSET + 4]);
  350.     }
  351. }
  352.  
  353.  
  354. /* Set a mode */
  355.  
  356. static int ark_setmode( int mode, int prv_mode ) {
  357.     ModeInfo *modeinfo;
  358.     ModeTiming *modetiming;
  359.     unsigned char *moderegs;
  360.  
  361.     if ((mode < G640x480x256 || mode == G720x348x2)
  362.     && mode != G320x200x256)
  363.         /* Let the standard VGA driver set standard VGA modes. */
  364.         return vga_driverspecs.setmode(mode, prv_mode);
  365.     if (!ark_modeavailable(mode))
  366.         return 1;
  367.  
  368.     modeinfo = createModeInfoStructureForSvgalibMode(mode);
  369.  
  370.     modetiming = malloc(sizeof(ModeTiming));
  371.     if (getmodetiming(modetiming, modeinfo, cardspecs)) {
  372.         free(modetiming);
  373.         free(modeinfo);
  374.         return 1;
  375.     }
  376.  
  377.     moderegs = malloc(ARK_TOTAL_REGS);
  378.  
  379.     ark_initializemode(moderegs, modetiming, modeinfo);
  380.     free(modeinfo);
  381.     free(modetiming);
  382.  
  383.     __vga_setregs(moderegs);    /* Set standard regs. */
  384.     ark_setregs(moderegs, mode);    /* Set extended regs. */
  385.     free(moderegs);
  386.     return 0;
  387. }
  388.  
  389.  
  390. /* Indentify chipset; return non-zero if detected */
  391.  
  392. static int ark_test() {
  393.     if (ark_init(0, 0, 0))
  394.         return 0;
  395.     return 1;
  396. }
  397.  
  398.  
  399. /* Bank switching function - set 64K bank number */
  400.  
  401. static void ark_setpage( int page ) {
  402.     outw(0x3c4, 0x15 + (page << 8));    /* Aperture Write index. */
  403.     outw(0x3c4, 0x16 + (page << 8));    /* Aperture Read index. */
  404. }
  405.  
  406.  
  407. /* Set display start address (not for 16 color modes) */
  408.  
  409. static int ark_setdisplaystart( int address ) {
  410.     outw(0x3d4, 0x0d + ((address >> 2) & 0x00ff) * 256);    /* sa2-sa9 */
  411.     outw(0x3d4, 0x0c + ((address >> 2) & 0xff00));        /* sa10-sa17 */
  412.     inb(0x3da);            /* set ATC to addressing mode */
  413.     outb(0x3c0, 0x13 + 0x20);    /* select ATC reg 0x13 */
  414.     outb(0x3c0, (inb(0x3c1) & 0xf0) | ((address & 3) << 1));
  415.         /* write sa0-1 to bits 1-2 */
  416.     outb(CRT_I, 0x40);
  417.     outb(CRT_D, (address & 0x1C0000) >> 18);    /* sa18-sa20 */
  418. }
  419.  
  420.  
  421. /* Set logical scanline length (usually multiple of 8) */
  422. /* Multiples of 8 to 2040 */
  423.  
  424. static int ark_setlogicalwidth( int width ) { 
  425.     outw(0x3d4, 0x13 + (width >> 3) * 256);    /* lw3-lw11 */
  426.     outb(CRT_I, 0x41);
  427.     outb(CRT_D, (inb(CRT_D) & ~0x08) | ((width >> 3) & 0x100));
  428.     return 0;
  429. }
  430.  
  431.  
  432. /* Function table (exported) */
  433.  
  434. DriverSpecs ark_driverspecs = {
  435.     ark_saveregs,        /* saveregs */
  436.     ark_setregs,        /* setregs */
  437.     (int (*)()) nothing,    /* unlock */
  438.     (int (*)()) nothing,    /* lock */
  439.     ark_test,
  440.     ark_init,
  441.     (int (*)()) ark_setpage,
  442.     (int (*)()) nothing,
  443.     (int (*)()) nothing,
  444.     ark_setmode,
  445.     ark_modeavailable,
  446.     ark_setdisplaystart,
  447.     ark_setlogicalwidth,
  448.     ark_getmodeinfo,
  449.     0,    /* bitblt */
  450.     0,    /* imageblt */
  451.     0,    /* fillblt */
  452.     0,    /* hlinelistblt */
  453.     0,    /* bltwait */
  454.     0,    /* extset */
  455.     0,
  456.     0,    /* linear */
  457.     NULL    /* accelspecs */
  458. };
  459.  
  460.  
  461. /* Initialize driver (called after detection) */
  462.  
  463. static char *ark_chipname[] = { "ARK1000PV", "ARK2000PV" };
  464.  
  465. static DacMethods *dacs_to_probe[] = { &S3_SDAC_methods, &normal_dac_methods,
  466.     NULL };
  467.  
  468. static int ark_init( int force, int par1, int par2) {
  469.     ark_unlock();
  470.  
  471.     if (force) {
  472.         ark_chip = par1;    /* we already know the type */
  473.         ark_memory = par2;
  474.     }
  475.     else {
  476.         unsigned char id, val;
  477.         id = inCR(0x50) >> 3;
  478.         if (id == 0x12)
  479.             ark_chip = ARK1000PV;
  480.         else
  481.         if (id == 0x13)
  482.             ark_chip = ARK2000PV;
  483.         else {
  484.             printf("svgalib: ark: Unknown chiptype %d.\n",
  485.                 ark_chip);
  486.             return -1;
  487.         }
  488.         val = inSR(0x10);
  489.         if ((val & 0xC0) == 0)
  490.             ark_memory = 1024;
  491.         if ((val & 0xC0) == 0x40)
  492.             ark_memory = 2048;
  493.         else
  494.             ark_memory = 4096;
  495.     }
  496.  
  497.     /* Detect DAC. */
  498.  
  499.  #if 1    /* Use 0 to force SDAC. */
  500.     dac_used = probeDacs(dacs_to_probe);
  501. #else
  502.     dac_used = &S3_SDAC_methods;
  503.     dac_used->initialize();
  504. #endif
  505.  
  506. /* begin: Initialize cardspecs. */
  507.     cardspecs = malloc(sizeof(CardSpecs));
  508.     cardspecs->videoMemory = ark_memory;
  509.     cardspecs->maxHorizontalCrtc = 4088;
  510.     cardspecs->nClocks = 0;
  511.     cardspecs->flags = 0;
  512.  
  513.     dac_used->qualifyCardSpecs(cardspecs);
  514.  
  515.     /* Initialize standard clocks for unknown DAC. */
  516.     if (!(dac_used->flags & CLOCK_PROGRAMMABLE)
  517.     && cardspecs->nClocks == 0) {
  518.         cardspecs->nClocks = 2;
  519.         cardspecs->clocks = malloc(sizeof(int) * 2);
  520.         cardspecs->clocks[0] = 25175;
  521.         cardspecs->clocks[1] = 28322;
  522.     }
  523.  
  524.     /* Limit pixel clocks according to chip specifications. */
  525.     if (ark_chip == ARK1000PV) {
  526.         /* Limit max clocks according to 120 MHz DCLK spec. */
  527.         /* 8-bit DAC. */
  528.         LIMIT(cardspecs->maxPixelClock4bpp, 120000);
  529.         LIMIT(cardspecs->maxPixelClock8bpp, 120000);
  530.         LIMIT(cardspecs->maxPixelClock16bpp, 120000 / 2);
  531.         LIMIT(cardspecs->maxPixelClock24bpp, 120000 / 3);
  532.         LIMIT(cardspecs->maxPixelClock32bpp, 120000 / 4);
  533.     }
  534.     if (ark_chip == ARK2000PV) {
  535.         /* Limit max clocks according to 120 MHz DCLK spec. */
  536.         /* Assume 16-bit DAC. */
  537.         LIMIT(cardspecs->maxPixelClock4bpp, 120000);
  538.         LIMIT(cardspecs->maxPixelClock8bpp, 120000 * 2);
  539.         LIMIT(cardspecs->maxPixelClock16bpp, 120000);
  540.         LIMIT(cardspecs->maxPixelClock24bpp, 120000 / 3);
  541.         LIMIT(cardspecs->maxPixelClock32bpp, 120000 / 2);
  542.     }
  543. /* end: Initialize cardspecs. */
  544.  
  545.     if (__svgalib_driver_report) {
  546.         printf("svgalib: Using ARK driver (%s, %dK).\n",
  547.             ark_chipname[ark_chip], ark_memory);
  548.     }
  549.     driverspecs = &ark_driverspecs;
  550.  
  551.     return 0;
  552. }
  553.