[Xf86-video-armsoc] [PATCH 1/1] Report damage for drawable in ARMSOCDRI2ScheduleSwap

Daniel Kurtz djkurtz at chromium.org
Thu Feb 20 10:53:19 PST 2014


On Fri, Feb 21, 2014 at 1:46 AM,  <armsoc-bugs at arm.com> wrote:
> From: Dave Barnish <dave.barnish at arm.com>
>
> Based on chromeos xf86-video-armsoc commit
> https://chromium.googlesource.com/chromiumos/third_party/xf86-video-armsoc/+/81e3f9f
>
> Change-Id: Idd7b9df652e26167a14ffff3ddf3156b726bbc88
> ---
>  src/armsoc_dri2.c |    9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/armsoc_dri2.c b/src/armsoc_dri2.c
> index f79ac51..793ea10 100644
> --- a/src/armsoc_dri2.c
> +++ b/src/armsoc_dri2.c
> @@ -607,6 +607,8 @@ ARMSOCDRI2ScheduleSwap(ClientPtr client, DrawablePtr pDraw,
>         struct armsoc_bo *src_bo, *dst_bo;
>         int src_fb_id, dst_fb_id;
>         int new_canflip, ret, do_flip;
> +       RegionRec region;
> +       PixmapPtr pDstPixmap = draw2pix(dri2draw(pDraw, pDstBuffer));
>
>         cmd = calloc(1, sizeof(*cmd));
>         if (!cmd)
> @@ -622,6 +624,13 @@ ARMSOCDRI2ScheduleSwap(ClientPtr client, DrawablePtr pDraw,
>         cmd->func = func;
>         cmd->data = data;
>
> +       region.extents.x1 = region.extents.y1 = 0;
> +       region.extents.x2 = pDstPixmap->drawable.width;
> +       region.extents.y2 = pDstPixmap->drawable.height;
> +       region.data = NULL;
> +       DamageRegionAppend(&pDstPixmap->drawable, &region);
> +       DamageRegionProcessPending(&pDstPixmap->drawable);
> +

Typically, pDstBuffer is the front buffer and pSrcBuffer is a back
buffer for the drawable pDraw.
If pDraw is a Window, pDstPixmap will then be the Pixmap fetched using
GetWindowPixmap(), which I believe will probably be the Pixmap of the
root Window.

So, if you are swapping buffers for a non-fullscreen window, the
dstPixmap and srcPixmap won't have the same dimensions, nor will they
be located on at the same position on the screen.

It seems to me that the damage region could be optimized to be just
the region of the dstPixmap that is overlapped by the Window
associated with the srcPixmap.
Although, I'm not sure what is the best way to compute this.

>         DEBUG_MSG("%d -> %d", pSrcBuffer->attachment, pDstBuffer->attachment);
>
>         /* obtain extra ref on buffers to avoid them going away while we await
> --
> 1.7.9.5
>
> _______________________________________________
> Xf86-video-armsoc mailing list
> Xf86-video-armsoc at lists.freedesktop.org
> http://lists.x.org/mailman/listinfo/xf86-video-armsoc


More information about the Xf86-video-armsoc mailing list