From patchwork Thu Feb 17 20:26:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Cheng X-Patchwork-Id: 12750625 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 101D2C433F5 for ; Thu, 17 Feb 2022 20:27:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7AADE10E7BA; Thu, 17 Feb 2022 20:26:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id CAEE310E7AF; Thu, 17 Feb 2022 20:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645129615; x=1676665615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CAOY7D1XGhAYqvQP/hcL22aF29wRn657CuZ5WaLOiTw=; b=irPXxnVe0poAeiGWqcsUvfF6V9QKgZDG0OLdnQHkbAHq6aOyZunGljkK lOwlTVUC57moVC3VXnQOksiYtfesqLPPpWqE/7hcZULUHUw84r34vTMGO VA/1/Bb4Fj7gZsOVJv7IMxxEN2BWMrJMnXXolmabKiFJX+XLxtDPHJ1E6 XFaF3xU+P8hcU4bBjLOivF270EHlm0uahYMHwVJMIKfx0xcjCpkBfHepM vuGMHlpwc4ZOYsJFwvm+FTOkP/ILKQ/OP/E14sHCDdjBS5ZtR3+rlKX7e BE8LOcHJclBYwSMZm+T2WfdqGO7pu4v+EcMTnvpW1rUfuDj1XQNsLgxzd A==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="238370945" X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="238370945" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 12:26:55 -0800 X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="545842096" Received: from zlwang-mobl2.amr.corp.intel.com (HELO mvcheng-desk2.intel.com) ([10.212.198.213]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 12:26:55 -0800 From: Michael Cheng To: intel-gfx@lists.freedesktop.org Date: Thu, 17 Feb 2022 12:26:42 -0800 Message-Id: <20220217202644.122937-2-michael.cheng@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217202644.122937-1-michael.cheng@intel.com> References: <20220217202644.122937-1-michael.cheng@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 1/3] drm_cache: Add logic for wbvind_on_all_cpus 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: michael.cheng@intel.com, lucas.demarchi@intel.com, dri-devel@lists.freedesktop.org, siva.mullati@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add logic for wbvind_on_all_cpus for non-x86 platforms. v2(Michael Cheng): Change logic to if platform is not x86, then we add pr_warn for calling wbvind_on_all_cpus. Signed-off-by: Michael Cheng --- drivers/gpu/drm/drm_cache.c | 2 -- include/drm/drm_cache.h | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index 66597e411764..722e3931d68a 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c @@ -40,8 +40,6 @@ #define MEMCPY_BOUNCE_SIZE 128 #if defined(CONFIG_X86) -#include - /* * clflushopt is an unordered instruction which needs fencing with mfence or * sfence to avoid ordering issues. For drm_clflush_page this fencing happens diff --git a/include/drm/drm_cache.h b/include/drm/drm_cache.h index 22deb216b59c..24fcf6be1419 100644 --- a/include/drm/drm_cache.h +++ b/include/drm/drm_cache.h @@ -34,6 +34,12 @@ #define _DRM_CACHE_H_ #include +#include + +#if !defined(CONFIG_x86) +#define wbinvd_on_all_cpus() \ + pr_warn("Missing cache flush in %s\n", __func__) +#endif struct iosys_map; From patchwork Thu Feb 17 20:26:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Cheng X-Patchwork-Id: 12750624 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 BBE0BC433EF for ; Thu, 17 Feb 2022 20:27:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8CDE610E7B8; Thu, 17 Feb 2022 20:26:57 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4AC2810E790; Thu, 17 Feb 2022 20:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645129616; x=1676665616; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oVDGf1dJNIS7op/ho91MBOqEVTzq6Y+bedisro38V48=; b=HNCmrCAcLps4/VCxNQf1tqeXJ3hbB0tWD0h0Pdoy9Md6iKVV93oThl9u e4v6xKkUsvBwKf2nzcHw+VTGJ6/G0JUCMPVclrF++phprXPWZ9cnVxg4i 0O0V8EhvuR5bHcNmfFlmBzZ8oHpUC9tFJi/2YiPWxG7s+NkFjboJyvVda 0lzYHeZUjHcDbZuKwV3VvB583FIzNjAxqGooVDjtLJYgNXxSsJqPI5UX9 F6DjxPI7BFW6nISnJnR6I9+xD1R5blbk+m/Vh6Xy0c1CHZRoqVdlEU0qK XPpdqcywPSvpO2ejDMKJ4XMNZl3orGeBDTshSFdfUv9mcv+zX3NDHG9X2 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="238370947" X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="238370947" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 12:26:56 -0800 X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="545842101" Received: from zlwang-mobl2.amr.corp.intel.com (HELO mvcheng-desk2.intel.com) ([10.212.198.213]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 12:26:55 -0800 From: Michael Cheng To: intel-gfx@lists.freedesktop.org Date: Thu, 17 Feb 2022 12:26:43 -0800 Message-Id: <20220217202644.122937-3-michael.cheng@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217202644.122937-1-michael.cheng@intel.com> References: <20220217202644.122937-1-michael.cheng@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 2/3] drm/i915/gem: Remove logic for wbinvd_on_all_cpus 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: michael.cheng@intel.com, lucas.demarchi@intel.com, dri-devel@lists.freedesktop.org, siva.mullati@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" drm_cache.h now handles calls to wbinvd_on_all_cpus. Signed-off-by: Michael Cheng --- drivers/gpu/drm/i915/gem/i915_gem_pm.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_pm.c index 00359ec9d58b..ee4783e4d135 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pm.c @@ -13,12 +13,7 @@ #include "i915_driver.h" #include "i915_drv.h" -#if defined(CONFIG_X86) -#include -#else -#define wbinvd_on_all_cpus() \ - pr_warn(DRIVER_NAME ": Missing cache flush in %s\n", __func__) -#endif +#include void i915_gem_suspend(struct drm_i915_private *i915) { From patchwork Thu Feb 17 20:26:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Cheng X-Patchwork-Id: 12750626 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 52421C433EF for ; Thu, 17 Feb 2022 20:27:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA6DE10E81C; Thu, 17 Feb 2022 20:26:58 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id C724110E7AF; Thu, 17 Feb 2022 20:26:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645129616; x=1676665616; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5s8WwXED9j1A4hMdCFff54d6DwS++vt5oG3f5u7P8aU=; b=Rif2n5kp47WiG3jqbft2Jr/psdUGh99w0pYG0IMnLmBiJaCl1n06Zwb9 HupKqyr8WMR3YJoyB0blrMsWEy5dEiSzzQdprmj9PJwoSy4wm4SWqfRgK YjYl/iDeWfPJJNl6+CXL0R31lZZXRowCxFsQhEhVl3IjFZaxdKbNVjp9j BLajgJKn72Q4uiNVUgevYjxetYPEyH8rrdPQda8pB5B1NjiS+OJT5mptG IqufksPvuiM5QHS487l2ufssaaQzMmhCNjBDuKdwOW2I6JCMhdd2h2dCf MzlsqwgZvqHJd/HuzP2A7u3nI8CSr0hBAff/Pcj/McT0jFlKGrcnZBjPn w==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="238370951" X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="238370951" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 12:26:56 -0800 X-IronPort-AV: E=Sophos;i="5.88,376,1635231600"; d="scan'208";a="545842107" Received: from zlwang-mobl2.amr.corp.intel.com (HELO mvcheng-desk2.intel.com) ([10.212.198.213]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 12:26:56 -0800 From: Michael Cheng To: intel-gfx@lists.freedesktop.org Date: Thu, 17 Feb 2022 12:26:44 -0800 Message-Id: <20220217202644.122937-4-michael.cheng@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220217202644.122937-1-michael.cheng@intel.com> References: <20220217202644.122937-1-michael.cheng@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 3/3] drm/i915/: Add drm_cache.h 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: michael.cheng@intel.com, lucas.demarchi@intel.com, dri-devel@lists.freedesktop.org, siva.mullati@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add drm_cache.h to additionals files that calls wbinvd_on_all_cpus and remove un-needed header files. Signed-off-by: Michael Cheng --- drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c | 2 +- drivers/gpu/drm/i915/gt/intel_ggtt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c index 13917231ae81..edb0ebbb089c 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include "gem/i915_gem_dmabuf.h" #include "i915_drv.h" diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c index 8850d4e0f9cc..dac62e3ba142 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -7,10 +7,10 @@ #include #include -#include #include #include +#include #include "gem/i915_gem_lmem.h"