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=-10.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 32B0CC47082 for ; Mon, 31 May 2021 17:17:43 +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 B4DFC610E7 for ; Mon, 31 May 2021 17:17:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4DFC610E7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shipmail.org 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 EBD846E947; Mon, 31 May 2021 17:17:41 +0000 (UTC) Received: from pio-pvt-msa1.bahnhof.se (pio-pvt-msa1.bahnhof.se [79.136.2.40]) by gabe.freedesktop.org (Postfix) with ESMTPS id 312276E947 for ; Mon, 31 May 2021 17:17:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTP id 5CB053F91D for ; Mon, 31 May 2021 19:17:38 +0200 (CEST) Authentication-Results: pio-pvt-msa1.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b="Jk8gXgZX"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se Received: from pio-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q1kGUfG_cEsT for ; Mon, 31 May 2021 19:17:36 +0200 (CEST) Received: by pio-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 7E2CE3F820 for ; Mon, 31 May 2021 19:17:36 +0200 (CEST) Received: from [192.168.0.209] (irdmzpr01-ext.ir.intel.com [192.198.151.36]) by mail1.shipmail.org (Postfix) with ESMTPSA id 99F0D3600DD for ; Mon, 31 May 2021 19:17:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1622481455; bh=Jp/dDJX6OR22eVXJNeMWLTU0E9wMfeJW7rnGV+q15NE=; h=Subject:To:References:From:Date:In-Reply-To:From; b=Jk8gXgZXWu1c1+BUe6G1wjR4ED4ZoNCzqJH6hrHT7K0ioGXPR7mJ9mcbYDdLmWLCy bHSyKfLLsleNfxHmmKiDNFmVX8xEvSzZxgqceI+eTHViUsSUtEUFjIqLL34e6/rUJX S7+/H3DLFQsuix/BybiW/6GU3ozirYfhn/4GHZiQ= Subject: Re: [PATCH v7 15/15] drm/i915: Use ttm mmap handling for ttm bo's. To: dri-devel@lists.freedesktop.org References: <20210531121940.267032-1-thomas.hellstrom@linux.intel.com> <20210531121940.267032-16-thomas.hellstrom@linux.intel.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28Intel=29?= Message-ID: Date: Mon, 31 May 2021 19:17:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210531121940.267032-16-thomas.hellstrom@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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" On 5/31/21 2:19 PM, Thomas Hellström wrote: > From: Maarten Lankhorst > > Use the ttm handlers for servicing page faults, and vm_access. > > We do our own validation of read-only access, otherwise use the > ttm handlers as much as possible. > > Because the ttm handlers expect the vma_node at vma->base, we slightly > need to massage the mmap handlers to look at vma_node->driver_private > to fetch the bo, if it's NULL, we assume i915's normal mmap_offset uapi > is used. > > This is the easiest way to achieve compatibility without changing ttm's > semantics. > > Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström