From patchwork Wed Feb 21 22:59:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10234317 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 6BBA760385 for ; Wed, 21 Feb 2018 23:05:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A6E428571 for ; Wed, 21 Feb 2018 23:05:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C920285D2; Wed, 21 Feb 2018 23:05:08 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CEF9128571 for ; Wed, 21 Feb 2018 23:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8XNtMLhldm3Mrdun1CZv3ppLeguqSwCtzyyBeFi1P/c=; b=AHr3Dcc8DVSoyUvygtS9Y0gJXw wb2KMPpohXttKV9djnQTHS6dLzaM1bniI7ShjNKH7aPBdu0HLZOTvD8carJSJ7g0gbdudbvuy8eeK +dxJ1XiYz3+rYwELVFONWYk5XcootBcB7J3oUGe9JCu1Y5XKlaISPiXqiXBlvSsxa0xm0KyGJmwZz Qudyqpf9gabsD6VcOUnBemRiAMxwDSDLwpqT3AYNc6sG5kqJI+RVY7oL85molT7Kw9Axz9EEVX5/z SSkdw4CFjA93mrvLf1ndGIk4GiKzvQzDapU/Ghtfu7mlX2gpXeh3l+fajw7OWflV4jDWivQPsuDjQ vR5j6bww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eodRW-0000YR-2c; Wed, 21 Feb 2018 23:04:54 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eodMy-0005Tm-GH for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2018 23:00:26 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5AD5F60ACA; Wed, 21 Feb 2018 22:59:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519254003; bh=hn7Hv4n8SNwSa4CVpwe9U1aSQoUPgDCZf+DdfC8jKfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kuHvfvu91BSC5gnw+ZQA56CHomtAPDnltoUemwbR4osB7SYjpNqixStoe7ku5+0FQ o7lOFEod58/hM76Q9oo/F92wQdPwapVyo/o/Js0+EyMTMCSV+0lqh0Nh3j4roHa025 SjYsVuBn3HIxQR2/M2eRhvLbs/JENHRB2iyRVyls= 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 4965361136; Wed, 21 Feb 2018 22:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519253986; bh=hn7Hv4n8SNwSa4CVpwe9U1aSQoUPgDCZf+DdfC8jKfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mTf22lxW5arGS2mVzQNpfTdvQfIyT/91OtQOt7rb1hG8erZDqww/sSAz1iuBBy+qc tKOTU6vQ6zCnI0fO22f7apizG/MmJxaLtqhGjFvWbdr3PeLs3/mnl5xQtcb9lftAPZ Ak3VyxraBikqQHAmIBYuj7lTxMn/AGAUxkJ6vN2Q= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4965361136 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 10/14] drm/msm: Add msm_mmu features Date: Wed, 21 Feb 2018 15:59:20 -0700 Message-Id: <20180221225924.30737-11-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180221225924.30737-1-jcrouse@codeaurora.org> References: <20180221225924.30737-1-jcrouse@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180221_150012_765653_F4E5BD52 X-CRM114-Status: GOOD ( 10.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jean-philippe.brucker@arm.com, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, tfiga@chromium.org, iommu@lists.linux-foundation.org, vivek.gautam@codeaurora.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add a few simple support functions to support a bitmask of features that a specific MMU implementation supports. The first feature will be per-instance pagetables coming in the following patch. Signed-off-by: Jordan Crouse --- drivers/gpu/drm/msm/msm_mmu.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/msm/msm_mmu.h b/drivers/gpu/drm/msm/msm_mmu.h index aa2c5d4580c8..85df78d71398 100644 --- a/drivers/gpu/drm/msm/msm_mmu.h +++ b/drivers/gpu/drm/msm/msm_mmu.h @@ -35,6 +35,7 @@ struct msm_mmu { struct device *dev; int (*handler)(void *arg, unsigned long iova, int flags); void *arg; + unsigned long features; }; static inline void msm_mmu_init(struct msm_mmu *mmu, struct device *dev, @@ -54,4 +55,16 @@ static inline void msm_mmu_set_fault_handler(struct msm_mmu *mmu, void *arg, mmu->handler = handler; } +static inline void msm_mmu_set_feature(struct msm_mmu *mmu, + unsigned long feature) +{ + mmu->features |= feature; +} + +static inline bool msm_mmu_has_feature(struct msm_mmu *mmu, + unsigned long feature) +{ + return (mmu->features & feature) ? true : false; +} + #endif /* __MSM_MMU_H__ */