Bug 105950

Summary: radeonsi: OpenCL not working correctly on a big endian machine
Product: Mesa Reporter: Bas Vermeulen <bas>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium    
Version: 17.3   
Hardware: PowerPC   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch for si_vgt_param_key endian fix
Patch for dispatch_packet endianness fix

Description Bas Vermeulen 2018-04-09 10:52:17 UTC
Running any OpenCL program on a big endian machine using a radeonsi card fails.

- union si_vgt_param_key uses a bitfield shared with a 32 bit value. This causes the index to be wrong on a big endian machine, and crashes any OpenCL program with a segfault.
- si_setup_user_sgprs_co_v2 in si_compute.c fills a dispatch_packet struct with values which are uploaded to the GPU. To ensure this works correctly, these values need to be converted to little endian.

I'll send patches to the mesa-dev list for both these issues.

Bas Vermeulen
Comment 1 Bas Vermeulen 2018-04-09 11:16:49 UTC
Created attachment 138697 [details] [review]
Patch for si_vgt_param_key endian fix
Comment 2 Bas Vermeulen 2018-04-09 11:17:19 UTC
Created attachment 138698 [details] [review]
Patch for dispatch_packet endianness fix
Comment 3 Timothy Arceri 2018-09-09 22:43:59 UTC
These patches were committed. Closing as fixed.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.