All of lore.kernel.org
 help / color / mirror / Atom feed
From: alexdeucher@gmail.com
To: airlied@gmail.com, dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 3/5] drm/radeon/r1xx-r4xx: don't use radeon_crtc for vblank callback
Date: Wed, 15 Aug 2012 17:36:11 -0400	[thread overview]
Message-ID: <1345066573-1492-3-git-send-email-alexdeucher@gmail.com> (raw)
In-Reply-To: <1345066573-1492-1-git-send-email-alexdeucher@gmail.com>

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

This might be called before we've allocated the radeon_crtcs

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

diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 8acb34f..2ac693c 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -80,10 +80,12 @@ MODULE_FIRMWARE(FIRMWARE_R520);
  */
 void r100_wait_for_vblank(struct radeon_device *rdev, int crtc)
 {
-	struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc];
 	int i;
 
-	if (radeon_crtc->crtc_id == 0) {
+	if (crtc >= rdev->num_crtc)
+		return;
+
+	if (crtc == 0) {
 		if (RREG32(RADEON_CRTC_GEN_CNTL) & RADEON_CRTC_EN) {
 			for (i = 0; i < rdev->usec_timeout; i++) {
 				if (!(RREG32(RADEON_CRTC_STATUS) & RADEON_CRTC_VBLANK_CUR))
-- 
1.7.7.5

  parent reply	other threads:[~2012-08-15 21:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-15 21:36 [PATCH 1/5] drm/radeon/dce4+: don't use radeon_crtc for vblank callback alexdeucher
2012-08-15 21:36 ` [PATCH 2/5] drm/radeon: clean up evergreen_get_vblank_counter alexdeucher
2012-08-15 21:36 ` alexdeucher [this message]
2012-08-15 21:36 ` [PATCH 4/5] drm/radeon/r5xx-r7xx: don't use radeon_crtc for vblank callback alexdeucher
2012-08-15 21:59   ` [PATCH 4/5] drm/radeon/r5xx-r7xx: don't use radeon_crtc for vblank callback (v2) alexdeucher
2012-08-15 21:36 ` [PATCH 5/5] drm/radeon: properly handle mc_stop/mc_resume on evergreen+ alexdeucher
2012-08-15 23:49 ` [PATCH 1/5] drm/radeon/dce4+: don't use radeon_crtc for vblank callback Jerome Glisse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345066573-1492-3-git-send-email-alexdeucher@gmail.com \
    --to=alexdeucher@gmail.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.