Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp7484pxb; Wed, 25 Aug 2021 18:17:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo9sAnOX2FyXnr2ABmftkNgGoaNiUPaDzzDaODYF/o0PztWfWpGSH5iH/s7y8IeYrb9xRe X-Received: by 2002:a5e:c903:: with SMTP id z3mr1013356iol.61.1629940637500; Wed, 25 Aug 2021 18:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629940637; cv=none; d=google.com; s=arc-20160816; b=oaaJuhlbzjjytRkAaReRWsivKFhPcQtNapwNTSB3DuCbk26k/X1pX04OdU8fWYqNqP qLu9fDkPL5b/hsEBVCBrOOH7SDpNDjIGs7bzazBD3B9qh7MfgMFFrnAk/mLlqOgcJa/d uE4IMsb7sQ2kVZ87VUp15JYbqIOZ6d4KbAeeiGcV8Fb6ilVJHmY0n2/xnt7jjM+fHv4K EC3gIcWJzDQNko5zqNd0Np7WK7D1OJwdmSwHxNkLLkY8liO9Ak1qQYSJhLJ8w8iHLAHc hh8ITGQ27uwZQqJZ8Xa2yyZkbEKtP3UgrYXgCPbtLmZnxCvX1z/HAjklcUv01f00lo8c TjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=VDtQvOQv727aNRxipzw7gZMeb+dgPYex69LEhj6J4CQ=; b=uJgZqoRMVPop9oJwdrTHDMMijXMhkaUvaIFP6fBp/Q1JWQ933O3Lfm0xQSwcUYQz4h NWh+nNh+SGnNkUQ7YsPo13jZUMd3PngcRFCNT9FUPtZyv9sL4REVrAtuddeSOaHt8Kwh S6AsSF3vuv19smv4c3rsr8gIL3ScHk+5lJQjQEgTPuX6KbZoQJzgLXdqQYa8Lcx9yfbz QK7hvMUCOHVgdD+8m1yZX7L6xnm6x2GtIcVhKUPEw/KKw0B+++UE+sgrTDyTeG6dHGTf B0HdWuFq+lsYeK616LrnnvozEAuX1h6lI8Bg9sKm2MnLco1e5Qr1Ek6gm3efTFsIrddN TxMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i9si1525388ilv.82.2021.08.25.18.17.04; Wed, 25 Aug 2021 18:17:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235201AbhHZBQx (ORCPT + 99 others); Wed, 25 Aug 2021 21:16:53 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59712 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234655AbhHZBQx (ORCPT ); Wed, 25 Aug 2021 21:16:53 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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! ????