Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp55237lfv; Tue, 12 Apr 2022 17:04:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye2pjuWQPpUJdIq7sEvj/HYUU8029oboTFWWlRurbg46OHX/0AJDI+Iz2lGIWvhoBDTO0A X-Received: by 2002:a05:6a00:1701:b0:505:aece:5361 with SMTP id h1-20020a056a00170100b00505aece5361mr16116482pfc.16.1649808297381; Tue, 12 Apr 2022 17:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649808297; cv=none; d=google.com; s=arc-20160816; b=Vc2L4ndgSfcS5IwSUrBJtbYAyKjPEV6aepxSFugygV3kLKRgB3SrqQrO/1DCfHs/GO KW8WRbhISHbiV/p97aFO1oPzlY7OiG+emPzo+I5yWkdCOK+OHFEg/l5ES8XiyPHmkwO7 fMliiJLdWTpn6tmbYd8em8z/yShtK3tI/d+i3hr/7VyY1x2eCBjWBrMu2Ueom3I2oWBQ 89LSvffnlb8a7C/ttMjapLuCFwLFvT7jeDHJCGSaBCU1ffIiWSdFw+5t6+/0qkX6b7Sw 8vxkSD2o6kSgdqTaYDLgS/YiWhbFb0mrexCld65utjPuoWN5z1vNy1zwGCM/sBrNMG5Z uzIw== 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=Rp0ujM0SS28ex1EntBA74tEjq/CRBe91yWm7njLQamJqiQcLHtaXw2BdmNQyGveYQr UvQdVt2WlN3BpFmcXyvBwnNQlySKCq4SDlFcuHUmBCAEpRuXsrPFHSHrjd7blt1R6xyi Dt/2m2/DpWfDr2yU8jBUKKdqYtfeNlXuC1R8UE9f3ccTEVhAD1z2ispZKQS0x75PTzNM Q0Fbp+Jajnnt+s2hrhJ/EuSu4aT1c28UppRDTRI9CPQB2naqXKYjQZK0NHIIp4s5syst Pl5gUtl6kSdDq8XVZzgUIcCxaFuI+vcuwQYzYnQ3dxGdxUY226OblOoslh/DvqQ14tXq l41g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kI1hU9As; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id b18-20020a170902e95200b00155f7af1822si12293755pll.484.2022.04.12.17.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 17:04:57 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=kI1hU9As; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 DDF6D14D7A9; Tue, 12 Apr 2022 15:01:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358880AbiDLTlN (ORCPT + 99 others); Tue, 12 Apr 2022 15:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232559AbiDLTkz (ORCPT ); Tue, 12 Apr 2022 15:40:55 -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 04CD92F396 for ; Tue, 12 Apr 2022 12:38:36 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: bbeckett) with ESMTPSA id 8986A1F419AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1649792314; bh=GrofPaVaAIh/vGpNqrDMDcYhEYMfkIf09BP3sK/sbsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kI1hU9Asv2e1sq6tDoucznk5+wlEMkMTBplx1amLaHmRFyxwtv3mvSjFYB6WF9ybw KPqpflOqD0TK/zgXsgqFYRo6roIRgMQWyCo6fDmnkWPdp1KrcfIUf4Mgos/Y9xFeKU ti00qLSAmGitT0NNg5OdWKZ0ua8B4qwWRRFzHK9U/jKWIPqxYsDLAeCFmUMwse8glA HkAdSRCSTTCTxw65A1hh1jdHDWenO8oLDwtc+MWQOglXh/t8d73r4t+5npHgJXFcr2 wezKyEVDjBJf1jsEGkAWnlYujgwjBd9TJMaFu3l6DsKWt4MLtNtfjpMPXadPuUWPi5 HWEkmQ9zdCp5Q== 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 v3 2/5] drm/i915: sanitize mem_flags for stolen buffers Date: Tue, 12 Apr 2022 19:38:13 +0000 Message-Id: <20220412193817.2098308-3-bob.beckett@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220412193817.2098308-1-bob.beckett@collabora.com> References: <20220412193817.2098308-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