dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/radeon: fix card_posted check for newer asics
@ 2013-05-22 15:32 alexdeucher
  2013-05-22 15:32 ` [PATCH 2/2] drm/radeon: don't check crtcs in card_posted() on cards without DCE alexdeucher
  2013-05-22 15:48 ` [PATCH 1/2] drm/radeon: fix card_posted check for newer asics Michel Dänzer
  0 siblings, 2 replies; 3+ messages in thread
From: alexdeucher @ 2013-05-22 15:32 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher, stable

From: Alex Deucher <alexander.deucher@amd.com>

Newer asics have variable numbers of crtcs.  Use that
rather than the asic family to determine which crtcs
to check.  This avoids checking non-existent crtcs or
missing crtcs on certain asics.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_device.c |   19 +++++++++----------
 1 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index c2c59fb..89cc816 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -472,18 +472,17 @@ bool radeon_card_posted(struct radeon_device *rdev)
 		return false;
 
 	/* 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)) {
-- 
1.7.7.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] drm/radeon: don't check crtcs in card_posted() on cards without DCE
  2013-05-22 15:32 [PATCH 1/2] drm/radeon: fix card_posted check for newer asics alexdeucher
@ 2013-05-22 15:32 ` alexdeucher
  2013-05-22 15:48 ` [PATCH 1/2] drm/radeon: fix card_posted check for newer asics Michel Dänzer
  1 sibling, 0 replies; 3+ messages in thread
From: alexdeucher @ 2013-05-22 15:32 UTC (permalink / raw)
  To: dri-devel; +Cc: Alex Deucher

From: Alex Deucher <alexander.deucher@amd.com>

Skip checking crtcs in hardware without them.  Avoids checking
non-existent hardware.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/radeon/radeon_device.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 89cc816..af82c9b 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -471,6 +471,9 @@ bool radeon_card_posted(struct radeon_device *rdev)
 	    rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE)
 		return false;
 
+	if (ASIC_IS_NODCE(rdev))
+		goto check_memsize;
+
 	/* first check CRTCs */
 	if (ASIC_IS_DCE4(rdev)) {
 		reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) |
@@ -499,6 +502,7 @@ bool radeon_card_posted(struct radeon_device *rdev)
 		}
 	}
 
+check_memsize:
 	/* then check MEM_SIZE, in case the crtcs are off */
 	if (rdev->family >= CHIP_R600)
 		reg = RREG32(R600_CONFIG_MEMSIZE);
-- 
1.7.7.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] drm/radeon: fix card_posted check for newer asics
  2013-05-22 15:32 [PATCH 1/2] drm/radeon: fix card_posted check for newer asics alexdeucher
  2013-05-22 15:32 ` [PATCH 2/2] drm/radeon: don't check crtcs in card_posted() on cards without DCE alexdeucher
@ 2013-05-22 15:48 ` Michel Dänzer
  1 sibling, 0 replies; 3+ messages in thread
From: Michel Dänzer @ 2013-05-22 15:48 UTC (permalink / raw)
  To: alexdeucher; +Cc: dri-devel

On Mit, 2013-05-22 at 11:32 -0400, alexdeucher@gmail.com wrote:
> From: Alex Deucher <alexander.deucher@amd.com>
> 
> Newer asics have variable numbers of crtcs.  Use that
> rather than the asic family to determine which crtcs
> to check.  This avoids checking non-existent crtcs or
> missing crtcs on certain asics.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-22 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 15:32 [PATCH 1/2] drm/radeon: fix card_posted check for newer asics alexdeucher
2013-05-22 15:32 ` [PATCH 2/2] drm/radeon: don't check crtcs in card_posted() on cards without DCE alexdeucher
2013-05-22 15:48 ` [PATCH 1/2] drm/radeon: fix card_posted check for newer asics Michel Dänzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox