[haiku-commits] r41543 - in haiku/trunk: headers/private/graphics/radeon_hd src/add-ons/accelerants/radeon_hd src/add-ons/kernel/drivers/graphics/radeon_hd

  • From: kallisti5@xxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 16 May 2011 20:10:49 +0200 (CEST)

Author: kallisti5
Date: 2011-05-16 20:10:49 +0200 (Mon, 16 May 2011)
New Revision: 41543
Changeset: https://dev.haiku-os.org/changeset/41543

Modified:
   haiku/trunk/headers/private/graphics/radeon_hd/radeon_hd.h
   haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp
   haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp
Log:
read and store aperture size (will be used in fblocation calculations)

Modified: haiku/trunk/headers/private/graphics/radeon_hd/radeon_hd.h
===================================================================
--- haiku/trunk/headers/private/graphics/radeon_hd/radeon_hd.h  2011-05-16 
17:44:23 UTC (rev 41542)
+++ haiku/trunk/headers/private/graphics/radeon_hd/radeon_hd.h  2011-05-16 
18:10:49 UTC (rev 41543)
@@ -76,6 +76,7 @@
        uint8*                  graphics_memory;
        addr_t                  physical_graphics_memory;
        uint32                  graphics_memory_size;
+       uint32                  graphics_aperture_size;
 
        bool                    has_edid;
        edid1_info              edid_info;
@@ -145,6 +146,9 @@
        uint32  buffer_base;
 };
 
+// registers
+#define R6XX_CONFIG_APER_SIZE                  0x5430  // r600>
+#define OLD_CONFIG_APER_SIZE                   0x0108  // <r600
 
 // cursor
 #define RADEON_CURSOR_CONTROL                  0x70080

Modified: haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp      2011-05-16 
17:44:23 UTC (rev 41542)
+++ haiku/trunk/src/add-ons/accelerants/radeon_hd/mode.cpp      2011-05-16 
18:10:49 UTC (rev 41543)
@@ -38,8 +38,6 @@
        const color_space kRadeonHDSpaces[] = {B_RGB32_LITTLE, B_RGB24_LITTLE,
                B_RGB16_LITTLE, B_RGB15_LITTLE, B_CMAP8};
 
-       // TODO : Read EDID for create_display_modes via AtomBios as well
-
        gInfo->mode_list_area = create_display_modes("radeon HD modes",
                gInfo->shared_info->has_edid ? &gInfo->shared_info->edid_info : 
NULL,
                NULL, 0, kRadeonHDSpaces,

Modified: 
haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp     
2011-05-16 17:44:23 UTC (rev 41542)
+++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon_hd/radeon_hd.cpp     
2011-05-16 18:10:49 UTC (rev 41543)
@@ -109,20 +109,32 @@
                info.shared_info->has_edid = false;
        }
 
-       // Populate graphics_memory_size with graphics memory size in KB
+       // Populate graphics_memory/aperture_size with 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) << 10;
+               info.shared_info->graphics_aperture_size
+                       = read32(info.registers + R6XX_CONFIG_APER_SIZE) << 10;
        } else {
                // R600-R700 has memory stored in bytes
                info.shared_info->graphics_memory_size
                        = read32(info.registers + R6XX_CONFIG_MEMSIZE) >> 10;
+               info.shared_info->graphics_aperture_size
+                       = read32(info.registers + R6XX_CONFIG_APER_SIZE) >> 10;
        }
 
        TRACE("card(%ld): found %ld MB memory on card.\n", info.id,
-               info.shared_info->graphics_memory_size / 1024);
+               info.shared_info->graphics_memory_size >> 10);
+       TRACE("card(%ld): found %ld MB aperture on card.\n", info.id,
+               info.shared_info->graphics_aperture_size >> 10);
 
+       // if there are more then 512MB memory on the card, only map
+       // the aperture size to prevent overflow of gart
+       if (info.shared_info->graphics_memory_size > 524288)
+               info.shared_info->graphics_memory_size
+                       = info.shared_info->graphics_aperture_size;
+
        TRACE("card(%ld): %s completed successfully!\n", info.id, __func__);
        return B_OK;
 }


Other related posts:

  • » [haiku-commits] r41543 - in haiku/trunk: headers/private/graphics/radeon_hd src/add-ons/accelerants/radeon_hd src/add-ons/kernel/drivers/graphics/radeon_hd - kallisti5