summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2012-05-29 12:25:12 +0300
committerAlon Levy <alevy@redhat.com>2012-06-15 10:34:57 +0300
commit0f817bb4e1b4e33ef50c0399c92f1cc091840ef5 (patch)
tree01b187807075314f388dd0696746a512df09026b /src
parent326b80974b4080ed7519801f7d1c96077f5ae0b9 (diff)
io: add qxl_io_destroy_primary
Diffstat (limited to 'src')
-rw-r--r--src/qxl.h1
-rw-r--r--src/qxl_driver.c17
2 files changed, 18 insertions, 0 deletions
diff --git a/src/qxl.h b/src/qxl.h
index 4a1cc62..1db0581 100644
--- a/src/qxl.h
+++ b/src/qxl.h
@@ -436,6 +436,7 @@ static 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 51b28db..0e34a86 100644
--- a/src/qxl_driver.c
+++ b/src/qxl_driver.c
@@ -182,6 +182,23 @@ 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);