Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp786011pxb; Tue, 12 Apr 2022 13:25:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/HKkA0jYd2bDEDPAu22ub4hwljRfHXNUFLAhLEUMky4pw/wgeso4p0aP4LzwAoGTRkKCa X-Received: by 2002:a65:4c44:0:b0:39c:e0b5:cd2a with SMTP id l4-20020a654c44000000b0039ce0b5cd2amr21463080pgr.481.1649795114415; Tue, 12 Apr 2022 13:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649795114; cv=none; d=google.com; s=arc-20160816; b=Srh2/kWE38cXvWNjrvh+HPqK/XFs7fsV+0lAXXp/MpEMta4iK7ah0V2wrIF8wrSoGD d6TGDot1RHQctfytRntGb5TOd8r0nF9YzxAEspfUr6v1heY6NWLaebHRObiuz7MOropT /enu0n4HZnqRghUjs59HtzUiylnP0dG4lPcVeRLcPXtnUzocAaOY9bVbWr5SwJrL9t3u AO7d9+hUrGkl5Ow5EM1hKju8doVN+V8BSNONaqpmBBu6O44ILMs0Yjg/CqB82K/oeCr+ IlNleJ9zYgWzQcl/hghidlOX9yF5ZzYPkSsgFiZx3VyX2mhJdwVxJwhANR198y+NueM7 UyIg== 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=nw+kOsJGbw0rR1yvtKCwTlI1QrAAvVr7vupcdZNujB9IETkABhjyIhDwo1komnTaci NLj273/aNlCfFdSL35cNn/kImj96IZk5SOJ0I8Ga2QRCXFSt5Hnv/bevkCOdaoo8qcGP 0XtsfzJrIOTgo6XXT0E7Ia0x04brN7VYapFDivr54fAWBxHa76PlYaMnsl+Q3RGpA4WD 3Rfa9nHnTwNUNMwv0fNwILUw8S+LYIAiwYwl201cAs7T2k5YFqsvAnZ9A3INGaBK9bf1 dzYl0hTkEgX5JpO9Eq8A8ZvShtUQzC8+VO1a5S1RNvTDKjy24HkhrUyC1iUEnq69jbqH lF4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=l16RXCAW; 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 a15-20020a631a4f000000b003985223c137si3798934pgm.354.2022.04.12.13.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:25:14 -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=l16RXCAW; 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 A7E9D183B7; Tue, 12 Apr 2022 13:04:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352923AbiDLPVZ (ORCPT + 99 others); Tue, 12 Apr 2022 11:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355806AbiDLPVU (ORCPT ); Tue, 12 Apr 2022 11:21:20 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A12F5 for ; Tue, 12 Apr 2022 08:19:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: bbeckett) with ESMTPSA id 77FE01F44909 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649776739; bh=GrofPaVaAIh/vGpNqrDMDcYhEYMfkIf09BP3sK/sbsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l16RXCAWZ2wE+/K5GAoKEQePqYBubGdxR1nlh1DFB1CeO6ePMaDn9+EsS/IMZDHMn SGe5cbSEVOoZ/TpLD8tV4vMSMb7r1R3ManQqkC3YtiuFx8BlPnZXYRWnExy8JHT7uM EP4qJWq1f5t4dj9mhXAf2T/iUY2SJvE6ZDB+zEi6oEZAnaY2DZy6ucdaBIi2X+5wLo YEV4yKkbFDqQj+cqpaNj03FL9sJVOB+ueHAy+J54P9xWS6rqW1uG0k+PY0X3kHHt8u 6aMa8RqKwGWj59D3Lfxj4Xo44a7udQTxNeSCutlOv5XxsGNdYMstxBfCvP7WserWdG r8GWM7oEyTWag== 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 v2 2/5] drm/i915: sanitize mem_flags for stolen buffers Date: Tue, 12 Apr 2022 15:18:35 +0000 Message-Id: <20220412151838.1298956-3-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412151838.1298956-1-bob.beckett@collabora.com> References: <20220412151838.1298956-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