diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2012-01-16 10:54:57 -0500 |
---|---|---|
committer | Søren Sandmann <ssp@redhat.com> | 2012-01-27 10:33:08 -0500 |
commit | 6acad24a8df389e72c923e02fedd615e56dfe15b (patch) | |
tree | 4ab92f36df0408d2cb15a6544f71a5c33550d95b | |
parent | 1b5a3f606a16fd704cdbd296b29f7dc89faf8471 (diff) |
Add support for parsing various options
- EnableImageCache
- EnableFallbackCache
- EnableSurfaces
EnableImageCache will enable the use of caching for PutImage
requests. EnableFallbackCache will enable the use of caching for image
commands that are the result of fallback rendering.
-rw-r--r-- | src/qxl.h | 8 | ||||
-rw-r--r-- | src/qxl_driver.c | 29 |
2 files changed, 35 insertions, 2 deletions
@@ -122,6 +122,10 @@ enum { OPTION_SPICE_TLS_CIPHERS, OPTION_SPICE_CACERT_FILE, OPTION_SPICE_DH_FILE, +#else + OPTION_ENABLE_IMAGE_CACHE = 0, + OPTION_ENABLE_FALLBACK_CACHE, + OPTION_ENABLE_SURFACES, #endif OPTION_COUNT, }; @@ -207,6 +211,10 @@ struct _qxl_screen_t OptionInfoRec options[OPTION_COUNT + 1]; + int enable_image_cache; + int enable_fallback_cache; + int enable_surfaces; + #ifdef XSPICE /* XSpice specific */ struct QXLRom shadow_rom; /* Parameter RAM */ diff --git a/src/qxl_driver.c b/src/qxl_driver.c index 33658d6..8f71492 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -100,10 +100,21 @@ const OptionInfoRec DefaultOptions[] = { "SpiceCacertFile", OPTV_STRING, {0}, FALSE}, { OPTION_SPICE_DH_FILE, "SpiceDhFile", OPTV_STRING, {0}, FALSE}, +#else + { OPTION_ENABLE_IMAGE_CACHE, "EnableImageCache", OPTV_BOOLEAN, { 0 }, TRUE }, + { OPTION_ENABLE_FALLBACK_CACHE, "EnableFallbackCache", OPTV_BOOLEAN, { 0 }, TRUE }, + { OPTION_ENABLE_SURFACES, "EnableSurfaces", OPTV_BOOLEAN, { 0 }, TRUE }, #endif + { -1, NULL, OPTV_NONE, {0}, FALSE } }; +static const OptionInfoRec * +qxl_available_options (int chipid, int busid) +{ + return DefaultOptions; +} + static void qxl_wait_for_io_command(qxl_screen_t *qxl) { struct QXLRam *ram_header = (void *)( @@ -1399,7 +1410,7 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags) return FALSE; CHECK_POINT(); - + /* zaphod mode is for suckers and i choose not to implement it */ if (xf86IsEntityShared(pScrn->entityList[0])) { xf86DrvMsg(scrnIndex, X_ERROR, "No Zaphod mode for you\n"); @@ -1428,6 +1439,20 @@ qxl_pre_init(ScrnInfoPtr pScrn, int flags) xf86CollectOptions(pScrn, NULL); memcpy(qxl->options, DefaultOptions, sizeof(DefaultOptions)); xf86ProcessOptions(scrnIndex, pScrn->options, qxl->options); + + qxl->enable_image_cache = + xf86ReturnOptValBool (qxl->options, OPTION_ENABLE_IMAGE_CACHE, FALSE); + qxl->enable_fallback_cache = + xf86ReturnOptValBool (qxl->options, OPTION_ENABLE_FALLBACK_CACHE, FALSE); + qxl->enable_surfaces = + xf86ReturnOptValBool (qxl->options, OPTION_ENABLE_SURFACES, FALSE); + + xf86DrvMsg(scrnIndex, X_INFO, "Offscreen Surfaces: %s\n", + qxl->enable_surfaces? "Enabled" : "Disabled"); + xf86DrvMsg(scrnIndex, X_INFO, "Image Cache: %s\n", + qxl->enable_image_cache? "Enabled" : "Disabled"); + xf86DrvMsg(scrnIndex, X_INFO, "Fallback Cache: %s\n", + qxl->enable_fallback_cache? "Enabled" : "Disabled"); if (!qxl_map_memory(qxl, scrnIndex)) goto out; @@ -1715,7 +1740,7 @@ static DriverRec qxl_driver = { QXL_DRIVER_NAME, qxl_identify, qxl_probe, - NULL, + qxl_available_options, NULL, 0, #ifdef XSPICE |