[Intel-gfx] [PATCH 06/12] Remove glamor support from UXA acceleration
Keith Packard
keithp at keithp.com
Fri Jul 25 01:18:22 CEST 2014
Makes UXA no longer include calls to glamor acceleration functions.
Signed-off-by: Keith Packard <keithp at keithp.com>
---
src/uxa/Makefile.am | 9 --
src/uxa/intel_dri.c | 60 +------------
src/uxa/intel_driver.c | 1 -
src/uxa/intel_uxa.c | 49 -----------
src/uxa/intel_uxa.h | 1 -
src/uxa/uxa-accel.c | 230 -------------------------------------------------
src/uxa/uxa-glamor.h | 65 --------------
src/uxa/uxa-glyphs.c | 28 ------
src/uxa/uxa-render.c | 79 -----------------
src/uxa/uxa.c | 7 --
src/uxa/uxa.h | 16 ----
11 files changed, 2 insertions(+), 543 deletions(-)
delete mode 100644 src/uxa/uxa-glamor.h
diff --git a/src/uxa/Makefile.am b/src/uxa/Makefile.am
index 23b074d..b9618c9 100644
--- a/src/uxa/Makefile.am
+++ b/src/uxa/Makefile.am
@@ -34,7 +34,6 @@ libuxa_la_SOURCES = \
intel_batchbuffer.h \
intel_display.c \
intel_driver.c \
- intel_glamor.h \
intel_memory.c \
intel_uxa.c \
intel_video.c \
@@ -65,14 +64,6 @@ libuxa_la_SOURCES = \
uxa-unaccel.c
$(NULL)
-if GLAMOR
-AM_CFLAGS += $(LIBGLAMOR_CFLAGS)
-libuxa_la_LIBADD += $(LIBGLAMOR_LIBS)
-libuxa_la_SOURCES += \
- intel_glamor.c \
- $(NULL)
-endif
-
if DRI2
AM_CFLAGS += $(DRI2_CFLAGS)
libuxa_la_SOURCES += \
diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c
index 65612f7..79978ab 100644
--- a/src/uxa/intel_dri.c
+++ b/src/uxa/intel_dri.c
@@ -793,38 +793,6 @@ I830DRI2ExchangeBuffers(struct intel_screen_private *intel, DRI2BufferPtr front,
dri_bo_reference (intel->front_buffer);
}
-static 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);
- intel_set_pixmap_bo(back_pixmap, back_bo);
- if (!intel_glamor_create_textured_pixmap(back_pixmap)) {
- 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;
-}
-
static drm_intel_bo *get_pixmap_bo(I830DRI2BufferPrivatePtr priv)
{
drm_intel_bo *bo = intel_get_pixmap_bo(priv->pixmap);
@@ -883,10 +851,6 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
}
if (intel->back_buffer == NULL) {
- I830DRI2BufferPrivatePtr drvpriv;
- PixmapPtr front_pixmap, back_pixmap;
- ScreenPtr screen;
-
new_back = drm_intel_bo_alloc(intel->bufmgr, "front buffer",
intel->front_buffer->size, 0);
if (new_back == NULL)
@@ -903,21 +867,6 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
drm_intel_bo_disable_reuse(new_back);
dri_bo_flink(new_back, &intel->back_name);
-
- if ((intel->uxa_flags & UXA_USE_GLAMOR)) {
- screen = draw->pScreen;
- drvpriv = info->front->driverPrivate;
- front_pixmap = drvpriv->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;
- }
} else {
new_back = intel->back_buffer;
intel->back_buffer = NULL;
@@ -937,13 +886,8 @@ I830DRI2ScheduleFlip(struct intel_screen_private *intel,
intel->back_buffer = intel->front_buffer;
drm_intel_bo_reference(intel->back_buffer);
- if (!(intel->uxa_flags & UXA_USE_GLAMOR)) {
- intel_set_pixmap_bo(priv->pixmap, new_back);
- drm_intel_bo_unreference(new_back);
- }
- else
- intel_exchange_pixmap_buffers(intel, priv->pixmap,
- intel->back_pixmap);
+ intel_set_pixmap_bo(priv->pixmap, new_back);
+ drm_intel_bo_unreference(new_back);
tmp_name = info->front->name;
info->front->name = intel->back_name;
diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
index 8ab2252..d9f918b 100644
--- a/src/uxa/intel_driver.c
+++ b/src/uxa/intel_driver.c
@@ -963,7 +963,6 @@ I830ScreenInit(SCREEN_INIT_ARGS_DECL)
intel->CreateScreenResources = screen->CreateScreenResources;
screen->CreateScreenResources = i830CreateScreenResources;
- intel_glamor_init(screen);
if (!xf86CrtcScreenInit(screen))
return FALSE;
diff --git a/src/uxa/intel_uxa.c b/src/uxa/intel_uxa.c
index 7ea9325..da4eb97 100644
--- a/src/uxa/intel_uxa.c
+++ b/src/uxa/intel_uxa.c
@@ -40,7 +40,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <unistd.h>
#include "intel.h"
-#include "intel_glamor.h"
#include "uxa.h"
#include "i830_reg.h"
@@ -660,16 +659,6 @@ static Bool intel_uxa_prepare_access(PixmapPtr pixmap, uxa_access_t access)
dri_bo *bo = priv->bo;
int ret;
- /* Transitioning to glamor acceleration, we need to flush all pending
- * usage by UXA. */
- if (access == UXA_GLAMOR_ACCESS_RW || access == UXA_GLAMOR_ACCESS_RO) {
- if (!list_is_empty(&priv->batch))
- intel_batch_submit(scrn);
- return TRUE;
- }
-
- /* When falling back to swrast, flush all pending operations */
- intel_glamor_flush(intel);
if (access == UXA_ACCESS_RW || priv->dirty)
intel_batch_submit(scrn);
@@ -695,9 +684,6 @@ static void intel_uxa_finish_access(PixmapPtr pixmap, uxa_access_t access)
{
struct intel_uxa_pixmap *priv;
- if (access == UXA_GLAMOR_ACCESS_RW || access == UXA_GLAMOR_ACCESS_RO)
- return;
-
priv = intel_uxa_get_pixmap_private(pixmap);
if (priv == NULL)
return;
@@ -967,7 +953,6 @@ 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);
intel_throttle(intel);
}
@@ -981,12 +966,6 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
struct intel_uxa_pixmap *priv;
PixmapPtr pixmap, new_pixmap = NULL;
- if (!(usage & INTEL_CREATE_PIXMAP_DRI2)) {
- pixmap = intel_glamor_create_pixmap(screen, w, h, depth, usage);
- if (pixmap)
- return pixmap;
- }
-
if (w > 32767 || h > 32767)
return NullPixmap;
@@ -1067,34 +1046,10 @@ intel_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
screen->ModifyPixmapHeader(pixmap, w, h, 0, 0, stride, NULL);
- if (!intel_glamor_create_textured_pixmap(pixmap))
- goto fallback_glamor;
}
return pixmap;
-fallback_glamor:
- if (usage & INTEL_CREATE_PIXMAP_DRI2) {
- /* XXX need further work to handle the DRI2 failure case.
- * Glamor don't know how to handle a BO only pixmap. Put
- * a warning indicator here.
- */
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "Failed to create textured DRI2 pixmap.");
- return pixmap;
- }
- /* Create textured pixmap failed means glamor failed to
- * create a texture from current BO for some reasons. We turn
- * to create a new glamor pixmap and clean up current one.
- * One thing need to be noted, this new pixmap doesn't
- * has a priv and bo attached to it. It's glamor's responsbility
- * to take care of it. Glamor will mark this new pixmap as a
- * texture only pixmap and will never fallback to DDX layer
- * afterwards.
- */
- new_pixmap = intel_glamor_create_pixmap(screen, w, h,
- depth, usage);
- dri_bo_unreference(priv->bo);
fallback_priv:
free(priv);
fallback_pixmap:
@@ -1108,7 +1063,6 @@ fallback_pixmap:
static Bool intel_uxa_destroy_pixmap(PixmapPtr pixmap)
{
if (pixmap->refcnt == 1) {
- intel_glamor_destroy_pixmap(pixmap);
intel_uxa_set_pixmap_bo(pixmap, NULL);
}
fbDestroyPixmap(pixmap);
@@ -1146,9 +1100,6 @@ Bool intel_uxa_create_screen_resources(ScreenPtr screen)
if (intel_uxa_get_pixmap_private(pixmap) == NULL)
goto err;
- if (!intel_glamor_create_screen_resources(screen))
- goto err;
-
intel_uxa_get_pixmap_private(pixmap)->pinned |= PIN_SCANOUT;
scrn->displayWidth = intel->front_pitch / intel->cpp;
diff --git a/src/uxa/intel_uxa.h b/src/uxa/intel_uxa.h
index 34903a3..69500a8 100644
--- a/src/uxa/intel_uxa.h
+++ b/src/uxa/intel_uxa.h
@@ -40,7 +40,6 @@ struct intel_uxa_pixmap {
#define PIN_DRI2 0x2
#define PIN_DRI3 0x4
#define PIN_PRIME 0x8
-#define PIN_GLAMOR 0x10
};
#if HAS_DEVPRIVATEKEYREC
diff --git a/src/uxa/uxa-accel.c b/src/uxa/uxa-accel.c
index 757b276..b0d3c80 100644
--- a/src/uxa/uxa-accel.c
+++ b/src/uxa/uxa-accel.c
@@ -32,7 +32,6 @@
#include <dix-config.h>
#endif
#include "uxa-priv.h"
-#include "uxa-glamor.h"
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "uxa.h"
@@ -50,21 +49,6 @@ 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) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_fill_spans_nf(pDrawable,
- pGC, n, ppt, pwidth, fSorted);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
if (uxa_screen->force_fallback)
goto fallback;
@@ -210,26 +194,9 @@ static void
uxa_put_image(DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
int w, int h, int leftPad, int format, char *bits)
{
- uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_put_image_nf(pDrawable,
- pGC, depth, x, y, w, h,
- leftPad, format, bits);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
- if (!ok)
- goto fallback;
-
- return;
- }
if (!uxa_do_put_image(pDrawable, pGC, depth, x, y, w, h, format, bits,
PixmapBytePad(w, pDrawable->depth))) {
-fallback:
uxa_check_put_image(pDrawable, pGC, depth, x, y, w, h, leftPad,
format, bits);
}
@@ -374,26 +341,6 @@ uxa_copy_n_to_n(DrawablePtr pSrcDrawable,
int dst_off_x, dst_off_y;
PixmapPtr pSrcPixmap, pDstPixmap;
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pSrcDrawable, UXA_GLAMOR_ACCESS_RO)) {
- if (uxa_prepare_access(pDstDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_copy_n_to_n_nf(pSrcDrawable, pDstDrawable,
- pGC, pbox, nbox, dx, dy,
- reverse, upsidedown, bitplane,
- closure);
- uxa_finish_access(pDstDrawable, UXA_GLAMOR_ACCESS_RW);
- }
- uxa_finish_access(pSrcDrawable, UXA_GLAMOR_ACCESS_RO);
- }
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
if (uxa_screen->force_fallback)
goto fallback;
@@ -560,19 +507,6 @@ uxa_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
{
int i;
xRectangle *prect;
- uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_poly_point_nf(pDrawable, pGC, mode, npt, ppt);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (ok)
- return;
- }
/* If we can't reuse the current GC as is, don't bother accelerating the
* points.
@@ -611,19 +545,6 @@ uxa_poly_lines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
xRectangle *prect;
int x1, x2, y1, y2;
int i;
- uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_poly_lines_nf(pDrawable, pGC, mode, npt, ppt);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (ok)
- return;
- }
/* Don't try to do wide lines or non-solid fill style. */
if (pGC->lineWidth != 0 || pGC->lineStyle != LineSolid ||
@@ -685,19 +606,6 @@ uxa_poly_segment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg)
{
xRectangle *prect;
int i;
- uxa_screen_t *uxa_screen = uxa_get_screen(pDrawable->pScreen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_poly_segment_nf(pDrawable, pGC, nseg, pSeg);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (ok)
- return;
- }
/* Don't try to do wide lines or non-solid fill style. */
if (pGC->lineWidth != 0 || pGC->lineStyle != LineSolid ||
@@ -762,20 +670,6 @@ uxa_poly_fill_rect(DrawablePtr pDrawable,
int xorg, yorg;
int n;
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_poly_fill_rect_nf(pDrawable, pGC, nrect, prect);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (!ok)
- uxa_check_poly_fill_rect(pDrawable, pGC, nrect, prect);
-
- return;
- }
-
/* Compute intersection of rects and clip region */
pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
@@ -885,25 +779,6 @@ uxa_get_spans(DrawablePtr pDrawable,
int wMax,
DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart)
{
- ScreenPtr screen = pDrawable->pScreen;
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_get_spans_nf(pDrawable, wMax, ppt,
- pwidth, nspans, pdstStart);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
-fallback:
uxa_check_get_spans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
}
@@ -911,25 +786,6 @@ static void
uxa_set_spans(DrawablePtr pDrawable, GCPtr gc, char *src,
DDXPointPtr points, int *widths, int n, int sorted)
{
- ScreenPtr screen = pDrawable->pScreen;
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_set_spans_nf(pDrawable, gc, src,
- points, widths, n, sorted);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
-fallback:
uxa_check_set_spans(pDrawable, gc, src, points, widths, n, sorted);
}
@@ -938,27 +794,6 @@ uxa_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane)
{
- ScreenPtr screen = pDst->pScreen;
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- RegionPtr region = NULL;
- int ok = 0;
-
- if (uxa_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW)) {
- if (uxa_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO)) {
- ok = glamor_copy_plane_nf(pSrc, pDst, pGC, srcx, srcy, w, h,
- dstx, dsty, bitPlane, ®ion);
- uxa_finish_access(pSrc, UXA_GLAMOR_ACCESS_RO);
- }
- uxa_finish_access(pDst, UXA_GLAMOR_ACCESS_RW);
- }
- if (!ok)
- goto fallback;
- return region;
- }
-
-fallback:
return uxa_check_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane);
}
@@ -968,22 +803,6 @@ uxa_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr * ppci, pointer pglyphBase)
{
- ScreenPtr screen = pDrawable->pScreen;
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_image_glyph_blt_nf(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
- if (!ok)
- goto fallback;
- return;
- }
-
-fallback:
uxa_check_image_glyph_blt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
}
@@ -992,22 +811,6 @@ uxa_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr * ppci, pointer pglyphBase)
{
- ScreenPtr screen = pDrawable->pScreen;
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_poly_glyph_blt_nf(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
- if (!ok)
- goto fallback;
- return;
- }
-
-fallback:
uxa_check_poly_glyph_blt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
}
@@ -1015,25 +818,6 @@ static void
uxa_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable, int w, int h, int x, int y)
{
- ScreenPtr screen = pDrawable->pScreen;
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok = 0;
-
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- if (uxa_prepare_access(&pBitmap->drawable, UXA_GLAMOR_ACCESS_RO)) {
- ok = glamor_push_pixels_nf(pGC, pBitmap, pDrawable, w, h, x, y);
- uxa_finish_access(&pBitmap->drawable, UXA_GLAMOR_ACCESS_RO);
- }
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
- if (!ok)
- goto fallback;
- return;
- }
-
-fallback:
uxa_check_push_pixels(pGC, pBitmap, pDrawable, w, h, x, y);
}
@@ -1244,20 +1028,6 @@ uxa_get_image(DrawablePtr pDrawable, int x, int y, int w, int h,
Box.x2 = Box.x1 + w;
Box.y2 = Box.y1 + h;
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- ok = 0;
- if (uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW)) {
- ok = glamor_get_image_nf(pDrawable, x, y, w, h,
- format, planeMask, d);
- uxa_finish_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
- }
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
if (uxa_screen->force_fallback)
goto fallback;
diff --git a/src/uxa/uxa-glamor.h b/src/uxa/uxa-glamor.h
deleted file mode 100644
index 5ff19e0..0000000
--- a/src/uxa/uxa-glamor.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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 at linux.intel.com>
- *
- */
-
-#ifndef UXA_GLAMOR_H
-#define UXA_GLAMOR_H
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef USE_GLAMOR
-#include "glamor.h"
-#else
-#define glamor_fill_spans_nf(...) FALSE
-#define glamor_poly_fill_rect_nf(...) FALSE
-#define glamor_put_image_nf(...) FALSE
-#define glamor_copy_n_to_n_nf(...) FALSE
-#define glamor_get_spans_nf(...) FALSE
-#define glamor_set_spans_nf(...) FALSE
-#define glamor_get_image_nf(...) FALSE
-#define glamor_glyphs_nf(...) FALSE
-#define glamor_glyph_unrealize(...) do { } while(0)
-#define glamor_composite_nf(...) FALSE
-#define glamor_composite_rects_nf(...) FALSE
-#define glamor_trapezoids_nf(...) FALSE
-#define glamor_triangles_nf(...) FALSE
-#define glamor_add_traps_nf(...) FALSE
-#define glamor_create_gc(...) FALSE
-#define glamor_validate_gc(...) do { } while(0)
-#define glamor_poly_point_nf(...) FALSE
-#define glamor_poly_segment_nf(...) FALSE
-#define glamor_poly_lines_nf(...) FALSE
-#define glamor_push_pixels_nf(...) FALSE
-#define glamor_copy_plane_nf(...) FALSE
-#define glamor_image_glyph_blt_nf(...) FALSE
-#define glamor_poly_glyph_blt_nf(...) FALSE
-#endif
-
-#endif /* UXA_GLAMOR_H */
diff --git a/src/uxa/uxa-glyphs.c b/src/uxa/uxa-glyphs.c
index 7f35863..d24ba51 100644
--- a/src/uxa/uxa-glyphs.c
+++ b/src/uxa/uxa-glyphs.c
@@ -65,7 +65,6 @@
#include <stdlib.h>
#include "uxa-priv.h"
-#include "uxa-glamor.h"
#include "common.h"
/* Width of the pixmaps we use for the caches; this should be less than
@@ -210,10 +209,6 @@ bail:
Bool uxa_glyphs_init(ScreenPtr pScreen)
{
- uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR)
- return TRUE;
#if HAS_DIXREGISTERPRIVATEKEY
if (!dixRegisterPrivateKey(&uxa_glyph_key, PRIVATE_GLYPH, 0))
return FALSE;
@@ -308,12 +303,6 @@ uxa_glyph_unrealize(ScreenPtr screen,
GlyphPtr glyph)
{
struct uxa_glyph *priv;
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- glamor_glyph_unrealize(screen, glyph);
- return;
- }
/* Use Lookup in case we have not attached to this glyph. */
priv = dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_key);
@@ -975,23 +964,6 @@ uxa_glyphs(CARD8 op,
ScreenPtr screen = pDst->pDrawable->pScreen;
uxa_screen_t *uxa_screen = uxa_get_screen(screen);
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok;
-
- uxa_picture_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
- uxa_picture_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO);
- ok = glamor_glyphs_nf(op,
- pSrc, pDst, maskFormat,
- xSrc, ySrc, nlist, list, glyphs);
- uxa_picture_finish_access(pSrc, UXA_GLAMOR_ACCESS_RO);
- uxa_picture_finish_access(pDst, UXA_GLAMOR_ACCESS_RW);
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
if (!uxa_screen->info->prepare_composite ||
uxa_screen->force_fallback ||
!uxa_drawable_is_offscreen(pDst->pDrawable) ||
diff --git a/src/uxa/uxa-render.c b/src/uxa/uxa-render.c
index a138f16..438623c 100644
--- a/src/uxa/uxa-render.c
+++ b/src/uxa/uxa-render.c
@@ -29,7 +29,6 @@
#include <stdlib.h>
#include "uxa-priv.h"
-#include "uxa-glamor.h"
#ifdef RENDER
#include "mipict.h"
@@ -1357,30 +1356,6 @@ uxa_composite(CARD8 op,
RegionRec region;
int tx, ty;
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok;
-
- uxa_picture_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
- uxa_picture_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO);
- if (pMask)
- uxa_picture_prepare_access(pMask, UXA_GLAMOR_ACCESS_RO);
-
- ok = glamor_composite_nf(op,
- pSrc, pMask, pDst, xSrc, ySrc,
- xMask, yMask, xDst, yDst,
- width, height);
-
- if (pMask)
- uxa_picture_finish_access(pMask, UXA_GLAMOR_ACCESS_RO);
- uxa_picture_finish_access(pSrc, UXA_GLAMOR_ACCESS_RO);
- uxa_picture_finish_access(pDst, UXA_GLAMOR_ACCESS_RW);
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
if (uxa_screen->force_fallback)
goto fallback;
@@ -1722,25 +1697,7 @@ uxa_trapezoids(CARD8 op, PicturePtr src, PicturePtr dst,
BoxRec bounds;
Bool direct;
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok;
-
- uxa_picture_prepare_access(dst, UXA_GLAMOR_ACCESS_RW);
- uxa_picture_prepare_access(src, UXA_GLAMOR_ACCESS_RO);
- ok = glamor_trapezoids_nf(op,
- src, dst, maskFormat, xSrc,
- ySrc, ntrap, traps);
- uxa_picture_finish_access(src, UXA_GLAMOR_ACCESS_RO);
- uxa_picture_finish_access(dst, UXA_GLAMOR_ACCESS_RW);
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
if (uxa_screen->force_fallback) {
-fallback:
uxa_check_trapezoids(op, src, dst, maskFormat, xSrc, ySrc, ntrap, traps);
return;
}
@@ -1951,25 +1908,7 @@ uxa_triangles(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
BoxRec bounds;
Bool direct;
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok;
-
- uxa_picture_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
- uxa_picture_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO);
- ok = glamor_triangles_nf(op,
- pSrc, pDst, maskFormat, xSrc,
- ySrc, ntri, tris);
- uxa_picture_finish_access(pSrc, UXA_GLAMOR_ACCESS_RO);
- uxa_picture_finish_access(pDst, UXA_GLAMOR_ACCESS_RW);
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
if (uxa_screen->force_fallback) {
-fallback:
uxa_check_triangles(op, pSrc, pDst, maskFormat,
xSrc, ySrc, ntri, tris);
return;
@@ -2051,23 +1990,5 @@ void
uxa_add_traps(PicturePtr pPicture,
INT16 x_off, INT16 y_off, int ntrap, xTrap * traps)
{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
-
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- int ok;
-
- uxa_picture_prepare_access(pPicture, UXA_GLAMOR_ACCESS_RW);
- ok = glamor_add_traps_nf(pPicture,
- x_off, y_off, ntrap, traps);
- uxa_picture_finish_access(pPicture, UXA_GLAMOR_ACCESS_RW);
-
- if (!ok)
- goto fallback;
-
- return;
- }
-
-fallback:
uxa_check_add_traps(pPicture, x_off, y_off, ntrap, traps);
}
diff --git a/src/uxa/uxa.c b/src/uxa/uxa.c
index c8d7900..905667d 100644
--- a/src/uxa/uxa.c
+++ b/src/uxa/uxa.c
@@ -38,7 +38,6 @@
#include <X11/fonts/fontstruct.h>
#include "dixfontstr.h"
#include "uxa.h"
-#include "uxa-glamor.h"
#if HAS_DEVPRIVATEKEYREC
DevPrivateKeyRec uxa_screen_index;
@@ -184,7 +183,6 @@ void uxa_finish_access(DrawablePtr pDrawable, uxa_access_t access)
static void
uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
{
- uxa_screen_t *uxa_screen = uxa_get_screen(pGC->pScreen);
/* fbValidateGC will do direct access to pixmaps if the tiling has
* changed.
* Preempt fbValidateGC by doing its work and masking the change out, so
@@ -195,10 +193,6 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
* may be pure GLAMOR pixmap, then we should let the glamor
* to do the validation.
*/
- if (uxa_screen->info->flags & UXA_USE_GLAMOR) {
- glamor_validate_gc(pGC, changes, pDrawable);
- goto set_ops;
- }
#ifdef FB_24_32BIT
if ((changes & GCTile) && fbGetRotatedPixmap(pGC)) {
(*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC));
@@ -267,7 +261,6 @@ uxa_validate_gc(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
fbValidateGC(pGC, changes, pDrawable);
}
-set_ops:
pGC->ops = (GCOps *) & uxa_ops;
}
diff --git a/src/uxa/uxa.h b/src/uxa/uxa.h
index b8569f0..d08c601 100644
--- a/src/uxa/uxa.h
+++ b/src/uxa/uxa.h
@@ -46,8 +46,6 @@
typedef enum {
UXA_ACCESS_RO,
UXA_ACCESS_RW,
- UXA_GLAMOR_ACCESS_RO,
- UXA_GLAMOR_ACCESS_RW
} uxa_access_t;
/**
@@ -545,20 +543,6 @@ 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. This flag will be set only when glamor get
- * initialized successfully.
- * Note, in ddx close screen, this bit need to be cleared.
- */
-#define UXA_USE_GLAMOR (1 << 3)
-
-/* UXA_GLAMOR_EGL_INITIALIZED indicates glamor egl layer get initialized
- * successfully. UXA layer does not use this flag, before call to
- * glamor_init, ddx need to check this flag. */
-#define UXA_GLAMOR_EGL_INITIALIZED (1 << 4)
-
/** @} */
/** @name UXA CreatePixmap hint flags
* @{
--
2.0.1
More information about the Intel-gfx
mailing list