[PATCH 3/8] modesetting: Create new EGL screen in drmmode_xf86crtc_resize

Daniel Martin daniel.martin at secunet.com
Fri Nov 28 02:20:48 PST 2014


From: Daniel Martin <consume.noise at gmail.com>

If we don't glamor_egl_create_textured_screen_ext() in
drmmode_xf86crtc_resize() we end up with a black screen and no client
window(s) visible.

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
Found this as I was willing to expand the screen to an external monitor.
But, it can be reproduced if you switch the resolution of your panel to
a lower resolution (and back).

First, where I'm unsure. I haven't found a ...destroy... function, so we
just always create?

 hw/xfree86/drivers/modesetting/drmmode_display.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index ef9009e..5561df4 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -49,6 +49,11 @@
 
 #include "driver.h"
 
+#ifdef GLAMOR
+#define GLAMOR_FOR_XORG 1
+#include "glamor.h"
+#endif
+
 static struct dumb_bo *
 dumb_bo_create(int fd,
                const unsigned width, const unsigned height, const unsigned bpp)
@@ -1243,6 +1248,20 @@ drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
                                    pitch, drmmode->shadow_fb);
     }
 
+#ifdef GLAMOR
+    if (drmmode->glamor) {
+        if (!glamor_egl_create_textured_screen_ext(screen,
+                                                   drmmode->front_bo->handle,
+                                                   scrn->displayWidth *
+                                                   scrn->bitsPerPixel / 8,
+                                                   NULL)) {
+            xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+                       "glamor_egl_create_textured_screen_ext() failed\n");
+            goto fail;
+        }
+    }
+#endif
+
     for (i = 0; i < xf86_config->num_crtc; i++) {
         xf86CrtcPtr crtc = xf86_config->crtc[i];
 
-- 
2.1.3



More information about the xorg-devel mailing list