From patchwork Wed Jan 8 17:16:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= X-Patchwork-Id: 3455021 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 04BA0C02DD for ; Wed, 8 Jan 2014 17:16:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E60B3200E9 for ; Wed, 8 Jan 2014 17:16:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 89FB32010B for ; Wed, 8 Jan 2014 17:16:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19292FAD4A; Wed, 8 Jan 2014 09:16:36 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f180.google.com (mail-ea0-f180.google.com [209.85.215.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 68524FAD4A for ; Wed, 8 Jan 2014 09:16:33 -0800 (PST) Received: by mail-ea0-f180.google.com with SMTP id f15so960376eak.39 for ; Wed, 08 Jan 2014 09:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=51VC55K4L6YG2MpiiKKV4xZwT4XzO0+bFJfX9G41t5Y=; b=vcTdbbE2g0PHCoQt9ogQyUEAL46ILqdXtz9sJ+oNCIJ46C9dOTqa6OvGQYGv59o53k f5lleUVOo0CQOx49Jlz9+F9yvWh5DF/sULWY5qNFQG3dHC9/Z0SzGWaLQdPuvHqMjh7c OfaqBC4vIW2h7xVBhV/I/ZDYRsuyKmqAqX3ihF+61hNZMDlIv1vQ62Mh7LMkT8q+tPXj x+oxQnyY2VOzAV95yOhqRLAI/LNECSWksHic7nxiytcCsEnKqW0ZuQfYyxIAgBJyKwEw WalnRKqx5rU1BBP5/LPzyTO/lcFuoI5Sv7l8hChzf2JWWWAN7eV+Y9DvV2t1yObvRwQY iEVA== X-Received: by 10.15.32.73 with SMTP id z49mr100340504eeu.27.1389201391056; Wed, 08 Jan 2014 09:16:31 -0800 (PST) Received: from peklo.amd.com ([194.228.11.60]) by mx.google.com with ESMTPSA id 4sm191250209eed.14.2014.01.08.09.16.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 Jan 2014 09:16:30 -0800 (PST) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: skip colorbuffer checking if COLOR_INFO.FORMAT is set to INVALID Date: Wed, 8 Jan 2014 18:16:26 +0100 Message-Id: <1389201386-30126-1-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 1.8.3.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marek Olšák This fixes a bug which was causing rejections of valid GPU commands from userspace. Signed-off-by: Marek Olšák Cc: stable@vger.kernel.org --- drivers/gpu/drm/radeon/evergreen_cs.c | 5 ++++- drivers/gpu/drm/radeon/r600_cs.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index eb8ac31..c7cac07 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c @@ -967,7 +967,10 @@ static int evergreen_cs_track_check(struct radeon_cs_parser *p) if (track->cb_dirty) { tmp = track->cb_target_mask; for (i = 0; i < 8; i++) { - if ((tmp >> (i * 4)) & 0xF) { + u32 format = G_028C70_FORMAT(track->cb_color_info[i]); + + if (format != V_028C70_COLOR_INVALID && + (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", diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 5dceea6..56130bf 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c @@ -749,7 +749,10 @@ static int r600_cs_track_check(struct radeon_cs_parser *p) } for (i = 0; i < 8; i++) { - if ((tmp >> (i * 4)) & 0xF) { + u32 format = G_0280A0_FORMAT(track->cb_color_info[i]); + + if (format != V_0280A0_COLOR_INVALID && + (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",