xf86-video-modesetting: 2 commits - configure.ac src/driver.c src/drmmode_display.c

Dave Airlie airlied at kemper.freedesktop.org
Thu Feb 20 18:54:59 PST 2014


 configure.ac          |    2 +-
 src/driver.c          |    2 +-
 src/drmmode_display.c |   14 ++++++++++++++
 3 files changed, 16 insertions(+), 2 deletions(-)

New commits:
commit c36a5e298c36deb5f6fd0eef3029235aa58de295
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Jan 20 11:06:42 2014 +1000

    modesetting: try and use hotspot cursor support
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/configure.ac b/configure.ac
index 0b04923..0ec8e18 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,7 +74,7 @@ AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
 # Checks for header files.
 AC_HEADER_STDC
 
-PKG_CHECK_MODULES(DRM, [libdrm >= 2.2])
+PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.46])
 PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
 AM_CONDITIONAL(DRM, test "x$DRM" = xyes)
 
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index ccfd75f..5b796e0 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -43,6 +43,8 @@
 #include "xf86Crtc.h"
 #include "drmmode_display.h"
 
+#include <cursorstr.h>
+
 /* DPMS */
 #ifdef HAVE_XEXTPROTO_71
 #include <X11/extensions/dpmsconst.h>
@@ -491,6 +493,18 @@ drmmode_show_cursor (xf86CrtcPtr crtc)
 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
 	drmmode_ptr drmmode = drmmode_crtc->drmmode;
 	uint32_t handle = drmmode_crtc->cursor_bo->handle;
+       static Bool use_set_cursor2 = TRUE;
+
+       if (use_set_cursor2) {
+               xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
+               CursorPtr cursor = xf86_config->cursor;
+               int ret;
+               ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height, cursor->bits->xhot, cursor->bits->yhot);
+               if (ret == -ENOSYS)
+                       use_set_cursor2 = FALSE;
+               else
+                       return;
+       }
 
 	drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle,
 			 ms->cursor_width, ms->cursor_height);
commit bf359b118a0870f18a229d33979270ac2f0f5dcd
Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Feb 21 12:48:42 2014 +1000

    modesetting: move closing fd to after we check outputs
    
    On something like cirrus, start X, then attempt to start a second
    X while the first is running, if fbdev is installed it'll fail
    hard.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/src/driver.c b/src/driver.c
index b28622a..4a74ece 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -258,11 +258,11 @@ static Bool probe_hw_pci(const char *dev, struct pci_device *pdev)
 
     id = drmGetBusid(fd);
     devid = ms_DRICreatePCIBusID(pdev);
-    close(fd);
 
     if (id && devid && !strcmp(id, devid))
         ret = check_outputs(fd);
 
+    close(fd);
     free(id);
     free(devid);
     return ret;


More information about the xorg-commit mailing list