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=-17.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, 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 93E66C4338F for ; Fri, 6 Aug 2021 10:11:07 +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 4ADCD60E97 for ; Fri, 6 Aug 2021 10:11:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4ADCD60E97 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 8D4C46EB7A; Fri, 6 Aug 2021 10:11:06 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5818A6EB7A; Fri, 6 Aug 2021 10:11:05 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10067"; a="194614981" X-IronPort-AV: E=Sophos;i="5.84,300,1620716400"; d="scan'208";a="194614981" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2021 03:11:01 -0700 X-IronPort-AV: E=Sophos;i="5.84,300,1620716400"; d="scan'208";a="523406731" Received: from klipka-mobl.ger.corp.intel.com (HELO [10.252.54.14]) ([10.252.54.14]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2021 03:10:56 -0700 To: "Dixit, Ashutosh" , Matthew Auld Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Daniel Vetter , Ramalingam C References: <20210730085348.2326899-1-matthew.auld@intel.com> <20210730085348.2326899-3-matthew.auld@intel.com> <87pmuw5pg8.wl-ashutosh.dixit@intel.com> From: Maarten Lankhorst Message-ID: <56a57564-961f-f7da-a6d2-bf8eb577d852@linux.intel.com> Date: Fri, 6 Aug 2021 12:10:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <87pmuw5pg8.wl-ashutosh.dixit@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH i-g-t v3 03/11] lib/i915/gem_mman: add fixed mode to gem_mmap_offset__cpu X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Op 02-08-2021 om 08:29 schreef Dixit, Ashutosh: > On Fri, 30 Jul 2021 01:53:40 -0700, Matthew Auld wrote: >> On discrete we only support the new fixed mode. >> >> Signed-off-by: Matthew Auld >> Cc: Maarten Lankhorst >> Cc: Ashutosh Dixit >> Cc: Daniel Vetter >> Cc: Ramalingam C >> --- >> lib/i915/gem_mman.c | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/lib/i915/gem_mman.c b/lib/i915/gem_mman.c >> index c432bb16..563a7ccf 100644 >> --- a/lib/i915/gem_mman.c >> +++ b/lib/i915/gem_mman.c >> @@ -474,8 +474,14 @@ void *gem_mmap__cpu(int fd, uint32_t handle, uint64_t offset, uint64_t size, uns >> void *__gem_mmap_offset__cpu(int fd, uint32_t handle, uint64_t offset, >> uint64_t size, unsigned prot) >> { >> - return __gem_mmap_offset(fd, handle, offset, size, prot, >> + void *ptr; >> + >> + ptr = __gem_mmap_offset(fd, handle, offset, size, prot, >> I915_MMAP_OFFSET_WB); >> + if (!ptr) >> + ptr = __gem_mmap_offset__fixed(fd, handle, offset, size, prot); >> + >> + return ptr; > Imo there's some asymmetry here. If we are adding fixed mode to > mmap__device_coherent (in the previous patch) then we should also be adding > it to mmap__cpu_coherent (as before). Or, if we are adding fixed mode to > __gem_mmap_offset__cpu we should also be adding it to > __gem_mmap_offset__wc. Thanks. Why do we need it in __gem_mmap_offset_wc btw? Rest of series doesn't seem to be blocked by it, so pushed for now.