From: <dar...@ke...> - 2014-06-24 09:26:10
|
configure.ac | 8 +++++++- src/nouveau_dri2.c | 26 +++++++++++++++++++++----- src/nouveau_present.c | 2 +- src/nouveau_present.h | 6 +++++- 4 files changed, 34 insertions(+), 8 deletions(-) New commits: commit 096fb1ebc10b14ba1b747832efe378369bcf44e6 Author: Mario Kleiner <mar...@gm...> Date: Mon May 26 05:39:50 2014 +0200 dri2: Add support for handling more than 2 crtc's Need to use the DRM_VBLANK_HIGH_CRTC bits to allow selecting crtc's with id > 1 on latest gpu's with up to four display engines. Signed-off-by: Mario Kleiner <mar...@gm...> Signed-off-by: Ben Skeggs <bs...@re...> diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c index adb0b22..7446122 100644 --- a/src/nouveau_dri2.c +++ b/src/nouveau_dri2.c @@ -584,7 +584,23 @@ nouveau_wait_vblank(DrawablePtr draw, int type, CARD64 msc, event->s = data; } - vbl.request.type = type | (crtcs == 2 ? DRM_VBLANK_SECONDARY : 0); + /* Select crtc with smallest index from bitmask of crtcs */ + crtcs = ffs(crtcs) - 1; + + if (crtcs == 1) + type |= DRM_VBLANK_SECONDARY; + else if (crtcs > 1) +#ifdef DRM_VBLANK_HIGH_CRTC_SHIFT + type |= (crtcs << DRM_VBLANK_HIGH_CRTC_SHIFT) & + DRM_VBLANK_HIGH_CRTC_MASK; +#else + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "Wait for VBlank failed: Called for CRTC %d > 1, but " + "DRM_VBLANK_HIGH_CRTC_SHIFT not defined at build time.\n", + crtcs); +#endif + + vbl.request.type = type; vbl.request.sequence = msc; vbl.request.signal = (unsigned long)token; @@ -630,11 +646,11 @@ nouveau_dri2_finish_swap(DrawablePtr draw, unsigned int frame, draw->width, draw->height); - /* Whenever first crtc is involved, choose it as reference, as - * its vblank event triggered this swap. + /* Choose crtc with smallest index as reference, as its + * vblank event triggered this swap. ref_crtc_hw_id is + * a bit field (crtc 0 = bit 0, crtc 1 = bit 1 ...) */ - if (ref_crtc_hw_id & 1) - ref_crtc_hw_id = 1; + ref_crtc_hw_id = 1 << (ffs(ref_crtc_hw_id) - 1); /* Update frontbuffer pixmap and name: Could have changed due to * window (un)redirection as part of compositing. commit 4771ff5c668047a2dc56e4c6131175eed837e757 Author: Marcin Slusarz <mar...@gm...> Date: Sun Jun 22 01:32:42 2014 +0200 present: build only when glamor is enabled nouveau_present_flip_exec references glamor_fd_from_pixmap, which do not exist when glamor is disabled Signed-off-by: Marcin Slusarz <mar...@gm...> Signed-off-by: Ben Skeggs <bs...@re...> diff --git a/src/nouveau_present.c b/src/nouveau_present.c index b294bbe..38f2cac 100644 --- a/src/nouveau_present.c +++ b/src/nouveau_present.c @@ -23,7 +23,7 @@ */ #include "nouveau_present.h" -#ifdef DRI3 +#if defined(DRI3) && defined(HAVE_GLAMOR) #include "nv_include.h" #include "nouveau_glamor.h" #include "xf86drmMode.h" diff --git a/src/nouveau_present.h b/src/nouveau_present.h index dea19ce..958c2f7 100644 --- a/src/nouveau_present.h +++ b/src/nouveau_present.h @@ -4,7 +4,11 @@ #include "xorg-server.h" #include "scrnintstr.h" -#ifdef DRI3 +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#if defined(DRI3) && defined(HAVE_GLAMOR) #include "present.h" Bool nouveau_present_init(ScreenPtr pScreen); void nouveau_present_fini(ScreenPtr pScreen); commit 41c1c4ee867753422d6486f13bf20b45905a5dd5 Author: Marcin Slusarz <mar...@gm...> Date: Sun Jun 22 01:31:46 2014 +0200 glamor: fix build without glamor.h xorg-server can be built without glamor, which leads to: CC nouveau_xv.lo In file included from nouveau_xv.c:41:0: nouveau_glamor.h:12:20: fatal error: glamor.h: No such file or directory compilation terminated. Signed-off-by: Marcin Slusarz <mar...@gm...> Signed-off-by: Ben Skeggs <bs...@re...> diff --git a/configure.ac b/configure.ac index c34e575..92e047a 100644 --- a/configure.ac +++ b/configure.ac @@ -128,7 +128,13 @@ XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION AC_MSG_CHECKING([whether to include GLAMOR support]) -if pkg-config --exists "xorg-server >= 1.15.99.901" + +AC_COMPILE_IFELSE(AC_LANG_PROGRAM( +[[ + #include <glamor.h> +]],[[]]),[found_glamor_header=yes],[found_glamor_header=no]) + +if test "$found_glamor_header" = "yes" && pkg-config --exists "xorg-server >= 1.15.99.901" then AC_DEFINE(HAVE_GLAMOR, 1, [Build support for glamor acceleration]) AC_MSG_RESULT([yes]) |