From patchwork Wed Aug 15 21:36:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 1328821 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id C4FDEDFFED for ; Wed, 15 Aug 2012 21:38:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 982929EF5A for ; Wed, 15 Aug 2012 14:38:37 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f49.google.com (mail-yw0-f49.google.com [209.85.213.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 376349EEBB for ; Wed, 15 Aug 2012 14:36:30 -0700 (PDT) Received: by yhjj52 with SMTP id j52so2449746yhj.36 for ; Wed, 15 Aug 2012 14:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=vzm1M+PFwB0OaTItxioZS3A1ot0uht59HfPgWhKw1yE=; b=LOWLLoXHlYJ5fiHlUJXDf+qsd74OihyKWphja/RV5njtCk0Tg4lsfMyVSn+FHpt9zl mwYZRfG/LkMiB3sLBatZvUvjhn70ENK4a4gh+4nA+MMq5uo/nf9jb87t5mwxHl4RHyXU pQxIDWVjeVY/NvVVM1CPovjCoY9a6VgwfjhePc9ykRKD+O1Qm5tJNCvPlVeY6F4cUeM5 P8SsjQ49850xo8rCruaNHYc/SIRcnLOMGb1FLvFI7gHD0nOcb72ZHfEHqzA/BLRPl2j/ 2GbpUYFmRSYzUpJBl+tXa4ImM5Jo8PLyShukDxYDB40KlSnV/UFd/hogJ1QZfPV6YE65 FAWQ== Received: by 10.236.176.8 with SMTP id a8mr21165776yhm.54.1345066589601; Wed, 15 Aug 2012 14:36:29 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPS id i3sm2568249anl.0.2012.08.15.14.36.28 (version=SSLv3 cipher=OTHER); Wed, 15 Aug 2012 14:36:28 -0700 (PDT) From: alexdeucher@gmail.com To: airlied@gmail.com, dri-devel@lists.freedesktop.org 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 Message-Id: <1345066573-1492-3-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.7.5 In-Reply-To: <1345066573-1492-1-git-send-email-alexdeucher@gmail.com> References: <1345066573-1492-1-git-send-email-alexdeucher@gmail.com> Cc: Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Alex Deucher This might be called before we've allocated the radeon_crtcs Signed-off-by: Alex Deucher --- 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))