diff options
author | Alon Levy <alevy@redhat.com> | 2012-05-07 14:45:38 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-05-31 20:24:33 +0300 |
commit | 429295a6983a727b04c188795621d95130803806 (patch) | |
tree | 1cf02b8e2ddff6049dfeaa30fc68a203fb99c8b5 | |
parent | 969ab1a61b207a23103ccd0dbccd973acf57bacf (diff) |
qxl: add num_heads / OPTION_NUM_HEADS / "NumHeads"
-rw-r--r-- | src/qxl.h | 2 | ||||
-rw-r--r-- | src/qxl_driver.c | 10 |
2 files changed, 7 insertions, 5 deletions
@@ -100,6 +100,7 @@ enum { OPTION_ENABLE_IMAGE_CACHE = 0, OPTION_ENABLE_FALLBACK_CACHE, OPTION_ENABLE_SURFACES, + OPTION_NUM_HEADS, #ifdef XSPICE OPTION_SPICE_PORT, OPTION_SPICE_TLS_PORT, @@ -176,6 +177,7 @@ struct _qxl_screen_t EntityInfoPtr entity; + int num_heads; xf86CrtcPtr * crtcs; xf86OutputPtr * outputs; diff --git a/src/qxl_driver.c b/src/qxl_driver.c index 33b336d..c3c35c5 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -70,6 +70,8 @@ const OptionInfoRec DefaultOptions[] = { "EnableFallbackCache", OPTV_BOOLEAN, { 0 }, TRUE }, { OPTION_ENABLE_SURFACES, "EnableSurfaces", OPTV_BOOLEAN, { 0 }, TRUE }, + { OPTION_NUM_HEADS, + "NumHeads", OPTV_INTEGER, { 1 }, FALSE }, #ifdef XSPICE { OPTION_SPICE_PORT, "SpicePort", OPTV_INTEGER, {5900}, FALSE }, @@ -1599,11 +1601,9 @@ qxl_init_randr(ScrnInfoPtr pScrn, qxl_screen_t *qxl) * xf86InitialConfiguration */ xf86CrtcSetSizeRange(pScrn, 320, 200, maxWidth, maxHeight); - /* The count is arbitrary. */ - // TODO pickup count from xorg.conf and/or from pci device (QXLRom) - qxl->crtcs = xnfcalloc(sizeof(xf86CrtcPtr), 2); - qxl->outputs = xnfcalloc(sizeof(xf86OutputPtr), 2); - for (i = 0 ; i < 2; ++i) { + qxl->crtcs = xnfcalloc(sizeof(xf86CrtcPtr), qxl->num_heads); + qxl->outputs = xnfcalloc(sizeof(xf86OutputPtr), qxl->num_heads); + for (i = 0 ; i < qxl->num_heads; ++i) { qxl->crtcs[i] = xf86CrtcCreate(pScrn, &qxl_crtc_funcs); if (!qxl->crtcs[i]) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "failed to create Crtc %d", |