Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp38015pxb; Tue, 12 Apr 2022 16:08:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk4nUB/v7WMyIc+DnMzC1whxG9Df54SE2Z6M78tebcBiw9s10xMLDyLZXSH/agYiUg0Y2W X-Received: by 2002:aa7:88ca:0:b0:505:d092:16c8 with SMTP id k10-20020aa788ca000000b00505d09216c8mr9723946pff.22.1649804895520; Tue, 12 Apr 2022 16:08:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649804895; cv=none; d=google.com; s=arc-20160816; b=mnfAwprFK3ihtZXUz6JqgY9HCwn/vtZS3WN1Wh64nXz3sLDP3NERmh8n3VswZ8BXW0 ceVAnhG9UoYhMdiudGqWyho+fymsT5DZdk/bcNIokf5h4YrjgdCOkycFEU3agsRu2u7+ hUvonJUZq+Ul2snBA9+vwIrQWhbitOeDPYX3A/XpTU+hjM7gslvml74+WOGvzkgVQcyQ 2Gmx4BXb1TNd9YJrJqe3gHSU7B2R3r8ZJab/e1DBx5Yxk8YFp6LVBc/LMZt2WbpDGyPO nCrThKqP30aTupdcLnRpH8QPLPYgxM5BQKa5kAxK/FOgV2BtTnJmoThYJ/U7nPGZDIEM NEGA== 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=ANSCvCOivBYxqNZOizKj1/xwwXo2PU1g1a7hqqeI1ok=; b=kubUwZjjelTwoQBZnDvqZWaaAtogWAZMBChIsDcUlbPOxHaCVUbuI+Stsvg1NsQ3mC wAg+O/dt4oGxtWqIqpses4TPtbqTIldCpIRHZt68ph4sk2s0icfdoeXA0mH9vLAwgEBL 9OXrUTI/vRObyzD2zcHr3aHqzZEqDnhi/mPUcVKLYxv3TGczjLznAqAvs+Ee3+xrfkgt UCmrEdo6qaQbynLoOiysE91NLtgJtXhb61qIg76VNm2wEz/i9oL7RbZuiUf8nkI8oW+H cl8/MYv993sTtIORCi7FFHY/fIDwMk6COu0nrPZIGVTGwh7s5JUhVB3w/U9z4imsAnbv GJxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=EU6erXzC; 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 d70-20020a636849000000b003862e2b315dsi3775838pgc.516.2022.04.12.16.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:08:15 -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=EU6erXzC; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C1AC11F9A02; Tue, 12 Apr 2022 14:51:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349634AbiDKT2L (ORCPT + 99 others); Mon, 11 Apr 2022 15:28:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349609AbiDKT1Z (ORCPT ); Mon, 11 Apr 2022 15:27:25 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D53B13FBA for ; Mon, 11 Apr 2022 12:25:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: bbeckett) with ESMTPSA id 026B31F43CB4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649705109; bh=GrofPaVaAIh/vGpNqrDMDcYhEYMfkIf09BP3sK/sbsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EU6erXzCI7f81sjt6x336MGMJH7FfZKE5CDaUJc6KJCOkGolIQz6CNplo0GKhYZjL RE7vc4GNdFKq+A1ITS+boHQvkIkQFwWiVHf1Q9uuRndevGQylJw2FvEyuX/jHCFtgQ 5uzIuzB4hORtKXz/hNE9npZxQ+qSf0wGumhfOiebrXJj4+XwSbia7+xVCQipARPKBm 2uSLzI4Kijfqyt4jRBXhfT38X9ZOTd/ueWDy19h7Lx52vT6i5qQ0m9O2Uj13maMk3T y/WSvxN/GfoKS+BFCnnWZoIvFwhrhvNBIl2VsB6s3VSlinYIe2ZZXWiRo+YLvpWUPJ 3s2P/1gq+zlKg== 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 2/5] drm/i915: sanitize mem_flags for stolen buffers Date: Mon, 11 Apr 2022 19:24:50 +0000 Message-Id: <20220411192453.1000147-3-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220411192453.1000147-1-bob.beckett@collabora.com> References: <20220411192453.1000147-1-bob.beckett@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no 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 stolen regions are not page backed or considered iomem. Signed-off-by: Robert Beckett --- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c index 358f8a1a30ce..9fe8132de3b2 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -122,8 +122,9 @@ void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj) obj->mem_flags &= ~(I915_BO_FLAG_STRUCT_PAGE | I915_BO_FLAG_IOMEM); - obj->mem_flags |= i915_ttm_cpu_maps_iomem(bo->resource) ? I915_BO_FLAG_IOMEM : - I915_BO_FLAG_STRUCT_PAGE; + if (obj->mm.region->id != INTEL_REGION_STOLEN_SMEM) + obj->mem_flags |= i915_ttm_cpu_maps_iomem(bo->resource) ? I915_BO_FLAG_IOMEM : + I915_BO_FLAG_STRUCT_PAGE; cache_level = i915_ttm_cache_level(to_i915(bo->base.dev), bo->resource, bo->ttm); -- 2.25.1