From patchwork Fri Jun 30 17:01:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13298561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6E79EB64DA for ; Fri, 30 Jun 2023 17:02:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A15F010E4CB; Fri, 30 Jun 2023 17:02:35 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id E735C10E4C7 for ; Fri, 30 Jun 2023 17:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688144553; x=1719680553; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+Kj8wDPjICZ0x3wLUp0FEXsXINLfaBE5bp1/oZl/hnw=; b=gNiTHssS4eI2wRZSDQ3UNnxxN+oduu4TY531VSbakYfQsDC9SPqaI1Eu xaipCzOB7BMQOgQ68MUllBRKr1fxjXuCa9iImal9jwFSyM/4wSLHLaKtR odj5sGq42Is9oLQQ7hOlmXI2AzOom0sHKTmnGu/OQUTekXkc/gjApuLEt d7rJ9ae/KGpYJoHxfenH1djS/jjJyM8CEbaSysk/MsK+1LRBTztyshmmL U4MkQ+dLa5Ws1F8BcA5fg+WkHXMmw+rORhn/jNx9m0mDT5Xm64P9uGryT CDSJ62HgADFtwrLZ5I9M+Vr9KaEFEyJHc/ZtqYeSusZB4ykKYrXipEt91 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10757"; a="342026904" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="342026904" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2023 10:01:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10757"; a="841916176" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="841916176" Received: from nirmoyda-desk.igk.intel.com ([10.102.138.190]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2023 10:01:48 -0700 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Date: Fri, 30 Jun 2023 19:01:39 +0200 Message-Id: <20230630170140.17319-1-nirmoy.das@intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 Subject: [Intel-gfx] [PATCH 1/2] drm/i915/gt: Do not use stolen on MTL X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrzej Hajda , Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use smem on MTL due to a HW bug in MTL that prevents reading from stolen memory using LMEM BAR. Cc: Oak Zeng Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Andi Shyti Cc: Andrzej Hajda Signed-off-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/gt/intel_gt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c index 33a61046ba58..9f64d61dd5fc 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.c +++ b/drivers/gpu/drm/i915/gt/intel_gt.c @@ -466,7 +466,7 @@ static int intel_gt_init_scratch(struct intel_gt *gt, unsigned int size) obj = i915_gem_object_create_lmem(i915, size, I915_BO_ALLOC_VOLATILE | I915_BO_ALLOC_GPU_ONLY); - if (IS_ERR(obj)) + if (IS_ERR(obj) && !IS_METEORLAKE(i915)) /* Wa_22018444074 */ obj = i915_gem_object_create_stolen(i915, size); if (IS_ERR(obj)) obj = i915_gem_object_create_internal(i915, size); From patchwork Fri Jun 30 17:01:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nirmoy Das X-Patchwork-Id: 13298560 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7325AEB64D7 for ; Fri, 30 Jun 2023 17:02:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC2EE10E4C7; Fri, 30 Jun 2023 17:02:34 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2A3E010E4C7 for ; Fri, 30 Jun 2023 17:02:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688144554; x=1719680554; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kQxVfL2EpccIxpXmi0itTz3YmEgLQgQsYTRPvC+59zk=; b=IRG3R3kHuQezizxngK8C6NGNhljYj4PxLlA82qc2XGA5tqnr72YJeRf+ ZoNeWqL10kz2a9NFizi/i3jxV6nvLlLvmwdbiwU6OYShzSIHtut2Lo7MN kKDx0RLgRsyqSdcU/C+dbadIqMaC1bb1WEPvYB1tCaIobx0O2ef/M0ogz cpZSByylsU5Yb3uJmlJQJUt2FqnXKskmxDZuVQ2GKcfyC+bSVtiu0Xq4W paag/wWnWAs2R/eMTwRSBMQLEUUesKi/waLq29njrD8GfOwld+oSDdXhi 7f4U2lWXeJH2hzyyIr0X+LqhGajt2R7vISHwquNue129pOms0aiDLnAZY g==; X-IronPort-AV: E=McAfee;i="6600,9927,10757"; a="342026915" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="342026915" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2023 10:01:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10757"; a="841916179" X-IronPort-AV: E=Sophos;i="6.01,171,1684825200"; d="scan'208";a="841916179" Received: from nirmoyda-desk.igk.intel.com ([10.102.138.190]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2023 10:01:50 -0700 From: Nirmoy Das To: intel-gfx@lists.freedesktop.org Date: Fri, 30 Jun 2023 19:01:40 +0200 Message-Id: <20230630170140.17319-2-nirmoy.das@intel.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230630170140.17319-1-nirmoy.das@intel.com> References: <20230630170140.17319-1-nirmoy.das@intel.com> MIME-Version: 1.0 Organization: Intel Deutschland GmbH, Registered Address: Am Campeon 10, 85579 Neubiberg, Germany, Commercial Register: Amtsgericht Muenchen HRB 186928 Subject: [Intel-gfx] [PATCH 2/2] drm/i915/display: Do not use stolen on MTL X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrzej Hajda , Nirmoy Das Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Use smem on MTL due to a HW bug in MTL that prevents reading from stolen memory using LMEM BAR. Cc: Oak Zeng Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Andi Shyti Cc: Andrzej Hajda Signed-off-by: Nirmoy Das Reviewed-by: Andrzej Hajda Reviewed-by: Andi Shyti --- drivers/gpu/drm/i915/display/intel_fbdev.c | 2 ++ drivers/gpu/drm/i915/display/intel_overlay.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c index 1cc0ddc6a310..10e38d60f9ef 100644 --- a/drivers/gpu/drm/i915/display/intel_fbdev.c +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c @@ -182,6 +182,8 @@ static int intelfb_alloc(struct drm_fb_helper *helper, obj = i915_gem_object_create_lmem(dev_priv, size, I915_BO_ALLOC_CONTIGUOUS | I915_BO_ALLOC_USER); + } else if (IS_METEORLAKE(dev_priv)) { /* Wa_22018444074 */ + obj = i915_gem_object_create_shmem(dev_priv, size); } else { /* * If the FB is too big, just don't use it since fbdev is not very diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index d6fe2bbabe55..05ae446c8a56 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -1348,12 +1348,13 @@ int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data, static int get_registers(struct intel_overlay *overlay, bool use_phys) { struct drm_i915_private *i915 = overlay->i915; - struct drm_i915_gem_object *obj; + struct drm_i915_gem_object *obj = NULL; struct i915_vma *vma; int err; - obj = i915_gem_object_create_stolen(i915, PAGE_SIZE); - if (IS_ERR(obj)) + if (!IS_METEORLAKE(i915)) /* Wa_22018444074 */ + obj = i915_gem_object_create_stolen(i915, PAGE_SIZE); + if (IS_ERR_OR_NULL(obj)) obj = i915_gem_object_create_internal(i915, PAGE_SIZE); if (IS_ERR(obj)) return PTR_ERR(obj);