From patchwork Sun Sep 12 03:09:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= X-Patchwork-Id: 172792 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 o8C3ALTm012734 for ; Sun, 12 Sep 2010 03:10:42 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA6A79E903 for ; Sat, 11 Sep 2010 20:10:21 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-fx0-f49.google.com (mail-fx0-f49.google.com [209.85.161.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 481B39E740 for ; Sat, 11 Sep 2010 20:09:38 -0700 (PDT) Received: by fxm12 with SMTP id 12so3204826fxm.36 for ; Sat, 11 Sep 2010 20:09:37 -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:mime-version :content-type:content-transfer-encoding; bh=UasQMb2WmS8vVju36da/4PkyW/6yAxN7jyVI/jaXYp4=; b=sJMCDXS1aUMj7Vm/9NFgUH5+daLrTUg9PgS2Lv3OzsdzVWey0mDhnh1JR4DJAGG4sR 2bzkLhO2FlJFsd1Q5OG4noR9FQJnIJCB7JyxNl9qA32CmJqCPt9S4qkRlNw4RlPQhFTR tKahellJCRh9mPjiiP8qZarrwEmLaMob+DBz8= 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 :mime-version:content-type:content-transfer-encoding; b=nnEyUu+aTwvUVoUHfbf7cy48BEAN8OzyKDB//NKgiKXpIZtN4sqYVHv15AxoFrT6eS 3SoAdYMtFtJmf4LX5HdyDHu9/PLfcYqHQF6HRTg/gzbmYZorXgkZaUjrFBbad6CBqBKI +VDhgeVo/f+1iCeb27au2AAnlfexbQsAaVYG4= Received: by 10.223.122.194 with SMTP id m2mr2057354far.30.1284260976946; Sat, 11 Sep 2010 20:09:36 -0700 (PDT) Received: from localhost.localdomain (ip-94-113-216-99.net.upcbroadband.cz [94.113.216.99]) by mx.google.com with ESMTPS id a7sm2133244faa.21.2010.09.11.20.09.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 11 Sep 2010 20:09:36 -0700 (PDT) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/radeon/kms: fix the colorbuffer CS checker for r300-r500 Date: Sun, 12 Sep 2010 05:09:13 +0200 Message-Id: <1284260953-2334-2-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1284260953-2334-1-git-send-email-maraeo@gmail.com> References: <1284260953-2334-1-git-send-email-maraeo@gmail.com> MIME-Version: 1.0 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: , 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]); Sun, 12 Sep 2010 03:10:42 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter1.kernel.org id o8C3ALTm012734 diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index ec64b36..e151f16 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -3297,13 +3297,14 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track) unsigned long size; unsigned prim_walk; unsigned nverts; + unsigned num_cb = track->num_cb; - for (i = 0; i < track->num_cb; i++) { + if (!track->zb_cb_clear && !track->color_channel_mask && + !track->blend_read_enable) + num_cb = 0; + + for (i = 0; i < num_cb; i++) { if (track->cb[i].robj == NULL) { - if (!(track->zb_cb_clear || track->color_channel_mask || - track->blend_read_enable)) { - continue; - } DRM_ERROR("[drm] No buffer for color buffer %d !\n", i); return -EINVAL; }