anchor.diff:            (t
              (values nil resp-type)))))
   
  -(defun virtio-gpu-irq-handler (gpu)
  -  (latch-trigger (virtio-gpu-irq-latch gpu)))
  -
  -(defun virtio-gpu-dirty (gpu x y w h in-unsafe-context-p)
  -  ;; Issue commands to update the framebuffer and to flush the scanout.
  +(defun virtio-gpu-transfer-to-host-2d (gpu x y width height offset resource-id)
     (virtio-gpu-configure-command gpu
                                   +virtio-gpu-cmd-transfer-to-host-2d+
                                   0
  
positive.code:                                 0)
    (setf (sys.int::memref-unsigned-byte-32 (virtio-gpu-command-address gpu +virtio-gpu-resource-flush-x+) 0) x
          (sys.int::memref-unsigned-byte-32 (virtio-gpu-command-address gpu +virtio-gpu-resource-flush-y+) 0) y
          (sys.int::memref-unsigned-byte-32 (virtio-gpu-command-address gpu +virtio-gpu-resource-flush-width+) 0) w
          (sys.int::memref-unsigned-byte-32 (virtio-gpu-command-address gpu +virtio-gpu-resource-flush-height+) 0) h
          (sys.int::memref-unsigned-byte-32 (virtio-gpu-command-address gpu +virtio-gpu-resource-flush-resource-id+) 0) +virtio-gpu-framebuffer-resource-id+)
    (virtio-gpu-issue-command gpu +virtio-gpu-resource-flush-size+ 0 in-unsafe-context-p))
  
  
  (defun virtio-gpu-register (device)
    ;; Wired allocation required for the IRQ handler closure.
    (declare (sys.c::closure-allocation :wired))
    (debug-print-line "Detected virtio GPU device " device)
    (let* ((gpu (make-virtio-gpu :virtio-device device))
           (irq-handler (lambda (interrupt-frame irq)
                          (declare (ignore interrupt-frame irq))
                          (virtio-gpu-irq-handler gpu)))
           ;; Allocate some memory for the request header & footer.
           (frame (or (allocate-physical-pages 1)
                      (panic "Unable to allocate memory for virtio gpu request")))
  
negative.code:     (let ((last-used (virtio-ring-used-idx vq)))
        (virtio-ring-add-to-avail-ring vq cmd-desc)
        (virtio-kick dev +virtio-gpu-controlq+)
        ;; Spin waiting for the command to complete.
        (loop
           (when (not (eql last-used (virtio-ring-used-idx vq)))
             (return))))
      ;; Release descriptors
      (virtio-ring-free-descriptor vq cmd-desc)
      (virtio-ring-free-descriptor vq rsp-desc)
  