[PATCH] [RFC] glamor: implement write-only prepares

Eric Anholt eric at anholt.net
Thu Mar 10 19:56:08 UTC 2016


Dave Airlie <airlied at gmail.com> writes:

> From: Dave Airlie <airlied at redhat.com>
>
> For some putimages we know we won't ever care about the data we readback,
> we are going to trash it with the putimage contents. So implement
> GLAMOR_ACCESS_WO mode.
>
> This will avoid doing the readbacks. Use it for putimages that are copy
> with a solid planemask.
>
> inspired by Ilia and xlock -mode wator which does loads of XYBitmap
> putimages.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  glamor/glamor_image.c   | 6 +++++-
>  glamor/glamor_prepare.c | 9 +++++----
>  glamor/glamor_priv.h    | 1 +
>  3 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c
> index 3158749..87fdcf6 100644
> --- a/glamor/glamor_image.c
> +++ b/glamor/glamor_image.c
> @@ -88,7 +88,11 @@ static void
>  glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
>                        int w, int h, int leftPad, int format, char *bits)
>  {
> -    if (glamor_prepare_access_box(drawable, GLAMOR_ACCESS_RW, x, y, w, h))
> +    int access = GLAMOR_ACCESS_RW;
> +
> +    if (gc->alu == GXcopy && glamor_pm_is_solid(gc->depth, gc->planemask))
> +        access = GLAMOR_ACCESS_WO;
> +    if (glamor_prepare_access_box(drawable, access, x, y, w, h))
>          fbPutImage(drawable, gc, depth, x, y, w, h, leftPad, format, bits);
>      glamor_finish_access(drawable);
>  }

As I noted on IRC, the putimage only affects the composite clip, while
you're prepare/finishing a bounding box, so this would trash the
contents outside of the composite clip.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20160310/3834c2b9/attachment-0001.sig>


More information about the xorg-devel mailing list