From patchwork Fri May 18 21:34:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jordan Crouse X-Patchwork-Id: 10412407 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 7AA05602CB for ; Fri, 18 May 2018 22:20:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BE5D289D5 for ; Fri, 18 May 2018 22:20:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 50CBA28AED; Fri, 18 May 2018 22:20:59 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 09A13289D5 for ; Fri, 18 May 2018 22:20:59 +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=gcuEvXIrzQJ7wYgbQ1mTIUilI+iIwdEA9VKx6rmAUkQ=; b=LGT2Y9SKplgq38YiRUaWmC0DEq EopKmw2rL2P9DUf8CE51+DnXKZnxkDCkrC+OuqQd6uYaAJMX2CNeTU/Ic16QKee42Yni+heMP4BuW gK2qdwIx1tV6KNjc8UN7dM/Ffj4rpmL2GuIY18mA7Q6cXiQEaqaRtA88lIdJW+g1bmNLbdSn0FhGp nYk6Zjtqt41l1FtjfbqA7i/hozeDjIY2QQIdXcvyBU46axkRzaQS3UAoWNxlnZevUO5ze32AmLCPM jk5xyr12SS9fC/naEJVZCwycPaa46vriujNJ1XSHvan5XfYVDd+nvXAJPp7JwhwVgkZfJDH5gP9TB +rO0dD8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJnk9-0006uo-DF; Fri, 18 May 2018 22:20:57 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJn2B-00009o-5I for linux-arm-kernel@lists.infradead.org; Fri, 18 May 2018 21:35:36 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 42158610D6; Fri, 18 May 2018 21:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526679325; bh=4sp9BQU1UUy3RxW5CqZNhbxnY8fvjO/d/AokK8AXWgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lGvX38Z9opvJQ14Epk+l6saEZpCXj9xcZST+uDch1uWObm04L1e0H0oIG8yQvdJG8 A0EIYz8cd4a3OEaVFW+VBFDdeIo1xHrZUzQMb9ZrVVLi645ZpDD0czO29xMg5SLbHX eqfq/cFQFHDMqpDj4QjFF5bw4zDRoLAUfNqCtyOU= 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 B990160AF9; Fri, 18 May 2018 21:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1526679314; bh=4sp9BQU1UUy3RxW5CqZNhbxnY8fvjO/d/AokK8AXWgk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=csmHcceihxTkfZU6F+9E0VSrXoaFRElrpUNNGf1wbVaxmsS7g5tHE4XHpfZzXSJZ1 UAvanXlzbRPWldiGdcjkj3AejNP569vRUvlIAp77000MXdBKBh4VLFrQA01RanErwa kQWRjc8ZldGGYPA2o8Q8Uzhz9g/TGEuqlm4HDuAI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B990160AF9 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/16] drm/msm: Add msm_mmu features Date: Fri, 18 May 2018 15:34:54 -0600 Message-Id: <20180518213500.31595-11-jcrouse@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180518213500.31595-1-jcrouse@codeaurora.org> References: <20180518213500.31595-1-jcrouse@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180518_143531_240929_B9F3A296 X-CRM114-Status: GOOD ( 10.00 ) 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__ */