[igt-dev] [RFC 1/5] lib: Add halffloat implementation

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Tue Mar 5 11:21:10 UTC 2019


Op 04-03-2019 om 18:03 schreef Strasser, Kevin:
> Maarten Lankhorst wrote:
>> 4 function calls for every pixel is a bit much. Is there any cleaner way we
>> could accomplish the same?
>>
>> void igt_float_to_half(const float *, uint16_t *, int num)
>>
>> void igt_half_to_float(const uint16_t *, float *, int num)
>>
>> If no swizzle is required, it could do an entire line in 1 go, else per 4 or 3.
>>
>> Might be worth it to still do a line in 1 go, even for xrgb, with format
>> always set to rba128f, hardware will ignore the X component anyway. :)
>>
>> And then if required reswizzle.
> Interesting ideas, I agree we should be able to shave off some overhead with the
> function calls. I'm not so sure the payoff would be worth the extra conversions
> in the xrgb case, but I'll do some experimentation and fix accordingly.
>
> Thanks,
> Kevin

Just treat xrgb as argb, alpha channel should be ignored by hw. :)



More information about the igt-dev mailing list