diff options
author | Alon Levy <alevy@redhat.com> | 2012-05-23 20:52:48 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-05-31 20:13:47 +0300 |
commit | 09303958e18932c27347bcf8e70deef3a4c28aeb (patch) | |
tree | 95be7eeeab49fb39e9aff877153d8e3801ab53d0 | |
parent | 1c157ec1c464bf0f43bf24c0abb464264ab8a8b2 (diff) |
qxl.h: add device_primary tri state UNDEFINED/NONE/CREATED
-rw-r--r-- | src/qxl.h | 8 | ||||
-rw-r--r-- | src/qxl_driver.c | 4 |
2 files changed, 12 insertions, 0 deletions
@@ -126,6 +126,12 @@ enum { OPTION_COUNT, }; +enum { + QXL_DEVICE_PRIMARY_UNDEFINED, + QXL_DEVICE_PRIMARY_NONE, + QXL_DEVICE_PRIMARY_CREATED, +}; + struct _qxl_screen_t { /* These are the names QXL uses */ @@ -138,6 +144,8 @@ struct _qxl_screen_t struct qxl_ring * command_ring; struct qxl_ring * cursor_ring; struct qxl_ring * release_ring; + + int device_primary; int num_modes; struct QXLMode * modes; diff --git a/src/qxl_driver.c b/src/qxl_driver.c index 1dbde5b..d78ea23 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -179,6 +179,7 @@ void qxl_create_primary(qxl_screen_t *qxl) #else ioport_write(qxl, QXL_IO_CREATE_PRIMARY, 0); #endif + qxl->device_primary = QXL_DEVICE_PRIMARY_CREATED; } void qxl_notify_oom(qxl_screen_t *qxl) @@ -547,6 +548,7 @@ static void qxl_reset_and_create_mem_slots (qxl_screen_t *qxl) { ioport_write(qxl, QXL_IO_RESET, 0); + qxl->device_primary = QXL_DEVICE_PRIMARY_NONE; /* Mem slots */ ErrorF ("slots start: %d, slots end: %d\n", qxl->rom->slots_start, @@ -1236,6 +1238,7 @@ qxl_leave_vt(int scrnIndex, int flags) ioport_write(qxl, QXL_IO_RESET, 0); qxl_restore_state(pScrn); + qxl->device_primary = QXL_DEVICE_PRIMARY_NONE; } static Bool @@ -1449,6 +1452,7 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags) pScrn->driverPrivate = xnfcalloc(sizeof(qxl_screen_t), 1); qxl = pScrn->driverPrivate; memset(qxl, 0, sizeof(qxl)); + qxl->device_primary = QXL_DEVICE_PRIMARY_UNDEFINED; qxl->entity = xf86GetEntityInfo(pScrn->entityList[0]); |