+void intel_display_init(DisplayState *ds);
#endif
diff --git a/dom0_driver.c b/dom0_driver.c
-index 0988c6f..1aa5952 100644
+index 92f6b17..7f735a9 100644
--- a/dom0_driver.c
+++ b/dom0_driver.c
@@ -43,6 +43,7 @@
static void dom0_driver_state_change(const char *path, void *opaque);
static void dom0_driver_command(const char *path, void *opaque);
-@@ -692,6 +693,11 @@ void dom0_driver_init(const char *position)
+@@ -694,6 +695,11 @@ void dom0_driver_init(const char *position)
driver.enter = intel_enter;
driver.leave = intel_leave;
}
vga_update_display(s);
diff --git a/intel.c b/intel.c
new file mode 100644
-index 0000000..df9ebf7
+index 0000000..dbf08d2
--- /dev/null
+++ b/intel.c
-@@ -0,0 +1,517 @@
+@@ -0,0 +1,518 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+extern int vga_passthrough;
+uint32_t guest_framebuffer;
-+int intel_output;
++int intel_output = 2;
+static int display = 0;
+
+static int mmio_fd = -1;
+ if (intel_have_focus)
+ {
+ if (ds_get_width(ds) == IntelX && ds_get_height(ds) == IntelY &&
-+ is_buffer_shared(ds->surface))
++ is_buffer_shared(ds->surface) && lds->surface)
+ {
+ if (!map_size)
+ {
+ } else {
+ if (map_size)
+ unset_fb_mapping();
-+ intel_output = 1;
++ intel_output = 2;
+ }
+}
+
+ memset((uint8_t *)(intel_mem + intel_get_surface()), 0,
+ IntelX * IntelY * 4);
+ }
-+ vga_hw_invalidate();
+ vga_hw_update();
+ intel_check_linear();
++ vga_hw_invalidate();
+
-+ INTEL_DEBUG("intel_focus %d, x=%d, y=%d, stride=%d\n",
-+ focus, IntelX, IntelY, IntelPitch);
++ if (focus == 0)
++ intel_output = 2;
++
++ INTEL_DEBUG("intel_focus %d, x=%d, y=%d, stride=%d, intel_output=%d\n",
++ focus, IntelX, IntelY, IntelPitch, intel_output);
+}
+
+int intel_enter(void)
+ ds->surface = surf;
+ dpy_resize(ds);
+ }
-+
-+ intel_output = 1;
+ lds = ds;
+}
diff --git a/vl.c b/vl.c