From patchwork Tue Oct 3 15:27:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 9983103 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 476F7602B8 for ; Tue, 3 Oct 2017 15:27:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 395F7289B1 for ; Tue, 3 Oct 2017 15:27:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E4DE289C1; Tue, 3 Oct 2017 15:27:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F2C5C289B1 for ; Tue, 3 Oct 2017 15:27:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB3216E537; Tue, 3 Oct 2017 15:27:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.codeaurora.org (smtp.codeaurora.org [198.145.29.96]) by gabe.freedesktop.org (Postfix) with ESMTPS id 905F96E530; Tue, 3 Oct 2017 15:27:12 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7AEDA60C7B; Tue, 3 Oct 2017 15:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1507044432; bh=LNR2be8ok0r89b5dPin6SlwNK9IkCQW37keeTME6Uno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KS4mcBQ5JySCWi9BHPzvu27IZUWdB2UEUKNHuBoq/7a/p4sZscwQ4OSaMT2Vl0nCS QZ315A11248Isga20APp7kmjlT/+/EMQwmc+ZiRgPOCYuFsRtdqRezmYyWvacwSgXK 43pjDPac3NHuMt2nTMZiK+c+UnF9pzYFG2HTJjTQ= Received: from jcrouse-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jcrouse@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BE57060B7C; Tue, 3 Oct 2017 15:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1507044432; bh=LNR2be8ok0r89b5dPin6SlwNK9IkCQW37keeTME6Uno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KS4mcBQ5JySCWi9BHPzvu27IZUWdB2UEUKNHuBoq/7a/p4sZscwQ4OSaMT2Vl0nCS QZ315A11248Isga20APp7kmjlT/+/EMQwmc+ZiRgPOCYuFsRtdqRezmYyWvacwSgXK 43pjDPac3NHuMt2nTMZiK+c+UnF9pzYFG2HTJjTQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BE57060B7C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jcrouse@codeaurora.org From: Jordan Crouse To: freedreno@lists.freedesktop.org Subject: [PATCH 3/6] drm/msm: Map command buffers to kernel only if required Date: Tue, 3 Oct 2017 09:27:03 -0600 Message-Id: <1507044426-4042-4-git-send-email-jcrouse@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507044426-4042-1-git-send-email-jcrouse@codeaurora.org> References: <1507044426-4042-1-git-send-email-jcrouse@codeaurora.org> Cc: Sushmita Susheelendra , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sushmita Susheelendra Map command buffers to the kernel address space only if relocs are specified for the submission. This reduces some overhead on the submission path. Signed-off-by: Sushmita Susheelendra Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_gem_submit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 2708d3a..2d2aa65 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -320,6 +320,9 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob return -EINVAL; } + if (nr_relocs == 0) + return 0; + /* For now, just map the entire thing. Eventually we probably * to do it page-by-page, w/ kmap() if not vmap()d.. */