From patchwork Mon Nov 18 10:35:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11249337 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1CDF930 for ; Mon, 18 Nov 2019 10:36:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9A3120862 for ; Mon, 18 Nov 2019 10:36:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9A3120862 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4DE1289FA6; Mon, 18 Nov 2019 10:35:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id C79DD89FA5 for ; Mon, 18 Nov 2019 10:35:47 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id l7so18778955wrp.6 for ; Mon, 18 Nov 2019 02:35:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YpxWMRcpbAZ8vRO0hhGeBAkizcjjb+EwGPq78LSGoIc=; b=pC0APSKgeSI8kjvP4MMiLrRPPajGN73LX12x2+W2slSAHNpGRsSbMg8jVLhzaau1ir /0BrnxlI6YDIY5a1fUBiwrWK38+lOPGWpdBXWV4gEk7dt0uY4urr55tZ8O+6k6wcVSwD 1pDAyKaTpZ6n6BkvxD+wcLuocPQoQOJjbQsvPaWw/BxsSU6ShvN5QOXMCTGIEb7Qj3GC q9V63B5jea9oCHqR3D9sTDNFE3eDhPT64BgiIQa5jHyoLrr+3iPCPNwcAGtDyLdswoOU gaQBzhNuN12hPgQUZjICKtgpLjj/n9ZK/5drt7MLVH+K6nukhB4hbf0Ph5ZsaFXAFRhv kMig== X-Gm-Message-State: APjAAAVtS4MUaPJ9kKLE37Pme+Kw7Jeo8nuWKjKpeADVuw8hT+ZfhA/S aUhSWNM18gwhz61QRhjA5KuRi/93bpw= X-Google-Smtp-Source: APXvYqyOGusOciBfG2OBXh6PKwLGp9NKfOVa9T1VHeuE1aaABFM0YzolACCslDVyf3lAWPh08o1InA== X-Received: by 2002:a5d:670a:: with SMTP id o10mr20215754wru.312.1574073346158; Mon, 18 Nov 2019 02:35:46 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id j2sm22749200wrt.61.2019.11.18.02.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2019 02:35:45 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 02/15] drm/tegra: Delete host1x_bo_ops->k(un)map Date: Mon, 18 Nov 2019 11:35:23 +0100 Message-Id: <20191118103536.17675-3-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191118103536.17675-1-daniel.vetter@ffwll.ch> References: <20191118103536.17675-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YpxWMRcpbAZ8vRO0hhGeBAkizcjjb+EwGPq78LSGoIc=; b=JjYHPvN4fgfI7MF2pubeKuD+GYtD7BlbPRDIfYCkJ91CYZjGSX/+8DgwlDnPfkaXue 6rRUxbjmyP4SYql5CzSTzlnPpS+reeUlWHSv1S63Wr5WTyDtWwKjPYLsOnGa8riu29zV 4M8YnhhCfzJBXW7beNGhAMpJ2dNrzaWuwdBck= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , Intel Graphics Development , Jonathan Hunter , Thierry Reding , linux-tegra@vger.kernel.org, Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" It doesn't have any callers anymore. Aside: The ->mmap/munmap hooks have a bit a confusing name, they don't do userspace mmaps, but a kernel vmap. I think most places use vmap for this, except ttm, which uses kmap for vmap for added confusion. mmap seems entirely for userspace mappings set up through mmap(2) syscall. Signed-off-by: Daniel Vetter Cc: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org Reviewed-by: Thierry Reding Tested-by: Thierry Reding --- drivers/gpu/drm/tegra/gem.c | 28 ---------------------------- include/linux/host1x.h | 13 ------------- 2 files changed, 41 deletions(-) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 746dae32c484..662cb7c87ef5 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -103,32 +103,6 @@ static void tegra_bo_munmap(struct host1x_bo *bo, void *addr) vunmap(addr); } -static void *tegra_bo_kmap(struct host1x_bo *bo, unsigned int page) -{ - struct tegra_bo *obj = host1x_to_tegra_bo(bo); - - if (obj->vaddr) - return obj->vaddr + page * PAGE_SIZE; - else if (obj->gem.import_attach) - return dma_buf_kmap(obj->gem.import_attach->dmabuf, page); - else - return vmap(obj->pages + page, 1, VM_MAP, - pgprot_writecombine(PAGE_KERNEL)); -} - -static void tegra_bo_kunmap(struct host1x_bo *bo, unsigned int page, - void *addr) -{ - struct tegra_bo *obj = host1x_to_tegra_bo(bo); - - if (obj->vaddr) - return; - else if (obj->gem.import_attach) - dma_buf_kunmap(obj->gem.import_attach->dmabuf, page, addr); - else - vunmap(addr); -} - static struct host1x_bo *tegra_bo_get(struct host1x_bo *bo) { struct tegra_bo *obj = host1x_to_tegra_bo(bo); @@ -145,8 +119,6 @@ static const struct host1x_bo_ops tegra_bo_ops = { .unpin = tegra_bo_unpin, .mmap = tegra_bo_mmap, .munmap = tegra_bo_munmap, - .kmap = tegra_bo_kmap, - .kunmap = tegra_bo_kunmap, }; static int tegra_bo_iommu_map(struct tegra_drm *tegra, struct tegra_bo *bo) diff --git a/include/linux/host1x.h b/include/linux/host1x.h index 6f8d772591ba..6edeb9228c4e 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h @@ -72,8 +72,6 @@ struct host1x_bo_ops { void (*unpin)(struct device *dev, struct sg_table *sgt); void *(*mmap)(struct host1x_bo *bo); void (*munmap)(struct host1x_bo *bo, void *addr); - void *(*kmap)(struct host1x_bo *bo, unsigned int pagenum); - void (*kunmap)(struct host1x_bo *bo, unsigned int pagenum, void *addr); }; struct host1x_bo { @@ -119,17 +117,6 @@ static inline void host1x_bo_munmap(struct host1x_bo *bo, void *addr) bo->ops->munmap(bo, addr); } -static inline void *host1x_bo_kmap(struct host1x_bo *bo, unsigned int pagenum) -{ - return bo->ops->kmap(bo, pagenum); -} - -static inline void host1x_bo_kunmap(struct host1x_bo *bo, - unsigned int pagenum, void *addr) -{ - bo->ops->kunmap(bo, pagenum, addr); -} - /* * host1x syncpoints */