Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1285690iob; Wed, 4 May 2022 19:55:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzBKDlRdqmQv2ABCwm6DwaQ24yqEUFqGkwOPXvJrV/YvIM2aaTNH8dEUIhSJ/LLgolz9ms X-Received: by 2002:a17:907:e89:b0:6f4:98fe:49e7 with SMTP id ho9-20020a1709070e8900b006f498fe49e7mr10285983ejc.425.1651719336755; Wed, 04 May 2022 19:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651719336; cv=none; d=google.com; s=arc-20160816; b=RJBoWD5mrGUYaczMMKo5qZ7Y8k6Yd5P+8jcHWac/EKWabrdN3OBADbtwSfxOYJ0Oe+ IMEu2VHt6T2Cdxkl0A9V2jgrqUkkR1wYCHD8JaC2duIUTs0x7W+ipvSgo15getCwZ7Ao Rhee8X+sXHQbK7kj4Apqi8dDnuLCMCb9+4SxO9aOVR0Py+FKmxtW1i32SnAxeQ3fjYQl Y53Uzl6G6pyw0R9wg3Q1+CIGza/kMcKwy8P0hNP+zIa99QIJZv3c4dArohFIt7Mqz+/4 npnjz10HwFJCNM/ptZXcOe8/hKq4EpyF2Su6nCMd3ifcqZ0q2u7gMeeclpjTYOjbKbD1 6I4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0PNLMEq0M9pXBK0yLmkdS5gN44SrL3XEGuQBm+RFW0c=; b=P3u8HklWezrsSGSfVMITU1uSSHq814JqWHOHG5jifcNFac7oh4NEswBgD4A563ITZ5 5V0uoJPxNL08j/gB9io2xV5zzwNRCaSId440i3ghwagN6U8LIsdkaPpKJvehypxxCw2S aYt7HygKdFkowmMrfMOe1uc0H3/EnNtQR+WFlcYf7vKhtbu0HjQw9tWcmjiZjUxbtM1F m7+aNkYMtpz98xMJbHqJC1ME7MFF9ADXND4rnpj6KjDMt0X4YzlFV3mREXrjabRe0cN7 yWbx+fyjZLrYXGDXEXzA/CgklgJpDZYVw3/C5VgFPjcePhHcxofXSX6SQ7D1/6FkaV/F 3GLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dc0PkMkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020a1709066b1800b006f3895ac94asi732437ejr.728.2022.05.04.19.55.14; Wed, 04 May 2022 19:55:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dc0PkMkZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241833AbiECTRU (ORCPT + 99 others); Tue, 3 May 2022 15:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236114AbiECTRQ (ORCPT ); Tue, 3 May 2022 15:17:16 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C56083FBC6 for ; Tue, 3 May 2022 12:13:43 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: bbeckett) with ESMTPSA id 5E60C1F44697 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1651605222; bh=MwugLBh23dXXE1qsLkpJ+qfy/t4gW1mABUdWdV5evKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dc0PkMkZWCj0KBoGj/DAsdV/CPLSna0T5TiMp0x8GzaoSEYMBmmEPKJJ2tMf65CUw zr7lybq5exzd6qXWVQcf4dInaC9bNRB0ScdDOm7ylNTJOZijvxVKmTgIWP8Em6Rh8J lBpR8+I9hQMfe7H+O242dh7I3WsnR5UoHd2d4frt1BF+oFC3eCDZgOYQF7fMRFoO3T WLGhogv8KXDGO2xj7cVyGP49glbzbRWVSsNGiqwkGywsga9Kb9T3XRUes9WW3CXq77 jxrvJ7v6hsUq9/i84fV++YhLzBqkmGideSIp/bGB3LQXDW6DXyTvo6DOxBcobcZ/Gx q4YAIUJEvrzyg== From: Robert Beckett To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: Robert Beckett , Matthew Auld , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] drm/i915: allow volatile buffers to use ttm pool allocator Date: Tue, 3 May 2022 19:13:15 +0000 Message-Id: <20220503191316.1145124-4-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220503191316.1145124-1-bob.beckett@collabora.com> References: <20220503191316.1145124-1-bob.beckett@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham 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 internal buffers should be shmem backed. if a volatile buffer is requested, allow ttm to use the pool allocator to provide volatile pages as backing Signed-off-by: Robert Beckett --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 4c25d9b2f138..fdb3a1c18cb6 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -309,7 +309,8 @@ static struct ttm_tt *i915_ttm_tt_create(struct ttm_buffer_object *bo, page_flags |= TTM_TT_FLAG_ZERO_ALLOC; caching = i915_ttm_select_tt_caching(obj); - if (i915_gem_object_is_shrinkable(obj) && caching == ttm_cached) { + if (i915_gem_object_is_shrinkable(obj) && caching == ttm_cached && + !i915_gem_object_is_volatile(obj)) { page_flags |= TTM_TT_FLAG_EXTERNAL | TTM_TT_FLAG_EXTERNAL_MAPPABLE; i915_tt->is_shmem = true; -- 2.25.1