summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-02-01 16:55:32 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-02-01 16:59:13 +0000
commit3e784832a52686cd29d62bdeac7b1c539c640c5b (patch)
tree1b0e7b9948884751678c62bd2f9fac2f23d49110
parent3f2e199b6b4ce86ba3922f9f2dea5f6cba053453 (diff)
glamor: Enable Xv support
In addition to the UXA texture paths (which in theory support VSync) and direct overlay support, create a textured video paths that utilize the glamor acceleration code. Requested-by: Fabio Pedretti <fabio.ped@libero.it> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74311 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--configure.ac2
-rw-r--r--src/uxa/intel_glamor.c11
-rw-r--r--src/uxa/intel_glamor.h4
-rw-r--r--src/uxa/intel_video.c13
4 files changed, 27 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 03134a05..4e93f95e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -322,7 +322,7 @@ if test "x$GLAMOR" != "xno"; then
if test "x$UXA" != "xyes"; then
AC_MSG_ERROR([Glamor acceleration requested but UXA is not enabled])
fi
- PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.3.1])
+ PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
fi
diff --git a/src/uxa/intel_glamor.c b/src/uxa/intel_glamor.c
index 4d1c7679..e1e2a742 100644
--- a/src/uxa/intel_glamor.c
+++ b/src/uxa/intel_glamor.c
@@ -52,6 +52,17 @@ intel_glamor_exchange_buffers(struct intel_screen_private *intel,
glamor_egl_exchange_buffers(src, dst);
}
+XF86VideoAdaptorPtr intel_glamor_xv_init(ScreenPtr screen, int num_ports)
+{
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+
+ if ((intel->uxa_flags & UXA_USE_GLAMOR) == 0)
+ return NULL;
+
+ return glamor_xv_init(screen, num_ports);
+}
+
Bool
intel_glamor_create_screen_resources(ScreenPtr screen)
{
diff --git a/src/uxa/intel_glamor.h b/src/uxa/intel_glamor.h
index 46692bc8..2e305fc9 100644
--- a/src/uxa/intel_glamor.h
+++ b/src/uxa/intel_glamor.h
@@ -30,6 +30,8 @@
#ifndef INTEL_GLAMOR_H
#define INTEL_GLAMOR_H
+#include <xf86xv.h>
+
#ifdef USE_GLAMOR
Bool intel_glamor_pre_init(ScrnInfoPtr scrn);
@@ -45,6 +47,7 @@ void intel_glamor_destroy_pixmap(PixmapPtr pixmap);
PixmapPtr intel_glamor_create_pixmap(ScreenPtr screen, int w, int h,
int depth, unsigned int usage);
void intel_glamor_exchange_buffers(struct intel_screen_private *intel, PixmapPtr src, PixmapPtr dst);
+XF86VideoAdaptorPtr intel_glamor_xv_init(ScreenPtr screen, int num_ports);
#else
static inline Bool intel_glamor_pre_init(ScrnInfoPtr scrn) { return TRUE; }
@@ -62,6 +65,7 @@ static inline PixmapPtr intel_glamor_create_pixmap(ScreenPtr screen, int w, int
int depth, unsigned int usage) { return NULL; }
static inline void intel_glamor_exchange_buffers(struct intel_screen_private *intel, PixmapPtr src, PixmapPtr dst) {}
+static inline XF86VideoAdaptorPtr intel_glamor_xv_init(ScreenPtr screen, int num_ports) { return NULL; }
#endif
#endif /* INTEL_GLAMOR_H */
diff --git a/src/uxa/intel_video.c b/src/uxa/intel_video.c
index 238cd471..d1b98d47 100644
--- a/src/uxa/intel_video.c
+++ b/src/uxa/intel_video.c
@@ -78,6 +78,7 @@
#define _INTEL_XVMC_SERVER_
#include "intel_xvmc.h"
#endif
+#include "intel_glamor.h"
#define OFF_DELAY 250 /* milliseconds */
@@ -331,13 +332,13 @@ void I830InitVideo(ScreenPtr screen)
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
XF86VideoAdaptorPtr *adaptors = NULL, *newAdaptors = NULL;
- XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL;
+ XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL, glamorAdaptor = NULL;
int num_adaptors = xf86XVListGenericAdaptors(scrn, &adaptors);
/* Give our adaptor list enough space for the overlay and/or texture video
* adaptors.
*/
newAdaptors = realloc(adaptors,
- (num_adaptors + 2) * sizeof(XF86VideoAdaptorPtr));
+ (num_adaptors + 3) * sizeof(XF86VideoAdaptorPtr));
if (newAdaptors == NULL) {
free(adaptors);
return;
@@ -378,12 +379,20 @@ void I830InitVideo(ScreenPtr screen)
}
}
+ glamorAdaptor = intel_glamor_xv_init(screen, 16);
+ if (glamorAdaptor != NULL)
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "Set up textured video using glamor\n");
+
if (overlayAdaptor && intel->XvPreferOverlay)
adaptors[num_adaptors++] = overlayAdaptor;
if (texturedAdaptor)
adaptors[num_adaptors++] = texturedAdaptor;
+ if (glamorAdaptor)
+ adaptors[num_adaptors++] = glamorAdaptor;
+
if (overlayAdaptor && !intel->XvPreferOverlay)
adaptors[num_adaptors++] = overlayAdaptor;