2024-02-16 06:53:40

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 00/21] drm/i915: remove unused structure members

Hi,

this series removes unused i915 structure members as found by
clang-struct (and manually checked by me).

Cc: [email protected]
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>

Jiri Slaby (SUSE) (21):
drm/i915: remove unused intel_dvo_dev_ops hooks
drm/i915: remove structs intel_vgpu_pipe_format and
intel_vgpu_fb_format
drm/i915: remove intel_dsi::{port_bits,hs}
drm/i915: remove
intel_gvt_gtt::{mm_alloc_page_table,mm_free_page_table}
drm/i915: remove intel_gvt_mmio_info::{device,addr_range}
drm/i915: remove intel_vgpu_workload::{ring_context,restore_inhibit}
drm/i915: remove intel_vbt_panel_data::edp::initialized
drm/i915: remove intel_guc::ads_engine_usage_size
drm/i915: remove i915_drm_client::id
drm/i915: remove i915_perf_stream::size_exponent
drm/i915: remove intel_vgpu_gtt::active_ppgtt_mm_bitmap
drm/i915: remove intel_vgpu_fence::base
drm/i915: remove intel_vgpu_opregion::mapped
drm/i915: remove intel_vgpu::intx_trigger
drm/i915: remove gvt_mmio_block::device
drm/i915: remove intel_gvt_irq_info::warned
drm/i915: remove intel_gvt_event_info::policy
drm/i915: remove intel_gvt_irq::pending_events
drm/i915: remove execute_cb::signal
drm/i915: remove i915_vma::obj_hash
drm/i915: remove intel_memory_region_ops::flags

.../drm/i915/display/intel_display_types.h | 1 -
drivers/gpu/drm/i915/display/intel_dsi.h | 4 ---
drivers/gpu/drm/i915/display/intel_dvo_dev.h | 25 -------------------
drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 --
drivers/gpu/drm/i915/gvt/fb_decoder.h | 11 --------
drivers/gpu/drm/i915/gvt/gtt.h | 3 ---
drivers/gpu/drm/i915/gvt/gvt.h | 5 ----
drivers/gpu/drm/i915/gvt/interrupt.c | 1 -
drivers/gpu/drm/i915/gvt/interrupt.h | 2 --
drivers/gpu/drm/i915/gvt/mmio.h | 2 --
drivers/gpu/drm/i915/gvt/scheduler.h | 2 --
drivers/gpu/drm/i915/i915_drm_client.h | 2 --
drivers/gpu/drm/i915/i915_perf_types.h | 1 -
drivers/gpu/drm/i915/i915_request.c | 1 -
drivers/gpu/drm/i915/i915_vma_types.h | 1 -
drivers/gpu/drm/i915/intel_memory_region.h | 2 --
16 files changed, 65 deletions(-)

--
2.43.1



2024-02-16 06:53:52

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 01/21] drm/i915: remove unused intel_dvo_dev_ops hooks

struct intel_dvo_dev_ops's ::create_resources(), ::prepare(),
::commit::, and get_modes() are all unused since their addition in
79e539453b34 (DRM: i915: add mode setting support). Drop all of them.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/display/intel_dvo_dev.h | 25 --------------------
1 file changed, 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dvo_dev.h b/drivers/gpu/drm/i915/display/intel_dvo_dev.h
index f7e98e1c6470..af7b04539b93 100644
--- a/drivers/gpu/drm/i915/display/intel_dvo_dev.h
+++ b/drivers/gpu/drm/i915/display/intel_dvo_dev.h
@@ -53,12 +53,6 @@ struct intel_dvo_dev_ops {
bool (*init)(struct intel_dvo_device *dvo,
struct i2c_adapter *i2cbus);

- /*
- * Called to allow the output a chance to create properties after the
- * RandR objects have been created.
- */
- void (*create_resources)(struct intel_dvo_device *dvo);
-
/*
* Turn on/off output.
*
@@ -79,16 +73,6 @@ struct intel_dvo_dev_ops {
enum drm_mode_status (*mode_valid)(struct intel_dvo_device *dvo,
struct drm_display_mode *mode);

- /*
- * Callback for preparing mode changes on an output
- */
- void (*prepare)(struct intel_dvo_device *dvo);
-
- /*
- * Callback for committing mode changes on an output
- */
- void (*commit)(struct intel_dvo_device *dvo);
-
/*
* Callback for setting up a video mode after fixups have been made.
*
@@ -111,15 +95,6 @@ struct intel_dvo_dev_ops {
*/
bool (*get_hw_state)(struct intel_dvo_device *dev);

- /**
- * Query the device for the modes it provides.
- *
- * This function may also update MonInfo, mm_width, and mm_height.
- *
- * \return singly-linked list of modes or NULL if no modes found.
- */
- struct drm_display_mode *(*get_modes)(struct intel_dvo_device *dvo);
-
/**
* Clean up driver-specific bits of the output
*/
--
2.43.1


2024-02-16 06:54:04

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 02/21] drm/i915: remove structs intel_vgpu_pipe_format and intel_vgpu_fb_format

Both struct intel_vgpu_pipe_format and intel_vgpu_fb_format were never
used since its addition in commit 9f31d1063b43 (drm/i915/gvt: Add
framebuffer decoder support). Drop them.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/fb_decoder.h | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/fb_decoder.h b/drivers/gpu/drm/i915/gvt/fb_decoder.h
index 4eff44194439..fa6503900c84 100644
--- a/drivers/gpu/drm/i915/gvt/fb_decoder.h
+++ b/drivers/gpu/drm/i915/gvt/fb_decoder.h
@@ -152,17 +152,6 @@ struct intel_vgpu_cursor_plane_format {
u32 y_hot; /* in pixels */
};

-struct intel_vgpu_pipe_format {
- struct intel_vgpu_primary_plane_format primary;
- struct intel_vgpu_sprite_plane_format sprite;
- struct intel_vgpu_cursor_plane_format cursor;
- enum DDI_PORT ddi_port; /* the DDI port that pipe is connected to */
-};
-
-struct intel_vgpu_fb_format {
- struct intel_vgpu_pipe_format pipes[I915_MAX_PIPES];
-};
-
int intel_vgpu_decode_primary_plane(struct intel_vgpu *vgpu,
struct intel_vgpu_primary_plane_format *plane);
int intel_vgpu_decode_cursor_plane(struct intel_vgpu *vgpu,
--
2.43.1


2024-02-16 06:54:16

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 03/21] drm/i915: remove intel_dsi::{port_bits,hs}

intel_dsi::port_bits is unused since commit 369602d370fa (drm/i915: Add
support for port enable/disable for dual link configuration) and ::hs is
unused likely since commit 063c86f60ad4 (drm/i915/dsi: remove
intel_dsi_cmd.c and the unused functions therein). Drop them.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/display/intel_dsi.h | 4 ----
1 file changed, 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dsi.h b/drivers/gpu/drm/i915/display/intel_dsi.h
index 083390e5e442..e99c94edfaae 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi.h
+++ b/drivers/gpu/drm/i915/display/intel_dsi.h
@@ -57,9 +57,6 @@ struct intel_dsi {
u16 phys; /* ICL DSI */
};

- /* if true, use HS mode, otherwise LP */
- bool hs;
-
/* virtual channel */
int channel;

@@ -93,7 +90,6 @@ struct intel_dsi {
bool bgr_enabled;

u8 pixel_overlap;
- u32 port_bits;
u32 bw_timer;
u32 dphy_reg;

--
2.43.1


2024-02-16 06:54:28

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 04/21] drm/i915: remove intel_gvt_gtt::{mm_alloc_page_table,mm_free_page_table}

intel_gvt_gtt::{mm_alloc_page_table,mm_free_page_table} are not used
since commit ede9d0cfcb78 (drm/i915/gvt: Rework shadow graphic memory
management code). Drop them.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/gtt.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/gtt.h b/drivers/gpu/drm/i915/gvt/gtt.h
index 4cb183e06e95..fb96ea454fd1 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.h
+++ b/drivers/gpu/drm/i915/gvt/gtt.h
@@ -93,8 +93,6 @@ struct intel_gvt_gtt_gma_ops {
struct intel_gvt_gtt {
const struct intel_gvt_gtt_pte_ops *pte_ops;
const struct intel_gvt_gtt_gma_ops *gma_ops;
- int (*mm_alloc_page_table)(struct intel_vgpu_mm *mm);
- void (*mm_free_page_table)(struct intel_vgpu_mm *mm);
struct list_head oos_page_use_list_head;
struct list_head oos_page_free_list_head;
struct mutex ppgtt_mm_lock;
--
2.43.1


2024-02-16 06:54:53

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 06/21] drm/i915: remove intel_vgpu_workload::{ring_context,restore_inhibit}

intel_vgpu_workload::ring_context was never used since its addition in
commit 28c4c6ca7f79 (drm/i915/gvt: vGPU workload submission) and
::restore_inhibit since its addition in commit e473405783c0
(drm/i915/gvt: vGPU workload scheduler). Drop them.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/scheduler.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/scheduler.h b/drivers/gpu/drm/i915/gvt/scheduler.h
index 1f391b3da2cc..cd94993278b6 100644
--- a/drivers/gpu/drm/i915/gvt/scheduler.h
+++ b/drivers/gpu/drm/i915/gvt/scheduler.h
@@ -104,10 +104,8 @@ struct intel_vgpu_workload {

/* execlist context information */
struct execlist_ctx_descriptor_format ctx_desc;
- struct execlist_ring_context *ring_context;
unsigned long rb_head, rb_tail, rb_ctl, rb_start, rb_len;
unsigned long guest_rb_head;
- bool restore_inhibit;
struct intel_vgpu_elsp_dwords elsp_dwords;
bool emulate_schedule_in;
atomic_t shadow_ctx_active;
--
2.43.1


2024-02-16 06:55:04

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 07/21] drm/i915: remove intel_vbt_panel_data::edp::initialized

intel_vbt_panel_data::edp::initialized is not used since commit
9f0e7ff4b366 (drm/i915: fetch eDP configuration data from the VBT).
Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/display/intel_display_types.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 01eb6e4e6049..e0d291dd7d2d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -327,7 +327,6 @@ struct intel_vbt_panel_data {
struct edp_power_seq pps;
u8 drrs_msa_timing_delay;
bool low_vswing;
- bool initialized;
bool hobl;
} edp;

--
2.43.1


2024-02-16 06:55:17

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 08/21] drm/i915: remove intel_guc::ads_engine_usage_size

intel_guc::ads_engine_usage_size was never used since its addition in
commit 77cdd054dd2c (drm/i915/pmu: Connect engine busyness stats from
GuC to pmu). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
index 813cc888e6fa..be70c46604b4 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc.h
@@ -206,8 +206,6 @@ struct intel_guc {
u32 ads_golden_ctxt_size;
/** @ads_capture_size: size of register lists in the ADS used for error capture */
u32 ads_capture_size;
- /** @ads_engine_usage_size: size of engine usage in the ADS */
- u32 ads_engine_usage_size;

/** @lrc_desc_pool_v69: object allocated to hold the GuC LRC descriptor pool */
struct i915_vma *lrc_desc_pool_v69;
--
2.43.1


2024-02-16 06:55:27

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 09/21] drm/i915: remove i915_drm_client::id

i915_drm_client::id is not used since commit e894b724c316 (drm/i915:
Use the fdinfo helper). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/i915_drm_client.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drm_client.h b/drivers/gpu/drm/i915/i915_drm_client.h
index a439dd789936..2e7a50d16a88 100644
--- a/drivers/gpu/drm/i915/i915_drm_client.h
+++ b/drivers/gpu/drm/i915/i915_drm_client.h
@@ -24,8 +24,6 @@ struct drm_printer;
struct i915_drm_client {
struct kref kref;

- unsigned int id;
-
spinlock_t ctx_lock; /* For add/remove from ctx_list. */
struct list_head ctx_list; /* List of contexts belonging to client. */

--
2.43.1


2024-02-16 06:56:23

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 10/21] drm/i915: remove i915_perf_stream::size_exponent

i915_perf_stream::size_exponent was never used since its addition in
commit a37f08a882b0 (drm/i915/perf: Refactor oa object to better manage
resources). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/i915_perf_types.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_perf_types.h b/drivers/gpu/drm/i915/i915_perf_types.h
index 46445248d193..39fb6ce4a7ef 100644
--- a/drivers/gpu/drm/i915/i915_perf_types.h
+++ b/drivers/gpu/drm/i915/i915_perf_types.h
@@ -288,7 +288,6 @@ struct i915_perf_stream {
struct i915_vma *vma;
u8 *vaddr;
u32 last_ctx_id;
- int size_exponent;

/**
* @oa_buffer.ptr_lock: Locks reads and writes to all
--
2.43.1


2024-02-16 06:56:32

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 11/21] drm/i915: remove intel_vgpu_gtt::active_ppgtt_mm_bitmap

intel_vgpu_gtt::active_ppgtt_mm_bitmap was never used since its
addition in commit 2707e4446688 (drm/i915/gvt: vGPU graphics memory
virtualization). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/gtt.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/gtt.h b/drivers/gpu/drm/i915/gvt/gtt.h
index fb96ea454fd1..cb50700e6cc9 100644
--- a/drivers/gpu/drm/i915/gvt/gtt.h
+++ b/drivers/gpu/drm/i915/gvt/gtt.h
@@ -208,7 +208,6 @@ struct intel_vgpu_scratch_pt {

struct intel_vgpu_gtt {
struct intel_vgpu_mm *ggtt_mm;
- unsigned long active_ppgtt_mm_bitmap;
struct list_head ppgtt_mm_list_head;
struct radix_tree_root spt_tree;
struct list_head oos_page_list_head;
--
2.43.1


2024-02-16 06:56:33

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 05/21] drm/i915: remove intel_gvt_mmio_info::{device,addr_range}

intel_gvt_mmio_info::device is not used since commit e0f74ed4634d
(i915/gvt: Separate the MMIO tracking table from GVT-g) and ::addr_range
was never used since its addition in commit 12d14cc43b34 (drm/i915/gvt:
Introduce a framework for tracking HW registers.). Drop them.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/mmio.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/mmio.h b/drivers/gpu/drm/i915/gvt/mmio.h
index bba154e38705..32ebacb078e8 100644
--- a/drivers/gpu/drm/i915/gvt/mmio.h
+++ b/drivers/gpu/drm/i915/gvt/mmio.h
@@ -62,10 +62,8 @@ typedef int (*gvt_mmio_func)(struct intel_vgpu *, unsigned int, void *,
struct intel_gvt_mmio_info {
u32 offset;
u64 ro_mask;
- u32 device;
gvt_mmio_func read;
gvt_mmio_func write;
- u32 addr_range;
struct hlist_node node;
};

--
2.43.1


2024-02-16 06:56:40

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 15/21] drm/i915: remove gvt_mmio_block::device

gvt_mmio_block::device is not used since commit e0f74ed4634d (i915/gvt:
Separate the MMIO tracking table from GVT-g). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/gvt.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index b8b8ffe4d566..2c95aeef4e41 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -253,7 +253,6 @@ struct intel_gvt_fence {

/* Special MMIO blocks. */
struct gvt_mmio_block {
- unsigned int device;
i915_reg_t offset;
unsigned int size;
gvt_mmio_func read;
--
2.43.1


2024-02-16 06:56:42

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 12/21] drm/i915: remove intel_vgpu_fence::base

intel_vgpu_fence::base was never used since its addition in commit
28a60dee2ce6 (drm/i915/gvt: vGPU HW resource management). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/gvt.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index c57aba09091f..b6fe17f1a16f 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -89,7 +89,6 @@ struct intel_vgpu_gm {
/* Fences owned by a vGPU */
struct intel_vgpu_fence {
struct i915_fence_reg *regs[INTEL_GVT_MAX_NUM_FENCES];
- u32 base;
u32 size;
};

@@ -444,7 +443,6 @@ int intel_gvt_load_firmware(struct intel_gvt *gvt);
#define vgpu_hidden_gmadr_end(vgpu) \
(vgpu_hidden_gmadr_base(vgpu) + vgpu_hidden_sz(vgpu) - 1)

-#define vgpu_fence_base(vgpu) (vgpu->fence.base)
#define vgpu_fence_sz(vgpu) (vgpu->fence.size)

/* ring context size i.e. the first 0x50 dwords*/
--
2.43.1


2024-02-16 06:56:52

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 16/21] drm/i915: remove intel_gvt_irq_info::warned

intel_gvt_irq_info::warned was never used since its addition in commit
c8fe6a6811a7 (drm/i915/gvt: vGPU interrupt virtualization.). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/interrupt.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/interrupt.c b/drivers/gpu/drm/i915/gvt/interrupt.c
index c8e7dfc9f791..336d079c4207 100644
--- a/drivers/gpu/drm/i915/gvt/interrupt.c
+++ b/drivers/gpu/drm/i915/gvt/interrupt.c
@@ -40,7 +40,6 @@ struct intel_gvt_irq_info {
char *name;
i915_reg_t reg_base;
enum intel_gvt_event_type bit_to_event[INTEL_GVT_IRQ_BITWIDTH];
- unsigned long warned;
int group;
DECLARE_BITMAP(downstream_irq_bitmap, INTEL_GVT_IRQ_BITWIDTH);
bool has_upstream_irq;
--
2.43.1


2024-02-16 06:57:00

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 14/21] drm/i915: remove intel_vgpu::intx_trigger

intel_vgpu::intx_trigger was never used since its addition in commit
f30437c5e7bf (drm/i915/gvt: add KVMGT support). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/gvt.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index 8e5d696fc79c..b8b8ffe4d566 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -221,7 +221,6 @@ struct intel_vgpu {

struct vfio_region *region;
int num_regions;
- struct eventfd_ctx *intx_trigger;
struct eventfd_ctx *msi_trigger;

/*
--
2.43.1


2024-02-16 06:57:02

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 17/21] drm/i915: remove intel_gvt_event_info::policy

intel_gvt_event_info::policy was never used since its addition in
commit c8fe6a6811a7 (drm/i915/gvt: vGPU interrupt virtualization.).
Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/interrupt.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/interrupt.h b/drivers/gpu/drm/i915/gvt/interrupt.h
index e60ad476fe60..b1fd6ed4e34a 100644
--- a/drivers/gpu/drm/i915/gvt/interrupt.h
+++ b/drivers/gpu/drm/i915/gvt/interrupt.h
@@ -177,7 +177,6 @@ enum intel_gvt_irq_type {
/* per-event information */
struct intel_gvt_event_info {
int bit; /* map to register bit */
- int policy; /* forwarding policy */
struct intel_gvt_irq_info *info; /* register info */
gvt_event_virt_handler_t v_handler; /* for v_event */
};
--
2.43.1


2024-02-16 06:57:16

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 18/21] drm/i915: remove intel_gvt_irq::pending_events

intel_gvt_irq::pending_events was never used since its addition in
commit c8fe6a6811a7 (drm/i915/gvt: vGPU interrupt virtualization.).
Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/interrupt.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/interrupt.h b/drivers/gpu/drm/i915/gvt/interrupt.h
index b1fd6ed4e34a..cd214be98668 100644
--- a/drivers/gpu/drm/i915/gvt/interrupt.h
+++ b/drivers/gpu/drm/i915/gvt/interrupt.h
@@ -187,7 +187,6 @@ struct intel_gvt_irq {
struct intel_gvt_irq_info *info[INTEL_GVT_IRQ_INFO_MAX];
DECLARE_BITMAP(irq_info_bitmap, INTEL_GVT_IRQ_INFO_MAX);
struct intel_gvt_event_info events[INTEL_GVT_EVENT_MAX];
- DECLARE_BITMAP(pending_events, INTEL_GVT_EVENT_MAX);
struct intel_gvt_irq_map *irq_map;
};

--
2.43.1


2024-02-16 06:57:28

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 19/21] drm/i915: remove execute_cb::signal

execute_cb::signal is not used since commit 5ac545b8b014
(drm/i915/request: Remove the hook from await_execution). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/i915_request.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index f59081066a19..519e096c607c 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -52,7 +52,6 @@
struct execute_cb {
struct irq_work work;
struct i915_sw_fence *fence;
- struct i915_request *signal;
};

static struct kmem_cache *slab_requests;
--
2.43.1


2024-02-16 06:57:41

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 20/21] drm/i915: remove i915_vma::obj_hash

i915_vma::obj_hash was never used since its addition in commit
4ff4b44cbb70 (drm/i915: Store a direct lookup from object handle to
vma). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/i915_vma_types.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_vma_types.h b/drivers/gpu/drm/i915/i915_vma_types.h
index 64472b7f0e77..559de74d0b11 100644
--- a/drivers/gpu/drm/i915/i915_vma_types.h
+++ b/drivers/gpu/drm/i915/i915_vma_types.h
@@ -290,7 +290,6 @@ struct i915_vma {

struct list_head obj_link; /* Link in the object's VMA list */
struct rb_node obj_node;
- struct hlist_node obj_hash;

/** This vma's place in the eviction list */
struct list_head evict_link;
--
2.43.1


2024-02-16 06:57:53

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 21/21] drm/i915: remove intel_memory_region_ops::flags

intel_memory_region_ops::flags was never used since its addition in
commit 232a6ebae419 (drm/i915: introduce intel_memory_region). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/intel_memory_region.h | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_memory_region.h b/drivers/gpu/drm/i915/intel_memory_region.h
index 40810cfb3fd9..8c927e303c4a 100644
--- a/drivers/gpu/drm/i915/intel_memory_region.h
+++ b/drivers/gpu/drm/i915/intel_memory_region.h
@@ -50,8 +50,6 @@ enum intel_region_id {
for_each_if((mr) = (i915)->mm.regions[id])

struct intel_memory_region_ops {
- unsigned int flags;
-
int (*init)(struct intel_memory_region *mem);
int (*release)(struct intel_memory_region *mem);

--
2.43.1


2024-02-16 06:57:57

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 13/21] drm/i915: remove intel_vgpu_opregion::mapped

intel_vgpu_opregion::mapped is not used since commit 367748066eeb
(drm/i915/gvt: remove enum hypervisor_type). Drop it.

Found by https://github.com/jirislaby/clang-struct.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: Jani Nikula <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: [email protected]
---
drivers/gpu/drm/i915/gvt/gvt.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index b6fe17f1a16f..8e5d696fc79c 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -118,7 +118,6 @@ struct intel_vgpu_irq {
};

struct intel_vgpu_opregion {
- bool mapped;
void *va;
u32 gfn[INTEL_GVT_OPREGION_PAGES];
};
--
2.43.1


2024-02-16 08:53:57

by Jani Nikula

[permalink] [raw]
Subject: Re: [PATCH 00/21] drm/i915: remove unused structure members

On Fri, 16 Feb 2024, "Jiri Slaby (SUSE)" <[email protected]> wrote:
> this series removes unused i915 structure members as found by
> clang-struct (and manually checked by me).

Thanks Jiri, good stuff!

Acked-by: Jani Nikula <[email protected]>

However, you may have overlooked that drivers/gpu/drm/i915/gvt/ is
maintained separately.

Cc: Zhenyu, Zhi, how do you want the gvt patches in this series handled?


BR,
Jani.


>
> Cc: [email protected]
> Cc: Jani Nikula <[email protected]>
> Cc: Joonas Lahtinen <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Cc: Tvrtko Ursulin <[email protected]>
>
> Jiri Slaby (SUSE) (21):
> drm/i915: remove unused intel_dvo_dev_ops hooks
> drm/i915: remove structs intel_vgpu_pipe_format and
> intel_vgpu_fb_format
> drm/i915: remove intel_dsi::{port_bits,hs}
> drm/i915: remove
> intel_gvt_gtt::{mm_alloc_page_table,mm_free_page_table}
> drm/i915: remove intel_gvt_mmio_info::{device,addr_range}
> drm/i915: remove intel_vgpu_workload::{ring_context,restore_inhibit}
> drm/i915: remove intel_vbt_panel_data::edp::initialized
> drm/i915: remove intel_guc::ads_engine_usage_size
> drm/i915: remove i915_drm_client::id
> drm/i915: remove i915_perf_stream::size_exponent
> drm/i915: remove intel_vgpu_gtt::active_ppgtt_mm_bitmap
> drm/i915: remove intel_vgpu_fence::base
> drm/i915: remove intel_vgpu_opregion::mapped
> drm/i915: remove intel_vgpu::intx_trigger
> drm/i915: remove gvt_mmio_block::device
> drm/i915: remove intel_gvt_irq_info::warned
> drm/i915: remove intel_gvt_event_info::policy
> drm/i915: remove intel_gvt_irq::pending_events
> drm/i915: remove execute_cb::signal
> drm/i915: remove i915_vma::obj_hash
> drm/i915: remove intel_memory_region_ops::flags
>
> .../drm/i915/display/intel_display_types.h | 1 -
> drivers/gpu/drm/i915/display/intel_dsi.h | 4 ---
> drivers/gpu/drm/i915/display/intel_dvo_dev.h | 25 -------------------
> drivers/gpu/drm/i915/gt/uc/intel_guc.h | 2 --
> drivers/gpu/drm/i915/gvt/fb_decoder.h | 11 --------
> drivers/gpu/drm/i915/gvt/gtt.h | 3 ---
> drivers/gpu/drm/i915/gvt/gvt.h | 5 ----
> drivers/gpu/drm/i915/gvt/interrupt.c | 1 -
> drivers/gpu/drm/i915/gvt/interrupt.h | 2 --
> drivers/gpu/drm/i915/gvt/mmio.h | 2 --
> drivers/gpu/drm/i915/gvt/scheduler.h | 2 --
> drivers/gpu/drm/i915/i915_drm_client.h | 2 --
> drivers/gpu/drm/i915/i915_perf_types.h | 1 -
> drivers/gpu/drm/i915/i915_request.c | 1 -
> drivers/gpu/drm/i915/i915_vma_types.h | 1 -
> drivers/gpu/drm/i915/intel_memory_region.h | 2 --
> 16 files changed, 65 deletions(-)

--
Jani Nikula, Intel

2024-02-16 12:40:55

by Zhi Wang

[permalink] [raw]
Subject: Re: [PATCH 00/21] drm/i915: remove unused structure members

On Fri, 16 Feb 2024 10:51:20 +0200
Jani Nikula <[email protected]> wrote:

> On Fri, 16 Feb 2024, "Jiri Slaby (SUSE)" <[email protected]> wrote:
> > this series removes unused i915 structure members as found by
> > clang-struct (and manually checked by me).
>
> Thanks Jiri, good stuff!
>
> Acked-by: Jani Nikula <[email protected]>
>
> However, you may have overlooked that drivers/gpu/drm/i915/gvt/ is
> maintained separately.
>
> Cc: Zhenyu, Zhi, how do you want the gvt patches in this series
> handled?
>

Many thanks for the clean-up patch Jiri! Jani, it would be easier
for us that you can help to apply the patches through i915.

Thanks,
Zhi.

>
> BR,
> Jani.
>
>
> >
> > Cc: [email protected]
> > Cc: Jani Nikula <[email protected]>
> > Cc: Joonas Lahtinen <[email protected]>
> > Cc: Rodrigo Vivi <[email protected]>
> > Cc: Tvrtko Ursulin <[email protected]>
> >
> > Jiri Slaby (SUSE) (21):
> > drm/i915: remove unused intel_dvo_dev_ops hooks
> > drm/i915: remove structs intel_vgpu_pipe_format and
> > intel_vgpu_fb_format
> > drm/i915: remove intel_dsi::{port_bits,hs}
> > drm/i915: remove
> > intel_gvt_gtt::{mm_alloc_page_table,mm_free_page_table}
> > drm/i915: remove intel_gvt_mmio_info::{device,addr_range}
> > drm/i915: remove
> > intel_vgpu_workload::{ring_context,restore_inhibit} drm/i915:
> > remove intel_vbt_panel_data::edp::initialized drm/i915: remove
> > intel_guc::ads_engine_usage_size drm/i915: remove
> > i915_drm_client::id drm/i915: remove i915_perf_stream::size_exponent
> > drm/i915: remove intel_vgpu_gtt::active_ppgtt_mm_bitmap
> > drm/i915: remove intel_vgpu_fence::base
> > drm/i915: remove intel_vgpu_opregion::mapped
> > drm/i915: remove intel_vgpu::intx_trigger
> > drm/i915: remove gvt_mmio_block::device
> > drm/i915: remove intel_gvt_irq_info::warned
> > drm/i915: remove intel_gvt_event_info::policy
> > drm/i915: remove intel_gvt_irq::pending_events
> > drm/i915: remove execute_cb::signal
> > drm/i915: remove i915_vma::obj_hash
> > drm/i915: remove intel_memory_region_ops::flags
> >
> > .../drm/i915/display/intel_display_types.h | 1 -
> > drivers/gpu/drm/i915/display/intel_dsi.h | 4 ---
> > drivers/gpu/drm/i915/display/intel_dvo_dev.h | 25
> > ------------------- drivers/gpu/drm/i915/gt/uc/intel_guc.h |
> > 2 -- drivers/gpu/drm/i915/gvt/fb_decoder.h | 11 --------
> > drivers/gpu/drm/i915/gvt/gtt.h | 3 ---
> > drivers/gpu/drm/i915/gvt/gvt.h | 5 ----
> > drivers/gpu/drm/i915/gvt/interrupt.c | 1 -
> > drivers/gpu/drm/i915/gvt/interrupt.h | 2 --
> > drivers/gpu/drm/i915/gvt/mmio.h | 2 --
> > drivers/gpu/drm/i915/gvt/scheduler.h | 2 --
> > drivers/gpu/drm/i915/i915_drm_client.h | 2 --
> > drivers/gpu/drm/i915/i915_perf_types.h | 1 -
> > drivers/gpu/drm/i915/i915_request.c | 1 -
> > drivers/gpu/drm/i915/i915_vma_types.h | 1 -
> > drivers/gpu/drm/i915/intel_memory_region.h | 2 --
> > 16 files changed, 65 deletions(-)
>


2024-02-20 19:32:53

by Rodrigo Vivi

[permalink] [raw]
Subject: Re: [PATCH 00/21] drm/i915: remove unused structure members

On Fri, Feb 16, 2024 at 02:40:26PM +0200, Zhi Wang wrote:
> On Fri, 16 Feb 2024 10:51:20 +0200
> Jani Nikula <[email protected]> wrote:
>
> > On Fri, 16 Feb 2024, "Jiri Slaby (SUSE)" <[email protected]> wrote:
> > > this series removes unused i915 structure members as found by
> > > clang-struct (and manually checked by me).
> >
> > Thanks Jiri, good stuff!
> >
> > Acked-by: Jani Nikula <[email protected]>
> >
> > However, you may have overlooked that drivers/gpu/drm/i915/gvt/ is
> > maintained separately.
> >
> > Cc: Zhenyu, Zhi, how do you want the gvt patches in this series
> > handled?
> >
>
> Many thanks for the clean-up patch Jiri! Jani, it would be easier
> for us that you can help to apply the patches through i915.

I pushed the entire series through drm-intel-next.
Thanks for the patches and acks.

>
> Thanks,
> Zhi.
>
> >
> > BR,
> > Jani.
> >
> >
> > >
> > > Cc: [email protected]
> > > Cc: Jani Nikula <[email protected]>
> > > Cc: Joonas Lahtinen <[email protected]>
> > > Cc: Rodrigo Vivi <[email protected]>
> > > Cc: Tvrtko Ursulin <[email protected]>
> > >
> > > Jiri Slaby (SUSE) (21):
> > > drm/i915: remove unused intel_dvo_dev_ops hooks
> > > drm/i915: remove structs intel_vgpu_pipe_format and
> > > intel_vgpu_fb_format
> > > drm/i915: remove intel_dsi::{port_bits,hs}
> > > drm/i915: remove
> > > intel_gvt_gtt::{mm_alloc_page_table,mm_free_page_table}
> > > drm/i915: remove intel_gvt_mmio_info::{device,addr_range}
> > > drm/i915: remove
> > > intel_vgpu_workload::{ring_context,restore_inhibit} drm/i915:
> > > remove intel_vbt_panel_data::edp::initialized drm/i915: remove
> > > intel_guc::ads_engine_usage_size drm/i915: remove
> > > i915_drm_client::id drm/i915: remove i915_perf_stream::size_exponent
> > > drm/i915: remove intel_vgpu_gtt::active_ppgtt_mm_bitmap
> > > drm/i915: remove intel_vgpu_fence::base
> > > drm/i915: remove intel_vgpu_opregion::mapped
> > > drm/i915: remove intel_vgpu::intx_trigger
> > > drm/i915: remove gvt_mmio_block::device
> > > drm/i915: remove intel_gvt_irq_info::warned
> > > drm/i915: remove intel_gvt_event_info::policy
> > > drm/i915: remove intel_gvt_irq::pending_events
> > > drm/i915: remove execute_cb::signal
> > > drm/i915: remove i915_vma::obj_hash
> > > drm/i915: remove intel_memory_region_ops::flags
> > >
> > > .../drm/i915/display/intel_display_types.h | 1 -
> > > drivers/gpu/drm/i915/display/intel_dsi.h | 4 ---
> > > drivers/gpu/drm/i915/display/intel_dvo_dev.h | 25
> > > ------------------- drivers/gpu/drm/i915/gt/uc/intel_guc.h |
> > > 2 -- drivers/gpu/drm/i915/gvt/fb_decoder.h | 11 --------
> > > drivers/gpu/drm/i915/gvt/gtt.h | 3 ---
> > > drivers/gpu/drm/i915/gvt/gvt.h | 5 ----
> > > drivers/gpu/drm/i915/gvt/interrupt.c | 1 -
> > > drivers/gpu/drm/i915/gvt/interrupt.h | 2 --
> > > drivers/gpu/drm/i915/gvt/mmio.h | 2 --
> > > drivers/gpu/drm/i915/gvt/scheduler.h | 2 --
> > > drivers/gpu/drm/i915/i915_drm_client.h | 2 --
> > > drivers/gpu/drm/i915/i915_perf_types.h | 1 -
> > > drivers/gpu/drm/i915/i915_request.c | 1 -
> > > drivers/gpu/drm/i915/i915_vma_types.h | 1 -
> > > drivers/gpu/drm/i915/intel_memory_region.h | 2 --
> > > 16 files changed, 65 deletions(-)
> >
>