[PATCH] hw/xfree86: Fix block handler wrapping in xf86Rotate
keithp at keithp.com
Wed Apr 16 22:55:23 PDT 2014
Eric Anholt <eric at anholt.net> writes:
> I'm uncomfortable with you mashing these 3 changes together,
> particularly the reinsertion change in what was supposed to be just a
> bugfix commit. It didn't take much grepping for me to find more code
> that wasn't rewrapping the blockhandler according to these rules:
Yeah, stuff which doesn't dynamically wrap, and which wraps at server
init time I didn't worry about as it can't cause problems of the nature
I found. But, it would be best to have everything following the rules
From a documentation perspective. I audited the code which wraps after
server init time (which are also the only ones which unwrap) and made
sure all of those were correct; those are the only ones which could
potentially cause problems.
Given that the software cursor code *does* unwrap, having more code
which operates in the same fashion is just going to expose the same bugs
in other ways though; I guess that's "worse" in some metric?
But, yes, splitting the patch into two pieces would be more sensible,
and also auditing the static wrapping code to make sure it follows the
same style guidelines for consistency would be a good idea.
There are only a few users of the BlockHandler in the core server:
Dynamic and correct.
Static and correct
Not a wrapper, this is the bottom function
Static and incorrect
This is abusing the screen BlockHandler typedef
Dynamic and currently incorrect.
Not actually being used (the code is commented out)
Dynamic and incorrect. (although it does work currently).
Dynamic and correct.
misprite should clearly be fixed; it happens to work currently because
nothing that it calls changes BlockHandlers, but it calls a *lot* of
Given that we have two layers which require correct wrapping behavior,
I'd suggest fixing the core server to do it right everywhere and then
letting the rotate code also expect correct behavior. That should be a
sequence of probably five patches:
1) Add the comment
2) Fix xf86Rotate to be correct
3) Fix misprite to be correct
4) fix xf86VGAarbiter to be correct
5) change xf86Rotate to leave things unwrapped
Every video driver also has a block handler, and I'm pretty sure they're
all wrapping the miscrinit.c setting of NoopDDA as there doesn't appear
to be another one anywhere. In any case, I think these are all static,
and so it would be nice to make them correct, but it would probably be
nicer to just not have them wrapping at all.
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 810 bytes
Desc: not available
More information about the xorg-devel