From patchwork Mon Feb 24 15:20:43 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: 3709771 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B60889F38B for ; Mon, 24 Feb 2014 15:21:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E77642015A for ; Mon, 24 Feb 2014 15:21:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D4F1320163 for ; Mon, 24 Feb 2014 15:21:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEAE0FAAEC; Mon, 24 Feb 2014 07:21:26 -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 3195BFAAE0 for ; Mon, 24 Feb 2014 07:21:06 -0800 (PST) Received: by mail-ea0-f180.google.com with SMTP id o10so3132489eaj.25 for ; Mon, 24 Feb 2014 07:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=ubG95vDiiCjZ23ynK/xUO7Zg6kZVjPhqsE4OEbtSPN0=; b=EDxJhajsmvei7hP7EfECQppELI8GGeMcCnW1lA8PZaCthm50Gl3mVk8ax+S4ufrTBD lzlS6vUsXu4VXBOLUZMvj94aJDDV9eL6UzW6iFNQqZHXf1xNpGNyPKwwOhmGS/Nf/JOU M8SiGeiaN9erdjPrt/8QqPOu/o4l4TU2Wg+WmVZDZqESrBT6CF7ZJdyh/D+AXDBxnyLi l0MpqbQzvRqyNLylly/QG9RSCtja6N+QgWu7vuvLdciBuXYIySLggWrTBsrWLGVHB/jY Poa7yqJKYPduPOrp/XsOSfLdysJTADSEh7vDvyp2grsy5xBo0VT+05gGqrUom94tVXBC XfGQ== X-Received: by 10.14.107.9 with SMTP id n9mr25236279eeg.21.1393255265417; Mon, 24 Feb 2014 07:21:05 -0800 (PST) Received: from localhost.localdomain ([194.228.11.204]) by mx.google.com with ESMTPSA id o43sm64864402eef.12.2014.02.24.07.21.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Feb 2014 07:21:04 -0800 (PST) From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/6] drm/radeon: deduplicate code in radeon_gem_busy_ioctl Date: Mon, 24 Feb 2014 16:20:43 +0100 Message-Id: <1393255246-8296-4-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393255246-8296-1-git-send-email-maraeo@gmail.com> References: <1393255246-8296-1-git-send-email-maraeo@gmail.com> 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=-2.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Signed-off-by: Marek Olšák --- drivers/gpu/drm/radeon/radeon_gem.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index d7890f2..ccb7d0f 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -344,18 +344,7 @@ int radeon_gem_busy_ioctl(struct drm_device *dev, void *data, } robj = gem_to_radeon_bo(gobj); r = radeon_bo_wait(robj, &cur_placement, true); - switch (cur_placement) { - case TTM_PL_VRAM: - args->domain = RADEON_GEM_DOMAIN_VRAM; - break; - case TTM_PL_TT: - args->domain = RADEON_GEM_DOMAIN_GTT; - break; - case TTM_PL_SYSTEM: - args->domain = RADEON_GEM_DOMAIN_CPU; - default: - break; - } + args->domain = radeon_mem_type_to_domain(cur_placement); drm_gem_object_unreference_unlocked(gobj); r = radeon_gem_handle_lockup(rdev, r); return r;