Re: [PATCH v2] glamor: Add glamor_copy_fbo_cpu() for CopyArea to non-GPU destination
Eric Anholt e...@anholt.net writes: Michel Dänzer mic...@daenzer.net writes: From: Michel Dänzer michel.daen...@amd.com This provides a speedup e.g. when the destination is an SHM pixmap. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76285 Signed-off-by: Michel Dänzer michel.daen...@amd.com --- v2: Drop unnecessary use of GLAMOR_ACCESS_WO, thanks Eric for pointing that out. Disregard the GLAMOR_ACCESS_WO patch for now. Nice. We may end up pulling the other patch some day, but it seemed separate from what this one needed. Reviewed-by: Eric Anholt e...@anholt.net (My guess is keithp will pull the patch directly.) I'm easy; nominally, I'm pulling glamor patches from your tree, but I can take them directly if you like as well. Just let me know which you prefer; I'll merge this one in directly. -- keith.pack...@intel.com pgpvbtZsdWG91.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH v2] glamor: Add glamor_copy_fbo_cpu() for CopyArea to non-GPU destination
Michel Dänzer mic...@daenzer.net writes: From: Michel Dänzer michel.daen...@amd.com This provides a speedup e.g. when the destination is an SHM pixmap. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76285 Signed-off-by: Michel Dänzer michel.daen...@amd.com --- v2: Drop unnecessary use of GLAMOR_ACCESS_WO, thanks Eric for pointing that out. Disregard the GLAMOR_ACCESS_WO patch for now. Merged. 1e30fc1..606b701 master - master -- keith.pack...@intel.com pgpF3oMegzgE7.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH v2] glamor: Add glamor_copy_fbo_cpu() for CopyArea to non-GPU destination
Michel Dänzer mic...@daenzer.net writes: From: Michel Dänzer michel.daen...@amd.com This provides a speedup e.g. when the destination is an SHM pixmap. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76285 Signed-off-by: Michel Dänzer michel.daen...@amd.com --- v2: Drop unnecessary use of GLAMOR_ACCESS_WO, thanks Eric for pointing that out. Disregard the GLAMOR_ACCESS_WO patch for now. Nice. We may end up pulling the other patch some day, but it seemed separate from what this one needed. Reviewed-by: Eric Anholt e...@anholt.net (My guess is keithp will pull the patch directly.) pgp7P7ZeZCebZ.pgp Description: PGP signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH v2] glamor: Add glamor_copy_fbo_cpu() for CopyArea to non-GPU destination
From: Michel Dänzer michel.daen...@amd.com This provides a speedup e.g. when the destination is an SHM pixmap. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76285 Signed-off-by: Michel Dänzer michel.daen...@amd.com --- v2: Drop unnecessary use of GLAMOR_ACCESS_WO, thanks Eric for pointing that out. Disregard the GLAMOR_ACCESS_WO patch for now. glamor/glamor_copy.c | 54 1 file changed, 54 insertions(+) diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c index bfcde43..b84fcf2 100644 --- a/glamor/glamor_copy.c +++ b/glamor/glamor_copy.c @@ -233,6 +233,56 @@ bail: return FALSE; } +/** + * Implements CopyArea from the GPU to the CPU using glReadPixels from the + * source FBO. + */ +static Bool +glamor_copy_fbo_cpu(DrawablePtr src, +DrawablePtr dst, +GCPtr gc, +BoxPtr box, +int nbox, +int dx, +int dy, +Bool reverse, +Bool upsidedown, +Pixel bitplane, +void *closure) +{ +ScreenPtr screen = dst-pScreen; +glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); +PixmapPtr src_pixmap = glamor_get_drawable_pixmap(src); +FbBits *dst_bits; +FbStride dst_stride; +int dst_bpp; +int src_xoff, src_yoff; +int dst_xoff, dst_yoff; + +if (gc gc-alu != GXcopy) +goto bail; + +if (gc !glamor_pm_is_solid(dst, gc-planemask)) +goto bail; + +glamor_make_current(glamor_priv); +glamor_prepare_access(dst, GLAMOR_ACCESS_RW); + +glamor_get_drawable_deltas(src, src_pixmap, src_xoff, src_yoff); + +fbGetDrawable(dst, dst_bits, dst_stride, dst_bpp, dst_xoff, dst_yoff); + +glamor_download_boxes(src_pixmap, box, nbox, src_xoff + dx, src_yoff + dy, + dst_xoff, dst_yoff, + (uint8_t *) dst_bits, dst_stride * sizeof (FbBits)); +glamor_finish_access(dst); + +return TRUE; + +bail: +return FALSE; +} + /* * Copy from GPU to GPU by using the source * as a texture and painting that into the destination @@ -584,6 +634,10 @@ glamor_copy_gl(DrawablePtr src, if (bitplane == 0) return glamor_copy_cpu_fbo(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure); +} else if (GLAMOR_PIXMAP_PRIV_HAS_FBO(src_priv) + bitplane == 0) { +return glamor_copy_fbo_cpu(src, dst, gc, box, nbox, dx, dy, + reverse, upsidedown, bitplane, closure); } return FALSE; } -- 2.0.1 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel