From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id A557E8994A for ; Mon, 30 Aug 2021 17:53:49 +0000 (UTC) Date: Mon, 30 Aug 2021 10:40:16 -0700 Message-ID: <8735qqx24f.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" In-Reply-To: <20210830092214.1204343-1-tejaskumarx.surendrakumar.upadhyay@intel.com> References: <20210830092214.1204343-1-tejaskumarx.surendrakumar.upadhyay@intel.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [igt-dev] [i-g-t, V2] lib/i915: Use FIXED mapping only for discrete memory List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" To: Tejas Upadhyay Cc: igt-dev@lists.freedesktop.org List-ID: On Mon, 30 Aug 2021 02:22:14 -0700, Tejas Upadhyay wrote: > > bool gem_has_mmap_offset_type(int fd, const struct mmap_offset *t) > { > - return gem_has_mmap_offset(fd) || t->type == I915_MMAP_OFFSET_GTT; > + if (gem_has_mmap_offset(fd)) > + if (gem_has_lmem(fd)) > + return t->type == I915_MMAP_OFFSET_FIXED; > + else > + return t->type != I915_MMAP_OFFSET_FIXED; The above looks correct to me. > + else > + return false; But about this, from the previous logic, shouldn't this be: return t->type == I915_MMAP_OFFSET_GTT;