From patchwork Wed Oct 31 17:05:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10662963 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 5651B17DF for ; Wed, 31 Oct 2018 17:05:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FCE62B1FA for ; Wed, 31 Oct 2018 17:05:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33C6C2B33C; Wed, 31 Oct 2018 17:05:58 +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 CEC0D2B1FA for ; Wed, 31 Oct 2018 17:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729408AbeKACEt (ORCPT ); Wed, 31 Oct 2018 22:04:49 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42732 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729391AbeKACEt (ORCPT ); Wed, 31 Oct 2018 22:04:49 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 644026072E; Wed, 31 Oct 2018 17:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541005556; bh=q0VQJcK7W/5zforQbAAcQVejcjlxHEyHQAU6Kf9G4TQ=; h=From:To:Cc:Subject:Date:From; b=RSTs8+gG7WFgUMmYaHSWwOsT3r/bKbIPGSyzmA31sDJzrJxDA56Jo1JZoNShHhoCr jkxBwKOnuXDh5C00vIq0FlXOIGupAFowyNYksLHXPPBfz+9hTG7fF6HaAxGswrgDSE hQALeaBK/Ke/Fq014SjJNfGaIsNH3c/2Z0vfEjBs= 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 A3ACE6019F; Wed, 31 Oct 2018 17:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1541005556; bh=q0VQJcK7W/5zforQbAAcQVejcjlxHEyHQAU6Kf9G4TQ=; h=From:To:Cc:Subject:Date:From; b=RSTs8+gG7WFgUMmYaHSWwOsT3r/bKbIPGSyzmA31sDJzrJxDA56Jo1JZoNShHhoCr jkxBwKOnuXDh5C00vIq0FlXOIGupAFowyNYksLHXPPBfz+9hTG7fF6HaAxGswrgDSE hQALeaBK/Ke/Fq014SjJNfGaIsNH3c/2Z0vfEjBs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A3ACE6019F 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: dri-devel@lists.freedesktop.org, hoegsberg@chromium.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 0/6] RFC: drm/msm: separate iova allocation and mapping Date: Wed, 31 Oct 2018 11:05:46 -0600 Message-Id: <20181031170552.32542-1-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.18.0 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 Currently in the msm driver iova addresses are mapped in the IOMMU at allocation time and stay there for the life of the buffer. This may not be desirable for long lived user space buffers that could be temporarily swapped or moved. This first set of patches breaks up the allocation and mapping into distinct steps and adds reference counting for pinning and unpinning the memory. Future code can use this information to manipulate the memory when it isn't in use. Jordan Crouse (6): drm/msm: Add a common function to free kernel buffer objects drm/msm: Remove sgt from the mmu unmap function drm/msm: Split msm_gem_get_iova into two steps drm/msm: Clean up and enhance the output of the 'gem' debugfs node drm/msm: Add msm_gem_get_and_pin_iova() drm/msm: Count how many times iova memory is pinned drivers/gpu/drm/msm/adreno/a5xx_debugfs.c | 6 +- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 22 +-- drivers/gpu/drm/msm/adreno/a5xx_power.c | 13 +- drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 14 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 3 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 3 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c | 6 +- drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 4 +- drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 4 +- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +- drivers/gpu/drm/msm/msm_drv.c | 4 + drivers/gpu/drm/msm/msm_drv.h | 16 ++- drivers/gpu/drm/msm/msm_fb.c | 4 +- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- drivers/gpu/drm/msm/msm_gem.c | 162 ++++++++++++++++------ drivers/gpu/drm/msm/msm_gem.h | 2 + drivers/gpu/drm/msm/msm_gem_submit.c | 4 +- drivers/gpu/drm/msm/msm_gem_vma.c | 95 +++++++++---- drivers/gpu/drm/msm/msm_gpu.c | 16 +-- drivers/gpu/drm/msm/msm_iommu.c | 3 +- drivers/gpu/drm/msm/msm_mmu.h | 3 +- drivers/gpu/drm/msm/msm_ringbuffer.c | 7 +- 22 files changed, 242 insertions(+), 155 deletions(-)