[PATCH 16/19] io: add qxl_io_destroy_primary
Alon Levy
alevy at redhat.com
Thu May 31 03:24:50 PDT 2012
---
src/qxl.h | 1 +
src/qxl_driver.c | 15 +++++++++++++++
2 files changed, 16 insertions(+)
diff --git a/src/qxl.h b/src/qxl.h
index 819c98d..aa6645c 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -435,6 +435,7 @@ inline void qxl_mem_unverifiable(struct qxl_mem *mem) {}
void qxl_update_area(qxl_screen_t *qxl);
void qxl_io_memslot_add(qxl_screen_t *qxl, uint8_t id);
void qxl_io_create_primary(qxl_screen_t *qxl);
+void qxl_io_destroy_primary(qxl_screen_t *qxl);
void qxl_io_notify_oom(qxl_screen_t *qxl);
void qxl_io_flush_surfaces(qxl_screen_t *qxl);
void qxl_io_destroy_all_surfaces (qxl_screen_t *qxl);
diff --git a/src/qxl_driver.c b/src/qxl_driver.c
index 852cae2..809be5e 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -182,6 +182,21 @@ void qxl_io_create_primary(qxl_screen_t *qxl)
qxl->device_primary = QXL_DEVICE_PRIMARY_CREATED;
}
+void qxl_io_destroy_primary(qxl_screen_t *qxl)
+{
+#ifndef XSPICE
+ if (qxl->pci->revision >= 3) {
+ ioport_write(qxl, QXL_IO_DESTROY_PRIMARY_ASYNC, 0);
+ qxl_wait_for_io_command(qxl);
+ } else {
+ ioport_write(qxl, QXL_IO_DESTROY_PRIMARY, 0);
+ }
+#else
+ ioport_write(qxl, QXL_IO_DESTROY_PRIMARY, 0);
+#endif
+ qxl->device_primary = QXL_DEVICE_PRIMARY_NONE;
+}
+
void qxl_io_notify_oom(qxl_screen_t *qxl)
{
ioport_write(qxl, QXL_IO_NOTIFY_OOM, 0);
--
1.7.10.1
More information about the xorg-devel
mailing list