From patchwork Wed Mar 13 16:38:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 2263861 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 5FAD2DF215 for ; Wed, 13 Mar 2013 16:39:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AB76E65F0 for ; Wed, 13 Mar 2013 09:39:06 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f175.google.com (mail-qc0-f175.google.com [209.85.216.175]) by gabe.freedesktop.org (Postfix) with ESMTP id CCB53E6473 for ; Wed, 13 Mar 2013 09:38:52 -0700 (PDT) Received: by mail-qc0-f175.google.com with SMTP id j3so553108qcs.6 for ; Wed, 13 Mar 2013 09:38:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=08wemzbFKxrGMGW+KmgqeGznMFUbYmfQCQO9ZBJb8Ig=; b=LrXKuIdsFbPoYMM2zy9jdRA7gf3gMME8p4wufTxgeVDHLXhHEddfIKwG/VUM/q5bIR DO1i/T+DFKRxm1pDjHtAXSyhbjIS0wmzvL9eJGyMy0WorM5Rl8K4bqg51h3x0TPPhjZI ukc2EVv7wobjgD2KajPUY2nOxIAED1nYh2AoQIyMGWYRfdZFqZpjzB2qd77Uc6H6e4D1 ue889r8WTUPDpIq4IjDvxcIhrsXPBnZ+jjZSqbWkxgDgVdF+fSYsQ1DSQoTdohqP/DEU wZEF/OKr/d2XO6TXkE3/S1+15yCSYvjIaQQNzWDCpHVX4a6Wr6UKKlTx6Tz2iRJhQfYi d2iA== X-Received: by 10.229.137.75 with SMTP id v11mr1244220qct.26.1363192731860; Wed, 13 Mar 2013 09:38:51 -0700 (PDT) Received: from localhost.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by mx.google.com with ESMTPS id gw9sm38414265qab.10.2013.03.13.09.38.50 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 13 Mar 2013 09:38:51 -0700 (PDT) From: alexdeucher@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/radeon/benchmark: make sure bo blit copy exists before using it Date: Wed, 13 Mar 2013 12:38:44 -0400 Message-Id: <1363192725-5902-1-git-send-email-alexdeucher@gmail.com> X-Mailer: git-send-email 1.7.7.5 Cc: Alex Deucher , stable@vger.kernel.org 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: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Alex Deucher Fixes a segfault on asics without a blit callback. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=62239 Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Michel Dänzer --- drivers/gpu/drm/radeon/radeon_benchmark.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_benchmark.c b/drivers/gpu/drm/radeon/radeon_benchmark.c index bedda9c..a2f0c24 100644 --- a/drivers/gpu/drm/radeon/radeon_benchmark.c +++ b/drivers/gpu/drm/radeon/radeon_benchmark.c @@ -135,13 +135,15 @@ static void radeon_benchmark_move(struct radeon_device *rdev, unsigned size, sdomain, ddomain, "dma"); } - time = radeon_benchmark_do_move(rdev, size, saddr, daddr, - RADEON_BENCHMARK_COPY_BLIT, n); - if (time < 0) - goto out_cleanup; - if (time > 0) - radeon_benchmark_log_results(n, size, time, - sdomain, ddomain, "blit"); + if (rdev->asic->copy.blit) { + time = radeon_benchmark_do_move(rdev, size, saddr, daddr, + RADEON_BENCHMARK_COPY_BLIT, n); + if (time < 0) + goto out_cleanup; + if (time > 0) + radeon_benchmark_log_results(n, size, time, + sdomain, ddomain, "blit"); + } out_cleanup: if (sobj) {