From patchwork Wed Feb 10 22:36:12 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: 78585 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 o1AMbNTj010586 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Feb 2010 22:37:59 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 1NfLAZ-00084n-OU; Wed, 10 Feb 2010 22:36:27 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NfLAY-00084e-R3 for dri-devel@lists.sourceforge.net; Wed, 10 Feb 2010 22:36:26 +0000 Received-SPF: pass (sfi-mx-1.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-1.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NfLAX-00039o-9m for dri-devel@lists.sourceforge.net; Wed, 10 Feb 2010 22:36:26 +0000 Received: from oldium.localnet (ip-89-103-84-89.karneval.cz [89.103.84.89]) by email-relay1.ng.seznam.cz (Seznam SMTPD 1.1.7@13984) with ESMTP; Wed, 10 Feb 2010 23:36:16 +0100 (CET) To: dri-devel@lists.sourceforge.net Subject: [PATCH] drm/radeon/kms: Fix for CS track check to allow at least one enabled component From: =?iso-8859-2?q?Old=F8ich_Jedli=E8ka?= Date: Wed, 10 Feb 2010 23:36:12 +0100 MIME-Version: 1.0 Message-Id: <201002102336.13227.oldium.pro@seznam.cz> X-Smtpd: 1.1.7@13984 X-Seznam-User: oldium.pro@seznam.cz X-QM-Mark: email-qm2<414726316> 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: 1NfLAX-00039o-9m 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:37:59 +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;