From patchwork Wed Feb 10 22:54:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?T2xkw4XihKJpY2ggSmVkbGnDhMKNa2E=?= X-Patchwork-Id: 78590 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1AMtZoG013172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Feb 2010 22:56:15 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-1.v29.ch3.sourceforge.com) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NfLS0-0000ny-91; Wed, 10 Feb 2010 22:54:28 +0000 Received: from sfi-mx-3.v28.ch3.sourceforge.com ([172.29.28.123] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NfLRz-0000ns-Ku for dri-devel@lists.sourceforge.net; Wed, 10 Feb 2010 22:54:27 +0000 Received-SPF: pass (sfi-mx-3.v28.ch3.sourceforge.com: domain of seznam.cz designates 77.75.76.43 as permitted sender) client-ip=77.75.76.43; envelope-from=oldium.pro@seznam.cz; helo=smtp.seznam.cz; Received: from [77.75.76.43] (helo=smtp.seznam.cz) by sfi-mx-3.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NfLRx-0008KL-Nf for dri-devel@lists.sourceforge.net; Wed, 10 Feb 2010 22:54:27 +0000 Received: from oldium.localnet (ip-89-103-84-89.karneval.cz [89.103.84.89]) by email-relay2.ng.seznam.cz (Seznam SMTPD 1.1.7@13984) with ESMTP; Wed, 10 Feb 2010 23:54:16 +0100 (CET) From: =?iso-8859-2?q?Old=F8ich_Jedli=E8ka?= To: dri-devel@lists.sourceforge.net Subject: [PATCH v2] drm/radeon/kms: Fix for CS track check to allow at least one enabled component Date: Wed, 10 Feb 2010 23:54:13 +0100 User-Agent: KMail/1.13.0 (Linux/2.6.32-drm; KDE/4.4.0; i686; ; ) References: <201002102336.13227.oldium.pro@seznam.cz> <201002102345.30154.oldium.pro@seznam.cz> In-Reply-To: <201002102345.30154.oldium.pro@seznam.cz> MIME-Version: 1.0 Message-Id: <201002102354.13717.oldium.pro@seznam.cz> X-Smtpd: 1.1.7@13984 X-Seznam-User: oldium.pro@seznam.cz X-QM-Mark: email-qm5<414688505> X-Spam-Score: -0.8 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 1.0 RDNS_NONE Delivered to trusted network by a host with no rDNS -0.2 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NfLRx-0008KL-Nf X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 10 Feb 2010 22:56:15 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 7cabb62..f1dab96 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -233,6 +233,7 @@ static int r600_cs_track_check(struct radeon_cs_parser *p) struct r600_cs_track *track = p->track; u32 tmp; int r, i; + bool is_valid = false; /* on legacy kernel we don't perform advanced check */ if (p->rdev == NULL) @@ -247,17 +248,20 @@ static int r600_cs_track_check(struct radeon_cs_parser *p) for (i = 0; i < 8; i++) { if ((tmp >> (i * 4)) & 0xF) { /* at least one component is enabled */ - if (track->cb_color_bo[i] == NULL) { - dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb for %d\n", - __func__, __LINE__, track->cb_target_mask, track->cb_shader_mask, i); - return -EINVAL; + if (track->cb_color_bo[i] != NULL) { + /* perform rewrite of CB_COLOR[0-7]_SIZE */ + r = r600_cs_track_validate_cb(p, i); + if (r) + return r; + is_valid = true; } - /* perform rewrite of CB_COLOR[0-7]_SIZE */ - r = r600_cs_track_validate_cb(p, i); - if (r) - return r; } } + if (!is_valid) { + dev_warn(p->dev, "%s:%d mask 0x%08X | 0x%08X no cb found\n", + __func__, __LINE__, track->cb_target_mask, track->cb_shader_mask); + return -EINVAL; + } return 0; }