From patchwork Fri Jun 3 13:05:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 12869053 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 498F2C43334 for ; Fri, 3 Jun 2022 13:06:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A535B1134C0; Fri, 3 Jun 2022 13:06:11 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B23F1134C0 for ; Fri, 3 Jun 2022 13:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654261570; x=1685797570; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Efgy0gH3sHa9cnk1D/8oWqJ/i2mVL3W1OFEFNoUfldg=; b=QJY+qDiCfJJADIJ8bK+gJ1ffeuCzNUSOYcz0eIuIAp9lGrXrS+OCsLW6 HMO347uVTgcrSQfjUyzyTd74WMArF4w7xpEGJSEoPtz4aBE0UWQ6rjAHn /ub+TIGPxJjcn0bGZxRoGEOCFr/Co4sgURolxDn8O2qNIagBfepzbNlqg Izh3sO1Dio17mXLD7JQ8rT7AWhPQSRAjVzjBw+gZ6VtfzDrmBlt2teYu2 LrJ49LnL0iCVBudFB3Hk8WjvDHNGrPgpgniyEM41BMrN3X3Nu0ktN3LLW GYP/EjxzIzWcaI3GrOSrOrF1ed1d9srIIRERxSV5MfhmLZNVNmlc4Rps6 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="301617877" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="301617877" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:09 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="553322364" Received: from richardf-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.27]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:07 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Jun 2022 16:05:54 +0300 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 1/7] drm/i915/tasklet: separate local hacks around struct tasklet_struct 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: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add a dedicated file for the local functions around struct tasklet_struct. Far from ideal, but better placed in a dedicated file than i915_gem.h. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/TODO.txt | 2 +- drivers/gpu/drm/i915/i915_gem.h | 33 -------------------- drivers/gpu/drm/i915/i915_scheduler.h | 1 + drivers/gpu/drm/i915/i915_tasklet.h | 43 +++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 drivers/gpu/drm/i915/i915_tasklet.h diff --git a/drivers/gpu/drm/i915/TODO.txt b/drivers/gpu/drm/i915/TODO.txt index 81a82c9c203f..879b08ca32b3 100644 --- a/drivers/gpu/drm/i915/TODO.txt +++ b/drivers/gpu/drm/i915/TODO.txt @@ -37,5 +37,5 @@ Smaller things: https://lore.kernel.org/linux-mm/20210301083320.943079-1-hch@lst.de/ -- tasklet helpers in i915_gem.h also look a bit misplaced and should +- tasklet helpers in i915_tasklet.h also look a bit misplaced and should probably be moved to tasklet headers. diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h index a2be323a4be5..68d8d52bd541 100644 --- a/drivers/gpu/drm/i915/i915_gem.h +++ b/drivers/gpu/drm/i915/i915_gem.h @@ -26,7 +26,6 @@ #define __I915_GEM_H__ #include -#include #include @@ -85,36 +84,4 @@ struct drm_i915_private; #define I915_GEM_IDLE_TIMEOUT (HZ / 5) -static inline void tasklet_lock(struct tasklet_struct *t) -{ - while (!tasklet_trylock(t)) - cpu_relax(); -} - -static inline bool tasklet_is_locked(const struct tasklet_struct *t) -{ - return test_bit(TASKLET_STATE_RUN, &t->state); -} - -static inline void __tasklet_disable_sync_once(struct tasklet_struct *t) -{ - if (!atomic_fetch_inc(&t->count)) - tasklet_unlock_spin_wait(t); -} - -static inline bool __tasklet_is_enabled(const struct tasklet_struct *t) -{ - return !atomic_read(&t->count); -} - -static inline bool __tasklet_enable(struct tasklet_struct *t) -{ - return atomic_dec_and_test(&t->count); -} - -static inline bool __tasklet_is_scheduled(struct tasklet_struct *t) -{ - return test_bit(TASKLET_STATE_SCHED, &t->state); -} - #endif /* __I915_GEM_H__ */ diff --git a/drivers/gpu/drm/i915/i915_scheduler.h b/drivers/gpu/drm/i915/i915_scheduler.h index 0b9b86af6c7f..c229c91071d7 100644 --- a/drivers/gpu/drm/i915/i915_scheduler.h +++ b/drivers/gpu/drm/i915/i915_scheduler.h @@ -12,6 +12,7 @@ #include #include "i915_scheduler_types.h" +#include "i915_tasklet.h" struct drm_printer; diff --git a/drivers/gpu/drm/i915/i915_tasklet.h b/drivers/gpu/drm/i915/i915_tasklet.h new file mode 100644 index 000000000000..5d7069bdf2c0 --- /dev/null +++ b/drivers/gpu/drm/i915/i915_tasklet.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2022 Intel Corporation + */ + +#ifndef __I915_TASKLET_H__ +#define __I915_TASKLET_H__ + +#include + +static inline void tasklet_lock(struct tasklet_struct *t) +{ + while (!tasklet_trylock(t)) + cpu_relax(); +} + +static inline bool tasklet_is_locked(const struct tasklet_struct *t) +{ + return test_bit(TASKLET_STATE_RUN, &t->state); +} + +static inline void __tasklet_disable_sync_once(struct tasklet_struct *t) +{ + if (!atomic_fetch_inc(&t->count)) + tasklet_unlock_spin_wait(t); +} + +static inline bool __tasklet_is_enabled(const struct tasklet_struct *t) +{ + return !atomic_read(&t->count); +} + +static inline bool __tasklet_enable(struct tasklet_struct *t) +{ + return atomic_dec_and_test(&t->count); +} + +static inline bool __tasklet_is_scheduled(struct tasklet_struct *t) +{ + return test_bit(TASKLET_STATE_SCHED, &t->state); +} + +#endif /* __I915_TASKLET_H__ */ From patchwork Fri Jun 3 13:05:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 12869054 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 B4A22C43334 for ; Fri, 3 Jun 2022 13:06:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D8391134C3; Fri, 3 Jun 2022 13:06:15 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABEB71134C3 for ; Fri, 3 Jun 2022 13:06:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654261573; x=1685797573; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+53iuusBXvs9ck7/peRmGtOL/OMTCHE+iHs/tzC89pU=; b=UUp+APYrinmGNf8/fbSIETEUvc6aocGjFnk7HFVjkkhObGEqx5K06SJo jjzU+nYaU56zY9CLpSt7gogyzS/7EIeQsjr4c9wrVLYuoQzBKqgDbQHX8 kqBjntniYor3w6hu/m5DWQth81krbgGCCbN7W48Cy8frWO8G8D8fJUjSw J+djqnt4T6DmOyaKyQXARGMUTYuovA28jZyRC5jEYTv71jQvoFXLkaUWS MqtT7uDYcjRZoNLWuvoCAY9pKonuPjV6reC5VvSWXr/YvokocLSPm6O+7 YcysAYwhrf/MmLP8iUxOzpa8Q2bXnAtb0Dh2Db7yzmzlm09/81ysEaaP/ Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="263897459" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="263897459" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:13 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="607389764" Received: from richardf-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.27]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:11 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Jun 2022 16:05:55 +0300 Message-Id: <46e237c35203fd07f9c28afd33de8b5cfbfe2d71.1654261471.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 2/7] drm/i915/debug: add new i915_debug.h for debug asserts 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: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Move the various GEM_BUG_ON(), GEM_WARN_ON(), etc. debug macros to a dedicated i915_debug.h file. Unfortunately, the i915_debug.h needs to be included from some headers that get included from i915_drv.h, so we don't really get much build benefits here, other than getting rid of superfluous i915_gem.h includes. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/gem/i915_gem_context.h | 1 - drivers/gpu/drm/i915/gem/i915_gem_internal.c | 1 - drivers/gpu/drm/i915/gem/i915_gem_object.h | 5 +- drivers/gpu/drm/i915/gem/i915_gem_tiling.c | 1 - drivers/gpu/drm/i915/gt/gen8_engine_cs.h | 2 +- drivers/gpu/drm/i915/gt/intel_engine_stats.h | 2 +- drivers/gpu/drm/i915/gt/intel_engine_types.h | 1 - drivers/gpu/drm/i915/gt/intel_gt.c | 1 + drivers/gpu/drm/i915/gt/intel_gt_sysfs.h | 2 - drivers/gpu/drm/i915/gt/intel_renderstate.h | 2 +- drivers/gpu/drm/i915/gt/intel_ring.h | 2 +- drivers/gpu/drm/i915/gt/intel_sseu.h | 5 +- drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h | 2 + drivers/gpu/drm/i915/gt/uc/intel_guc_log.h | 1 - drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h | 1 - drivers/gpu/drm/i915/i915_debug.h | 63 +++++++++++++++++++ drivers/gpu/drm/i915/i915_drm_client.c | 1 - drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/i915_gem.h | 57 ----------------- drivers/gpu/drm/i915/i915_gpu_error.h | 1 - drivers/gpu/drm/i915/i915_ioctl.c | 1 - drivers/gpu/drm/i915/i915_request.h | 1 - drivers/gpu/drm/i915/i915_scatterlist.h | 2 +- drivers/gpu/drm/i915/i915_syncmap.c | 5 +- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 3 +- drivers/gpu/drm/i915/i915_vma_resource.h | 1 - 26 files changed, 80 insertions(+), 85 deletions(-) create mode 100644 drivers/gpu/drm/i915/i915_debug.h diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.h b/drivers/gpu/drm/i915/gem/i915_gem_context.h index e5b0f66ea1fe..0529bbf5f51c 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_context.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.h @@ -12,7 +12,6 @@ #include "gt/intel_context.h" #include "i915_drv.h" -#include "i915_gem.h" #include "i915_scheduler.h" #include "intel_device_info.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_internal.c b/drivers/gpu/drm/i915/gem/i915_gem_internal.c index c698f95af15f..9f4050933d6e 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_internal.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_internal.c @@ -9,7 +9,6 @@ #include #include "i915_drv.h" -#include "i915_gem.h" #include "i915_gem_internal.h" #include "i915_gem_object.h" #include "i915_scatterlist.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.h b/drivers/gpu/drm/i915/gem/i915_gem_object.h index e11d82a9f7c3..9308f3ab9c98 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.h +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.h @@ -12,11 +12,12 @@ #include #include "display/intel_frontbuffer.h" -#include "intel_memory_region.h" -#include "i915_gem_object_types.h" +#include "i915_debug.h" #include "i915_gem_gtt.h" +#include "i915_gem_object_types.h" #include "i915_gem_ww.h" #include "i915_vma_types.h" +#include "intel_memory_region.h" enum intel_region_id; diff --git a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c index 80ac0db1ae8c..ef8767f3d432 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_tiling.c @@ -8,7 +8,6 @@ #include #include "i915_drv.h" -#include "i915_gem.h" #include "i915_gem_ioctls.h" #include "i915_gem_mman.h" #include "i915_gem_object.h" diff --git a/drivers/gpu/drm/i915/gt/gen8_engine_cs.h b/drivers/gpu/drm/i915/gt/gen8_engine_cs.h index 32e3d2b831bb..1e693f1a924b 100644 --- a/drivers/gpu/drm/i915/gt/gen8_engine_cs.h +++ b/drivers/gpu/drm/i915/gt/gen8_engine_cs.h @@ -9,7 +9,7 @@ #include #include -#include "i915_gem.h" /* GEM_BUG_ON */ +#include "i915_debug.h" #include "intel_gt_regs.h" #include "intel_gpu_commands.h" diff --git a/drivers/gpu/drm/i915/gt/intel_engine_stats.h b/drivers/gpu/drm/i915/gt/intel_engine_stats.h index 8e762d683e50..c7673af7bc01 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_stats.h +++ b/drivers/gpu/drm/i915/gt/intel_engine_stats.h @@ -10,7 +10,7 @@ #include #include -#include "i915_gem.h" /* GEM_BUG_ON */ +#include "i915_debug.h" #include "intel_engine.h" static inline void intel_engine_context_in(struct intel_engine_cs *engine) diff --git a/drivers/gpu/drm/i915/gt/intel_engine_types.h b/drivers/gpu/drm/i915/gt/intel_engine_types.h index 2286f96f5f87..5f6334bd6f41 100644 --- a/drivers/gpu/drm/i915/gt/intel_engine_types.h +++ b/drivers/gpu/drm/i915/gt/intel_engine_types.h @@ -17,7 +17,6 @@ #include #include -#include "i915_gem.h" #include "i915_pmu.h" #include "i915_priolist_types.h" #include "i915_selftest.h" diff --git a/drivers/gpu/drm/i915/gt/intel_gt.c b/drivers/gpu/drm/i915/gt/intel_gt.c index ddfb98f70489..b5f445aaa7ab 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt.c +++ b/drivers/gpu/drm/i915/gt/intel_gt.c @@ -10,6 +10,7 @@ #include "pxp/intel_pxp.h" #include "i915_drv.h" +#include "i915_gem.h" #include "intel_context.h" #include "intel_engine_regs.h" #include "intel_gt.h" diff --git a/drivers/gpu/drm/i915/gt/intel_gt_sysfs.h b/drivers/gpu/drm/i915/gt/intel_gt_sysfs.h index a99aa7e8b01a..acebf48720fa 100644 --- a/drivers/gpu/drm/i915/gt/intel_gt_sysfs.h +++ b/drivers/gpu/drm/i915/gt/intel_gt_sysfs.h @@ -9,8 +9,6 @@ #include #include -#include "i915_gem.h" /* GEM_BUG_ON() */ - struct intel_gt; bool is_object_gt(struct kobject *kobj); diff --git a/drivers/gpu/drm/i915/gt/intel_renderstate.h b/drivers/gpu/drm/i915/gt/intel_renderstate.h index 4da4c5234ef0..5e8c28c7e770 100644 --- a/drivers/gpu/drm/i915/gt/intel_renderstate.h +++ b/drivers/gpu/drm/i915/gt/intel_renderstate.h @@ -7,7 +7,7 @@ #define _INTEL_RENDERSTATE_H_ #include -#include "i915_gem.h" + #include "i915_gem_ww.h" struct i915_request; diff --git a/drivers/gpu/drm/i915/gt/intel_ring.h b/drivers/gpu/drm/i915/gt/intel_ring.h index 1b32dadfb8c3..3504f5346493 100644 --- a/drivers/gpu/drm/i915/gt/intel_ring.h +++ b/drivers/gpu/drm/i915/gt/intel_ring.h @@ -6,7 +6,7 @@ #ifndef INTEL_RING_H #define INTEL_RING_H -#include "i915_gem.h" /* GEM_BUG_ON */ +#include "i915_debug.h" #include "i915_request.h" #include "intel_ring_types.h" diff --git a/drivers/gpu/drm/i915/gt/intel_sseu.h b/drivers/gpu/drm/i915/gt/intel_sseu.h index aa87d3832d60..0b2e4d6fd4b5 100644 --- a/drivers/gpu/drm/i915/gt/intel_sseu.h +++ b/drivers/gpu/drm/i915/gt/intel_sseu.h @@ -9,11 +9,12 @@ #include #include -#include "i915_gem.h" +#include "i915_utils.h" struct drm_i915_private; -struct intel_gt; struct drm_printer; +struct intel_gt; +struct seq_file; /* * Maximum number of slices on older platforms. Slices no longer exist diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h index 42cb7a9a6199..2e7e43533e7c 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_fwif.h @@ -19,6 +19,8 @@ #include "abi/guc_klvs_abi.h" #include "abi/guc_messages_abi.h" +#include "i915_debug.h" + /* Payload length only i.e. don't include G2H header length */ #define G2H_LEN_DW_SCHED_CONTEXT_MODE_SET 2 #define G2H_LEN_DW_DEREGISTER_CONTEXT 1 diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h index 18007e639be9..475e1c95597a 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_log.h @@ -11,7 +11,6 @@ #include #include "intel_guc_fwif.h" -#include "i915_gem.h" struct intel_guc; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h index 4f169035f504..bc4095837476 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h @@ -9,7 +9,6 @@ #include #include "intel_uc_fw_abi.h" #include "intel_device_info.h" -#include "i915_gem.h" #include "i915_vma.h" struct drm_printer; diff --git a/drivers/gpu/drm/i915/i915_debug.h b/drivers/gpu/drm/i915/i915_debug.h new file mode 100644 index 000000000000..6b1867fa4b52 --- /dev/null +++ b/drivers/gpu/drm/i915/i915_debug.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2022 Intel Corporation + */ + +#ifndef __I915_DEBUG_H__ +#define __I915_DEBUG_H__ + +#include +#include + +#include "i915_utils.h" + +#ifdef CONFIG_DRM_I915_DEBUG_GEM + +#define GEM_SHOW_DEBUG() drm_debug_enabled(DRM_UT_DRIVER) + +#ifdef CONFIG_DRM_I915_DEBUG_GEM_ONCE +#define __GEM_BUG(cond) BUG() +#else +#define __GEM_BUG(cond) \ + WARN(1, "%s:%d GEM_BUG_ON(%s)\n", __func__, __LINE__, __stringify(cond)) +#endif + +#define GEM_BUG_ON(condition) do { if (unlikely((condition))) { \ + GEM_TRACE_ERR("%s:%d GEM_BUG_ON(%s)\n", \ + __func__, __LINE__, __stringify(condition)); \ + GEM_TRACE_DUMP(); \ + __GEM_BUG(condition); \ + } \ + } while(0) +#define GEM_WARN_ON(expr) WARN_ON(expr) + +#define GEM_DEBUG_WARN_ON(expr) GEM_WARN_ON(expr) + +#else + +#define GEM_SHOW_DEBUG() (0) + +#define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr) +#define GEM_WARN_ON(expr) ({ unlikely(!!(expr)); }) + +#define GEM_DEBUG_WARN_ON(expr) ({ BUILD_BUG_ON_INVALID(expr); 0; }) +#endif + +#if IS_ENABLED(CONFIG_DRM_I915_TRACE_GEM) +#define GEM_TRACE(...) trace_printk(__VA_ARGS__) +#define GEM_TRACE_ERR(...) do { \ + pr_err(__VA_ARGS__); \ + trace_printk(__VA_ARGS__); \ +} while (0) +#define GEM_TRACE_DUMP() \ + do { ftrace_dump(DUMP_ALL); __add_taint_for_CI(TAINT_WARN); } while (0) +#define GEM_TRACE_DUMP_ON(expr) \ + do { if (expr) GEM_TRACE_DUMP(); } while (0) +#else +#define GEM_TRACE(...) do { } while (0) +#define GEM_TRACE_ERR(...) do { } while (0) +#define GEM_TRACE_DUMP() do { } while (0) +#define GEM_TRACE_DUMP_ON(expr) BUILD_BUG_ON_INVALID(expr) +#endif + +#endif /* __I915_DEBUG_H__ */ diff --git a/drivers/gpu/drm/i915/i915_drm_client.c b/drivers/gpu/drm/i915/i915_drm_client.c index 18d38cb59923..f2241bf61b5d 100644 --- a/drivers/gpu/drm/i915/i915_drm_client.c +++ b/drivers/gpu/drm/i915/i915_drm_client.c @@ -14,7 +14,6 @@ #include "gem/i915_gem_context.h" #include "i915_drm_client.h" #include "i915_file_private.h" -#include "i915_gem.h" #include "i915_utils.h" void i915_drm_clients_init(struct i915_drm_clients *clients, diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index c3854b8a014f..5d4607535f2a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -62,7 +62,6 @@ #include "gt/uc/intel_uc.h" #include "i915_drm_client.h" -#include "i915_gem.h" #include "i915_gpu_error.h" #include "i915_params.h" #include "i915_perf_types.h" diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h index 68d8d52bd541..4403221c16a5 100644 --- a/drivers/gpu/drm/i915/i915_gem.h +++ b/drivers/gpu/drm/i915/i915_gem.h @@ -25,63 +25,6 @@ #ifndef __I915_GEM_H__ #define __I915_GEM_H__ -#include - -#include - -#include "i915_utils.h" - -struct drm_i915_private; - -#ifdef CONFIG_DRM_I915_DEBUG_GEM - -#define GEM_SHOW_DEBUG() drm_debug_enabled(DRM_UT_DRIVER) - -#ifdef CONFIG_DRM_I915_DEBUG_GEM_ONCE -#define __GEM_BUG(cond) BUG() -#else -#define __GEM_BUG(cond) \ - WARN(1, "%s:%d GEM_BUG_ON(%s)\n", __func__, __LINE__, __stringify(cond)) -#endif - -#define GEM_BUG_ON(condition) do { if (unlikely((condition))) { \ - GEM_TRACE_ERR("%s:%d GEM_BUG_ON(%s)\n", \ - __func__, __LINE__, __stringify(condition)); \ - GEM_TRACE_DUMP(); \ - __GEM_BUG(condition); \ - } \ - } while(0) -#define GEM_WARN_ON(expr) WARN_ON(expr) - -#define GEM_DEBUG_WARN_ON(expr) GEM_WARN_ON(expr) - -#else - -#define GEM_SHOW_DEBUG() (0) - -#define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr) -#define GEM_WARN_ON(expr) ({ unlikely(!!(expr)); }) - -#define GEM_DEBUG_WARN_ON(expr) ({ BUILD_BUG_ON_INVALID(expr); 0; }) -#endif - -#if IS_ENABLED(CONFIG_DRM_I915_TRACE_GEM) -#define GEM_TRACE(...) trace_printk(__VA_ARGS__) -#define GEM_TRACE_ERR(...) do { \ - pr_err(__VA_ARGS__); \ - trace_printk(__VA_ARGS__); \ -} while (0) -#define GEM_TRACE_DUMP() \ - do { ftrace_dump(DUMP_ALL); __add_taint_for_CI(TAINT_WARN); } while (0) -#define GEM_TRACE_DUMP_ON(expr) \ - do { if (expr) GEM_TRACE_DUMP(); } while (0) -#else -#define GEM_TRACE(...) do { } while (0) -#define GEM_TRACE_ERR(...) do { } while (0) -#define GEM_TRACE_DUMP() do { } while (0) -#define GEM_TRACE_DUMP_ON(expr) BUILD_BUG_ON_INVALID(expr) -#endif - #define I915_GEM_IDLE_TIMEOUT (HZ / 5) #endif /* __I915_GEM_H__ */ diff --git a/drivers/gpu/drm/i915/i915_gpu_error.h b/drivers/gpu/drm/i915/i915_gpu_error.h index 55a143b92d10..86ea6df83e72 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.h +++ b/drivers/gpu/drm/i915/i915_gpu_error.h @@ -20,7 +20,6 @@ #include "intel_device_info.h" -#include "i915_gem.h" #include "i915_gem_gtt.h" #include "i915_params.h" #include "i915_scheduler.h" diff --git a/drivers/gpu/drm/i915/i915_ioctl.c b/drivers/gpu/drm/i915/i915_ioctl.c index 06a10ccea80b..fb7075af3e13 100644 --- a/drivers/gpu/drm/i915/i915_ioctl.c +++ b/drivers/gpu/drm/i915/i915_ioctl.c @@ -6,7 +6,6 @@ #include "gt/intel_engine_regs.h" #include "i915_drv.h" -#include "i915_gem.h" #include "i915_ioctl.h" #include "i915_reg.h" #include "intel_runtime_pm.h" diff --git a/drivers/gpu/drm/i915/i915_request.h b/drivers/gpu/drm/i915/i915_request.h index 28b1f9db5487..137474003719 100644 --- a/drivers/gpu/drm/i915/i915_request.h +++ b/drivers/gpu/drm/i915/i915_request.h @@ -36,7 +36,6 @@ #include "gt/intel_engine_types.h" #include "gt/intel_timeline_types.h" -#include "i915_gem.h" #include "i915_scheduler.h" #include "i915_selftest.h" #include "i915_sw_fence.h" diff --git a/drivers/gpu/drm/i915/i915_scatterlist.h b/drivers/gpu/drm/i915/i915_scatterlist.h index 12c6a1684081..6cf7cf8b3d65 100644 --- a/drivers/gpu/drm/i915/i915_scatterlist.h +++ b/drivers/gpu/drm/i915/i915_scatterlist.h @@ -11,7 +11,7 @@ #include #include -#include "i915_gem.h" +#include "i915_debug.h" struct drm_mm_node; struct ttm_resource; diff --git a/drivers/gpu/drm/i915/i915_syncmap.c b/drivers/gpu/drm/i915/i915_syncmap.c index 60404dbb2e9f..1e9547e35e4d 100644 --- a/drivers/gpu/drm/i915/i915_syncmap.c +++ b/drivers/gpu/drm/i915/i915_syncmap.c @@ -24,10 +24,9 @@ #include -#include "i915_syncmap.h" - -#include "i915_gem.h" /* GEM_BUG_ON() */ +#include "i915_debug.h" #include "i915_selftest.h" +#include "i915_syncmap.h" #define SHIFT ilog2(KSYNCMAP) #define MASK (KSYNCMAP - 1) diff --git a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c index a5109548abc0..5d5a8bab4b0b 100644 --- a/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c +++ b/drivers/gpu/drm/i915/i915_ttm_buddy_manager.c @@ -10,10 +10,9 @@ #include +#include "i915_debug.h" #include "i915_ttm_buddy_manager.h" -#include "i915_gem.h" - struct i915_ttm_buddy_manager { struct ttm_resource_manager manager; struct drm_buddy mm; diff --git a/drivers/gpu/drm/i915/i915_vma_resource.h b/drivers/gpu/drm/i915/i915_vma_resource.h index 5d8427caa2ba..d249f4047ae0 100644 --- a/drivers/gpu/drm/i915/i915_vma_resource.h +++ b/drivers/gpu/drm/i915/i915_vma_resource.h @@ -9,7 +9,6 @@ #include #include -#include "i915_gem.h" #include "i915_scatterlist.h" #include "i915_sw_fence.h" #include "intel_runtime_pm.h" From patchwork Fri Jun 3 13:05:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 12869055 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 188C3C433EF for ; Fri, 3 Jun 2022 13:06:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9EC1D1134D3; Fri, 3 Jun 2022 13:06:18 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98FC911365D for ; Fri, 3 Jun 2022 13:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654261577; x=1685797577; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zkdfu5zNedSj+vPLHF0BtpeMLB2e9TjigVOYb7YJ+j4=; b=bKsAUxoRvZhD7tksDojacerNzoHUxN6fN+uE+5ZdKLicKyTWXC9M2FDX W7869FTVp4EHA31jZdYinM2gDCHtOGiB0Rpjdhxm5bl/fLtfoYSGfwzmz gWvPVPDK1ooLRh6aJhPaBdZLRDQR9urTyjblknV4g5Arl9nbRx4kb0Oe8 85EJuQdUfHfZQusdZNhT6BK4vc/7/44st8FKbdJSnbyufOXlrRosOzGXO z/4FT7z+zlzVpPnr+M1lB/ZRyYWBGeKx9cTV9HEM8S5CTQTQlqmXBQCb0 uNwOT2pOcrgRDhiC2bnp07vPDFpxfSDkDAPCqxIVWUF8xLdEt8SzxGOLu g==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="263897468" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="263897468" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:17 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="607389777" Received: from richardf-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.27]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:16 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Jun 2022 16:05:56 +0300 Message-Id: <1a8b6339d30fcb29976e2e1839c8a9203d557dd2.1654261471.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 3/7] drm/i915: un-inline i915_gem_drain_* functions 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: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" As best I can tell these aren't used in the kind of hotpaths that mandate using static inline. They do make header cleanup harder, though, so un-inline. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/i915_drv.h | 39 ++------------------------------- drivers/gpu/drm/i915/i915_gem.c | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 37 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 5d4607535f2a..c3b2cbf8bfb7 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1364,43 +1364,8 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, void i915_gem_init_early(struct drm_i915_private *dev_priv); void i915_gem_cleanup_early(struct drm_i915_private *dev_priv); -static inline void i915_gem_drain_freed_objects(struct drm_i915_private *i915) -{ - /* - * A single pass should suffice to release all the freed objects (along - * most call paths) , but be a little more paranoid in that freeing - * the objects does take a little amount of time, during which the rcu - * callbacks could have added new objects into the freed list, and - * armed the work again. - */ - while (atomic_read(&i915->mm.free_count)) { - flush_delayed_work(&i915->mm.free_work); - flush_delayed_work(&i915->bdev.wq); - rcu_barrier(); - } -} - -static inline void i915_gem_drain_workqueue(struct drm_i915_private *i915) -{ - /* - * Similar to objects above (see i915_gem_drain_freed-objects), in - * general we have workers that are armed by RCU and then rearm - * themselves in their callbacks. To be paranoid, we need to - * drain the workqueue a second time after waiting for the RCU - * grace period so that we catch work queued via RCU from the first - * pass. As neither drain_workqueue() nor flush_workqueue() report - * a result, we make an assumption that we only don't require more - * than 3 passes to catch all _recursive_ RCU delayed work. - * - */ - int pass = 3; - do { - flush_workqueue(i915->wq); - rcu_barrier(); - i915_gem_drain_freed_objects(i915); - } while (--pass); - drain_workqueue(i915->wq); -} +void i915_gem_drain_freed_objects(struct drm_i915_private *i915); +void i915_gem_drain_workqueue(struct drm_i915_private *i915); struct i915_vma * __must_check i915_gem_object_ggtt_pin_ww(struct drm_i915_gem_object *obj, diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 702e5b89be22..5a6bd2547f04 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1085,6 +1085,44 @@ i915_gem_madvise_ioctl(struct drm_device *dev, void *data, return err; } +void i915_gem_drain_freed_objects(struct drm_i915_private *i915) +{ + /* + * A single pass should suffice to release all the freed objects (along + * most call paths) , but be a little more paranoid in that freeing + * the objects does take a little amount of time, during which the rcu + * callbacks could have added new objects into the freed list, and + * armed the work again. + */ + while (atomic_read(&i915->mm.free_count)) { + flush_delayed_work(&i915->mm.free_work); + flush_delayed_work(&i915->bdev.wq); + rcu_barrier(); + } +} + +void i915_gem_drain_workqueue(struct drm_i915_private *i915) +{ + /* + * Similar to objects above (see i915_gem_drain_freed-objects), in + * general we have workers that are armed by RCU and then rearm + * themselves in their callbacks. To be paranoid, we need to + * drain the workqueue a second time after waiting for the RCU + * grace period so that we catch work queued via RCU from the first + * pass. As neither drain_workqueue() nor flush_workqueue() report + * a result, we make an assumption that we only don't require more + * than 3 passes to catch all _recursive_ RCU delayed work. + * + */ + int pass = 3; + do { + flush_workqueue(i915->wq); + rcu_barrier(); + i915_gem_drain_freed_objects(i915); + } while (--pass); + drain_workqueue(i915->wq); +} + int i915_gem_init(struct drm_i915_private *dev_priv) { int ret; From patchwork Fri Jun 3 13:05:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 12869059 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 99CCCC433EF for ; Fri, 3 Jun 2022 13:06:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 34343113666; Fri, 3 Jun 2022 13:06:43 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2014113666 for ; Fri, 3 Jun 2022 13:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654261601; x=1685797601; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Hy3twg5hINi+T2pYICCxGNq9cwSbjb/oostZKYBbBIY=; b=H82Y4EKhEr5xOPT5mlNxePpodXm6L8eBVsKhvH47MJ0oiWvjMlA2942t kFxDzHo7dfr/Hrrp/GIJSMz8zNuwtpyM4IiDV2yKCpKt56yc8S24RTKew V6gMJgh2aQjucRcqCBz5PTmLWZUiSbnCoQZqml0bQFOeEz/eaYiyGREJL wnAfff66QaTDpkGzoETW9okzezrP3/lxATs5+AamgAeqz+Tr3D5MFjk30 ye+DxWeA6HU0t/fcCnJYNE7lEBoaw0BS7DXpeZudde+5RRJJ/e+SVoQhC j3MuTT8DOaf3RnyOZYkN86kxuXcoiEHd4rrinOOhFmpT0Iqu+eXMZ0pAj A==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="362615658" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="362615658" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:21 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="578015461" Received: from richardf-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.27]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:20 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Jun 2022 16:05:57 +0300 Message-Id: <8488036303d01479225564438f0d7b8e711990d2.1654261471.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 4/7] drm/i915/gem: split out the gem stuff from i915_drv.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: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Turn i915_gem.h into a useful header for declaring the functions in i915_gem.c. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/display/intel_dpt.c | 1 + drivers/gpu/drm/i915/display/intel_dsb.c | 1 + drivers/gpu/drm/i915/display/intel_overlay.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_domain.c | 1 + .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_mman.c | 5 ++- drivers/gpu/drm/i915/gem/i915_gem_object.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_phys.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_pm.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_shrinker.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 1 + .../i915/gem/selftests/i915_gem_coherency.c | 1 + .../drm/i915/gem/selftests/i915_gem_context.c | 1 + .../drm/i915/gem/selftests/i915_gem_mman.c | 1 + drivers/gpu/drm/i915/gt/intel_ggtt.c | 10 ++--- drivers/gpu/drm/i915/gt/selftest_migrate.c | 2 + drivers/gpu/drm/i915/gt/selftest_timeline.c | 1 + drivers/gpu/drm/i915/gvt/scheduler.c | 1 + drivers/gpu/drm/i915/i915_debugfs.c | 1 + drivers/gpu/drm/i915/i915_driver.c | 3 +- drivers/gpu/drm/i915/i915_drv.h | 38 ---------------- drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/i915_gem.h | 44 +++++++++++++++++++ drivers/gpu/drm/i915/i915_perf.c | 1 + drivers/gpu/drm/i915/intel_gvt.c | 1 + .../gpu/drm/i915/selftests/i915_gem_evict.c | 2 +- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 +- .../gpu/drm/i915/selftests/i915_selftest.c | 1 + drivers/gpu/drm/i915/selftests/i915_vma.c | 2 +- .../drm/i915/selftests/intel_memory_region.c | 1 + 31 files changed, 82 insertions(+), 50 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dpt.c b/drivers/gpu/drm/i915/display/intel_dpt.c index fb0e7e79e0cd..9f374c964549 100644 --- a/drivers/gpu/drm/i915/display/intel_dpt.c +++ b/drivers/gpu/drm/i915/display/intel_dpt.c @@ -7,6 +7,7 @@ #include "gt/gen8_ppgtt.h" #include "i915_drv.h" +#include "i915_gem.h" #include "intel_display_types.h" #include "intel_dpt.h" #include "intel_fb.h" diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c index c4affcb216fd..b48fb10efb39 100644 --- a/drivers/gpu/drm/i915/display/intel_dsb.c +++ b/drivers/gpu/drm/i915/display/intel_dsb.c @@ -7,6 +7,7 @@ #include "gem/i915_gem_internal.h" #include "i915_drv.h" +#include "i915_gem.h" #include "intel_de.h" #include "intel_display_types.h" diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c index ee46561b5ae8..dab4cd42c91b 100644 --- a/drivers/gpu/drm/i915/display/intel_overlay.c +++ b/drivers/gpu/drm/i915/display/intel_overlay.c @@ -34,6 +34,7 @@ #include "gt/intel_ring.h" #include "i915_drv.h" +#include "i915_gem.h" #include "i915_reg.h" #include "intel_de.h" #include "intel_display_types.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_domain.c b/drivers/gpu/drm/i915/gem/i915_gem_domain.c index 3e5d6057b3ef..68d96fefb91b 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_domain.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_domain.c @@ -8,6 +8,7 @@ #include "gt/intel_gt.h" #include "i915_drv.h" +#include "i915_gem.h" #include "i915_gem_clflush.h" #include "i915_gem_domain.h" #include "i915_gem_gtt.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c index 30fe847c6664..eb7ed00bf9f6 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c @@ -27,6 +27,7 @@ #include "i915_cmd_parser.h" #include "i915_drv.h" #include "i915_file_private.h" +#include "i915_gem.h" #include "i915_gem_clflush.h" #include "i915_gem_context.h" #include "i915_gem_evict.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index 0c5c43852e24..ef36d1f72724 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -15,15 +15,16 @@ #include "gt/intel_gt_requests.h" #include "i915_drv.h" +#include "i915_gem.h" #include "i915_gem_evict.h" #include "i915_gem_gtt.h" #include "i915_gem_ioctls.h" -#include "i915_gem_object.h" #include "i915_gem_mman.h" +#include "i915_gem_object.h" +#include "i915_gem_ttm.h" #include "i915_mm.h" #include "i915_trace.h" #include "i915_user_extensions.h" -#include "i915_gem_ttm.h" #include "i915_vma.h" static inline bool diff --git a/drivers/gpu/drm/i915/gem/i915_gem_object.c b/drivers/gpu/drm/i915/gem/i915_gem_object.c index 06b1b188ce5a..1a34a8057ab3 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_object.c @@ -32,6 +32,7 @@ #include "i915_drv.h" #include "i915_file_private.h" +#include "i915_gem.h" #include "i915_gem_clflush.h" #include "i915_gem_context.h" #include "i915_gem_dmabuf.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/i915_gem_phys.c index 0d0e46dae559..74d2efe8915c 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_phys.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_phys.c @@ -12,6 +12,7 @@ #include "gt/intel_gt.h" #include "i915_drv.h" +#include "i915_gem.h" #include "i915_gem_object.h" #include "i915_gem_region.h" #include "i915_gem_tiling.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_pm.c index 00359ec9d58b..cd2519a8b373 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pm.c @@ -12,6 +12,7 @@ #include "i915_driver.h" #include "i915_drv.h" +#include "i915_gem.h" #if defined(CONFIG_X86) #include diff --git a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c index 1030053571a2..f76f7f6e49f1 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_shrinker.c @@ -15,6 +15,7 @@ #include "gt/intel_gt_requests.h" +#include "i915_gem.h" #include "i915_trace.h" static bool swap_available(void) 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 a10716f4e717..1602b66ab459 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c @@ -7,6 +7,7 @@ #include "i915_deps.h" #include "i915_drv.h" +#include "i915_gem.h" #include "intel_memory_region.h" #include "intel_region_ttm.h" diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c index 094f06b4ce33..360bbbf1e396 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c @@ -40,6 +40,7 @@ #include #include "i915_drv.h" +#include "i915_gem.h" #include "i915_gem_ioctls.h" #include "i915_gem_object.h" #include "i915_gem_userptr.h" diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c index 13b088cc787e..3433647fc57b 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c @@ -12,6 +12,7 @@ #include "gt/intel_gt_pm.h" #include "gt/intel_ring.h" +#include "i915_gem.h" #include "i915_selftest.h" #include "selftests/i915_random.h" diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c index 93a67422ca3b..2b34befad24b 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c @@ -14,6 +14,7 @@ #include "gt/intel_gt.h" #include "gt/intel_gt_requests.h" #include "gt/intel_reset.h" +#include "i915_gem.h" #include "i915_selftest.h" #include "gem/selftests/igt_gem_utils.h" diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index 5bc93a1ce3e3..7af8c309afb5 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -18,6 +18,7 @@ #include "i915_ttm_buddy_manager.h" #include "huge_gem_object.h" +#include "i915_gem.h" #include "i915_selftest.h" #include "selftests/i915_random.h" #include "selftests/igt_flush_test.h" diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c index e6b2eb122ad7..6e8511bde456 100644 --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c @@ -11,16 +11,16 @@ #include "gem/i915_gem_lmem.h" -#include "intel_gt.h" -#include "intel_gt_gmch.h" -#include "intel_gt_regs.h" +#include "gen8_ppgtt.h" #include "i915_drv.h" +#include "i915_gem.h" #include "i915_scatterlist.h" #include "i915_utils.h" #include "i915_vgpu.h" - +#include "intel_gt.h" +#include "intel_gt_gmch.h" +#include "intel_gt_regs.h" #include "intel_gtt.h" -#include "gen8_ppgtt.h" static void i915_ggtt_color_adjust(const struct drm_mm_node *node, unsigned long color, diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c index 2b0c87999949..91a4f4cd37d3 100644 --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c @@ -9,6 +9,8 @@ #include "selftests/i915_random.h" +#include "i915_gem.h" + static const unsigned int sizes[] = { SZ_4K, SZ_64K, diff --git a/drivers/gpu/drm/i915/gt/selftest_timeline.c b/drivers/gpu/drm/i915/gt/selftest_timeline.c index 522d0190509c..badcdfd69bc4 100644 --- a/drivers/gpu/drm/i915/gt/selftest_timeline.c +++ b/drivers/gpu/drm/i915/gt/selftest_timeline.c @@ -6,6 +6,7 @@ #include #include +#include "i915_gem.h" #include "intel_context.h" #include "intel_engine_heartbeat.h" #include "intel_engine_pm.h" diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index d6fe94cd0fdb..a1f93f45d19e 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c @@ -43,6 +43,7 @@ #include "gt/intel_ring.h" #include "i915_drv.h" +#include "i915_gem.h" #include "i915_gem_gtt.h" #include "i915_perf_oa_regs.h" #include "gvt.h" diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 94e5c29d2ee3..25ef6a41f2d2 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -49,6 +49,7 @@ #include "i915_debugfs.h" #include "i915_debugfs_params.h" #include "i915_driver.h" +#include "i915_gem.h" #include "i915_irq.h" #include "i915_scheduler.h" #include "intel_mchbar_regs.h" diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c index d26dcca7e654..f154914d4bfc 100644 --- a/drivers/gpu/drm/i915/i915_driver.c +++ b/drivers/gpu/drm/i915/i915_driver.c @@ -74,11 +74,12 @@ #include "pxp/intel_pxp_pm.h" -#include "i915_file_private.h" #include "i915_debugfs.h" #include "i915_driver.h" #include "i915_drm_client.h" #include "i915_drv.h" +#include "i915_file_private.h" +#include "i915_gem.h" #include "i915_getparam.h" #include "i915_ioc32.h" #include "i915_ioctl.h" diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index c3b2cbf8bfb7..fa8f208c8939 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1360,44 +1360,6 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915, #define HAS_ONE_EU_PER_FUSE_BIT(i915) (INTEL_INFO(i915)->has_one_eu_per_fuse_bit) -/* i915_gem.c */ -void i915_gem_init_early(struct drm_i915_private *dev_priv); -void i915_gem_cleanup_early(struct drm_i915_private *dev_priv); - -void i915_gem_drain_freed_objects(struct drm_i915_private *i915); -void i915_gem_drain_workqueue(struct drm_i915_private *i915); - -struct i915_vma * __must_check -i915_gem_object_ggtt_pin_ww(struct drm_i915_gem_object *obj, - struct i915_gem_ww_ctx *ww, - const struct i915_ggtt_view *view, - u64 size, u64 alignment, u64 flags); - -struct i915_vma * __must_check -i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj, - const struct i915_ggtt_view *view, - u64 size, u64 alignment, u64 flags); - -int i915_gem_object_unbind(struct drm_i915_gem_object *obj, - unsigned long flags); -#define I915_GEM_OBJECT_UNBIND_ACTIVE BIT(0) -#define I915_GEM_OBJECT_UNBIND_BARRIER BIT(1) -#define I915_GEM_OBJECT_UNBIND_TEST BIT(2) -#define I915_GEM_OBJECT_UNBIND_VM_TRYLOCK BIT(3) -#define I915_GEM_OBJECT_UNBIND_ASYNC BIT(4) - -void i915_gem_runtime_suspend(struct drm_i915_private *dev_priv); - -int __must_check i915_gem_set_global_seqno(struct drm_device *dev, u32 seqno); - -int __must_check i915_gem_init(struct drm_i915_private *dev_priv); -void i915_gem_driver_register(struct drm_i915_private *i915); -void i915_gem_driver_unregister(struct drm_i915_private *i915); -void i915_gem_driver_remove(struct drm_i915_private *dev_priv); -void i915_gem_driver_release(struct drm_i915_private *dev_priv); - -int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file); - /* intel_device_info.c */ static inline struct intel_device_info * mkwrite_device_info(struct drm_i915_private *dev_priv) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 5a6bd2547f04..665282237b45 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -56,6 +56,7 @@ #include "i915_drv.h" #include "i915_file_private.h" +#include "i915_gem.h" #include "i915_trace.h" #include "i915_vgpu.h" #include "intel_pm.h" diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h index 4403221c16a5..98c5c1572307 100644 --- a/drivers/gpu/drm/i915/i915_gem.h +++ b/drivers/gpu/drm/i915/i915_gem.h @@ -25,6 +25,50 @@ #ifndef __I915_GEM_H__ #define __I915_GEM_H__ +#include + +struct drm_file; +struct drm_i915_gem_object; +struct drm_i915_private; +struct i915_gem_ww_ctx; +struct i915_ggtt_view; +struct i915_vma; + #define I915_GEM_IDLE_TIMEOUT (HZ / 5) +void i915_gem_init_early(struct drm_i915_private *i915); +void i915_gem_cleanup_early(struct drm_i915_private *i915); + +void i915_gem_drain_freed_objects(struct drm_i915_private *i915); +void i915_gem_drain_workqueue(struct drm_i915_private *i915); + +struct i915_vma * __must_check +i915_gem_object_ggtt_pin_ww(struct drm_i915_gem_object *obj, + struct i915_gem_ww_ctx *ww, + const struct i915_ggtt_view *view, + u64 size, u64 alignment, u64 flags); + +struct i915_vma * __must_check +i915_gem_object_ggtt_pin(struct drm_i915_gem_object *obj, + const struct i915_ggtt_view *view, + u64 size, u64 alignment, u64 flags); + +int i915_gem_object_unbind(struct drm_i915_gem_object *obj, + unsigned long flags); +#define I915_GEM_OBJECT_UNBIND_ACTIVE BIT(0) +#define I915_GEM_OBJECT_UNBIND_BARRIER BIT(1) +#define I915_GEM_OBJECT_UNBIND_TEST BIT(2) +#define I915_GEM_OBJECT_UNBIND_VM_TRYLOCK BIT(3) +#define I915_GEM_OBJECT_UNBIND_ASYNC BIT(4) + +void i915_gem_runtime_suspend(struct drm_i915_private *i915); + +int __must_check i915_gem_init(struct drm_i915_private *i915); +void i915_gem_driver_register(struct drm_i915_private *i915); +void i915_gem_driver_unregister(struct drm_i915_private *i915); +void i915_gem_driver_remove(struct drm_i915_private *i915); +void i915_gem_driver_release(struct drm_i915_private *i915); + +int i915_gem_open(struct drm_i915_private *i915, struct drm_file *file); + #endif /* __I915_GEM_H__ */ diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 1577ab6754db..0066557b7ccc 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -211,6 +211,7 @@ #include "i915_drv.h" #include "i915_file_private.h" +#include "i915_gem.h" #include "i915_perf.h" #include "i915_perf_oa_regs.h" diff --git a/drivers/gpu/drm/i915/intel_gvt.c b/drivers/gpu/drm/i915/intel_gvt.c index e98b6d69a91a..e4e391bff938 100644 --- a/drivers/gpu/drm/i915/intel_gvt.c +++ b/drivers/gpu/drm/i915/intel_gvt.c @@ -22,6 +22,7 @@ */ #include "i915_drv.h" +#include "i915_gem.h" #include "i915_vgpu.h" #include "intel_gvt.h" #include "gem/i915_gem_dmabuf.h" diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c index 8c6517d29b8e..bac6bbad311d 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c @@ -28,8 +28,8 @@ #include "gem/selftests/mock_context.h" #include "gt/intel_gt.h" +#include "i915_gem.h" #include "i915_selftest.h" - #include "igt_flush_test.h" #include "lib_sw_fence.h" #include "mock_drm.h" diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index 8633bec18fa7..ecf343e347ee 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -33,14 +33,14 @@ #include "gt/intel_gpu_commands.h" #include "gt/intel_gtt.h" +#include "i915_gem.h" #include "i915_random.h" #include "i915_selftest.h" #include "i915_vma_resource.h" - +#include "igt_flush_test.h" #include "mock_drm.h" #include "mock_gem_device.h" #include "mock_gtt.h" -#include "igt_flush_test.h" static void cleanup_freed_objects(struct drm_i915_private *i915) { diff --git a/drivers/gpu/drm/i915/selftests/i915_selftest.c b/drivers/gpu/drm/i915/selftests/i915_selftest.c index c4e932368b37..9a8bda364b1b 100644 --- a/drivers/gpu/drm/i915/selftests/i915_selftest.c +++ b/drivers/gpu/drm/i915/selftests/i915_selftest.c @@ -26,6 +26,7 @@ #include "gt/intel_gt_pm.h" #include "i915_driver.h" #include "i915_drv.h" +#include "i915_gem.h" #include "i915_selftest.h" #include "igt_flush_test.h" diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c index 6921ba128015..97da5f4b8d9c 100644 --- a/drivers/gpu/drm/i915/selftests/i915_vma.c +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c @@ -28,9 +28,9 @@ #include "gem/i915_gem_internal.h" #include "gem/selftests/mock_context.h" +#include "i915_gem.h" #include "i915_scatterlist.h" #include "i915_selftest.h" - #include "mock_gem_device.h" #include "mock_gtt.h" diff --git a/drivers/gpu/drm/i915/selftests/intel_memory_region.c b/drivers/gpu/drm/i915/selftests/intel_memory_region.c index 73eb53edb8de..2065bf321491 100644 --- a/drivers/gpu/drm/i915/selftests/intel_memory_region.c +++ b/drivers/gpu/drm/i915/selftests/intel_memory_region.c @@ -24,6 +24,7 @@ #include "gt/intel_engine_user.h" #include "gt/intel_gt.h" #include "gt/intel_migrate.h" +#include "i915_gem.h" #include "i915_memcpy.h" #include "i915_ttm_buddy_manager.h" #include "selftests/igt_flush_test.h" From patchwork Fri Jun 3 13:05:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 12869056 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 67493C43334 for ; Fri, 3 Jun 2022 13:06:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DACD71134C5; Fri, 3 Jun 2022 13:06:26 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 24ED81134C5 for ; Fri, 3 Jun 2022 13:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654261586; x=1685797586; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HatwjPwiowOU2o0invSZXIyK4F22MW/hPq6xsB7WG1o=; b=ehoOKYozQO812MWcX+aq+E4oqdF0/tHDI8Wxd8rEaMiGsyShFZ0A1C8j bnnblxsWlzwFq00J421ofK3kT3u2+QJCAEjQBviuMzctCTOiyYUlSpq1J FtuIS9V4sBMStaWwQb0TH/jCv7MxppS9q1jyxw1b6vzs+ZUB08DawCfIo 2SfGkNUK5epBFPG98njSIV4+ECJWvc/D+jpTdag9MNCquwPploSek7xWp igqSHxaBTuk+0p4jml3a2saSPz92KR2eA04ktRRc9NRY5DAdOy4l1+DBL YLdWmB/gkvBJl+iUj9pIhAB3CD54I64ry20Nau6KMtiLnWFejXLmqtTm7 g==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="263897491" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="263897491" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:25 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="553322492" Received: from richardf-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.27]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:24 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Jun 2022 16:05:58 +0300 Message-Id: <6490a5aa5d148cec99b7cf59ec40146a099ac9b2.1654261471.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 5/7] drm/i915/drv: drop intel_bios.h include 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: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" No longer needed after panel data was moved. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/i915_drv.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index fa8f208c8939..5093fe824789 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -37,7 +37,6 @@ #include #include -#include "display/intel_bios.h" #include "display/intel_cdclk.h" #include "display/intel_display.h" #include "display/intel_display_power.h" From patchwork Fri Jun 3 13:05:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 12869057 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 D6192C43334 for ; Fri, 3 Jun 2022 13:06:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 24082113665; Fri, 3 Jun 2022 13:06:31 +0000 (UTC) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2BF62113665 for ; Fri, 3 Jun 2022 13:06:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654261590; x=1685797590; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y0iaX2FPfyXEwqOt5RufA2PUu6Q0nkRBdf+QG15AWak=; b=U9yF9IFuqbx9BXXfF54SWuP0a5dBKm9R64RzXkm43zpGxlyzJCk+9krx MBYmf253mZ8H7sCGcwTp7FTJzfnyOyTMUJgacGx+tLhB/Uz5yKcTz1aBX 2mdsaFeJOnZTibR/lRov2D6J0s8ml+6Gt3NMSfyl+Ht4jOc+sLI0v9lQx FdBbpCHKT/1QhZEETBAxKf7oV5h2DoA/o7lC3RWOsyA1xyUkkC12n+AHa /ykMQo8hvco5cErl70FimkvXgkwBZDo18i5X4QQTBZKhcfhYlt+BfokH2 /2G2uicAJ+FVFOxnezEzQKl978ooUtLiNvQ3CYYkLAsZswcGzdQf6RHjn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="336905966" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="336905966" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:29 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="757468167" Received: from richardf-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.27]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:28 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Jun 2022 16:05:59 +0300 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 6/7] drm/i915/client: only include what's needed 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: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Only the uapi header is required. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/i915_drm_client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drm_client.h b/drivers/gpu/drm/i915/i915_drm_client.h index f796c5e8e060..69496af996d9 100644 --- a/drivers/gpu/drm/i915/i915_drm_client.h +++ b/drivers/gpu/drm/i915/i915_drm_client.h @@ -11,7 +11,7 @@ #include #include -#include "gt/intel_engine_types.h" +#include #define I915_LAST_UABI_ENGINE_CLASS I915_ENGINE_CLASS_COMPUTE From patchwork Fri Jun 3 13:06:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 12869058 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 54FBDC43334 for ; Fri, 3 Jun 2022 13:06:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6A9811365D; Fri, 3 Jun 2022 13:06:34 +0000 (UTC) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id F03C411365D for ; Fri, 3 Jun 2022 13:06: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=1654261594; x=1685797594; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3bV11c4ZTPCSPNObxRcpC/fGSPhEJCl2F6q/ptvgZSo=; b=QJlAKh0r57qxl2JnXQFbEagUrEeLnb2PKUuqhdGcc1bv7BS6PH5DKnzP /jh3yX5DwpTNIGwAL8JJtFgno1FT3nhhOgX1nKGmsRYboV6e/KORf915V Hth5JynfdAHcPZyQt4i7Bio5P2dhR61O6bbFexzZUOA3sHubiRRRqs+vg 0YvDhY4X1MG9PwoF3CH053cWrEQ39UP8IQ29oLsnkqmahnx7Dej6SslAU CPX2A2oU0OHkTSgn+i7K7jmy5A+oDSAn8ferS456oeC9B5F+fPzzzLTV2 OYtFZZJChNV9ItPvoc5IsP/emQ/TPUfYY+C+6A4PGu+SebsRY9NnA+jGN w==; X-IronPort-AV: E=McAfee;i="6400,9594,10366"; a="263897511" X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="263897511" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:33 -0700 X-IronPort-AV: E=Sophos;i="5.91,274,1647327600"; d="scan'208";a="578015539" Received: from richardf-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.55.27]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2022 06:06:32 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org Date: Fri, 3 Jun 2022 16:06:00 +0300 Message-Id: <26e1ad54ca97e0c42c4b4e86fac89fc74d2a3e4d.1654261471.git.jani.nikula@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: [Intel-gfx] [PATCH 7/7] drm/i915/utils: throw out unused stuff 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: jani.nikula@intel.com Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Remove some of the unused helpers from i915_utils.h. Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/i915_utils.h | 40 ------------------------------- 1 file changed, 40 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index ea7648e3aa0e..c10d68cdc3ca 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -115,39 +115,6 @@ bool i915_error_injected(void); #define overflows_type(x, T) \ (sizeof(x) > sizeof(T) && (x) >> BITS_PER_TYPE(T)) -static inline bool -__check_struct_size(size_t base, size_t arr, size_t count, size_t *size) -{ - size_t sz; - - if (check_mul_overflow(count, arr, &sz)) - return false; - - if (check_add_overflow(sz, base, &sz)) - return false; - - *size = sz; - return true; -} - -/** - * check_struct_size() - Calculate size of structure with trailing array. - * @p: Pointer to the structure. - * @member: Name of the array member. - * @n: Number of elements in the array. - * @sz: Total size of structure and array - * - * Calculates size of memory needed for structure @p followed by an - * array of @n @member elements, like struct_size() but reports - * whether it overflowed, and the resultant size in @sz - * - * Return: false if the calculation overflowed. - */ -#define check_struct_size(p, member, n, sz) \ - likely(__check_struct_size(sizeof(*(p)), \ - sizeof(*(p)->member) + __must_be_array((p)->member), \ - n, sz)) - #define ptr_mask_bits(ptr, n) ({ \ unsigned long __v = (unsigned long)(ptr); \ (typeof(ptr))(__v & -BIT(n)); \ @@ -184,8 +151,6 @@ __check_struct_size(size_t base, size_t arr, size_t count, size_t *size) #define struct_member(T, member) (((T *)0)->member) -#define ptr_offset(ptr, member) offsetof(typeof(*(ptr)), member) - #define fetch_and_zero(ptr) ({ \ typeof(*ptr) __T = *(ptr); \ *(ptr) = (typeof(*ptr))0; \ @@ -228,11 +193,6 @@ static __always_inline ptrdiff_t ptrdiff(const void *a, const void *b) get_user(mbz__, (U)) ? -EFAULT : mbz__ ? -EINVAL : 0; \ }) -static inline u64 ptr_to_u64(const void *ptr) -{ - return (uintptr_t)ptr; -} - #define u64_to_ptr(T, x) ({ \ typecheck(u64, x); \ (T *)(uintptr_t)(x); \