Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e5786bd authored by Dave Airlie's avatar Dave Airlie
Browse files

drm/radeon/kms: add sanity check to wptr.



If we resume in a bad way, we'll get 0xffffffff in wptr, and then
oops with no console. This just adds a sanity check so that we can
avoid the oops and hopefully get more details out of people's systems.

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent fb668c2f
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -744,6 +744,8 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size)
	udelay(10);
	udelay(10);
	rdev->cp.rptr = RREG32(RADEON_CP_RB_RPTR);
	rdev->cp.rptr = RREG32(RADEON_CP_RB_RPTR);
	rdev->cp.wptr = RREG32(RADEON_CP_RB_WPTR);
	rdev->cp.wptr = RREG32(RADEON_CP_RB_WPTR);
	/* protect against crazy HW on resume */
	rdev->cp.wptr &= rdev->cp.ptr_mask;
	/* Set cp mode to bus mastering & enable cp*/
	/* Set cp mode to bus mastering & enable cp*/
	WREG32(RADEON_CP_CSQ_MODE,
	WREG32(RADEON_CP_CSQ_MODE,
	       REG_SET(RADEON_INDIRECT2_START, indirect2_start) |
	       REG_SET(RADEON_INDIRECT2_START, indirect2_start) |