From patchwork Tue Oct 19 03:45:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 264111 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9J3k0BC022147 for ; Tue, 19 Oct 2010 03:46:21 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 546AE9ECE1 for ; Mon, 18 Oct 2010 20:45:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qy0-f170.google.com (mail-qy0-f170.google.com [209.85.216.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 04B9D9E9E6 for ; Mon, 18 Oct 2010 20:45:48 -0700 (PDT) Received: by qyk32 with SMTP id 32so396023qyk.15 for ; Mon, 18 Oct 2010 20:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=Tc0xQvqTmCDQRSCiIh3kpfirCnYTkTWBcwTfwrlaXzc=; b=gkr01Z6BkUtMtTDLnqME+avtKVsCuiKWX5gCw3xDORnszmIiOvGsTk6fA0T4xHiLP4 lrmzZHUSr7E2lIAAVSUyIbb/YrclZ6/YWoqlkuVmcBUhPN0O2+/8HzH+vxM4td2SiwRB vVuvXwcalW81EmJWNZ3bSt931yvXbpmHfs6Vo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=j9Bg7a8p0QfXieRrvgn/FDrXfFOFuXILuBpCWleyCXJYSqzcWne8dvhIDHjPpkG9Ih FoF1WtqkSDeqbGmKYPfWza+ymrO5aQUxQQMtIORW/SjhJlGO9/xZ6eAbIe9ujDw+U5wU J+PfxJc6/f1wYo92RJrIDvvZe28akWJBLYEmY= Received: by 10.229.75.1 with SMTP id w1mr4656557qcj.100.1287459948217; Mon, 18 Oct 2010 20:45:48 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-7.washdc.fios.verizon.net [74.96.105.7]) by mx.google.com with ESMTPS id nb14sm14309253qcb.24.2010.10.18.20.45.46 (version=SSLv3 cipher=RC4-MD5); Mon, 18 Oct 2010 20:45:47 -0700 (PDT) From: Alex Deucher To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon/kms: fix 2D tile height alignment in the r600 CS checker Date: Mon, 18 Oct 2010 23:45:39 -0400 Message-Id: <1287459939-9734-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.1.1 Cc: stable@kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Oct 2010 03:46:21 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 250a3a9..478fddf 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -228,7 +228,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) __func__, __LINE__, pitch); return -EINVAL; } - if (!IS_ALIGNED((height / 8), track->nbanks)) { + if (!IS_ALIGNED((height / 8), track->npipes)) { dev_warn(p->dev, "%s:%d cb height (%d) invalid\n", __func__, __LINE__, height); return -EINVAL; @@ -367,7 +367,7 @@ static int r600_cs_track_check(struct radeon_cs_parser *p) __func__, __LINE__, pitch); return -EINVAL; } - if ((height / 8) & (track->nbanks - 1)) { + if (!IS_ALIGNED((height / 8), track->npipes)) { dev_warn(p->dev, "%s:%d db height (%d) invalid\n", __func__, __LINE__, height); return -EINVAL;