From patchwork Tue May 27 00:56:36 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: 4245751 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 A9A01BF90B for ; Tue, 27 May 2014 00:56:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E822A20265 for ; Tue, 27 May 2014 00:56:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2AD3620254 for ; Tue, 27 May 2014 00:56:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03BEB6E1FA; Mon, 26 May 2014 17:56:46 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTP id A3E1C6E1FA for ; Mon, 26 May 2014 17:56:43 -0700 (PDT) Received: by mail-wi0-f176.google.com with SMTP id n15so766623wiw.3 for ; Mon, 26 May 2014 17:56:42 -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=FcGkKX9J3FdWbVNWt/IhPlABu8wrq7OZ4C9WQ4ahS0c=; b=QjJCsW4XtiltKtchFUzPbjocaB80kmf1breSObCCWCnZrfp4KsE7ZQOzTPBr6nzPNU AeWeyukGXV1VdmkPsKgmqAcJ4iOd4DLbS0zDJsAXM/6/0gLHpgBvp+yrAS/5TacPk0jh vejJ2TMM5OTOjVgwmsmXFNZJv59vjyRsQ516TDemE0QYOEhPtgNY4t/ZInHg7/gTHSCX CERgJXprIakYRITEnaf+ByzlQmkHsFduPB2AJMXhWnmHf17rTLjuGXFDvaNjBR7gaFmQ HQG+o0tAdDlkJ9aCxM1TxCzmfSDdA6060E9V8MrsMZbNXgp/vPaOAm+9PPH3C4YOTZC/ Tnow== X-Received: by 10.180.126.8 with SMTP id mu8mr32990185wib.10.1401152202445; Mon, 26 May 2014 17:56:42 -0700 (PDT) Received: from localhost.localdomain ([194.228.11.91]) by mx.google.com with ESMTPSA id be3sm30815116wjc.5.2014.05.26.17.56.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 May 2014 17:56:41 -0700 (PDT) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: don't allow RADEON_GEM_DOMAIN_CPU for command submission Date: Tue, 27 May 2014 02:56:36 +0200 Message-Id: <1401152196-4604-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.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 It hangs the hardware. Signed-off-by: Marek Olšák Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon_cs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 2b6e0eb..2b78191 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -152,6 +152,12 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) uint32_t domain = r->write_domain ? r->write_domain : r->read_domains; + if (domain & RADEON_GEM_DOMAIN_CPU) { + DRM_ERROR("RADEON_GEM_DOMAIN_CPU is not valid " + "for command submission\n"); + return -EINVAL; + } + p->relocs[i].domain = domain; if (domain == RADEON_GEM_DOMAIN_VRAM) domain |= RADEON_GEM_DOMAIN_GTT;