From patchwork Wed Oct 17 16:28:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10645867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E71B1057 for ; Wed, 17 Oct 2018 16:28:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E7AB28481 for ; Wed, 17 Oct 2018 16:28:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5060628485; Wed, 17 Oct 2018 16:28:30 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E17EE284AA for ; Wed, 17 Oct 2018 16:28:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbeJRAY4 (ORCPT ); Wed, 17 Oct 2018 20:24:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49740 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727435AbeJRAY4 (ORCPT ); Wed, 17 Oct 2018 20:24:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DBFAE60C54; Wed, 17 Oct 2018 16:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539793708; bh=WPZFmI6XdDQtXrrOWRr5h8fPZs7Y/1zPfa43kFwN7WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aVnrnXlzdMBE72/bLbURykVhmwyx8OmZNiM2X4NES7xmXIVsk9N8+7nq7Lk6A3g1C zboIVtl68FiiVs2rBOfF9PUH1FsX1q0fd4fq64BAK9Raz9zsvArQEX9g4iDTn5Rbrr pO8ck9/7TFn8QiJItxuSz2rx/7q3hDYkFLttbfDI= 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 25ECC60769; Wed, 17 Oct 2018 16:28:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1539793708; bh=WPZFmI6XdDQtXrrOWRr5h8fPZs7Y/1zPfa43kFwN7WE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aVnrnXlzdMBE72/bLbURykVhmwyx8OmZNiM2X4NES7xmXIVsk9N8+7nq7Lk6A3g1C zboIVtl68FiiVs2rBOfF9PUH1FsX1q0fd4fq64BAK9Raz9zsvArQEX9g4iDTn5Rbrr pO8ck9/7TFn8QiJItxuSz2rx/7q3hDYkFLttbfDI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 25ECC60769 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 Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 11/11] drm/msm/gpu: Don't map command buffers with nr_relocs equal to 0 Date: Wed, 17 Oct 2018 10:28:18 -0600 Message-Id: <20181017162818.8498-12-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181017162818.8498-1-jcrouse@codeaurora.org> References: <20181017162818.8498-1-jcrouse@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a command buffer doesn't have any relocs assigned to it there then is no need to map it in the kernel address space. 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 aca7379b9c2e..1b05b8481c31 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -317,6 +317,9 @@ static int submit_reloc(struct msm_gem_submit *submit, struct msm_gem_object *ob uint32_t *ptr; int ret = 0; + if (!nr_relocs) + return 0; + if (offset % 4) { DRM_ERROR("non-aligned cmdstream buffer: %u\n", offset); return -EINVAL;