[Glamor] [PATCH 5/5] glyphblt/polyops: Use miFunctions by default.
Zhigang Gong
zhigang.gong at linux.intel.com
Fri Apr 6 06:28:58 PDT 2012
Calling to miFunctions give some opportunities to jump to
accelerated path, so we switch to call miFunctions rather
than fallback to fbFunctions directly.
---
src/glamor_glyphblt.c | 32 ++++++----------------------
src/glamor_polyops.c | 54 ++----------------------------------------------
2 files changed, 10 insertions(+), 76 deletions(-)
diff --git a/src/glamor_glyphblt.c b/src/glamor_glyphblt.c
index 1630998..18ad536 100644
--- a/src/glamor_glyphblt.c
+++ b/src/glamor_glyphblt.c
@@ -38,17 +38,10 @@ _glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
if (!fallback
&& glamor_ddx_fallback_check_pixmap(pDrawable)
&& glamor_ddx_fallback_check_gc(pGC))
- goto fail;
-
- glamor_priv = glamor_get_screen_private(pDrawable->pScreen);
- glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
- glamor_prepare_access_gc(pGC);
- fbImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- glamor_finish_access_gc(pGC);
- glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
+ return FALSE;
+
+ miImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
return TRUE;
- fail:
- return FALSE;
}
void
@@ -74,17 +67,12 @@ _glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
{
glamor_screen_private *glamor_priv;
- if (!fallback
+ if (!fallback
&& glamor_ddx_fallback_check_pixmap(pDrawable)
&& glamor_ddx_fallback_check_gc(pGC))
return FALSE;
- glamor_priv = glamor_get_screen_private(pDrawable->pScreen);
- glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
- glamor_prepare_access_gc(pGC);
- fbPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
- glamor_finish_access_gc(pGC);
- glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
+ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
return TRUE;
}
@@ -108,19 +96,13 @@ static Bool
_glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable, int w, int h, int x, int y, Bool fallback)
{
- if (!fallback
+ if (!fallback
&& glamor_ddx_fallback_check_pixmap(pDrawable)
&& glamor_ddx_fallback_check_pixmap(&pBitmap->drawable)
&& glamor_ddx_fallback_check_gc(pGC))
return FALSE;
- glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
- glamor_prepare_access(&pBitmap->drawable, GLAMOR_ACCESS_RO);
- glamor_prepare_access_gc(pGC);
- fbPushPixels(pGC, pBitmap, pDrawable, w, h, x, y);
- glamor_finish_access_gc(pGC);
- glamor_finish_access(&pBitmap->drawable, GLAMOR_ACCESS_RO);
- glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
+ miPushPixels(pGC, pBitmap, pDrawable, w, h, x, y);
return TRUE;
}
diff --git a/src/glamor_polyops.c b/src/glamor_polyops.c
index 7320c17..5930178 100644
--- a/src/glamor_polyops.c
+++ b/src/glamor_polyops.c
@@ -37,11 +37,8 @@ _glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
&& glamor_ddx_fallback_check_pixmap(pDrawable))
return FALSE;
- glamor_prepare_access_gc(pGC);
- glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
- fbPolyPoint(pDrawable, pGC, mode, npt, ppt);
- glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
- glamor_finish_access_gc(pGC);
+ miPolyPoint(pDrawable, pGC, mode, npt, ppt);
+
return TRUE;
}
@@ -68,15 +65,7 @@ _glamor_poly_segment(DrawablePtr pDrawable, GCPtr pGC, int nseg,
&& glamor_ddx_fallback_check_pixmap(pDrawable))
return FALSE;
- /* For lineWidth is not zero, fb calls to mi functions. */
- if (pGC->lineWidth == 0) {
- glamor_prepare_access_gc(pGC);
- glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
- fbPolySegment(pDrawable, pGC, nseg, pSeg);
- glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
- glamor_finish_access_gc(pGC);
- } else
- fbPolySegment(pDrawable, pGC, nseg, pSeg);
+ miPolySegment(pDrawable, pGC, nseg, pSeg);
return TRUE;
}
@@ -94,40 +83,3 @@ glamor_poly_segment_nf(DrawablePtr pDrawable, GCPtr pGC, int nseg,
{
return _glamor_poly_segment(pDrawable, pGC, nseg, pSeg, FALSE);
}
-
-static Bool
-_glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
- DDXPointPtr ppt, Bool fallback)
-{
- if (!fallback
- && glamor_ddx_fallback_check_gc(pGC)
- && glamor_ddx_fallback_check_pixmap(pDrawable))
- return FALSE;
- /* For lineWidth is not zero, fb calls to mi functions. */
-
- if (pGC->lineWidth == 0) {
- glamor_prepare_access_gc(pGC);
- glamor_prepare_access(pDrawable, GLAMOR_ACCESS_RW);
- fbPolyLine(pDrawable, pGC, mode, npt, ppt);
- glamor_finish_access(pDrawable, GLAMOR_ACCESS_RW);
- glamor_finish_access_gc(pGC);
- } else
- fbPolyLine(pDrawable, pGC, mode, npt, ppt);
-
- return TRUE;
-}
-
-void
-glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
- DDXPointPtr ppt)
-{
- _glamor_poly_line(pDrawable, pGC, mode, npt, ppt, TRUE);
-}
-
-Bool
-glamor_poly_line_nf(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
- DDXPointPtr ppt)
-{
- return _glamor_poly_line(pDrawable, pGC, mode, npt, ppt, FALSE);
-}
-
--
1.7.4.4
More information about the Glamor
mailing list