xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Dec 8 15:50:36 PST 2014


 config/udev.c                                    |    7 ++---
 hw/xfree86/drivers/modesetting/driver.c          |   14 +++++-----
 hw/xfree86/drivers/modesetting/driver.h          |    1 
 hw/xfree86/drivers/modesetting/drmmode_display.c |   32 +++++++++++++++++------
 hw/xfree86/drivers/modesetting/drmmode_display.h |    5 ++-
 5 files changed, 38 insertions(+), 21 deletions(-)

New commits:
commit 32ca85c9e075e40b8a4712a79a51702facba0332
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Fri Nov 28 11:20:50 2014 +0100

    modesetting: Remove unused params from drmmode_output_init()
    
    drmmode_output_init() doesn't touch (the int*) num_dvi and num_hdmi.
    Remove both parameters.
    
    Signed-off-by: Daniel Martin <consume.noise at gmail.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 40c9ed3..d5b7d00 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1024,8 +1024,7 @@ static const char *const output_names[] = {
 };
 
 static void
-drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num,
-                    int *num_dvi, int *num_hdmi)
+drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int num)
 {
     xf86OutputPtr output;
     drmModeConnectorPtr koutput;
@@ -1298,7 +1297,7 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
 Bool
 drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
 {
-    int i, num_dvi = 0, num_hdmi = 0;
+    int i;
     int ret;
     uint64_t value = 0;
 
@@ -1326,7 +1325,7 @@ drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
             drmmode_crtc_init(pScrn, drmmode, i);
 
     for (i = 0; i < drmmode->mode_res->count_connectors; i++)
-        drmmode_output_init(pScrn, drmmode, i, &num_dvi, &num_hdmi);
+        drmmode_output_init(pScrn, drmmode, i);
 
     /* workout clones */
     drmmode_clones_init(pScrn, drmmode);
commit c0ea476b9bb91f03061b891ffb897c438fa03879
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Fri Nov 28 11:20:49 2014 +0100

    modesetting: Fix ifdefs s/HAVE_UDEV/CONFIG_UDEV_KMS/
    
    We don't define HAVE_UDEV, that's a remnant from xf86-video-modesetting.
    But, we have CONFIG_UDEV_KMS.
    
    Signed-off-by: Daniel Martin <consume.noise at gmail.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 5561df4..40c9ed3 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1487,7 +1487,7 @@ drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn)
     return TRUE;
 }
 
-#ifdef HAVE_UDEV
+#ifdef CONFIG_UDEV_KMS
 static void
 drmmode_handle_uevents(int fd, void *closure)
 {
@@ -1507,7 +1507,7 @@ drmmode_handle_uevents(int fd, void *closure)
 void
 drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
 {
-#ifdef HAVE_UDEV
+#ifdef CONFIG_UDEV_KMS
     struct udev *u;
     struct udev_monitor *mon;
 
@@ -1540,7 +1540,7 @@ drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode)
 void
 drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode)
 {
-#ifdef HAVE_UDEV
+#ifdef CONFIG_UDEV_KMS
     if (drmmode->uevent_handler) {
         struct udev *u = udev_monitor_get_udev(drmmode->uevent_monitor);
 
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h
index 528123a..92e2816 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -28,7 +28,7 @@
 #define DRMMODE_DISPLAY_H
 
 #include "xf86drmMode.h"
-#ifdef HAVE_UDEV
+#ifdef CONFIG_UDEV_KMS
 #include "libudev.h"
 #endif
 
@@ -48,7 +48,7 @@ typedef struct {
     drmModeFBPtr mode_fb;
     int cpp;
     ScrnInfoPtr scrn;
-#ifdef HAVE_UDEV
+#ifdef CONFIG_UDEV_KMS
     struct udev_monitor *uevent_monitor;
     InputHandlerProc uevent_handler;
 #endif
commit 8a16620dcd7a22fd9b38876ffc711629c4fbda0a
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Fri Nov 28 11:20:48 2014 +0100

    modesetting: Create new EGL screen in drmmode_xf86crtc_resize
    
    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>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>

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];
 
commit 0d63fa5850fe9d8b045b8f1a83e72b75f9065a7a
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Fri Nov 28 11:20:47 2014 +0100

    modesetting: Move Bool glamor into drmmode struct
    
    Move the boolean glamor from struct modesetting into struct drmmode for
    later re-use in drmmode_display.
    
    Signed-off-by: Daniel Martin <consume.noise at gmail.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 592f246..d1284c6 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -593,7 +593,7 @@ try_enable_glamor(ScrnInfoPtr pScrn)
     Bool do_glamor = (!accel_method_str ||
                       strcmp(accel_method_str, "glamor") == 0);
 
-    ms->glamor = FALSE;
+    ms->drmmode.glamor = FALSE;
 
 #ifdef GLAMOR
     if (!do_glamor) {
@@ -604,7 +604,7 @@ try_enable_glamor(ScrnInfoPtr pScrn)
     if (xf86LoadSubModule(pScrn, GLAMOR_EGL_MODULE_NAME)) {
         if (glamor_egl_init(pScrn, ms->fd)) {
             xf86DrvMsg(pScrn->scrnIndex, X_INFO, "glamor initialized\n");
-            ms->glamor = TRUE;
+            ms->drmmode.glamor = TRUE;
         } else {
             xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                        "glamor initialization failed\n");
@@ -788,7 +788,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
 
     try_enable_glamor(pScrn);
 
-    if (ms->glamor) {
+    if (ms->drmmode.glamor) {
         xf86LoadSubModule(pScrn, "dri2");
     } else {
         Bool prefer_shadow = TRUE;
@@ -887,7 +887,7 @@ CreateScreenResources(ScreenPtr pScreen)
         return FALSE;
 
 #ifdef GLAMOR
-    if (ms->glamor) {
+    if (ms->drmmode.glamor) {
         if (!glamor_egl_create_textured_screen_ext(pScreen,
                                                    ms->drmmode.front_bo->handle,
                                                    pScrn->displayWidth *
@@ -1053,7 +1053,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
     fbPictureInit(pScreen, NULL, 0);
 
 #ifdef GLAMOR
-    if (ms->glamor) {
+    if (ms->drmmode.glamor) {
         if (!glamor_init(pScreen,
                          GLAMOR_USE_EGL_SCREEN |
                          GLAMOR_USE_SCREEN |
@@ -1116,7 +1116,7 @@ ScreenInit(ScreenPtr pScreen, int argc, char **argv)
     }
 
 #ifdef GLAMOR
-    if (ms->glamor) {
+    if (ms->drmmode.glamor) {
         if (!ms_dri2_screen_init(pScreen)) {
             xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                        "Failed to initialize the DRI2 extension.\n");
@@ -1190,7 +1190,7 @@ CloseScreen(ScreenPtr pScreen)
     modesettingPtr ms = modesettingPTR(pScrn);
 
 #ifdef GLAMOR
-    if (ms->glamor) {
+    if (ms->drmmode.glamor) {
         ms_dri2_close_screen(pScreen);
     }
 #endif
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index 9eda1c4..bbf1ae0 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -97,7 +97,6 @@ typedef struct _modesettingRec {
     Bool dirty_enabled;
 
     uint32_t cursor_width, cursor_height;
-    Bool glamor;
 } modesettingRec, *modesettingPtr;
 
 #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h
index 987608c..528123a 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -56,6 +56,7 @@ typedef struct {
     struct dumb_bo *front_bo;
     Bool sw_cursor;
 
+    Bool glamor;
     Bool shadow_enable;
     void *shadow_fb;
 
commit 62a4eeaa25099872682d6c2f9f13a0e73fc5ce1e
Author: Daniel Martin <consume.noise at gmail.com>
Date:   Fri Nov 28 11:20:46 2014 +0100

    config/udev: Prefix and shift "removing GPU" message
    
    The message "removing GPU device ..." appeared even if the removal was
    skipped (when path == NULL). Move it below the path check and make it a
    LogMessage with config/udev prefix.
    
    Signed-off-by: Daniel Martin <consume.noise at gmail.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/config/udev.c b/config/udev.c
index 1e4a9d7..1d2140a 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -300,12 +300,11 @@ device_removed(struct udev_device *device)
         const char *path = udev_device_get_devnode(device);
         dev_t devnum = udev_device_get_devnum(device);
 
-        if (strncmp(sysname,"card", 4) != 0)
-            return;
-        ErrorF("removing GPU device %s %s\n", syspath, path);
-        if (!path)
+        if ((strncmp(sysname,"card", 4) != 0) || (path == NULL))
             return;
 
+        LogMessage(X_INFO, "config/udev: removing GPU device %s %s\n",
+                   syspath, path);
         config_udev_odev_setup_attribs(path, syspath, major(devnum),
                                        minor(devnum), DeleteGPUDeviceRequest);
         /* Retry vtenter after a drm node removal */


More information about the xorg-commit mailing list