summaryrefslogtreecommitdiff
path: root/src/qxl_driver.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-01-16 10:54:57 -0500
committerSøren Sandmann <ssp@redhat.com>2012-01-27 10:33:08 -0500
commit6acad24a8df389e72c923e02fedd615e56dfe15b (patch)
tree4ab92f36df0408d2cb15a6544f71a5c33550d95b /src/qxl_driver.c
parent1b5a3f606a16fd704cdbd296b29f7dc89faf8471 (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.
Diffstat (limited to 'src/qxl_driver.c')
-rw-r--r--src/qxl_driver.c29
1 files changed, 27 insertions, 2 deletions
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