All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] uxa/glamor: Route some drawing function to glamor.
@ 2011-12-31 13:18 zhigang.gong
  2011-12-31 13:18 ` [PATCH] uxa/glamor: Route some missing " zhigang.gong
  2012-01-03 21:46 ` [PATCH 0/1] uxa/glamor: Route some " Chris Wilson
  0 siblings, 2 replies; 4+ messages in thread
From: zhigang.gong @ 2011-12-31 13:18 UTC (permalink / raw)
  To: chris; +Cc: intel-gfx

From: Zhigang Gong <zhigang.gong@linux.intel.com>

I agree to pending the last patch which is to create glamor pixmap by default.
This patch is based on the other 3 patch. After apply this patch, and use
the latest glamor. I spent too much time to fix those XTS regressions this week
and haven't have a chance to add version information to it. Will do that after 
the vacation. The good news is that now uxa/glamor has no regression compare 
to UXA.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] uxa/glamor: Route some missing drawing function to glamor.
  2011-12-31 13:18 [PATCH 0/1] uxa/glamor: Route some drawing function to glamor zhigang.gong
@ 2011-12-31 13:18 ` zhigang.gong
  2012-01-03 21:46 ` [PATCH 0/1] uxa/glamor: Route some " Chris Wilson
  1 sibling, 0 replies; 4+ messages in thread
From: zhigang.gong @ 2011-12-31 13:18 UTC (permalink / raw)
  To: chris; +Cc: intel-gfx

From: Zhigang Gong <zhigang.gong@linux.intel.com>

We have to route all the drawing function to glamor at first
if glamor is enabled. The previous commit missed some function.
Now add them in.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
---
 uxa/uxa-accel.c  |  142 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
 uxa/uxa-glamor.h |    8 +++
 2 files changed, 146 insertions(+), 4 deletions(-)

diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 00948b7..d67c1a6 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -558,6 +558,18 @@ 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;
+
+		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.
@@ -596,6 +608,18 @@ 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;
+
+		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 ||
@@ -657,6 +681,18 @@ 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;
+
+		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 ||
@@ -889,12 +925,110 @@ fallback:
 	uxa_check_set_spans(pDrawable, gc, src, points, widths, n, sorted);
 }
 
+static RegionPtr
+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) {
+		int ok;
+		RegionPtr region;
+
+		uxa_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW);
+		uxa_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO);
+		ok = glamor_copy_plane_nf(pSrc, pDst, pGC, srcx, srcy, w, h,
+					   dstx, dsty, bitPlane, &region);
+		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);
+}
+
+static void
+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;
+
+		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);
+}
+
+static void
+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;
+
+		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);
+}
+
+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;
+
+		uxa_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		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_prepare_access(pDrawable, UXA_GLAMOR_ACCESS_RW);
+		if (!ok)
+			goto fallback;
+		return;
+	}
+
+fallback:
+	uxa_check_push_pixels(pGC, pBitmap, pDrawable, w, h, x, y);
+}
+
 const GCOps uxa_ops = {
 	uxa_fill_spans,
 	uxa_set_spans,
 	uxa_put_image,
 	uxa_copy_area,
-	uxa_check_copy_plane,
+	uxa_copy_plane,
 	uxa_poly_point,
 	uxa_poly_lines,
 	uxa_poly_segment,
@@ -907,9 +1041,9 @@ const GCOps uxa_ops = {
 	miPolyText16,
 	miImageText8,
 	miImageText16,
-	uxa_check_image_glyph_blt,
-	uxa_check_poly_glyph_blt,
-	uxa_check_push_pixels,
+	uxa_image_glyph_blt,
+	uxa_poly_glyph_blt,
+	uxa_push_pixels,
 };
 
 void uxa_copy_window(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
diff --git a/uxa/uxa-glamor.h b/uxa/uxa-glamor.h
index 2b4b452..8f90d9a 100644
--- a/uxa/uxa-glamor.h
+++ b/uxa/uxa-glamor.h
@@ -52,6 +52,14 @@
 #define glamor_triangles_nf(...)	FALSE
 #define glamor_add_traps_nf(...)	FALSE
 #define glamor_create_gc(...)		FALSE
+#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
+#define glamor_validate_gc(...)		;
 #endif
 
 #endif /* UXA_GLAMOR_H */
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] uxa/glamor: Route some drawing function to glamor.
  2011-12-31 13:18 [PATCH 0/1] uxa/glamor: Route some drawing function to glamor zhigang.gong
  2011-12-31 13:18 ` [PATCH] uxa/glamor: Route some missing " zhigang.gong
@ 2012-01-03 21:46 ` Chris Wilson
  2012-01-04 11:50   ` Zhigang Gong
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2012-01-03 21:46 UTC (permalink / raw)
  To: zhigang.gong; +Cc: intel-gfx

On Sat, 31 Dec 2011 21:18:14 +0800, zhigang.gong@linux.intel.com wrote:
> From: Zhigang Gong <zhigang.gong@linux.intel.com>
> 
> I agree to pending the last patch which is to create glamor pixmap by default.
> This patch is based on the other 3 patch. After apply this patch, and use
> the latest glamor.

I've pushed those 4 patches (all bar to use
intel_glamor_create_textured_pixmap by default). I've a new segfault for
you in glamor_core.c::glamor_validate_gc(), line 425 as pixmap_priv is
NULL, which I only hit just as I thought I had completed testing the
code.

Afaics, the remaining big topics for the ddx are how to enable glx and
integration between glamor/uxa render paths, right?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/1] uxa/glamor: Route some drawing function to glamor.
  2012-01-03 21:46 ` [PATCH 0/1] uxa/glamor: Route some " Chris Wilson
@ 2012-01-04 11:50   ` Zhigang Gong
  0 siblings, 0 replies; 4+ messages in thread
From: Zhigang Gong @ 2012-01-04 11:50 UTC (permalink / raw)
  To: 'Chris Wilson'; +Cc: intel-gfx

> -----Original Message-----
> From: Chris Wilson [mailto:chris@chris-wilson.co.uk]
> Sent: Wednesday, January 04, 2012 5:47 AM
> To: zhigang.gong@linux.intel.com
> Cc: intel-gfx@lists.freedesktop.org; zhigang.gong@gmail.com;
> zhigang.gong@linux.intel.com
> Subject: Re: [PATCH 0/1] uxa/glamor: Route some drawing function to
> glamor.
> 
> On Sat, 31 Dec 2011 21:18:14 +0800, zhigang.gong@linux.intel.com
> wrote:
> > From: Zhigang Gong <zhigang.gong@linux.intel.com>
> >
> > I agree to pending the last patch which is to create glamor pixmap by
> default.
> > This patch is based on the other 3 patch. After apply this patch, and
> > use the latest glamor.
> 
> I've pushed those 4 patches (all bar to use
> intel_glamor_create_textured_pixmap by default). I've a new segfault for
> you in glamor_core.c::glamor_validate_gc(), line 425 as pixmap_priv is
> NULL, which I only hit just as I thought I had completed testing the code.
> 
> Afaics, the remaining big topics for the ddx are how to enable glx and
> integration between glamor/uxa render paths, right?

Exactly.
That's the hardest part now. There are two DRI loaders, one is AIGLX and the
other is EGL. Both loader have their own glapi.c. Currently, the AIGLX
always 
get loaded before the DDX driver, and thus the glapi in glx will be used. 

One possible solution is as below, please help to review and comment:

let the glamor egl module get loaded prior to the AIGLX And load the proper
libGL.so 
thus the egl will create a complete and correct context. And then latter, we
can call 
_glapi_create_table_from_handle to initialize the glx's dispatch structure. 
We can treat the context created by egl for glamor is the context dedicated
for server
client, and each time when call into glamor's rendering path, force current
to glamor's
context and restore to previous context at returning.

Copy to KRH, I know you are the master of DRI2/AIGLX. Any suggestion here?
Thanks.

> -Chris
> 
> --
> Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-04 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-31 13:18 [PATCH 0/1] uxa/glamor: Route some drawing function to glamor zhigang.gong
2011-12-31 13:18 ` [PATCH] uxa/glamor: Route some missing " zhigang.gong
2012-01-03 21:46 ` [PATCH 0/1] uxa/glamor: Route some " Chris Wilson
2012-01-04 11:50   ` Zhigang Gong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.