Quoting Ville Syrj�l�:
> The mach64 texture engine requires a power of two texture pitch. The
> attached patch tries to solve the problem by allowing drivers to request
> power of two pitches.
>
> It adds three values max_power_of_two_{pixelpitch,bytepitch,height} to
> CardLimitaions. If the buffer pitch is below these values the
> surfacemanager will increase the pitch to the next power of two value.
I wouldn't mind having that in CVS, but I would put the log2 routine
in "lib/direct/util.h" as direct_log2(), but I'm not sure if this kind
of log2 function is the mathematically correct version. At least it's
suitable for "the (next) integer power of two after/of the specified value".
> The biggest problem with this solution is that it can waste a lot of
> memory needlessly. One solution I can think of would involve the driver
> setting some flag in CheckState() which would signal
> dfb_surfacemanager_assure_video() to reallocate the buffer with a power of
> two pitch. But that might increase memory fragmentation.
>
> Any thoughts?
It would be quite complicated, but the surface manager could store the buffers
interleaved, i.e. use "wasted" memory of one buffer to store another buffer.
--
Best regards,
Denis Oliver Kropp
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
Convergence GmbH