Skip to contentSkip to conversation

drmmode: fix screen resize without acceleration

PATCH New Ilia Mirkin 1 participant 2 messages Jul 18, 2020 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drmmode: fix screen resize without acceleration

This got broken with commit 86024cee back in 2014! drmmode_pixmap/nouveau_pixmap expect there to be EXA wrapping around the pixmap now, which is not there without accel.

---
 src/drmmode_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/drmmode_display.c +1 -1
index 89927a4..69421e1 100644
@@ -1561,7 +1561,7 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
 	}
 
 	ppix = screen->GetScreenPixmap(screen);
-	if (pNv->AccelMethod >= NONE)
+	if (pNv->AccelMethod > NONE)
 		nouveau_bo_ref(pNv->scanout, &drmmode_pixmap(ppix)->bo);
 	screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch,
 				   (pNv->AccelMethod > NONE || pNv->ShadowPtr) ?
Signature · 1 line
2.26.2

A message that is not in the archive (sent off-list or not yet received): 20200718225319.27884-1-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

#2 lore raw

PATCH 2/2 present: don't enable if there's no acceleration

All the present logic relies on EXA being used to wrap everything. Unclear if present could even be used without the other things EXA enables, but better be safe.

---
 src/nv_driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/nv_driver.c +1 -1
index a63674c..e72a6b6 100644
@@ -1489,7 +1489,7 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
 
 	xf86SetBlackWhitePixels(pScreen);
 
-	if (nouveau_present_init(pScreen))
+	if (pNv->AccelMethod == EXA && nouveau_present_init(pScreen))
 		xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 			   "Hardware support for Present enabled\n");
 	else
Signature · 1 line
2.26.2