On 16/12/16 05:44 AM, Harry Wentland wrote: > On 2016-12-13 01:41 AM, Dave Airlie wrote: > >> One thing I noticed in passing is the displayport code seems >> possibly endian unsafe, it casts bytes read from hardware into >> bitfields, this is the best defined behaviour and is generally >> a pattern we try to steer away from. > > Yeah, we generally assume we run on x86. I haven't looked at all the > bitfields lately but I do know that we generally use two definitions, > one for little, one for big endian, for every bitfield. The memory layout of C bit-fields doesn't only vary due to endianness, it's completely up to each architecture's ABI. This is just one reason why we generally avoid bit-fields for modelling fixed memory layouts. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer