[Mesa-dev] gallium endianness and hw drivers
Marek Olšák
maraeo at gmail.com
Thu Jan 16 01:02:02 PST 2014
On Thu, Jan 16, 2014 at 8:43 AM, Michel Dänzer <michel at daenzer.net> wrote:
> On Mit, 2014-01-15 at 14:27 +0100, Marek Olšák wrote:
>> On Wed, Jan 15, 2014 at 7:07 AM, Michel Dänzer <michel at daenzer.net> wrote:
>> > On Die, 2014-01-14 at 00:22 +0100, Marek Olšák wrote:
>> >> I think the format conversion functions should look like:
>> >>
>> >> #ifdef BIG_ENDIAN
>> >> case PIPE_FORMAT_A8B8G8R8_UNORM:
>> >> return hw_format_for_R8G8B8A8_UNORM;
>> >> ...
>> >> #else
>> >> case PIPE_FORMAT_R8G8B8A8_UNORM:
>> >> return hw_format_for_R8G8B8A8_UNORM;
>> >> #endif
>> >>
>> >> which can be simplified to:
>> >>
>> >> case PIPE_FORMAT_RGBA8888_UNORM:
>> >> return hw_format_for_R8G8B8A8_UNORM;
>> >>
>> >> So that the GPU can see the same formats, but they are different for the CPU.
>> >>
>> >> What do you think?
>> >
>> > That might be an option, but PIPE_FORMAT_R8G8B8A8_UNORM is useful on big
>> > endian hosts as well, e.g. it matches GL_RGBA / GL_UNSIGNED_BYTE
>> > exactly.
>>
>> I wouldn't worry about such optimizations when we don't even have
>> proper big endian support.
>
> I'd consider it part of proper big endian support though.
>
>
>> I'd rather stick to the simplest solution for the old hardware.
>
> What do you mean by old hardware? Remember that SI and newer have
> basically no hardware byteswapping facilities anymore, and PowerPC
> machines with PCIe slots are still being produced and sold.
R300-R500.
Marek
More information about the mesa-dev
mailing list