mga_warp.c Question

nick xerofoify at gmail.com
Thu Nov 27 13:43:49 PST 2014


David,
I am posting some code below this message. Please tell me what you mean by this fix me in the code pasted.
Nick 
int mga_warp_init(drm_mga_private_t *dev_priv)
{
        u32 wmisc;
 
        /* FIXME: Get rid of these damned magic numbers...
        */
      switch (dev_priv->chipset) {
        case MGA_CARD_TYPE_G400:
        case MGA_CARD_TYPE_G550:
                 MGA_WRITE(MGA_WIADDR2, MGA_WMODE_SUSPEND);
                 MGA_WRITE(MGA_WGETMSB, 0x00000E00);
                 MGA_WRITE(MGA_WVRTXSZ, 0x00001807);
                 MGA_WRITE(MGA_WACCEPTSEQ, 0x18000000);
                 break;
         case MGA_CARD_TYPE_G200:
                MGA_WRITE(MGA_WIADDR, MGA_WMODE_SUSPEND);
                MGA_WRITE(MGA_WGETMSB, 0x1606);
                MGA_WRITE(MGA_WVRTXSZ, 7);
                break;
         default:
               return -EINVAL;
         }

       MGA_WRITE(MGA_WMISC, (MGA_WUCODECACHE_ENABLE |
                               MGA_WMASTER_ENABLE | MGA_WCACHEFLUSH_ENABLE));
      wmisc = MGA_READ(MGA_WMISC);
      if (wmisc != WMISC_EXPECTED) {
                DRM_ERROR("WARP engine config failed! 0x%x != 0x%x\n",
                wmisc, WMISC_EXPECTED);
              return -EINVAL;
        }

        return 0;
 }


More information about the dri-devel mailing list