[RFC PATCH] randr: crtc cursor confinement

Adam Jackson ajax at redhat.com
Wed Oct 13 07:47:41 PDT 2010


On Tue, 2010-10-12 at 23:22 +0400, Mikhail Gusarov wrote:

> Isn't it too indirect? Just scratched the following (not even
> compile-tested). If recursion is a no-no due to systems with numCrtcs >
> 100k, then recursion is easily rewritten to queue.
> 
> /* Depth-first search and mark all CRTCs reachable from cur */
> static void
> dfs (rrScrPrivPtr pScrPriv, int *reachable, int cur)
> {
>     int i;
>     reachable[cur] = TRUE;
>     for (i = 0; i < pScrPriv->numCrtcs; ++i) {
>         if (reachable[i])
>             continue;
>         if (crtcs_adjacent(pScrPriv->crtcs[cur], pScrPriv->crtcs[i]))
>             dfs(pScrPriv, reachable, i);
>     }
> }

Yeah, that is simpler.  My first cut at writing the connectivity test as
a recursive search was broken in that it would treat [A][B] [C][D] as
fully connected since each one was connected to at least one other
thing, so I just switched to full overkill mode.

We're clamping window depth arbitrarily to 256 for recursion reasons and
even that's conservative, I wouldn't worry about it here.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101013/6120708a/attachment-0001.pgp>


More information about the xorg-devel mailing list