From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 263D8C4320E for ; Thu, 26 Aug 2021 01:16:10 +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 C3D96610A4 for ; Thu, 26 Aug 2021 01:16:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C3D96610A4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BE416E453; Thu, 26 Aug 2021 01:16:09 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29EEE6E453 for ; Thu, 26 Aug 2021 01:16:07 +0000 (UTC) Received: from maud (unknown [IPv6:2600:8800:8c06:1000::c8f3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: alyssa) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 8DEC01F43E22; Thu, 26 Aug 2021 02:15:55 +0100 (BST) Date: Wed, 25 Aug 2021 21:15:45 -0400 From: Alyssa Rosenzweig To: Robin Murphy Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch, alyssa.rosenzweig@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/cma-helper: Set VM_DONTEXPAND for mmap Message-ID: References: <1c68be0449aa3217e2bbc898dd8c7426748fc6b8.1629902585.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1c68be0449aa3217e2bbc898dd8c7426748fc6b8.1629902585.git.robin.murphy@arm.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" > drm_gem_cma_mmap() cannot assume every implementation of dma_mmap_wc() > will end up calling remap_pfn_range() (which happens to set the relevant > vma flag, among others), so in order to make sure expectations around > VM_DONTEXPAND are met, let it explicitly set the flag like most other > GEM mmap implementations do. > > This avoids repeated warnings on a small minority of systems where the > display is behind an IOMMU, and has a simple driver which does not > override drm_gem_cma_default_funcs. Apple system-on-chips have their display behind an IOMMU. Actually, a separate IOMMU for each display, and a separate IOMMU for each display controller -- so there are 4 IOMMUs total for display on the M1. I've tested this patch against my work-in-progress display driver for the M1. It indeed fixes the annoying warnings every frame (wayland) and on mode setting (x11). So this is Tested-by: Alyssa Rosenzweig I've cherry-picked the patch into my M1 staging/downstream tree, so I guess that's an Acked-by. I don't know anything about the vm_* stuff in the kernel yet, though, since can't give a reviewed-by. Will leave that one to the pro's. I know you were trying to fix an HDLCD issue, but I needed this patch too, so thank you! 😄