浏览代码

drm/radeon: Clear surface registers at initialization time.

Some PowerMac firmwares set up a tiling surface at the beginning of VRAM
which messes us up otherwise.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
Michel Dänzer 16 年之前
父节点
当前提交
b1e3a6d1c4
共有 1 个文件被更改,包括 20 次插入0 次删除
  1. 20 0
      drivers/gpu/drm/radeon/radeon_device.c

+ 20 - 0
drivers/gpu/drm/radeon/radeon_device.c

@@ -34,6 +34,23 @@
 #include "radeon_asic.h"
 #include "atom.h"
 
+/*
+ * Clear GPU surface registers.
+ */
+static void radeon_surface_init(struct radeon_device *rdev)
+{
+	/* FIXME: check this out */
+	if (rdev->family < CHIP_R600) {
+		int i;
+
+		for (i = 0; i < 8; i++) {
+			WREG32(RADEON_SURFACE0_INFO +
+			       i * (RADEON_SURFACE1_INFO - RADEON_SURFACE0_INFO),
+			       0);
+		}
+	}
+}
+
 /*
  * GPU scratch registers helpers function.
  */
@@ -496,6 +513,9 @@ int radeon_device_init(struct radeon_device *rdev,
 	radeon_errata(rdev);
 	/* Initialize scratch registers */
 	radeon_scratch_init(rdev);
+	/* Initialize surface registers */
+	radeon_surface_init(rdev);
+
 	/* TODO: disable VGA need to use VGA request */
 	/* BIOS*/
 	if (!radeon_get_bios(rdev)) {