On Thu, Mar 03, 2005 at 04:48:58AM +0100, Roland Scheidegger wrote:
> here's a patch which mainly does 3 things:
> - convert sis, mach64, and radeon to spantmp2.
> The sis and mach64 drivers got a slight change, previously you could not 
> read back alpha values (always 0xff) and I don't think there was a good 
> reason for that?
> The 3 intel drivers and the s3v are not converted due to their support 
> of a RGB555 format spantmp2 can't handle (actually, the i810 does not 
> support the 555 format in its span functions, the driver elsewhere has 
> support for it, this probably can't be right). tdfx and ffb are not 
> converted since they support a 888 format. gamma is not converted since 
> it performs some unusual always-round-up tricks when using RGB565 
> format. trident is not converted since it doesn't support span functions 
> yet at all :-).
> 
> - remove HW_CLIPLOOP, HW_ENDCLIPLOOP, CLIPPIXEL and CLIPSPAN macros out 
> of the drivers whenever possible, since they are almost always 
> identical. ffb uses very different macros, and some drivers do not use 
> the driDrawable struct for HW_CLIPLOOP (which btw is interesting, I'm 
> not quite sure why some drivers need to handle that differently, I 
> didn't look too much into it but the difference is due to the handling 
> of front and back buffers somehow), so they keep their own definitions 
> hopefully.
> There are probably more macro definitions which could be factored out.
> 
> - change CLIPSPAN to never return negative number of pixels (only change 
> that once! not a dozen times, which is why I've done that macro 
> definition removal in the first place...).
> 
> Does this look sane? Driver source code should get quite a bit smaller 
> overall.
 
It looks o.k. and if there's hardware that's more obscure than the common
cases then they'd have their own span routines anyway.

Just watch out on the macro expansion though. You've got this currently...

#define GET_SRC_PTR(_x, _y) (read_buf + _x * 2 + _y * pitch)

and it should be...

#define GET_SRC_PTR(_x, _y) (read_buf + (_x) * 2 + (_y) * pitch)

Alan.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to