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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id BABE3C433EF for ; Thu, 3 Feb 2022 08:02:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4825A10EEA1; Thu, 3 Feb 2022 08:02:07 +0000 (UTC) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9A66910EE9A; Thu, 3 Feb 2022 08:02:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643875325; x=1675411325; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=zlS2TEGsW5taBuI4QoTlR8LND7MDmrsS1RZ8VYgZwJs=; b=FW0w1I6f0TjCTBoBnj+KtYJ1SxhYguwB/752WTRbO8k3MFHPmhSovtWs 5JuMJU8nqUqCVkIObjbAuTSYFQgq7X48WYKfiVqQhVcahscfY9QfxkkeG Uyx6WuODGPcKX4rZbN13/sjvtMq0LB9atwyUNy7OXujIRQZIax9CSJ90N FKUjePVQKKwcnT3KqPYeSimNPX7sdqw+Two/GEKtoZmG32JVntDpGVXDf QBHcTkyqSjIIR61EsW+JSjhJ05QVigxcVD8xM8LpIrTC+bjamVcvkU5cm aQqrX8hPi/ahgL1utMVMVBDNW07mpwUthjgmwV1oeNzrQbVEx4ydp28LX Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10246"; a="231660461" X-IronPort-AV: E=Sophos;i="5.88,339,1635231600"; d="scan'208";a="231660461" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2022 00:02:02 -0800 X-IronPort-AV: E=Sophos;i="5.88,339,1635231600"; d="scan'208";a="620421542" Received: from cmathias-mobl1.ger.corp.intel.com (HELO [10.249.254.246]) ([10.249.254.246]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2022 00:02:01 -0800 Message-ID: <552ac420-eaed-97fb-e68b-5cf0ce3fe8f7@linux.intel.com> Date: Thu, 3 Feb 2022 09:01:59 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Content-Language: en-US To: Matthew Auld , intel-gfx@lists.freedesktop.org References: <20220202173154.3758970-1-matthew.auld@intel.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= In-Reply-To: <20220202173154.3758970-1-matthew.auld@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH] drm/i915: opportunistically apply ALLOC_CONTIGIOUS 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: , Cc: dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 2/2/22 18:31, Matthew Auld wrote: > It looks like this code was accidentally dropped at some point(in a > slightly different form), so add it back. The gist is that if we know > the allocation will be one single chunk, then we can just annotate the > BO with I915_BO_ALLOC_CONTIGUOUS, even if the user doesn't bother. In > the future this might prove to be potentially useful. Perhaps be more clear that this allows us to avoid using vmap in upcoming patches. > > Signed-off-by: Matthew Auld > Cc: Thomas Hellström > --- > drivers/gpu/drm/i915/gem/i915_gem_region.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_region.c b/drivers/gpu/drm/i915/gem/i915_gem_region.c > index a4350227e9ae..dd414a2bcb06 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_region.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_region.c > @@ -57,6 +57,9 @@ i915_gem_object_create_region(struct intel_memory_region *mem, > > size = round_up(size, default_page_size); > > + if (default_page_size == size) > + flags |= I915_BO_ALLOC_CONTIGUOUS; > + > GEM_BUG_ON(!size); > GEM_BUG_ON(!IS_ALIGNED(size, I915_GTT_MIN_ALIGNMENT)); > Reviewed-by: Thomas Hellström