summaryrefslogtreecommitdiff
path: root/vmwgfx/vmwgfx_driver.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2017-03-23 08:57:44 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2017-08-21 11:33:43 +0200
commit08ad438e2793248452dab100822cbfcaa05b9938 (patch)
treeb14fd021e76f6cf4890f9215634df8c2813451dc /vmwgfx/vmwgfx_driver.c
parentc8b8b2ee4a7b1085990443bbf1903ec265ff46f0 (diff)
vmwgfx: Support DRI3 v2
Add server-side DRI3 support Currently DRI3 introduces extra latency with gnome-shell for the following reasons: 1) We enable GLX_EXT_buffer_age. Causes gnome-shell to post fullscreen damage. 2) We enable GLX_OML_sync_control. Cases additional slowdown. Not exactly sure why. Probably we want to implement workarounds in mesa so that we don't enable these extensions for gnome-shell. That can be done with driconf, using some trickery. v2: Verify that sharing an ARGB surface as XRGB works before enabling DRI3. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Diffstat (limited to 'vmwgfx/vmwgfx_driver.c')
-rw-r--r--vmwgfx/vmwgfx_driver.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index 967dec9..48d3d93 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -623,6 +623,11 @@ drv_pre_init(ScrnInfoPtr pScrn, int flags)
goto out_modes;
}
+ if (!xf86LoadSubModule(pScrn, "dri3")) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to load dri3 module.\n");
+ goto out_modes;
+ }
+
return TRUE;
out_modes:
@@ -1055,6 +1060,16 @@ drv_screen_init(SCREEN_INIT_ARGS_DECL)
ms->xat = NULL;
ms->from_render = X_PROBED;
}
+#ifdef DRI3
+ if (major == VMW_XA_VERSION_MAJOR_DRI3 &&
+ minor >= VMW_XA_VERSION_MINOR_DRI3) {
+ ms->xa_dri3 = TRUE;
+ } else {
+ ms->xa_dri3 = FALSE;
+ LogMessage(X_WARNING,
+ "Gallium3D XA version insufficient for dri3.\n");
+ }
+#endif
}
if (ms->xat == NULL && ms->rendercheck) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -1079,12 +1094,21 @@ drv_screen_init(SCREEN_INIT_ARGS_DECL)
}
ms->dri2_available = FALSE;
+ ms->dri3_available = FALSE;
if (ms->enable_dri) {
if (ms->xat) {
ms->dri2_available = xorg_dri2_init(pScreen);
if (!ms->dri2_available)
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Failed to initialize direct rendering.\n");
+ "Failed to initialize direct rendering DRI2.\n");
+#ifdef DRI3
+ if (ms->xa_dri3) {
+ ms->dri3_available = vmwgfx_dri3_init(pScreen);
+ if (!ms->dri3_available)
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Failed to initialize direct rendering DRI3.\n");
+ }
+#endif /* DRI3 */
} else {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Skipped initialization of direct rendering due "
@@ -1100,8 +1124,14 @@ drv_screen_init(SCREEN_INIT_ARGS_DECL)
"Rendercheck mode is %s.\n",
(ms->rendercheck) ? "enabled" : "disabled");
- xf86DrvMsg(pScrn->scrnIndex, ms->from_dri, "Direct rendering (3D) is %s.\n",
+ xf86DrvMsg(pScrn->scrnIndex, ms->from_dri,
+ "Direct rendering (DRI2 3D) is %s.\n",
(ms->dri2_available) ? "enabled" : "disabled");
+#ifdef DRI3
+ xf86DrvMsg(pScrn->scrnIndex, ms->from_dri,
+ "Direct rendering (DRI3 3D) is %s.\n",
+ (ms->dri3_available) ? "enabled" : "disabled");
+#endif
if (ms->xat != NULL) {
xf86DrvMsg(pScrn->scrnIndex, ms->from_dp, "Direct presents are %s.\n",
(ms->direct_presents) ? "enabled" : "disabled");