From: Petr V. <VAN...@vc...> - 2001-06-19 16:02:21
|
On 19 Jun 01 at 16:48, Ghozlane Toumi wrote: > -strange things : I have a value, previously stored in one bitfield R1 [7:4] > which is now dispatched in 3 bitfields : > { R1[24], R1[7:4], R2[30] } R2 being a "new" register added to the > architecture. > (the value was representing a number of 64 pixel wide tiles and to maintain > compatibility, it now reprents the number of .. 32 pixels wide tiles ...) Do you mean that value is now (MSB to LSB) R2[30] R1[24] R1[7:4], or is it really R2[30] R1[7:4] R1[24] ? Anyway, easiest thing is: if (fbinfo.capable.tile_is_64) { r1 = (r1 & ~0x010000F0) | ((v & 0xF) << 4) | ((v & 0x10) << (24 - 4)); r2 = (r2 & ~0x40000000) | (v & 0x20) << (30 - 5); } else { if (v > 0xF) { printk(KERN_DEBUG "Stupid, tile > 16!"); } r1 = (r1 & ~0x000000F0) | ((v & 0xF) << 4) } All drivers are full of such code. Petr Vandrovec van...@vc... |