anchor.diff:         ,@body)))
   
   (defun framebuffer-address (device)
  -  (logand (pci:pci-io-region (gma-device device) 2) (lognot #xF)))
  +  (logand (pci:pci-io-region (gma-device device) +pci-bar-gmadr+) (lognot #xF)))
   
   (defconstant +reference-frequency+ 96000000)
   
  
positive.code: (defclass intel-gma ()
    ((%device :initarg :device :reader gma-device)
     (%registers :initarg :registers :reader gma-registers)
     (%edid :initarg :edid :reader gma-edid)
     (%lock :reader gma-lock)))
  
  (defmethod initialize-instance :after ((instance intel-gma) &key)
    (setf (slot-value instance '%lock) (sup:make-mutex instance)))
  
  ;;; Clock Control and Power Management Registers
  (defconstant +vga0+              #x06000)
  
negative.code:                     (decode-edid-standard-timings edid)))))
  
  (defun intel-gma-probe (pci-device)
    (format t "Detected intel-gma at ~S~%" pci-device)
    (let* ((card (make-instance 'intel-gma
                                :device pci-device
                                :registers (pci:pci-io-region pci-device +pci-bar-mmadr+)
                                :gm (pci:pci-io-region pci-device +pci-bar-gmadr+)
                                :gtt (pci:pci-io-region pci-device +pci-bar-gttadr+)))
           (mode (save-current-mode-parameters card))
           (framebuffer (framebuffer-address card)))
      (pci:pci-io-region pci-device +pci-bar-iobar+)
      (setf *card* card)
      ;; Take ownership of the compositor framebuffer.
      (when (and (eql (sup::framebuffer-layout (sup:current-framebuffer)) :x8r8g8b8)
                 (eql (framebuffer-address card)
                      (sup::framebuffer-base-address (sup:current-framebuffer))))
        (sup::video-set-framebuffer
         framebuffer
         (timing-horz-active mode)
         (timing-vert-active mode)
         (* (timing-horz-active mode) 4)
         :x8r8g8b8
         :device card)
        (mezzano.gui.compositor:force-redisplay t))
      (setf (slot-value card '%edid)
            (ignore-errors (decode-raw-edid (read-raw-edid card))))
      card))
  
  ;; Scary warning:
  ;;   Be careful adding new IDs here.
  