summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-08-16 17:47:30 -0700
committerKeith Packard <keithp@keithp.com>2014-11-20 17:23:29 -0800
commit028f33d0e5b121afc984f5e2255963ae5e45ee3c (patch)
treef89629e0d08fb991ba3c8a1822e71000164b5232
parent9eeaa722ae7d0963d1e17be80569d9a2715ff670 (diff)
Add glamor back into the driver
This adds glamor support back into the driver, but instad of going through UXA, this uses it directly instead. Supports DRI2 directly and DRI3 via glamor. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--configure.ac42
-rw-r--r--src/intel_driver.h2
-rw-r--r--src/intel_module.c5
-rw-r--r--src/uxa/Makefile.am9
-rw-r--r--src/uxa/intel.h6
-rw-r--r--src/uxa/intel_driver.c36
-rw-r--r--src/uxa/intel_glamor.c382
-rw-r--r--src/uxa/intel_glamor.h62
8 files changed, 541 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 88c0f5ae..8f469ef9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -430,6 +430,22 @@ if test "x$UXA" != "xno"; then
UXA=yes
fi
+AC_ARG_ENABLE(glamor,
+ AS_HELP_STRING([--enable-glamor],
+ [Enable glamor, a new GL-based acceleration [default=no]]),
+ [GLAMOR="$enableval"],
+ [GLAMOR="no"])
+if test "x$GLAMOR" != "xno"; then
+ if pkg-config --exists "xorg-server >= 1.15.99.901"; then
+ GLAMOR="yes (using Xorg glamor module)"
+ else
+ PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
+ PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+ GLAMOR="yes (using libglamor)"
+ fi
+ AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
+fi
+
PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_server_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES])
ABI_VERSION=`$PKG_CONFIG --variable=abi_videodrv xorg-server`
@@ -637,6 +653,10 @@ AC_MSG_CHECKING([whether to include UXA support])
AC_MSG_RESULT([$UXA])
AM_CONDITIONAL(UXA, test "x$UXA" != "xno")
+AC_MSG_CHECKING([whether to include GLAMOR support])
+AC_MSG_RESULT([$GLAMOR])
+AM_CONDITIONAL(GLAMOR, test "x$GLAMOR" != "xno")
+
AC_MSG_CHECKING([whether to include SNA support])
AM_CONDITIONAL(SNA, test "x$SNA" != "xno")
AC_MSG_RESULT([$SNA])
@@ -657,7 +677,7 @@ fi
AC_ARG_WITH(default-accel,
AS_HELP_STRING([--with-default-accel],
- [Select the default acceleration method out of none, sna, or uxa [default is sna if enabled, otherwise uxa]]),
+ [Select the default acceleration method out of glamor, none, sna, or uxa [default is sna if enabled, otherwise uxa]]),
[accel="$withval"],
[accel="auto"])
if test "x$accel" = "xyes"; then
@@ -672,6 +692,10 @@ if test "x$accel" = "xauto"; then
else
if test "x$UXA" != "xno"; then
accel="uxa"
+ else
+ if test "x$GLAMOR" != "xno"; then
+ accel="glamor"
+ fi
fi
fi
if test "x$accel" = "xauto" -a "x$KMS" = "xyes"; then
@@ -698,6 +722,15 @@ if test "x$accel" = "xuxa"; then
fi
fi
+if test "x$accel" = "xglamor"; then
+ if test "x$GLAMOR" != "xno"; then
+ AC_DEFINE(DEFAULT_ACCEL_METHOD, GLAMOR, [Default acceleration method])
+ have_accel="yes"
+ else
+ AC_MSG_ERROR([glamor acceleration requested as default, but is not enabled])
+ fi
+fi
+
if test "x$have_accel" = "xnone"; then
if test "x$KMS" = "xyes"; then
if test "x$SNA" != "xno" -o "x$UXA" != "xno"; then
@@ -895,6 +928,13 @@ if test "x$UXA" != "xno"; then
accel_msg="$accel_msg uxa"
fi
fi
+if test "x$GLAMOR" != "xno"; then
+ if test "$accel" = "glamor"; then
+ accel_msg="$accel_msg *glamor"
+ else
+ accel_msg="$accel_msg glamor"
+ fi
+fi
if test "x$dri_msg" = "x"; then
dri_msg=" none"
diff --git a/src/intel_driver.h b/src/intel_driver.h
index 28ed1a0e..f3eb90a2 100644
--- a/src/intel_driver.h
+++ b/src/intel_driver.h
@@ -137,7 +137,7 @@ void intel_put_device(struct intel_device *dev);
void intel_detect_chipset(ScrnInfoPtr scrn, struct intel_device *dev);
#define IS_DEFAULT_ACCEL_METHOD(x) ({ \
- enum { NOACCEL, SNA, UXA } default_accel_method__ = DEFAULT_ACCEL_METHOD; \
+ enum { NOACCEL, SNA, UXA, GLAMOR } default_accel_method__ = DEFAULT_ACCEL_METHOD; \
default_accel_method__ == x; \
})
diff --git a/src/intel_module.c b/src/intel_module.c
index 102d52aa..2fbb4df2 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -500,7 +500,7 @@ _xf86findDriver(const char *ident, XF86ConfDevicePtr p)
return NULL;
}
-static enum accel_method { NOACCEL, SNA, UXA } get_accel_method(void)
+static enum accel_method { NOACCEL, SNA, UXA, GLAMOR } get_accel_method(void)
{
enum accel_method accel_method = DEFAULT_ACCEL_METHOD;
XF86ConfDevicePtr dev;
@@ -520,6 +520,8 @@ static enum accel_method { NOACCEL, SNA, UXA } get_accel_method(void)
accel_method = SNA;
else if (strcasecmp(s, "uxa") == 0)
accel_method = UXA;
+ else if (strcasecmp(s, "glamor") == 0)
+ accel_method = GLAMOR;
}
}
@@ -581,6 +583,7 @@ intel_scrn_create(DriverPtr driver,
#if !USE_SNA
case NOACCEL:
#endif
+ case GLAMOR:
case UXA:
return intel_init_scrn(scrn);
#endif
diff --git a/src/uxa/Makefile.am b/src/uxa/Makefile.am
index 7c9f7a56..83a6a61c 100644
--- a/src/uxa/Makefile.am
+++ b/src/uxa/Makefile.am
@@ -68,6 +68,15 @@ libuxa_la_SOURCES += \
$(NULL)
endif
+if GLAMOR
+AM_CFLAGS += $(LIBGLAMOR_CFLAGS)
+libuxa_la_LIBADD += $(LIBGLAMOR_LIBS)
+libuxa_la_SOURCES += \
+ intel_glamor.h \
+ intel_glamor.c \
+ $(NULL)
+endif
+
if DRI2
AM_CFLAGS += $(DRI2_CFLAGS)
libuxa_la_SOURCES += \
diff --git a/src/uxa/intel.h b/src/uxa/intel.h
index 0230271d..14be4ecd 100644
--- a/src/uxa/intel.h
+++ b/src/uxa/intel.h
@@ -221,7 +221,13 @@ struct intel_screen_accel {
XF86VideoAdaptorPtr (*create_textured_video_adaptor)(ScreenPtr screen);
};
+#if USE_UXA
extern const struct intel_screen_accel intel_uxa_accel;
+#endif
+
+#if USE_GLAMOR
+extern const struct intel_screen_accel intel_glamor_accel;
+#endif
#define INTEL_INFO(intel) ((intel)->info)
#define IS_GENx(intel, X) (INTEL_INFO(intel)->gen >= 8*(X) && INTEL_INFO(intel)->gen < 8*((X)+1))
diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index 329b0943..bbf68f52 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -210,6 +210,41 @@ static void intel_check_chipset_option(ScrnInfoPtr scrn)
intel_detect_chipset(scrn, intel->dev);
}
+static void intel_check_accel_option(ScrnInfoPtr scrn)
+{
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+ enum { NOACCEL, SNA, UXA, GLAMOR } accel_method = DEFAULT_ACCEL_METHOD;
+ const char *s;
+
+ s = xf86GetOptValString(intel->Options, OPTION_ACCEL_METHOD);
+ if (s != NULL) {
+#if USE_GLAMOR
+ if (strcasecmp(s, "glamor") == 0)
+ accel_method = GLAMOR;
+ else
+#endif
+#if USE_UXA
+ if (strcasecmp(s, "uxa") == 0)
+ accel_method = UXA;
+ else
+#endif
+ accel_method = DEFAULT_ACCEL_METHOD;
+ }
+ switch (accel_method) {
+ default:
+#if USE_GLAMOR
+ case GLAMOR:
+ intel->accel = &intel_glamor_accel;
+ break;
+#endif
+#if USE_UXA
+ case UXA:
+ intel->accel = &intel_uxa_accel;
+ break;
+#endif
+ }
+}
+
Bool intel_option_cast_string_to_bool(intel_screen_private *intel,
int id, Bool val)
{
@@ -438,6 +473,7 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
intel_setup_capabilities(scrn);
intel_check_chipset_option(scrn);
intel_check_dri_option(scrn);
+ intel_check_accel_option(scrn);
if (!intel_init_bufmgr(intel)) {
intel_pre_init_cleanup(scrn);
diff --git a/src/uxa/intel_glamor.c b/src/uxa/intel_glamor.c
new file mode 100644
index 00000000..4ca853de
--- /dev/null
+++ b/src/uxa/intel_glamor.c
@@ -0,0 +1,382 @@
+/*
+ * Copyright © 2011 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including
+ * the next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Zhigang Gong <zhigang.gong@linux.intel.com>
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "xorg-server.h"
+#include <xf86.h>
+#define GLAMOR_FOR_XORG 1
+#include <glamor.h>
+#include <unistd.h>
+
+#include "intel.h"
+#include "i915_drm.h"
+#include "intel_glamor.h"
+#include "intel_options.h"
+
+struct intel_glamor_pixmap {
+ dri_bo *bo;
+};
+
+static DevPrivateKeyRec intel_glamor_pixmap_key;
+
+static inline struct intel_glamor_pixmap *intel_glamor_get_pixmap(PixmapPtr pixmap)
+{
+ return dixGetPrivateAddr(&pixmap->devPrivates, &intel_glamor_pixmap_key);
+}
+
+dri_bo *
+intel_glamor_get_pixmap_bo(PixmapPtr pixmap)
+{
+ dri_bo *bo = intel_glamor_get_pixmap(pixmap)->bo;
+
+ if (!bo) {
+ ScreenPtr screen = pixmap->drawable.pScreen;
+ CARD16 stride;
+ CARD32 size;
+ int fd;
+
+ fd = glamor_fd_from_pixmap(screen,
+ pixmap,
+ &stride,
+ &size);
+
+ if (fd >= 0) {
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+
+ bo = drm_intel_bo_gem_create_from_prime(intel->bufmgr,
+ fd,
+ size);
+ close(fd);
+ intel_glamor_get_pixmap(pixmap)->bo = bo;
+ }
+ }
+ return bo;
+}
+
+static void
+intel_glamor_reference_pixmap_bo(PixmapPtr pixmap, drm_intel_bo *bo)
+{
+ struct intel_glamor_pixmap *glamor_pixmap = intel_glamor_get_pixmap(pixmap);
+
+ if (glamor_pixmap->bo) {
+ ErrorF("Unreference bo %d size %lu from pixmap %d x %d\n",
+ glamor_pixmap->bo->handle, glamor_pixmap->bo->size, pixmap->drawable.width, pixmap->drawable.height);
+ drm_intel_bo_unreference(glamor_pixmap->bo);
+ glamor_pixmap->bo = NULL;
+ }
+
+ if (bo) {
+ ErrorF("Reference bo %d size %lu from pixmap %d x %d\n",
+ bo->handle, bo->size, pixmap->drawable.width, pixmap->drawable.height);
+ drm_intel_bo_reference(bo);
+ glamor_pixmap->bo = bo;
+ }
+}
+
+Bool
+intel_glamor_set_pixmap_bo(PixmapPtr pixmap, drm_intel_bo *bo)
+{
+ if (bo == NULL || glamor_egl_create_textured_pixmap(pixmap,
+ bo->handle,
+ intel_pixmap_pitch(pixmap)))
+ {
+ intel_glamor_reference_pixmap_bo(pixmap, bo);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+static XF86VideoAdaptorPtr
+intel_glamor_create_textured_video_adaptor(ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ XF86VideoAdaptorPtr texturedAdaptor;
+ texturedAdaptor = glamor_xv_init(screen, 16);
+ if (texturedAdaptor != NULL)
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "Set up textured video using glamor\n");
+ return texturedAdaptor;
+}
+
+Bool
+intel_glamor_create_screen_resources(ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+ PixmapPtr pixmap = screen->GetScreenPixmap(screen);
+ int old_width, old_height, old_pitch;
+ Bool ret;
+
+ old_width = pixmap->drawable.width;
+ old_height = pixmap->drawable.height;
+ old_pitch = pixmap->devKind;
+
+ if (!screen->ModifyPixmapHeader(pixmap,
+ scrn->virtualX,
+ scrn->virtualY,
+ -1, -1,
+ intel->front_pitch,
+ NULL))
+ return FALSE;
+
+ ret = glamor_egl_create_textured_screen_ext(screen,
+ intel->front_buffer->handle,
+ intel->front_pitch,
+ &intel->back_pixmap);
+
+ if (!ret)
+ goto fail;
+
+ intel_glamor_reference_pixmap_bo(pixmap, intel->front_buffer);
+
+ return TRUE;
+
+fail:
+ screen->ModifyPixmapHeader(pixmap,
+ old_width, old_height, -1, -1, old_pitch, NULL);
+
+ return FALSE;
+}
+
+static Bool
+intel_glamor_do_pre_init(ScrnInfoPtr scrn)
+{
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+ pointer glamor_module;
+ CARD32 version;
+
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,15,0,0,0)
+ if (!xf86LoaderCheckSymbol("glamor_egl_init")) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "glamor requires Load \"glamoregl\" in "
+ "Section \"Module\", disabling.\n");
+ return FALSE;
+ }
+#endif
+
+ /* Load glamor module */
+ glamor_module = xf86LoadSubModule(scrn, GLAMOR_EGL_MODULE_NAME);
+ if (!glamor_module) {
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+ "glamor not available\n");
+ return FALSE;
+ }
+
+ version = xf86GetModuleVersion(glamor_module);
+ if (version < MODULE_VERSION_NUMERIC(0,3,1)) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Incompatible glamor version, required >= 0.3.0.\n");
+ return FALSE;
+ }
+ if (!glamor_egl_init(scrn, intel->drmSubFD)) {
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+ "glamor detected, failed to initialize egl.\n");
+ return FALSE;
+ }
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "glamor detected, initialising egl layer.\n");
+
+ return TRUE;
+}
+
+Bool
+intel_glamor_init(ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+
+ if (!intel_fb_init(screen, NULL))
+ return FALSE;
+
+ if (!dixRegisterPrivateKey(&intel_glamor_pixmap_key, PRIVATE_PIXMAP, sizeof (struct intel_glamor_pixmap)))
+ return FALSE;
+
+ if (!glamor_init(screen,
+ GLAMOR_INVERTED_Y_AXIS |
+ GLAMOR_USE_EGL_SCREEN |
+ GLAMOR_USE_SCREEN |
+ GLAMOR_USE_PICTURE_SCREEN))
+ {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to initialize glamor.\n");
+ return FALSE;
+ }
+
+ if (!glamor_egl_init_textured_pixmap(screen)) {
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to initialize textured pixmap of screen for glamor.\n");
+ return FALSE;
+ }
+
+ /* XXX indirect GL under Glamor doesn't work because of recursion during
+ * buffer creation
+ */
+ enableIndirectGLX = FALSE;
+
+ return TRUE;
+}
+
+void
+intel_glamor_flush(intel_screen_private * intel)
+{
+ ScreenPtr screen;
+
+ screen = xf86ScrnToScreen(intel->scrn);
+ glamor_block_handler(screen);
+}
+
+void
+intel_glamor_close_screen(ScreenPtr screen)
+{
+}
+
+Bool
+intel_glamor_copy_pixmap(PixmapPtr src, PixmapPtr dst)
+{
+ Bool ret = FALSE;
+#if HAS_GLAMOR_COPY
+ int width, height;
+
+ BoxRec box;
+
+ width = min (src->drawable.width, dst->drawable.width);
+ height = min (src->drawable.height, dst->drawable.height);
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = width;
+ box.y2 = height;
+ glamor_copy(&src->drawable,
+ &dst->drawable,
+ NULL,
+ &box,
+ 1,
+ 0, 0,
+ FALSE,
+ FALSE,
+ 0,
+ NULL);
+
+ ret = TRUE;
+#endif
+ return ret;
+}
+
+#if HAVE_DRI2
+void
+intel_glamor_exchange_buffers(struct intel_screen_private *intel,
+ PixmapPtr src,
+ PixmapPtr dst)
+{
+ glamor_egl_exchange_buffers(src, dst);
+}
+
+PixmapPtr
+intel_glamor_create_back_pixmap(ScreenPtr screen,
+ PixmapPtr front_pixmap,
+ drm_intel_bo *back_bo)
+{
+ PixmapPtr back_pixmap;
+
+ back_pixmap = screen->CreatePixmap(screen,
+ 0,
+ 0,
+ front_pixmap->drawable.depth,
+ 0);
+ if (back_pixmap == NULL)
+ return NULL;
+
+ screen->ModifyPixmapHeader(back_pixmap,
+ front_pixmap->drawable.width,
+ front_pixmap->drawable.height,
+ 0, 0,
+ front_pixmap->devKind,
+ 0);
+ if (!intel_glamor_set_pixmap_bo(back_pixmap, back_bo)) {
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+ "Failed to create textured back pixmap.\n");
+ screen->DestroyPixmap(back_pixmap);
+ return NULL;
+ }
+ return back_pixmap;
+}
+#endif
+
+static void
+intel_glamor_pre_init(ScrnInfoPtr scrn)
+{
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+
+ if (!intel_glamor_do_pre_init(scrn)) {
+ intel_pre_init_cleanup(scrn);
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to pre init glamor display.\n");
+#if USE_UXA
+ intel->accel = &intel_uxa_accel;
+#else
+ intel->accel = &intel_none_accel;
+#endif
+ }
+}
+
+static Bool
+intel_glamor_replace_back(DrawablePtr draw, PixmapPtr front_pixmap, dri_bo *new_back)
+{
+ ScreenPtr screen = draw->pScreen;
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+ PixmapPtr back_pixmap;
+
+ back_pixmap = intel_glamor_create_back_pixmap(screen,
+ front_pixmap,
+ new_back);
+ if (back_pixmap == NULL) {
+ drm_intel_bo_unreference(new_back);
+ return FALSE;
+ }
+ intel->back_pixmap = back_pixmap;
+ return TRUE;
+}
+
+const struct intel_screen_accel intel_glamor_accel = {
+ .pre_init = intel_glamor_pre_init,
+ .screen_init = intel_glamor_init,
+ .close_screen = intel_glamor_close_screen,
+ .create_screen_resources = intel_glamor_create_screen_resources,
+ .set_pixmap_bo = intel_glamor_set_pixmap_bo,
+ .get_pixmap_bo = intel_glamor_get_pixmap_bo,
+ .flush = intel_glamor_flush,
+ .copy_pixmap = intel_glamor_copy_pixmap,
+ .exchange_buffers = intel_glamor_exchange_buffers,
+ .replace_back = intel_glamor_replace_back,
+ .create_textured_video_adaptor = intel_glamor_create_textured_video_adaptor,
+};
diff --git a/src/uxa/intel_glamor.h b/src/uxa/intel_glamor.h
new file mode 100644
index 00000000..384bda6b
--- /dev/null
+++ b/src/uxa/intel_glamor.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright © 2011 Intel Corporation.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including
+ * the next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Zhigang Gong <zhigang.gong@linux.intel.com>
+ *
+ */
+
+#ifndef INTEL_GLAMOR_H
+#define INTEL_GLAMOR_H
+
+#include <xf86xv.h>
+
+Bool intel_glamor_init(ScreenPtr screen);
+Bool intel_glamor_create_screen_resources(ScreenPtr screen);
+void intel_glamor_close_screen(ScreenPtr screen);
+void intel_glamor_free_screen(int scrnIndex, int flags);
+
+void intel_glamor_flush(intel_screen_private * intel);
+
+#if HAVE_DRI2
+PixmapPtr
+intel_glamor_create_back_pixmap(ScreenPtr screen,
+ PixmapPtr front_pixmap,
+ drm_intel_bo *back_bo);
+
+void intel_glamor_exchange_buffers(struct intel_screen_private *intel, PixmapPtr src, PixmapPtr dst);
+#endif
+
+XF86VideoAdaptorPtr intel_glamor_xv_init(ScreenPtr screen, int num_ports);
+
+dri_bo *
+intel_glamor_get_pixmap_bo(PixmapPtr pixmap);
+
+Bool
+intel_glamor_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo);
+
+Bool
+intel_glamor_copy_pixmap(PixmapPtr src, PixmapPtr dst);
+
+#endif /* INTEL_GLAMOR_H */