Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1030760pxb; Fri, 15 Apr 2022 18:57:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL9pb0sZJ409s7CmDvr8qec2etcttpzjT8dRbV7I+A60I685fTahdGBBq3RnxuGS9tZP6R X-Received: by 2002:a17:902:f64c:b0:156:4349:7e9b with SMTP id m12-20020a170902f64c00b0015643497e9bmr1631789plg.139.1650074279271; Fri, 15 Apr 2022 18:57:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650074279; cv=none; d=google.com; s=arc-20160816; b=DZyDDHesHbbAhW/eaw2oDSYDvVFbUCCzQlzV4gEznkfzQs8SwZWdeLTCpvHL4Ah2g7 DnWa5IN9dB3M4t+CbjiSu5qtR1k1FjnuhNjk6f42Xcdh6I4oZ2vLf8zNpLFOC7Vsng53 uXuzmmqsmO1SlhoTH+BXV+KwQASdPpIlO3Oo7emoQW2+p2POjBMDMdBKwSHsqG+MizTv D15n2ngCCVnqWBfrDfa6ZiD+pgrIgNd3mkq097Sym0uCvigbXSpvOKdnxQ7Q/xuLT6po HW0jVByttjgSDtIsESWaro0LsYfcg2fis5ODHgiKrL6+pixHHgg+lnwmrJw7XkfeQiZg 9GbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=HN0hsa7n2zI07Dr8/c5QulPloYUtxMy4pvYdrWlBAO0=; b=OIpFKmzLFMssO8W+Bp0f6ZK3rRkJbGKrk7xplZOjKeJ2CGZv3DI4TS55OJiCLrYlU6 2Ol+c8I9Hk8jPrI1ya06QWxY3jieunTcPhR+deyozsCEaJwG3hxfeGb8ydhpGlTSpbjP oV6x8qXCe2trvHFcjqxdy4W8IgZ2gj9ttSqhml9bL4Qha+MiYbWnVrbjxcJJSgY7rLm/ xp1BPVSXkPZZ93dttdJiIP4W3nEspzBTZZMnDxgvjrgwuTz51o7yHFPcI7l8quMHQ4z3 08OitP4LGSPYYYqRtw1ybXLYneuZaT1qC13/Yx+MV4YFq7CENGIpR7YakiLhFQKLbC/y CErA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KhEWKrc5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q8-20020a637508000000b00386275ee890si3169185pgc.343.2022.04.15.18.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 18:57:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=KhEWKrc5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B34D1A7767; Fri, 15 Apr 2022 18:18:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245475AbiDNRZi (ORCPT + 99 others); Thu, 14 Apr 2022 13:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244624AbiDNRZh (ORCPT ); Thu, 14 Apr 2022 13:25:37 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 946A3BC862 for ; Thu, 14 Apr 2022 10:23:11 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: bbeckett) with ESMTPSA id B79D21F47BCE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649956990; bh=D3Guilrkks6V/1hTwTRFRrqejHfbyPr22LWaBmWvToo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KhEWKrc5jpdpnlEan/SJ5+kGF26hEhzLFsX6DVMxJLGi7R7KpgAMDEYPQJotCaaWo uIjlI/MD0FDOyWmglK4Bi4Hy59l9zTdy1cPQZn9lA3euRlaRBBBQAzcuwPj+uUCCdw S3wAiqfaQoVYB0G2jzHVZ5llQJCLsva2bCHU/uetz5eis8/YZpOl0FiBd0Mxtdzd8G OTfzlMLHdHKlP/rKTgpr7UjcAZ+ni5VCtJPpJ+EjFEjRotb/AiwQHPMa0iVx0F1RsS /xWFCgcHZJa9aqNb64gZra/RxZ0455Ef4v8X+NMJyPmLSPY+4iPrhdDBnJXDBP2c7x ZrF4tqzg5GgHw== Message-ID: <2f71160e-01cc-40a5-4661-b998b3acd153@collabora.com> Date: Thu, 14 Apr 2022 18:29:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3 5/5] drm/i915: stolen memory use ttm backend Content-Language: en-US To: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: Matthew Auld , linux-kernel@vger.kernel.org References: <20220412193817.2098308-1-bob.beckett@collabora.com> <20220412193817.2098308-6-bob.beckett@collabora.com> <94ddf51a-90ae-dee8-5d6a-45ee2cd1e584@linux.intel.com> From: Robert Beckett In-Reply-To: <94ddf51a-90ae-dee8-5d6a-45ee2cd1e584@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/04/2022 15:41, Thomas Hellström wrote: > Hi, > > > On 4/12/22 21:38, Robert Beckett wrote: >> +struct ttm_resource * >> +i915_gem_stolen_reserve_range(struct drm_i915_private *i915, >> +                  resource_size_t size, >> +                  u64 start, u64 end) >>   { >> -    int ret; >> +    struct intel_memory_region *mem = i915->mm.stolen_region; >> -    if (!drm_mm_initialized(&i915->mm.stolen)) >> -        return -ENODEV; >> - >> -    /* WaSkipStolenMemoryFirstPage:bdw+ */ >> -    if (GRAPHICS_VER(i915) >= 8 && start < 4096) >> -        start = 4096; > > Did we lose this Workaround? woops, looks like we did. Nice catch. I'll add a reservation at start of day if wa is needed when I issue v4. > > Need to continue reviewing this patchnext week. > > > Thx, > > Thomas > > > > >> - >> -    mutex_lock(&i915->mm.stolen_lock); >> -    ret = drm_mm_insert_node_in_range(&i915->mm.stolen, node, >> -                      size, alignment, 0, >> -                      start, end, DRM_MM_INSERT_BEST); >> -    mutex_unlock(&i915->mm.stolen_lock); >> +    if (!mem) >> +        return ERR_PTR(-ENODEV); >> +    return intel_region_ttm_resource_alloc(mem, size, start, end, >> I915_BO_ALLOC_CONTIGUOUS); >> +} >> -