From patchwork Fri Aug 1 13:43:20 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: 4663071 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 A473DC0338 for ; Fri, 1 Aug 2014 13:43:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7FEB201FB for ; Fri, 1 Aug 2014 13:43:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E9FDB201F7 for ; Fri, 1 Aug 2014 13:43:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B8E26E758; Fri, 1 Aug 2014 06:43:36 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by gabe.freedesktop.org (Postfix) with ESMTP id F39226E26E for ; Fri, 1 Aug 2014 06:43:34 -0700 (PDT) Received: by mail-wi0-f175.google.com with SMTP id ho1so1386251wib.8 for ; Fri, 01 Aug 2014 06:43:31 -0700 (PDT) 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=v2EKgo/7dIrIblS2SOQ6ZnDrXmhcmeCQd6FeCnpqxko=; b=Rqa0byQzlvrX2XLMTsO+jYunVAxmFLiuMCB3e3UHMusaVUBZcVFw7lvW3ln59pKnE6 xkTiN5mun9ASJzQ1BHpkWDttLiBJLzFqkfmLSGtNp2UfvWet3OXIJtXsyK3orYZhjfak rSk3H2LaWeqpp3u7KrQOZUZhMt9aw8cAafxKKlrAgntUtOG5HudIca2E+4+t9YD7SXqG LpAhrNZPZYlfA0ymyju8pmSJ4LN+IzbD5S4QA1dTVHEn1RuKL1R17WmJAPUOEr1funYa x3AYzVSiTtLal90wcQYhF99uv/LWCfh2fZpzwVB/XLVdt08LcdiaE0XXBkfnIYJI3IjO 7RXg== X-Received: by 10.194.7.36 with SMTP id g4mr8195562wja.37.1406900611009; Fri, 01 Aug 2014 06:43:31 -0700 (PDT) Received: from localhost.localdomain ([194.228.11.246]) by mx.google.com with ESMTPSA id 10sm21063127wjx.26.2014.08.01.06.43.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Aug 2014 06:43:30 -0700 (PDT) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] radeon: allow write_reloc with unaccounted buffers to cope with Mesa R200 bug Date: Fri, 1 Aug 2014 15:43:20 +0200 Message-Id: <1406900600-3601-1-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.0 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 Reviewed-by: Alex Deucher --- I'm not really interested in studying the R200 driver to fix it. This has to suffice. radeon/radeon_cs_gem.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/radeon/radeon_cs_gem.c b/radeon/radeon_cs_gem.c index b87c6b1..bcfa05b 100644 --- a/radeon/radeon_cs_gem.c +++ b/radeon/radeon_cs_gem.c @@ -178,6 +178,15 @@ static int cs_gem_write_reloc(struct radeon_cs_int *cs, uint32_t idx; unsigned i; + if (!boi->space_accounted) { + struct radeon_cs *rcs = (struct radeon_cs*)cs; + int r; + + radeon_cs_space_add_persistent_bo(rcs, bo, read_domain, write_domain); + r = radeon_cs_space_check(rcs); + if (r) + return r; + } assert(boi->space_accounted); /* check domains */