summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-12-06 09:53:16 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2011-12-06 18:22:55 +0100
commit2c438ad8b82f47ac3252403052df16655184acbd (patch)
treeb19ac1b0e2be79ec38014b6f42c028e932a70faf
parent1736a76246f0a0dab01f5a1066332168d34b2803 (diff)
vmwgfx: Add an option to enable rendercheck mode
Rendercheck mode is used to enable acceleration of all supported composite operations, regardless of the current data location. The mode is off by default, but could be turned on to test the hardware composite operation implementation. Due to excessive data migration, rendercheck mode will be slow. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
-rw-r--r--src/vmware_bootstrap.c1
-rw-r--r--src/vmware_bootstrap.h3
-rw-r--r--vmwgfx/vmwgfx_driver.c19
-rw-r--r--vmwgfx/vmwgfx_driver.h2
-rw-r--r--vmwgfx/vmwgfx_saa.c11
-rw-r--r--vmwgfx/vmwgfx_saa.h3
-rw-r--r--vmwgfx/vmwgfx_saa_priv.h1
7 files changed, 35 insertions, 5 deletions
diff --git a/src/vmware_bootstrap.c b/src/vmware_bootstrap.c
index 92eb3c5..522fec0 100644
--- a/src/vmware_bootstrap.c
+++ b/src/vmware_bootstrap.c
@@ -191,6 +191,7 @@ static const OptionInfoRec VMWAREOptions[] = {
{ OPTION_DRI, "DRI", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_DIRECT_PRESENTS, "DirectPresents", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_HW_PRESENTS, "HWPresents", OPTV_BOOLEAN, {0}, FALSE},
+ { OPTION_RENDERCHECK, "RenderCheck", OPTV_BOOLEAN, {0}, FALSE},
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
diff --git a/src/vmware_bootstrap.h b/src/vmware_bootstrap.h
index 1a1ee9e..172deb8 100644
--- a/src/vmware_bootstrap.h
+++ b/src/vmware_bootstrap.h
@@ -40,7 +40,8 @@ typedef enum {
OPTION_RENDER_ACCEL,
OPTION_DRI,
OPTION_DIRECT_PRESENTS,
- OPTION_HW_PRESENTS
+ OPTION_HW_PRESENTS,
+ OPTION_RENDERCHECK
} VMWAREOpts;
OptionInfoPtr VMWARECopyOptions(void);
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index fe98bca..088ac3d 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -449,6 +449,11 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
&ms->accelerate_render) ?
X_CONFIG : X_PROBED;
+ ms->rendercheck = FALSE;
+ ms->from_rendercheck = xf86GetOptValBool(ms->Options, OPTION_RENDERCHECK,
+ &ms->rendercheck) ?
+ X_CONFIG : X_DEFAULT;
+
ms->enable_dri = ms->accelerate_render;
ms->from_dri = xf86GetOptValBool(ms->Options, OPTION_DRI,
&ms->enable_dri) ?
@@ -993,11 +998,18 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
ms->from_render = X_PROBED;
}
}
+ if (ms->xat == NULL && ms->rendercheck) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Turning off renercheck mode.\n");
+ ms->rendercheck = FALSE;
+ ms->from_rendercheck = X_PROBED;
+ }
}
if (!vmwgfx_saa_init(pScreen, ms->fd, ms->xat, &xorg_flush,
ms->direct_presents,
- ms->only_hw_presents)) {
+ ms->only_hw_presents,
+ ms->rendercheck)) {
FatalError("Failed to initialize SAA.\n");
}
@@ -1018,6 +1030,11 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DrvMsg(pScrn->scrnIndex, ms->from_render, "Render acceleration is %s.\n",
(ms->xat != NULL) ? "enabled" : "disabled");
+
+ xf86DrvMsg(pScrn->scrnIndex, ms->from_rendercheck,
+ "Rendercheck mode is %s.\n",
+ (ms->rendercheck) ? "enabled" : "disabled");
+
xf86DrvMsg(pScrn->scrnIndex, ms->from_dri, "Direct rendering (3D) is %s.\n",
(ms->dri2_available) ? "enabled" : "disabled");
if (ms->xat != NULL) {
diff --git a/vmwgfx/vmwgfx_driver.h b/vmwgfx/vmwgfx_driver.h
index f6c9ec0..4589550 100644
--- a/vmwgfx/vmwgfx_driver.h
+++ b/vmwgfx/vmwgfx_driver.h
@@ -90,6 +90,8 @@ typedef struct _modesettingRec
/* Accel */
Bool accelerate_render;
Bool from_render;
+ Bool rendercheck;
+ MessageType from_rendercheck;
Bool SWCursor;
CursorPtr cursor;
Bool enable_dri;
diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
index d14c551..7788ed5 100644
--- a/vmwgfx/vmwgfx_saa.c
+++ b/vmwgfx/vmwgfx_saa.c
@@ -1070,7 +1070,12 @@ vmwgfx_composite_prepare(struct saa_driver *driver, CARD8 op,
valid_hw = (valid_hw && tmp_valid_hw);
}
- if (!valid_hw && !dirty_hw)
+ /*
+ * In rendercheck mode we try to accelerate all supported
+ * composite operations.
+ */
+
+ if (!valid_hw && !dirty_hw && !vsaa->rendercheck)
goto out_err;
/*
@@ -1320,7 +1325,8 @@ Bool
vmwgfx_saa_init(ScreenPtr pScreen, int drm_fd, struct xa_tracker *xat,
void (*present_flush)(ScreenPtr pScreen),
Bool direct_presents,
- Bool only_hw_presents)
+ Bool only_hw_presents,
+ Bool rendercheck)
{
struct vmwgfx_saa *vsaa;
@@ -1342,6 +1348,7 @@ vmwgfx_saa_init(ScreenPtr pScreen, int drm_fd, struct xa_tracker *xat,
vsaa->can_optimize_dma = FALSE;
vsaa->use_present_opt = direct_presents;
vsaa->only_hw_presents = only_hw_presents;
+ vsaa->rendercheck = rendercheck;
WSBMINITLISTHEAD(&vsaa->sync_x_list);
vsaa->driver = vmwgfx_saa_driver;
diff --git a/vmwgfx/vmwgfx_saa.h b/vmwgfx/vmwgfx_saa.h
index 1276768..bb8ec96 100644
--- a/vmwgfx/vmwgfx_saa.h
+++ b/vmwgfx/vmwgfx_saa.h
@@ -82,7 +82,8 @@ extern Bool
vmwgfx_saa_init(ScreenPtr pScreen, int drm_fd, struct xa_tracker *xat,
void (*present_flush)(ScreenPtr pScreen),
Bool direct_presents,
- Bool only_hw_presents);
+ Bool only_hw_presents,
+ Bool rendercheck);
extern uint32_t
vmwgfx_scanout_ref(struct vmwgfx_screen_entry *box);
diff --git a/vmwgfx/vmwgfx_saa_priv.h b/vmwgfx/vmwgfx_saa_priv.h
index b48ef18..5f46dee 100644
--- a/vmwgfx/vmwgfx_saa_priv.h
+++ b/vmwgfx/vmwgfx_saa_priv.h
@@ -53,6 +53,7 @@ struct vmwgfx_saa {
Bool can_optimize_dma;
Bool use_present_opt;
Bool only_hw_presents;
+ Bool rendercheck;
void (*present_flush) (ScreenPtr pScreen);
struct _WsbmListHead sync_x_list;
struct vmwgfx_composite *vcomp;