* [PATCH 0/2] Introduce Glamor to UXA framework.
@ 2011-11-16 7:04 Zhigang Gong
2011-11-16 7:04 ` [PATCH 1/2] glamor: Initial commit to introduce glamor acceleration Zhigang Gong
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Zhigang Gong @ 2011-11-16 7:04 UTC (permalink / raw)
To: intel-gfx
After discussion with Chris yesterday, I reworked the previous
glamor branch and concentrate the patchset to two patches. The
first patch is the same as the previous. The second patch merges
all the others into one, and made some slightly change. One major
change is that I decide to extent the finish_access to handle the
flushing operations by check the access type. And also add some
missed glamor flushing operations.
This patchset initially enable glamor with UXA. And two functions
,fill_spans and poly_fill_rects, go to the glamor path. I tested it
with render check, and it works fine.
One of the remaining issues is the vsync'ed copy. I discussed with
Chris, and already got a solution. Will do that when I enable
the copy_area to glamor path.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/2] glamor: Initial commit to introduce glamor acceleration.
2011-11-16 7:04 [PATCH 0/2] Introduce Glamor to UXA framework Zhigang Gong
@ 2011-11-16 7:04 ` Zhigang Gong
2011-11-16 7:04 ` [PATCH 2/2] glamor: Turn on glamor with a few glamor functions enabled Zhigang Gong
2011-11-17 1:13 ` [PATCH 0/2] Introduce Glamor to UXA framework Chris Wilson
2 siblings, 0 replies; 9+ messages in thread
From: Zhigang Gong @ 2011-11-16 7:04 UTC (permalink / raw)
To: intel-gfx
Added one configuration option --enable-glamor to control
whether use glamor. Added one new file intel_glamor.c to
wrap glamor egl API for intel driver's usage.
This commit doesn't really change the driver's control path.
It just adds necessary files for glamor and change some
configuration.
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
---
configure.ac | 17 +++++++
src/Makefile.am | 5 ++
src/intel_glamor.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/intel_glamor.h | 45 ++++++++++++++++++
4 files changed, 197 insertions(+), 0 deletions(-)
create mode 100644 src/intel_glamor.c
create mode 100644 src/intel_glamor.h
diff --git a/configure.ac b/configure.ac
index 831f6b3..d990702 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,6 +126,15 @@ AC_ARG_ENABLE(sna,
[SNA="$enableval"],
[SNA=no])
AM_CONDITIONAL(SNA, test x$SNA != xno)
+
+AC_ARG_ENABLE(glamor,
+ AS_HELP_STRING([--enable-glamor],
+ [Enable glamor, a new GL-based acceleration [default=no]]),
+ [GLAMOR="$enableval"],
+ [GLAMOR=no])
+
+AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
+
AC_MSG_CHECKING([whether to include SNA support])
required_xorg_xserver_version=1.6
@@ -137,6 +146,14 @@ if test "x$SNA" != "xno"; then
fi
AC_MSG_RESULT([$SNA])
+if test "x$GLAMOR" != "xno"; then
+ PKG_CHECK_MODULES(LIBGLAMOR, [glamor])
+ PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+ AC_DEFINE(GLAMOR, 1, [Enable glamor acceleration])
+fi
+
+AC_MSG_CHECKING([whether to include GLAMOR support])
+AC_MSG_RESULT([$GLAMOR])
AC_ARG_ENABLE(vmap,
AS_HELP_STRING([--enable-vmap],
diff --git a/src/Makefile.am b/src/Makefile.am
index cd1bb36..1a29390 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,6 +40,10 @@ SUBDIRS += sna
intel_drv_la_LIBADD += sna/libsna.la
endif
+if GLAMOR
+GLAMOR_SOURCE = intel_glamor.c
+endif
+
NULL:=#
intel_drv_la_SOURCES = \
@@ -70,6 +74,7 @@ intel_drv_la_SOURCES = \
i965_3d.c \
i965_video.c \
i965_render.c \
+ $(GLAMOR_SOURCE) \
$(NULL)
if DRI
diff --git a/src/intel_glamor.c b/src/intel_glamor.c
new file mode 100644
index 0000000..cadfc71
--- /dev/null
+++ b/src/intel_glamor.c
@@ -0,0 +1,130 @@
+/*
+ * 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_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <xf86drm.h>
+
+#define GLAMOR_FOR_XORG 1
+
+#include <glamor.h>
+#include "intel.h"
+#include "intel_glamor.h"
+
+Bool
+intel_glamor_create_screen_resources(ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_screen_private *intel = intel_get_screen_private(scrn);
+
+ if (!glamor_glyphs_init(screen))
+ return FALSE;
+ if (!glamor_egl_create_textured_screen(screen,
+ intel->front_buffer->handle,
+ intel->front_pitch))
+ return FALSE;
+ return TRUE;
+}
+
+Bool
+intel_glamor_pre_init(ScrnInfoPtr scrn)
+{
+ intel_screen_private *intel;
+ intel = intel_get_screen_private(scrn);
+ return glamor_egl_init(scrn, intel->drmSubFD);
+}
+
+Bool
+intel_glamor_create_textured_pixmap(PixmapPtr pixmap)
+{
+ struct intel_pixmap *priv;
+ priv = intel_get_pixmap_private(pixmap);
+ return glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
+ priv->stride);
+}
+
+void
+intel_glamor_destroy_pixmap(PixmapPtr pixmap)
+{
+ glamor_egl_destroy_textured_pixmap(pixmap);
+}
+
+Bool
+intel_glamor_init(ScreenPtr screen)
+{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+
+ if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS)) {
+ 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 glamor\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+void
+intel_glamor_block_handler(intel_screen_private * intel)
+{
+ ScreenPtr screen = screenInfo.screens[intel->scrn->scrnIndex];
+ glamor_block_handler(screen);
+}
+
+Bool
+intel_glamor_create_screen_image(ScreenPtr screen, int handle, int stride)
+{
+ PixmapPtr pixmap;
+ if (!glamor_egl_create_textured_screen(screen, handle, stride))
+ return FALSE;
+ pixmap = screen->GetScreenPixmap(screen);
+ return TRUE;
+}
+
+Bool
+intel_glamor_close_screen(ScreenPtr screen)
+{
+ return glamor_egl_close_screen(screen);
+}
+
+void
+intel_glamor_free_screen(int scrnIndex, int flags)
+{
+ glamor_egl_free_screen(scrnIndex, GLAMOR_EGL_EXTERNAL_BUFFER);
+}
diff --git a/src/intel_glamor.h b/src/intel_glamor.h
new file mode 100644
index 0000000..d7c2c86
--- /dev/null
+++ b/src/intel_glamor.h
@@ -0,0 +1,45 @@
+/*
+ * 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>
+ *
+ */
+Bool intel_glamor_pre_init(ScrnInfoPtr scrn);
+
+Bool intel_glamor_init(ScreenPtr screen);
+
+Bool intel_glamor_create_screen_resources(ScreenPtr screen);
+
+Bool intel_glamor_create_screen_image(ScreenPtr screen, int handle, int stride);
+
+Bool intel_glamor_close_screen(ScreenPtr screen);
+
+void intel_glamor_free_screen(int scrnIndex, int flags);
+
+void intel_glamor_block_handler(intel_screen_private * intel);
+
+Bool intel_glamor_create_textured_pixmap(PixmapPtr pixmap);
+
+void intel_glamor_destroy_pixmap(PixmapPtr pixmap);
--
1.7.4.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2] glamor: Turn on glamor with a few glamor functions enabled.
2011-11-16 7:04 [PATCH 0/2] Introduce Glamor to UXA framework Zhigang Gong
2011-11-16 7:04 ` [PATCH 1/2] glamor: Initial commit to introduce glamor acceleration Zhigang Gong
@ 2011-11-16 7:04 ` Zhigang Gong
2011-11-17 1:13 ` [PATCH 0/2] Introduce Glamor to UXA framework Chris Wilson
2 siblings, 0 replies; 9+ messages in thread
From: Zhigang Gong @ 2011-11-16 7:04 UTC (permalink / raw)
To: intel-gfx
Integrate glamor acceleration into UXA framework. Add
necessary flushing at the following points:
1. Flush UXA batch buffer before call into glamor.
2. Flush GL operations after return from a glamor function.
3. The point we need to flush UXA batch buffer, we also
need to flush GL operations, for example, in
intel_flush_callback and couple of places in intel_display.c.
This commit only enables two glamor functions for
fill_spans and poly_fill_rects. Will continue to enable the
reset glamor functions soon.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
---
src/Makefile.am | 6 +--
src/intel.h | 1 +
src/intel_display.c | 5 ++
src/intel_driver.c | 17 +++++++-
src/intel_glamor.c | 111 ++++++++++++++++++++++++++++++++++++++++++++++-----
src/intel_glamor.h | 2 +-
src/intel_uxa.c | 22 +++++++++-
uxa/uxa-accel.c | 38 +++++++++++++++--
uxa/uxa-priv.h | 4 +-
uxa/uxa-render.c | 16 ++++----
uxa/uxa-unaccel.c | 58 +++++++++++++-------------
uxa/uxa.c | 18 ++++----
uxa/uxa.h | 13 +++++-
13 files changed, 236 insertions(+), 75 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 1a29390..12ff6ee 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,10 +40,6 @@ SUBDIRS += sna
intel_drv_la_LIBADD += sna/libsna.la
endif
-if GLAMOR
-GLAMOR_SOURCE = intel_glamor.c
-endif
-
NULL:=#
intel_drv_la_SOURCES = \
@@ -74,7 +70,7 @@ intel_drv_la_SOURCES = \
i965_3d.c \
i965_video.c \
i965_render.c \
- $(GLAMOR_SOURCE) \
+ intel_glamor.c \
$(NULL)
if DRI
diff --git a/src/intel.h b/src/intel.h
index 3b3f87d..b24aa02 100644
--- a/src/intel.h
+++ b/src/intel.h
@@ -318,6 +318,7 @@ typedef struct intel_screen_private {
void (*batch_commit_notify) (struct intel_screen_private *intel);
uxa_driver_t *uxa_driver;
+ int uxa_flags;
Bool need_sync;
int accel_pixmap_offset_alignment;
int accel_max_x;
diff --git a/src/intel_display.c b/src/intel_display.c
index 84c7c08..f6ffa30 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -43,6 +43,8 @@
#include "xf86drmMode.h"
#include "X11/Xatom.h"
+#include "intel_glamor.h"
+
struct intel_mode {
int fd;
uint32_t fb_id;
@@ -451,6 +453,7 @@ intel_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
crtc->y = y;
crtc->rotation = rotation;
+ intel_glamor_flush(intel);
intel_batch_submit(crtc->scrn);
mode_to_kmode(crtc->scrn, &intel_crtc->kmode, mode);
@@ -1368,6 +1371,7 @@ intel_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height)
if (scrn->virtualX == width && scrn->virtualY == height)
return TRUE;
+ intel_glamor_flush(intel);
intel_batch_submit(scrn);
old_width = scrn->virtualX;
@@ -1457,6 +1461,7 @@ intel_do_pageflip(intel_screen_private *intel,
new_front->handle, &mode->fb_id))
goto error_out;
+ intel_glamor_flush(intel);
intel_batch_submit(scrn);
/*
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 24696da..ddeb40f 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -75,6 +75,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i915_drm.h"
#include <xf86drmMode.h>
+#include "intel_glamor.h"
+
/* *INDENT-OFF* */
/*
* Note: "ColorKey" is provided for compatibility with the i810 driver.
@@ -712,6 +714,13 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags)
return FALSE;
}
+ if (!intel_glamor_pre_init(scrn)) {
+ PreInitCleanup(scrn);
+ xf86DrvMsg(scrn->scrnIndex, X_ERROR,
+ "Failed to pre init glamor display.\n");
+ return FALSE;
+ }
+
/* Load the dri2 module if requested. */
if (intel->directRenderingType != DRI_DISABLED)
xf86LoadSubModule(scrn, "dri2");
@@ -813,8 +822,10 @@ intel_flush_callback(CallbackListPtr *list,
pointer user_data, pointer call_data)
{
ScrnInfoPtr scrn = user_data;
- if (scrn->vtSema)
+ if (scrn->vtSema) {
intel_batch_submit(scrn);
+ intel_glamor_flush(intel_get_screen_private(scrn));
+ }
}
#if HAVE_UDEV
@@ -1110,6 +1121,8 @@ static void I830FreeScreen(int scrnIndex, int flags)
ScrnInfoPtr scrn = xf86Screens[scrnIndex];
intel_screen_private *intel = intel_get_screen_private(scrn);
+ intel_glamor_free_screen(scrnIndex, flags);
+
if (intel) {
intel_mode_fini(intel);
intel_close_drm_master(intel);
@@ -1189,6 +1202,8 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
DeleteCallback(&FlushCallback, intel_flush_callback, scrn);
+ intel_glamor_close_screen(screen);
+
if (intel->uxa_driver) {
uxa_driver_fini(screen);
free(intel->uxa_driver);
diff --git a/src/intel_glamor.c b/src/intel_glamor.c
index cadfc71..a3e2c44 100644
--- a/src/intel_glamor.c
+++ b/src/intel_glamor.c
@@ -48,6 +48,9 @@ intel_glamor_create_screen_resources(ScreenPtr screen)
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
+ if (!(intel->uxa_flags & UXA_USE_GLAMOR))
+ return TRUE;
+
if (!glamor_glyphs_init(screen))
return FALSE;
if (!glamor_egl_create_textured_screen(screen,
@@ -60,57 +63,132 @@ intel_glamor_create_screen_resources(ScreenPtr screen)
Bool
intel_glamor_pre_init(ScrnInfoPtr scrn)
{
+#ifdef GLAMOR
intel_screen_private *intel;
intel = intel_get_screen_private(scrn);
+
+ /* Load glamor module */
+ if (!xf86LoadSubModule(scrn, "glamor_egl"))
+ return FALSE;
+
return glamor_egl_init(scrn, intel->drmSubFD);
+#else
+ return TRUE;
+#endif
}
Bool
intel_glamor_create_textured_pixmap(PixmapPtr pixmap)
{
struct intel_pixmap *priv;
+ ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ intel_screen_private * intel;
+
priv = intel_get_pixmap_private(pixmap);
- return glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
- priv->stride);
+ intel = intel_get_screen_private(scrn);
+ if ((intel->uxa_flags & UXA_USE_GLAMOR)
+ && glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
+ priv->stride)) {
+ priv->pinned = 1;
+ return TRUE;
+ }
+ return FALSE;
}
void
intel_glamor_destroy_pixmap(PixmapPtr pixmap)
{
- glamor_egl_destroy_textured_pixmap(pixmap);
+ ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum];
+ intel_screen_private * intel;
+
+ intel = intel_get_screen_private(scrn);
+ if (intel->uxa_flags & UXA_USE_GLAMOR)
+ glamor_egl_destroy_textured_pixmap(pixmap);
+}
+
+static void
+intel_glamor_need_flush(DrawablePtr pDrawable)
+{
+ ScrnInfoPtr scrn = xf86Screens[pDrawable->pScreen->myNum];
+ intel_screen_private * intel;
+
+ intel = intel_get_screen_private(scrn);
+ intel->needs_flush = TRUE;
}
+static void
+intel_glamor_finish_access(PixmapPtr pixmap, uxa_access_t access)
+{
+ switch(access) {
+ case UXA_ACCESS_RO:
+ case UXA_ACCESS_RW:
+ case UXA_GLAMOR_ACCESS_RO:
+ break;
+ case UXA_GLAMOR_ACCESS_RW:
+ intel_glamor_need_flush(&pixmap->drawable);
+ glamor_block_handler(pixmap->drawable.pScreen);
+ break;
+ default:
+ ErrorF("Invalid access mode %d\n", access);
+ }
+
+ return;
+}
+
+
Bool
intel_glamor_init(ScreenPtr screen)
{
+#ifdef GLAMOR
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_screen_private * intel;
if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
"Failed to initialize glamor\n");
- return FALSE;
+ goto fail;
}
if (!glamor_egl_init_textured_pixmap(screen)) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "Failed to initialize glamor\n");
- return FALSE;
+ "Failed to initialize textured pixmap.\n");
+ goto fail;
}
+ intel = intel_get_screen_private(scrn);
+ intel->uxa_driver->flags |= UXA_USE_GLAMOR;
+ intel->uxa_flags = intel->uxa_driver->flags;
+
+ intel->uxa_driver->finish_access = intel_glamor_finish_access;
+
+ xf86DrvMsg(scrn->scrnIndex, X_INFO,
+ "Use GLAMOR acceleration.\n");
+ return TRUE;
+
+ fail:
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+ "Use standard UXA acceleration.");
+ return FALSE;
+#else
return TRUE;
+#endif
}
void
-intel_glamor_block_handler(intel_screen_private * intel)
+intel_glamor_flush(intel_screen_private * intel)
{
- ScreenPtr screen = screenInfo.screens[intel->scrn->scrnIndex];
- glamor_block_handler(screen);
+ ScreenPtr screen;
+
+ screen = screenInfo.screens[intel->scrn->scrnIndex];
+ if (intel->uxa_flags & UXA_USE_GLAMOR)
+ glamor_block_handler(screen);
}
Bool
intel_glamor_create_screen_image(ScreenPtr screen, int handle, int stride)
{
PixmapPtr pixmap;
+
if (!glamor_egl_create_textured_screen(screen, handle, stride))
return FALSE;
pixmap = screen->GetScreenPixmap(screen);
@@ -120,11 +198,22 @@ intel_glamor_create_screen_image(ScreenPtr screen, int handle, int stride)
Bool
intel_glamor_close_screen(ScreenPtr screen)
{
- return glamor_egl_close_screen(screen);
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_screen_private * intel;
+
+ intel = intel_get_screen_private(scrn);
+ if (intel && (intel->uxa_flags & UXA_USE_GLAMOR))
+ return glamor_egl_close_screen(screen);
+ return TRUE;
}
void
intel_glamor_free_screen(int scrnIndex, int flags)
{
- glamor_egl_free_screen(scrnIndex, GLAMOR_EGL_EXTERNAL_BUFFER);
+ ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ intel_screen_private * intel;
+
+ intel = intel_get_screen_private(scrn);
+ if (intel && (intel->uxa_flags & UXA_USE_GLAMOR))
+ glamor_egl_free_screen(scrnIndex, GLAMOR_EGL_EXTERNAL_BUFFER);
}
diff --git a/src/intel_glamor.h b/src/intel_glamor.h
index d7c2c86..3c06be0 100644
--- a/src/intel_glamor.h
+++ b/src/intel_glamor.h
@@ -38,7 +38,7 @@ Bool intel_glamor_close_screen(ScreenPtr screen);
void intel_glamor_free_screen(int scrnIndex, int flags);
-void intel_glamor_block_handler(intel_screen_private * intel);
+void intel_glamor_flush(intel_screen_private * intel);
Bool intel_glamor_create_textured_pixmap(PixmapPtr pixmap);
diff --git a/src/intel_uxa.c b/src/intel_uxa.c
index 8c6f754..8ec4133 100644
--- a/src/intel_uxa.c
+++ b/src/intel_uxa.c
@@ -40,6 +40,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <string.h>
#include <errno.h>
+#include "intel_glamor.h"
+
static const int I830CopyROP[16] = {
ROP_0, /* GXclear */
ROP_DSa, /* GXand */
@@ -703,9 +705,15 @@ static Bool intel_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access)
int ret;
if (!list_is_empty(&priv->batch) &&
- (access == UXA_ACCESS_RW || priv->batch_write))
+ ((access == UXA_ACCESS_RW || access == UXA_GLAMOR_ACCESS_RW)
+ || priv->batch_write))
intel_batch_submit(scrn);
+ if (access == UXA_GLAMOR_ACCESS_RW || access == UXA_GLAMOR_ACCESS_RO)
+ return TRUE;
+
+ intel_glamor_flush(intel);
+
if (priv->tiling || bo->size <= intel->max_gtt_map_size)
ret = drm_intel_gem_bo_map_gtt(bo);
else
@@ -964,6 +972,7 @@ void intel_uxa_block_handler(intel_screen_private *intel)
* and beyond rendering results may not hit the
* framebuffer until significantly later.
*/
+ intel_glamor_flush(intel);
intel_flush_rendering(intel);
}
@@ -1095,6 +1104,8 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
list_init(&priv->batch);
list_init(&priv->flush);
intel_set_pixmap_private(pixmap, priv);
+
+ intel_glamor_create_textured_pixmap(pixmap);
}
return pixmap;
@@ -1102,8 +1113,10 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
static Bool intel_uxa_destroy_pixmap(PixmapPtr pixmap)
{
- if (pixmap->refcnt == 1)
+ if (pixmap->refcnt == 1) {
+ intel_glamor_destroy_pixmap(pixmap);
intel_set_pixmap_bo(pixmap, NULL);
+ }
fbDestroyPixmap(pixmap);
return TRUE;
}
@@ -1134,6 +1147,9 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
scrn->displayWidth = intel->front_pitch / intel->cpp;
}
+ if (!intel_glamor_create_screen_resources(screen))
+ return FALSE;
+
return TRUE;
}
@@ -1296,5 +1312,7 @@ Bool intel_uxa_init(ScreenPtr screen)
uxa_set_fallback_debug(screen, intel->fallback_debug);
uxa_set_force_fallback(screen, intel->force_fallback);
+ intel_glamor_init(screen);
+
return TRUE;
}
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 516834f..c56fd81 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -27,7 +27,6 @@
* Michel Dänzer <michel@tungstengraphics.com>
*
*/
-
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -37,6 +36,13 @@
#include "uxa.h"
#include "mipict.h"
+#ifdef GLAMOR
+#include "glamor.h"
+#else
+#define glamor_fill_spans_nf(...) FALSE
+#define glamor_poly_fill_rect_nf(...) FALSE
+#endif
+
static void
uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
DDXPointPtr ppt, int *pwidth, int fSorted)
@@ -50,6 +56,17 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int n,
int x1, x2, y;
int off_x, off_y;
+ if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+ uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+ if (glamor_fill_spans_nf(pDrawable,
+ pGC, n, ppt, pwidth, fSorted)) {
+ uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+ return;
+ }
+ uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RO);
+ goto fallback;
+ }
+
if (uxa_screen->swappedOut || uxa_screen->force_fallback)
goto fallback;
@@ -187,7 +204,7 @@ uxa_do_put_image(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
(x1 + dstXoff) * dstBpp, (x2 - x1) * dstBpp,
y2 - y1, GXcopy, FB_ALLONES, dstBpp);
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -481,9 +498,9 @@ fallback:
dx, dy, reverse, upsidedown, bitplane,
closure);
if (pSrcDrawable != pDstDrawable)
- uxa_finish_access(pSrcDrawable);
+ uxa_finish_access(pSrcDrawable, UXA_ACCESS_RO);
}
- uxa_finish_access(pDstDrawable);
+ uxa_finish_access(pDstDrawable, UXA_ACCESS_RW);
}
}
@@ -673,6 +690,17 @@ uxa_poly_fill_rect(DrawablePtr pDrawable,
int n;
RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
+ if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
+ uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+ if (glamor_poly_fill_rect_nf(pDrawable,
+ pGC, nrect, prect)) {
+ uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+ return;
+ }
+ uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RO);
+ goto fallback;
+ }
+
/* Compute intersection of rects and clip region */
REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
REGION_INTERSECT(pScreen, pReg, pClip, pReg);
@@ -1013,7 +1041,7 @@ fallback:
if (uxa_prepare_access(pDrawable, UXA_ACCESS_RO)) {
fbGetImage(pDrawable, x, y, w, h, format, planeMask, d);
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RO);
}
return;
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index 6b9a9c1..a455f25 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -325,10 +325,10 @@ uxa_check_composite(CARD8 op,
/* uxa.c */
Bool uxa_prepare_access(DrawablePtr pDrawable, uxa_access_t access);
-void uxa_finish_access(DrawablePtr pDrawable);
+void uxa_finish_access(DrawablePtr pDrawable, uxa_access_t access);
Bool uxa_picture_prepare_access(PicturePtr picture, int mode);
-void uxa_picture_finish_access(PicturePtr picture);
+void uxa_picture_finish_access(PicturePtr picture, int mode);
void
uxa_get_drawable_deltas(DrawablePtr pDrawable, PixmapPtr pPixmap,
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index 34257c6..51c12f1 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -571,7 +571,7 @@ uxa_picture_from_pixman_image(ScreenPtr screen,
if (uxa_picture_prepare_access(picture, UXA_ACCESS_RW)) {
fbComposite(PictOpSrc, src, NULL, picture,
0, 0, 0, 0, 0, 0, width, height);
- uxa_picture_finish_access(picture);
+ uxa_picture_finish_access(picture, UXA_ACCESS_RW);
}
FreePicture(src, 0);
@@ -599,7 +599,7 @@ uxa_create_solid(ScreenPtr screen, uint32_t color)
return 0;
}
*((uint32_t *)pixmap->devPrivate.ptr) = color;
- uxa_finish_access((DrawablePtr)pixmap);
+ uxa_finish_access((DrawablePtr)pixmap, UXA_ACCESS_RW);
picture = CreatePicture(0, &pixmap->drawable,
PictureMatchFormat(screen, 32, PICT_a8r8g8b8),
@@ -702,7 +702,7 @@ uxa_acquire_pattern(ScreenPtr pScreen,
if (uxa_picture_prepare_access(pDst, UXA_ACCESS_RW)) {
fbComposite(PictOpSrc, pSrc, NULL, pDst,
x, y, 0, 0, 0, 0, width, height);
- uxa_picture_finish_access(pDst);
+ uxa_picture_finish_access(pDst, UXA_ACCESS_RW);
return pDst;
} else {
FreePicture(pDst, 0);
@@ -761,9 +761,9 @@ uxa_render_picture(ScreenPtr screen,
ret = 1;
fbComposite(PictOpSrc, src, NULL, picture,
x, y, 0, 0, 0, 0, width, height);
- uxa_picture_finish_access(src);
+ uxa_picture_finish_access(src, UXA_ACCESS_RO);
}
- uxa_picture_finish_access(picture);
+ uxa_picture_finish_access(picture, UXA_ACCESS_RW);
}
if (!ret) {
@@ -1902,7 +1902,7 @@ uxa_trapezoids(CARD8 op, PicturePtr src, PicturePtr dst,
for (; ntrap; ntrap--, traps++)
(*ps->RasterizeTrapezoid) (dst, traps, 0, 0);
- uxa_finish_access(pDraw);
+ uxa_finish_access(pDraw, UXA_ACCESS_RW);
}
} else if (maskFormat) {
PixmapPtr scratch = NULL;
@@ -2013,7 +2013,7 @@ uxa_triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
DrawablePtr pDraw = pDst->pDrawable;
if (uxa_prepare_access(pDraw, UXA_ACCESS_RW)) {
(*ps->AddTriangles) (pDst, 0, 0, ntri, tris);
- uxa_finish_access(pDraw);
+ uxa_finish_access(pDraw, UXA_ACCESS_RW);
}
} else if (maskFormat) {
PicturePtr pPicture;
@@ -2049,7 +2049,7 @@ uxa_triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
if (uxa_prepare_access(pPicture->pDrawable, UXA_ACCESS_RW)) {
(*ps->AddTriangles) (pPicture, -bounds.x1, -bounds.y1,
ntri, tris);
- uxa_finish_access(pPicture->pDrawable);
+ uxa_finish_access(pPicture->pDrawable, UXA_ACCESS_RW);
}
xRel = bounds.x1 + xSrc - xDst;
diff --git a/uxa/uxa-unaccel.c b/uxa/uxa-unaccel.c
index 1d4b2c0..f431049 100644
--- a/uxa/uxa-unaccel.c
+++ b/uxa/uxa-unaccel.c
@@ -50,7 +50,7 @@ Bool uxa_prepare_access_gc(GCPtr pGC)
if (!uxa_prepare_access
(&pGC->tile.pixmap->drawable, UXA_ACCESS_RO)) {
if (pGC->stipple)
- uxa_finish_access(&pGC->stipple->drawable);
+ uxa_finish_access(&pGC->stipple->drawable, UXA_ACCESS_RO);
return FALSE;
}
return TRUE;
@@ -62,9 +62,9 @@ Bool uxa_prepare_access_gc(GCPtr pGC)
void uxa_finish_access_gc(GCPtr pGC)
{
if (pGC->fillStyle == FillTiled)
- uxa_finish_access(&pGC->tile.pixmap->drawable);
+ uxa_finish_access(&pGC->tile.pixmap->drawable, UXA_ACCESS_RO);
if (pGC->stipple)
- uxa_finish_access(&pGC->stipple->drawable);
+ uxa_finish_access(&pGC->stipple->drawable, UXA_ACCESS_RO);
}
Bool uxa_picture_prepare_access(PicturePtr picture, int mode)
@@ -77,21 +77,21 @@ Bool uxa_picture_prepare_access(PicturePtr picture, int mode)
if (picture->alphaMap &&
!uxa_prepare_access(picture->alphaMap->pDrawable, mode)) {
- uxa_finish_access(picture->pDrawable);
+ uxa_finish_access(picture->pDrawable, mode);
return FALSE;
}
return TRUE;
}
-void uxa_picture_finish_access(PicturePtr picture)
+void uxa_picture_finish_access(PicturePtr picture, int mode)
{
if (picture->pDrawable == NULL)
return;
- uxa_finish_access(picture->pDrawable);
+ uxa_finish_access(picture->pDrawable, mode);
if (picture->alphaMap)
- uxa_finish_access(picture->alphaMap->pDrawable);
+ uxa_finish_access(picture->alphaMap->pDrawable, mode);
}
@@ -114,7 +114,7 @@ uxa_check_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int nspans,
fSorted);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -128,7 +128,7 @@ uxa_check_set_spans(DrawablePtr pDrawable, GCPtr pGC, char *psrc,
uxa_drawable_location(pDrawable)));
if (uxa_prepare_access(pDrawable, UXA_ACCESS_RW)) {
fbSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -144,7 +144,7 @@ uxa_check_put_image(DrawablePtr pDrawable, GCPtr pGC, int depth,
if (uxa_prepare_access(pDrawable, UXA_ACCESS_RW)) {
fbPutImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format,
bits);
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -163,9 +163,9 @@ uxa_check_copy_area(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
ret =
fbCopyArea(pSrc, pDst, pGC, srcx, srcy, w, h, dstx,
dsty);
- uxa_finish_access(pSrc);
+ uxa_finish_access(pSrc, UXA_ACCESS_RO);
}
- uxa_finish_access(pDst);
+ uxa_finish_access(pDst, UXA_ACCESS_RW);
}
return ret;
}
@@ -186,9 +186,9 @@ uxa_check_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
ret =
fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h, dstx,
dsty, bitPlane);
- uxa_finish_access(pSrc);
+ uxa_finish_access(pSrc, UXA_ACCESS_RO);
}
- uxa_finish_access(pDst);
+ uxa_finish_access(pDst, UXA_ACCESS_RW);
}
return ret;
}
@@ -203,7 +203,7 @@ uxa_check_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
uxa_drawable_location(pDrawable)));
if (uxa_prepare_access(pDrawable, UXA_ACCESS_RW)) {
fbPolyPoint(pDrawable, pGC, mode, npt, pptInit);
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -223,7 +223,7 @@ uxa_check_poly_lines(DrawablePtr pDrawable, GCPtr pGC,
fbPolyLine(pDrawable, pGC, mode, npt, ppt);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
return;
}
@@ -247,7 +247,7 @@ uxa_check_poly_segment(DrawablePtr pDrawable, GCPtr pGC,
pSegInit);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
return;
}
@@ -274,7 +274,7 @@ uxa_check_poly_arc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * pArcs)
fbPolyArc(pDrawable, pGC, narcs, pArcs);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
return;
}
@@ -296,7 +296,7 @@ uxa_check_poly_fill_rect(DrawablePtr pDrawable, GCPtr pGC,
fbPolyFillRect(pDrawable, pGC, nrect, prect);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -315,7 +315,7 @@ uxa_check_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
pglyphBase);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -335,7 +335,7 @@ uxa_check_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
pglyphBase);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -355,9 +355,9 @@ uxa_check_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
y);
uxa_finish_access_gc(pGC);
}
- uxa_finish_access(&pBitmap->drawable);
+ uxa_finish_access(&pBitmap->drawable, UXA_ACCESS_RO);
}
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RW);
}
}
@@ -372,7 +372,7 @@ uxa_check_get_spans(DrawablePtr pDrawable,
uxa_drawable_location(pDrawable)));
if (uxa_prepare_access(pDrawable, UXA_ACCESS_RO)) {
fbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
- uxa_finish_access(pDrawable);
+ uxa_finish_access(pDrawable, UXA_ACCESS_RO);
}
}
@@ -399,11 +399,11 @@ uxa_check_composite(CARD8 op,
xDst, yDst,
width, height);
if (pMask)
- uxa_picture_finish_access(pMask);
+ uxa_picture_finish_access(pMask, UXA_ACCESS_RO);
}
- uxa_picture_finish_access(pSrc);
+ uxa_picture_finish_access(pSrc, UXA_ACCESS_RO);
}
- uxa_picture_finish_access(pDst);
+ uxa_picture_finish_access(pDst, UXA_ACCESS_RW);
}
}
@@ -417,7 +417,7 @@ uxa_check_add_traps(PicturePtr pPicture,
uxa_drawable_location(pPicture->pDrawable)));
if (uxa_picture_prepare_access(pPicture, UXA_ACCESS_RW)) {
fbAddTraps(pPicture, x_off, y_off, ntrap, traps);
- uxa_picture_finish_access(pPicture);
+ uxa_picture_finish_access(pPicture, UXA_ACCESS_RW);
}
}
@@ -448,7 +448,7 @@ CARD32 uxa_get_pixmap_first_pixel(PixmapPtr pPixmap)
pixel = *(CARD8 *) fb;
break;
}
- uxa_finish_access(&pPixmap->drawable);
+ uxa_finish_access(&pPixmap->drawable, UXA_ACCESS_RO);
return pixel;
}
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 856a0ce..5a3c0be 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -160,7 +160,7 @@ Bool uxa_prepare_access(DrawablePtr pDrawable, uxa_access_t access)
*
* It deals with calling the driver's finish_access() only if necessary.
*/
-void uxa_finish_access(DrawablePtr pDrawable)
+void uxa_finish_access(DrawablePtr pDrawable, uxa_access_t access)
{
ScreenPtr pScreen = pDrawable->pScreen;
uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
@@ -173,7 +173,7 @@ void uxa_finish_access(DrawablePtr pDrawable)
if (!uxa_pixmap_is_offscreen(pPixmap))
return;
- (*uxa_screen->info->finish_access) (pPixmap);
+ (*uxa_screen->info->finish_access) (pPixmap, access);
}
/**
@@ -217,7 +217,7 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
fb24_32ReformatTile(pOldTile,
pDrawable->
bitsPerPixel);
- uxa_finish_access(&pOldTile->drawable);
+ uxa_finish_access(&pOldTile->drawable, UXA_ACCESS_RO);
}
}
if (pNewTile) {
@@ -235,7 +235,7 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
if (uxa_prepare_access
(&pGC->tile.pixmap->drawable, UXA_ACCESS_RW)) {
fbPadPixmap(pGC->tile.pixmap);
- uxa_finish_access(&pGC->tile.pixmap->drawable);
+ uxa_finish_access(&pGC->tile.pixmap->drawable, UXA_ACCESS_RW);
}
}
/* Mask out the GCTile change notification, now that we've
@@ -250,7 +250,7 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
*/
if (uxa_prepare_access(&pGC->stipple->drawable, UXA_ACCESS_RW)) {
fbValidateGC(pGC, changes, pDrawable);
- uxa_finish_access(&pGC->stipple->drawable);
+ uxa_finish_access(&pGC->stipple->drawable, UXA_ACCESS_RW);
}
} else {
fbValidateGC(pGC, changes, pDrawable);
@@ -296,7 +296,7 @@ Bool uxa_prepare_access_window(WindowPtr pWin)
(&pWin->border.pixmap->drawable, UXA_ACCESS_RO)) {
if (pWin->backgroundState == BackgroundPixmap)
uxa_finish_access(&pWin->background.pixmap->
- drawable);
+ drawable, UXA_ACCESS_RO);
return FALSE;
}
}
@@ -306,10 +306,10 @@ Bool uxa_prepare_access_window(WindowPtr pWin)
void uxa_finish_access_window(WindowPtr pWin)
{
if (pWin->backgroundState == BackgroundPixmap)
- uxa_finish_access(&pWin->background.pixmap->drawable);
+ uxa_finish_access(&pWin->background.pixmap->drawable, UXA_ACCESS_RO);
if (pWin->borderIsPixel == FALSE)
- uxa_finish_access(&pWin->border.pixmap->drawable);
+ uxa_finish_access(&pWin->border.pixmap->drawable, UXA_ACCESS_RO);
}
static Bool uxa_change_window_attributes(WindowPtr pWin, unsigned long mask)
@@ -329,7 +329,7 @@ static RegionPtr uxa_bitmap_to_region(PixmapPtr pPix)
if (!uxa_prepare_access(&pPix->drawable, UXA_ACCESS_RO))
return NULL;
ret = fbPixmapToRegion(pPix);
- uxa_finish_access(&pPix->drawable);
+ uxa_finish_access(&pPix->drawable, UXA_ACCESS_RO);
return ret;
}
diff --git a/uxa/uxa.h b/uxa/uxa.h
index e001c53..66b5f1e 100644
--- a/uxa/uxa.h
+++ b/uxa/uxa.h
@@ -45,7 +45,9 @@
typedef enum {
UXA_ACCESS_RO,
- UXA_ACCESS_RW
+ UXA_ACCESS_RW,
+ UXA_GLAMOR_ACCESS_RO,
+ UXA_GLAMOR_ACCESS_RW
} uxa_access_t;
/**
@@ -513,7 +515,7 @@ typedef struct _UxaDriver {
* offscreen pixmap set up by prepare_access(). Note that the
* finish_access() will not be called if prepare_access() failed.
*/
- void (*finish_access) (PixmapPtr pPix);
+ void (*finish_access) (PixmapPtr pPix, uxa_access_t access);
/**
* PixmapIsOffscreen() is an optional driver replacement to
@@ -543,6 +545,13 @@ typedef struct _UxaDriver {
*/
#define UXA_TWO_BITBLT_DIRECTIONS (1 << 2)
+/**
+ * UXA_USE_GLAMOR indicates to use glamor acceleration to perform rendering.
+ * And if glamor fail to accelerate the rendering, then goto fallback to
+ * use CPU to do the rendering.
+ */
+#define UXA_USE_GLAMOR (1 << 3)
+
/** @} */
/** @name UXA CreatePixmap hint flags
--
1.7.4.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Introduce Glamor to UXA framework.
2011-11-16 7:04 [PATCH 0/2] Introduce Glamor to UXA framework Zhigang Gong
2011-11-16 7:04 ` [PATCH 1/2] glamor: Initial commit to introduce glamor acceleration Zhigang Gong
2011-11-16 7:04 ` [PATCH 2/2] glamor: Turn on glamor with a few glamor functions enabled Zhigang Gong
@ 2011-11-17 1:13 ` Chris Wilson
2011-11-17 2:55 ` Zhigang Gong
2 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2011-11-17 1:13 UTC (permalink / raw)
To: Zhigang Gong, intel-gfx
On Wed, 16 Nov 2011 15:04:35 +0800, Zhigang Gong <zhigang.gong@linux.intel.com> wrote:
> This patchset initially enable glamor with UXA. And two functions
> ,fill_spans and poly_fill_rects, go to the glamor path. I tested it
> with render check, and it works fine.
I split your patches slightly differently and pushed them. I could
only verify that it didn't impact UXA without the glamor_egl module
available. Do you have a patch for testing?
-Chrid
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Introduce Glamor to UXA framework.
2011-11-17 1:13 ` [PATCH 0/2] Introduce Glamor to UXA framework Chris Wilson
@ 2011-11-17 2:55 ` Zhigang Gong
2011-11-17 9:19 ` Chris Wilson
0 siblings, 1 reply; 9+ messages in thread
From: Zhigang Gong @ 2011-11-17 2:55 UTC (permalink / raw)
To: 'Chris Wilson', intel-gfx
> -----Original Message-----
> From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> Sent: Thursday, November 17, 2011 9:14 AM
> To: Zhigang Gong; intel-gfx@lists.freedesktop.org
> Cc: zhigang.gong@linux.intel.com
> Subject: Re: [PATCH 0/2] Introduce Glamor to UXA framework.
>
> On Wed, 16 Nov 2011 15:04:35 +0800, Zhigang Gong
> <zhigang.gong@linux.intel.com> wrote:
> > This patchset initially enable glamor with UXA. And two functions
> > ,fill_spans and poly_fill_rects, go to the glamor path. I tested it
> > with render check, and it works fine.
>
> I split your patches slightly differently and pushed them.
I just checked out the master branch, and have a simple test, everything
seems
ok. Thanks.
> I could only verify
> that it didn't impact UXA without the glamor_egl module available. Do you
> have a patch for testing?
Now glamor was extracted from the xorg and be a separate library. Please
checkout glamor at : git://people.freedesktop.org/~gongzg/glamor.
This library implements two modules glamor and glamor_egl which are
required for intel video driver to enable glamor.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Introduce Glamor to UXA framework.
2011-11-17 2:55 ` Zhigang Gong
@ 2011-11-17 9:19 ` Chris Wilson
2011-11-17 10:49 ` Zhigang Gong
0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2011-11-17 9:19 UTC (permalink / raw)
To: Zhigang Gong, intel-gfx
On Thu, 17 Nov 2011 10:55:39 +0800, "Zhigang Gong" <zhigang.gong@linux.intel.com> wrote:
> Now glamor was extracted from the xorg and be a separate library. Please
> checkout glamor at : git://people.freedesktop.org/~gongzg/glamor.
> This library implements two modules glamor and glamor_egl which are
> required for intel video driver to enable glamor.
Hmm, I did install the glamor library. A
/usr/lib/xorg/modules/libglamor.so is installed but the ddx is looking
for a "glamor_egl" module.
Ah, looks to be due to the
checking for EGL... no
checking for EGL... yes
in glamor. How very confusing. ;-)
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Introduce Glamor to UXA framework.
2011-11-17 9:19 ` Chris Wilson
@ 2011-11-17 10:49 ` Zhigang Gong
2011-11-17 10:57 ` Chris Wilson
0 siblings, 1 reply; 9+ messages in thread
From: Zhigang Gong @ 2011-11-17 10:49 UTC (permalink / raw)
To: 'Chris Wilson', intel-gfx
> -----Original Message-----
> From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> Sent: Thursday, November 17, 2011 5:20 PM
> To: Zhigang Gong; intel-gfx@lists.freedesktop.org
> Subject: RE: [PATCH 0/2] Introduce Glamor to UXA framework.
>
> On Thu, 17 Nov 2011 10:55:39 +0800, "Zhigang Gong"
> <zhigang.gong@linux.intel.com> wrote:
> > Now glamor was extracted from the xorg and be a separate library.
> > Please checkout glamor at :
> git://people.freedesktop.org/~gongzg/glamor.
> > This library implements two modules glamor and glamor_egl which are
> > required for intel video driver to enable glamor.
>
> Hmm, I did install the glamor library. A
/usr/lib/xorg/modules/libglamor.so
> is installed but the ddx is looking for a "glamor_egl" module.
>
> Ah, looks to be due to the
> checking for EGL... no
> checking for EGL... yes
> in glamor. How very confusing. ;-)
I think I know the reason, there is a typo error in glamor's configure.ac
which doesn't
Check the required packages correctly. Please pull the latest glamor master.
One of the
two above checks should be checking for GBM. I guess your mesa hasn't been
built with
gbm enabled. Then glamor will not build glamor_egl which depends on that.
Another thing need to pay attention is that when you build xserver, you need
to disable
glx.
Sorry for the confusing.
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Introduce Glamor to UXA framework.
2011-11-17 10:49 ` Zhigang Gong
@ 2011-11-17 10:57 ` Chris Wilson
2011-11-17 11:33 ` Zhigang Gong
0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2011-11-17 10:57 UTC (permalink / raw)
To: Zhigang Gong, intel-gfx
On Thu, 17 Nov 2011 18:49:49 +0800, "Zhigang Gong" <zhigang.gong@linux.intel.com> wrote:
> > -----Original Message-----
> > From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> > Sent: Thursday, November 17, 2011 5:20 PM
> > To: Zhigang Gong; intel-gfx@lists.freedesktop.org
> > Subject: RE: [PATCH 0/2] Introduce Glamor to UXA framework.
> >
> > On Thu, 17 Nov 2011 10:55:39 +0800, "Zhigang Gong"
> > <zhigang.gong@linux.intel.com> wrote:
> > > Now glamor was extracted from the xorg and be a separate library.
> > > Please checkout glamor at :
> > git://people.freedesktop.org/~gongzg/glamor.
> > > This library implements two modules glamor and glamor_egl which are
> > > required for intel video driver to enable glamor.
> >
> > Hmm, I did install the glamor library. A
> /usr/lib/xorg/modules/libglamor.so
> > is installed but the ddx is looking for a "glamor_egl" module.
> >
> > Ah, looks to be due to the
> > checking for EGL... no
> > checking for EGL... yes
> > in glamor. How very confusing. ;-)
> I think I know the reason, there is a typo error in glamor's configure.ac
> which doesn't
> Check the required packages correctly. Please pull the latest glamor master.
> One of the
> two above checks should be checking for GBM. I guess your mesa hasn't been
> built with
> gbm enabled. Then glamor will not build glamor_egl which depends on that.
It was actually mesa insisting on only building egl_platform=drm and the
pre-requisite egl_dri2 if and only if libxcb-dri2 was installed. Seems a
bit strange for something that is supposed to be used on an X-less
system.
> Another thing need to pay attention is that when you build xserver, you need
> to disable
> glx.
Rebuild the xserver... Oh well, that rules out testing by simply replacing
distro drivers. I'm having a lot of fun with building glamor as it is
missing or including headers in the wrong order and deciding that XID is
8 bytes when the server was compiled with a 4 byte XID. Fun. And the
usual problems with incomplete framebuffers, but hopefully that is just
the glx confusion.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/2] Introduce Glamor to UXA framework.
2011-11-17 10:57 ` Chris Wilson
@ 2011-11-17 11:33 ` Zhigang Gong
0 siblings, 0 replies; 9+ messages in thread
From: Zhigang Gong @ 2011-11-17 11:33 UTC (permalink / raw)
To: 'Chris Wilson', intel-gfx
> -----Original Message-----
> From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> Sent: Thursday, November 17, 2011 6:57 PM
> To: Zhigang Gong; intel-gfx@lists.freedesktop.org
> Subject: RE: [PATCH 0/2] Introduce Glamor to UXA framework.
>
> On Thu, 17 Nov 2011 18:49:49 +0800, "Zhigang Gong"
> <zhigang.gong@linux.intel.com> wrote:
> > > -----Original Message-----
> > > From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> > > Sent: Thursday, November 17, 2011 5:20 PM
> > > To: Zhigang Gong; intel-gfx@lists.freedesktop.org
> > > Subject: RE: [PATCH 0/2] Introduce Glamor to UXA framework.
> > >
> > > On Thu, 17 Nov 2011 10:55:39 +0800, "Zhigang Gong"
> > > <zhigang.gong@linux.intel.com> wrote:
> > > > Now glamor was extracted from the xorg and be a separate library.
> > > > Please checkout glamor at :
> > > git://people.freedesktop.org/~gongzg/glamor.
> > > > This library implements two modules glamor and glamor_egl which
> > > > are required for intel video driver to enable glamor.
> > >
> > > Hmm, I did install the glamor library. A
> > /usr/lib/xorg/modules/libglamor.so
> > > is installed but the ddx is looking for a "glamor_egl" module.
> > >
> > > Ah, looks to be due to the
> > > checking for EGL... no
> > > checking for EGL... yes
> > > in glamor. How very confusing. ;-)
> > I think I know the reason, there is a typo error in glamor's
> > configure.ac which doesn't Check the required packages correctly.
> > Please pull the latest glamor master.
> > One of the
> > two above checks should be checking for GBM. I guess your mesa hasn't
> > been built with gbm enabled. Then glamor will not build glamor_egl
> > which depends on that.
>
> It was actually mesa insisting on only building egl_platform=drm and the
> pre-requisite egl_dri2 if and only if libxcb-dri2 was installed. Seems a
bit
> strange for something that is supposed to be used on an X-less system.
>
> > Another thing need to pay attention is that when you build xserver,
> > you need to disable glx.
>
> Rebuild the xserver... Oh well, that rules out testing by simply replacing
> distro drivers.
One of the todo items is to fully support glx including direct and indirect
.
The major problem is that Xserver's glx code has the same glapi symbols
which conflicts with standard mesa's glapi's implementations. It's easy to
rename the xserver side glapi's symbol to other names to avoid this
conflicts,
but that will break indirect GLX in xserver side. I still don't have a
perfect
solution to solve this problem. Do you or anyone in this list have any
suggestion
to solve this confliction?
> I'm having a lot of fun with building glamor as it is missing or
> including headers in the wrong order and deciding that XID is
> 8 bytes when the server was compiled with a 4 byte XID. Fun.
Will discuss these problem with you through IRC.
> And the
> usual problems with incomplete framebuffers, but hopefully that is just
the
> glx confusion.
That must be caused by glapi symbol confliction.
Thanks.
- Zhigang
> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2011-11-17 11:33 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-16 7:04 [PATCH 0/2] Introduce Glamor to UXA framework Zhigang Gong
2011-11-16 7:04 ` [PATCH 1/2] glamor: Initial commit to introduce glamor acceleration Zhigang Gong
2011-11-16 7:04 ` [PATCH 2/2] glamor: Turn on glamor with a few glamor functions enabled Zhigang Gong
2011-11-17 1:13 ` [PATCH 0/2] Introduce Glamor to UXA framework Chris Wilson
2011-11-17 2:55 ` Zhigang Gong
2011-11-17 9:19 ` Chris Wilson
2011-11-17 10:49 ` Zhigang Gong
2011-11-17 10:57 ` Chris Wilson
2011-11-17 11:33 ` Zhigang Gong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox