summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-02-09 12:50:10 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-02-09 12:50:10 +0000
commitc25f2d47de74a5d74720853883144ca11b27cf16 (patch)
tree025909883e0685eb2598db202ac03b333b277f5b /sys/dev
parent2fdcbb5b23e0d78721760e4b1052be8b4ed61fca (diff)
drm/radeon: fix card_posted check for newer asics
From Alex Deucher 86330a74c53a09786820c4109ad681e6a62ebd83 in ubuntu 3.8 09fb8bd1a63b0f9f15e655c4fe8d047e5d2bf67a in mainline linux
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/drm/radeon/radeon_device.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_device.c b/sys/dev/pci/drm/radeon/radeon_device.c
index 8fa821e67c6..c2bc3c2f5c8 100644
--- a/sys/dev/pci/drm/radeon/radeon_device.c
+++ b/sys/dev/pci/drm/radeon/radeon_device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: radeon_device.c,v 1.4 2014/02/09 11:03:31 jsg Exp $ */
+/* $OpenBSD: radeon_device.c,v 1.5 2014/02/09 12:50:09 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -446,18 +446,17 @@ bool radeon_card_posted(struct radeon_device *rdev)
#endif
/* first check CRTCs */
- if (ASIC_IS_DCE41(rdev)) {
+ if (ASIC_IS_DCE4(rdev)) {
reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) |
RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET);
- if (reg & EVERGREEN_CRTC_MASTER_EN)
- return true;
- } else if (ASIC_IS_DCE4(rdev)) {
- reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) |
- RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET) |
- RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET) |
- RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET) |
- RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET) |
- RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
+ if (rdev->num_crtc >= 4) {
+ reg |= RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET) |
+ RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET);
+ }
+ if (rdev->num_crtc >= 6) {
+ reg |= RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET) |
+ RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
+ }
if (reg & EVERGREEN_CRTC_MASTER_EN)
return true;
} else if (ASIC_IS_AVIVO(rdev)) {