From patchwork Wed Oct 27 00:22:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 284402 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 o9R0NDb0026098 for ; Wed, 27 Oct 2010 00:23:34 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C706B9E7FF for ; Tue, 26 Oct 2010 17:23:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vw0-f49.google.com (mail-vw0-f49.google.com [209.85.212.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 3614A9E7A4 for ; Tue, 26 Oct 2010 17:22:54 -0700 (PDT) Received: by vws2 with SMTP id 2so3248vws.36 for ; Tue, 26 Oct 2010 17:22:53 -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:in-reply-to:references; bh=mduDTGUlXxNC6uAbf4lzgF0RRPsKlqJaf7u0+Kjqpo0=; b=Naq5SGfzq+iJH6pvwIu8Erg3rLabfFafLk0EuUuODNHyiJ6XVKO+8kPi7eL4oIGeZF iLXRYoSNJa/3nvH5EyWB34bjKkhE+FZ93EabdOMgsVAQ8edI955vAFaYy8iP5QzpBaZf mSXltQD3tmPHeR5ZAcZyFoP39TIzneNj1lDzY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Ydhy+1hJCdWTvanXRUgmJBtoIdCdAAKSpAPvQXzUyRQsGuMoXO4T6g2mQFR4wdl/1U OGTA1hy4Yjnv2Op/HqSvLb7vsySH0UriRdSY2/1oqOfgnr1x0zv9UHIjHk+XPQ95p3Qh NYn74xfU2VBWvi9vZhXV7b62JwCP72hSDNBSg= Received: by 10.220.177.137 with SMTP id bi9mr986532vcb.220.1288138973232; Tue, 26 Oct 2010 17:22:53 -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 p32sm4187586vbl.5.2010.10.26.17.22.52 (version=SSLv3 cipher=RC4-MD5); Tue, 26 Oct 2010 17:22:52 -0700 (PDT) From: Alex Deucher To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon/kms: fix r6xx/7xx 1D tiling CS checker v2 Date: Tue, 26 Oct 2010 20:22:42 -0400 Message-Id: <1288138962-2818-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: <1288120901-6433-1-git-send-email-alexdeucher@gmail.com> References: <1288120901-6433-1-git-send-email-alexdeucher@gmail.com> 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]); Wed, 27 Oct 2010 00:23:34 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 7e44b5a..0d29065 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -215,6 +215,9 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) __func__, __LINE__, pitch); return -EINVAL; } + /* avoid breaking userspace */ + if (height > 7) + height &= ~0x7; if (!IS_ALIGNED(height, 8)) { dev_warn(p->dev, "%s:%d cb height (%d) invalid\n", __func__, __LINE__, height);