From patchwork Sat Mar 1 23:56:19 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: 3748581 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 DC6789F44E for ; Sat, 1 Mar 2014 23:56:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB1D520394 for ; Sat, 1 Mar 2014 23:56:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EC9E420395 for ; Sat, 1 Mar 2014 23:56:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38412FABAA; Sat, 1 Mar 2014 15:56:40 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51]) by gabe.freedesktop.org (Postfix) with ESMTP id A14E6FABA4 for ; Sat, 1 Mar 2014 15:56:33 -0800 (PST) Received: by mail-ee0-f51.google.com with SMTP id c13so1175826eek.38 for ; Sat, 01 Mar 2014 15:56:31 -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=HEOmMtZrTfD/Tzi4iIrlVvNDwUPPyA95msRqi3n5CLM=; b=p28VID1upGNa+vQs5SxlCyOgeZdbfhMTqwZz5ahmdOWS8qoBWKojoSWo8ujK3/HL06 HTM+2y4+YRV50YGdaLcAqI3CrUWClPhHlSBUlxlVxFsbTrjpkk6GJmawyoyuTMksBdzg xUZeN9/5tvzadGdJtJ+ax1tutyO7yXrET5Z4Ch7ys5OHQoAhXhCLqf0H2MIF1kahXwmA o55nxQayuB8CjLkuNFKDKQW+Yzo/FyXLHdjETUqbRGGiWWZFcPAE39Xy6LjposKvOqAK taZe/OTDwcA874LBAEYNMXg/FPr/fCQRBnf0DeHmqgHOeicSPpTnWnYjiW9D/lbcV4LB 2JCA== X-Received: by 10.15.73.134 with SMTP id h6mr30796376eey.15.1393718191350; Sat, 01 Mar 2014 15:56:31 -0800 (PST) Received: from localhost.localdomain ([194.228.11.34]) by mx.google.com with ESMTPSA id x45sm3558181eef.15.2014.03.01.15.56.30 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Mar 2014 15:56:30 -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: Sun, 2 Mar 2014 00:56:19 +0100 Message-Id: <1393718182-12575-4-git-send-email-maraeo@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393718182-12575-1-git-send-email-maraeo@gmail.com> References: <1393718182-12575-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=-3.3 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 Signed-off-by: Marek Olšák Reviewed-by: Christian König --- 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 9863ca7..d09650c 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;