[haiku-commits] Re: r41526 - haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon_hd

  • From: kallisti5 <kallisti5@xxxxxxxxxxx>
  • To: <haiku-commits@xxxxxxxxxxxxx>
  • Date: Mon, 16 May 2011 09:50:36 -0500

On Mon, 16 May 2011 10:27:35 +0200, Stephan Aßmus wrote:
Hi,

+       // Populate graphics_memory_size with graphics memory size in KB
+       if (info.shared_info->device_chipset>= RADEON_R800) {
+               // R800+ has memory stored in MB
+               info.shared_info->graphics_memory_size
+                       = read32(info.registers + R6XX_CONFIG_MEMSIZE) * 1024;
+       } else {
+               // R600-R700 has memory stored in bytes
+               info.shared_info->graphics_memory_size
+                       = read32(info.registers + R6XX_CONFIG_MEMSIZE) >> 10;
+       }

If you mean "/ 1024", just write that.

Yeah, but doing a bitwise shift seems more elegant... also it is quicker
from what I hear for our 386 and 486 PCI-express Radeon HD users :P


Also "R6XX_CONFIG_MEMSIZE" is misnamed if it applies to R600, R700 and R800. :-)

I completely agree... except there are *thousands* (5,216 to be exact) of ati radeon register definitions in the Xorg sources, I am trying to not rename any
as looking up aka's are a pita.


Thanks!
  -- Alex

Other related posts: