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
signature.asc
Description: This is a digitally signed message part
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
