From patchwork Mon Dec 13 19:03:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 407402 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 oBDJ3UEf012287 for ; Mon, 13 Dec 2010 19:03:50 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 51EFB9E9D9 for ; Mon, 13 Dec 2010 11:03:29 -0800 (PST) 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 44C759E769 for ; Mon, 13 Dec 2010 11:03:19 -0800 (PST) Received: by qyk10 with SMTP id 10so4099227qyk.15 for ; Mon, 13 Dec 2010 11:03:18 -0800 (PST) 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=k6LHXpgE7pm4WP0HvF/3s/vQJzF5EskZBgNrTZaBfNw=; b=en5gycnp9QI5MBB67tDQuf2gziGJGkDBl3ObyBkY+j4oGQUi1Y57jaDxS2CSiwS8Zv CS+cov5cUGXkM1XceHnsWRYaMXRSu/BtkHt4QWjraHBPmUA12ixeZWbXynNNyJOgsQ1R Q6FofJxDJFq/Em0M0CV/njXQfMLBqIDRnBj8k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=hU0MUKKk3CeZ6uAD8S4SpQ3+96FyqJMf+P9J+8E/aSyGldOFEYgWHlGDOyrdNwbRVj MemWls8Ie4qQ6EQlmWYgxQebftn8cpk3cdspXBOnfOAs7ypEOUkBlhHt8PvaL1JunXsG BsqY4ziGG14aZ2DLpzbdls4H+k5mpl2QNBRBA= Received: by 10.224.54.138 with SMTP id q10mr4191914qag.372.1292266998523; Mon, 13 Dec 2010 11:03:18 -0800 (PST) Received: from localhost.localdomain (static-74-96-105-7.washdc.fios.verizon.net [74.96.105.7]) by mx.google.com with ESMTPS id n7sm4221175qcu.16.2010.12.13.11.03.15 (version=SSLv3 cipher=RC4-MD5); Mon, 13 Dec 2010 11:03:16 -0800 (PST) From: Alex Deucher To: airlied@gmail.com, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon/kms: disable the r600 cb offset checker for linear surfaces Date: Mon, 13 Dec 2010 14:03:09 -0500 Message-Id: <1292266989-6695-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.1.1 Cc: Jean Delvare 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]); Mon, 13 Dec 2010 19:03:50 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 0f90fc3..7831e08 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -315,11 +315,10 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { /* the initial DDX does bad things with the CB size occasionally */ /* it rounds up height too far for slice tile max but the BO is smaller */ - tmp = (height - 7) * 8 * bpe; - if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { - dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); - return -EINVAL; - } + /* r600c,g also seem to flush at bad times in some apps resulting in + * bogus values here. So for linear just allow anything to avoid breaking + * broken userspace. + */ } else { dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); return -EINVAL;