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 D67C3C433F5 for ; Fri, 25 Mar 2022 07:17:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FCDD10EE79; Fri, 25 Mar 2022 07:17:02 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEE1310EE76; Fri, 25 Mar 2022 07:17:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648192620; x=1679728620; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=QBWcCQxngZCieKayhC+50EI8Wyni78j9XDR8bGKBvss=; b=CDELLucFTRV1HF2Kzxnj8c+4tEvUefbh6qBs+0+y3yKMAEGJUTF1BHc6 jEBXwoCxuugkVJSF1zM+SM3aHsAA8EYPwuZyfLxsLQSYeNQpkLJ7K3T4O ZUjaysY6v3BdyBrKzh4sIovTcO0ZPGXcrDJ5Qy0QNlBAwNKyJgCW0eur7 EuI5uRMqgSbngEXobXFCLR8vjOKYQdVxFQDNlbN0agh6eTit+qORb9KxG 36A0+/zVPQiYfBmxc2uw/369uGazpAJg6OHQqtZnkhsGg0MXvnugZ5x2G GChQZ6zXRMpwE1Yq6d0ZIL7LUuxi9yFib4rO4RpVHWL2uf/g7mm+sQlTc w==; X-IronPort-AV: E=McAfee;i="6200,9189,10296"; a="321768664" X-IronPort-AV: E=Sophos;i="5.90,209,1643702400"; d="scan'208";a="321768664" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2022 00:17:00 -0700 X-IronPort-AV: E=Sophos;i="5.90,209,1643702400"; d="scan'208";a="601965239" Received: from vzinovie-mobl2.ccr.corp.intel.com (HELO [10.249.254.142]) ([10.249.254.142]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2022 00:16:58 -0700 Message-ID: <84deb237-3d0b-0c0e-21c8-25df59b9fc71@linux.intel.com> Date: Fri, 25 Mar 2022 08:16:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-US To: Matthew Auld , intel-gfx@lists.freedesktop.org References: <20220324172143.377104-1-matthew.auld@intel.com> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= In-Reply-To: <20220324172143.377104-1-matthew.auld@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915/ttm: limit where we apply TTM_PL_FLAG_CONTIGUOUS 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 3/24/22 18:21, Matthew Auld wrote: > We only need this when allocating device local-memory, where this > influences the drm_buddy. Currently there is some funny behaviour where > an "in limbo" system memory object is lacking the relevant placement > flags etc. before we first allocate the ttm_tt, leading to ttm > performing a move when not needed, since the current placement is seen > as not compatible. > > Suggested-by: Thomas Hellström > Fixes: 2ed38cec5606 ("drm/i915: opportunistically apply ALLOC_CONTIGIOUS") > Signed-off-by: Matthew Auld > Cc: Nirmoy Das > --- > drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c > index e4a06fcf741a..97e648fa76bd 100644 > --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c > @@ -133,6 +133,9 @@ i915_ttm_place_from_region(const struct intel_memory_region *mr, > memset(place, 0, sizeof(*place)); > place->mem_type = intel_region_to_ttm_type(mr); > > + if (mr->type == INTEL_MEMORY_SYSTEM) > + return; > + Reviewed-by: Thomas Hellström > if (flags & I915_BO_ALLOC_CONTIGUOUS) > place->flags |= TTM_PL_FLAG_CONTIGUOUS; > if (offset != I915_BO_INVALID_OFFSET) {