Skip to content

Commit 2f04432

Browse files
committed
drm/i915: split out i915_list_util.h
Move list related utilities from i915_utils.h to separate new file i915_list_util.h. Clean up related includes. Note: Arguably none of this should exist in i915 in the first place. At least isolate it better. Reviewed-by: Rodrigo Vivi <[email protected]> Link: https://lore.kernel.org/r/d7526809735194137116682f37cfa126a6a87ec9.1757582214.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
1 parent df7d085 commit 2f04432

File tree

5 files changed

+26
-15
lines changed

5 files changed

+26
-15
lines changed

drivers/gpu/drm/i915/gt/intel_execlists_submission.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112

113113
#include "gen8_engine_cs.h"
114114
#include "i915_drv.h"
115+
#include "i915_list_util.h"
115116
#include "i915_reg.h"
116117
#include "i915_timer_util.h"
117118
#include "i915_trace.h"

drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "gem/i915_gem_object.h"
88

99
#include "i915_drv.h"
10+
#include "i915_list_util.h"
1011
#include "intel_engine_pm.h"
1112
#include "intel_gt_buffer_pool.h"
1213

drivers/gpu/drm/i915/gt/intel_timeline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <linux/lockdep.h>
1010

1111
#include "i915_active.h"
12+
#include "i915_list_util.h"
1213
#include "i915_syncmap.h"
13-
#include "i915_utils.h"
1414
#include "intel_timeline_types.h"
1515

1616
struct drm_printer;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/* Copyright © 2025 Intel Corporation */
3+
4+
#ifndef __I915_LIST_UTIL_H__
5+
#define __I915_LIST_UTIL_H__
6+
7+
#include <linux/list.h>
8+
#include <asm/rwonce.h>
9+
10+
static inline void __list_del_many(struct list_head *head,
11+
struct list_head *first)
12+
{
13+
first->prev = head;
14+
WRITE_ONCE(head->next, first);
15+
}
16+
17+
static inline int list_is_last_rcu(const struct list_head *list,
18+
const struct list_head *head)
19+
{
20+
return READ_ONCE(list->next) == head;
21+
}
22+
23+
#endif /* __I915_LIST_UTIL_H__ */

drivers/gpu/drm/i915/i915_utils.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#ifndef __I915_UTILS_H
2626
#define __I915_UTILS_H
2727

28-
#include <linux/list.h>
2928
#include <linux/overflow.h>
3029
#include <linux/sched.h>
3130
#include <linux/string_helpers.h>
@@ -101,19 +100,6 @@ static inline bool is_power_of_2_u64(u64 n)
101100
return (n != 0 && ((n & (n - 1)) == 0));
102101
}
103102

104-
static inline void __list_del_many(struct list_head *head,
105-
struct list_head *first)
106-
{
107-
first->prev = head;
108-
WRITE_ONCE(head->next, first);
109-
}
110-
111-
static inline int list_is_last_rcu(const struct list_head *list,
112-
const struct list_head *head)
113-
{
114-
return READ_ONCE(list->next) == head;
115-
}
116-
117103
static inline unsigned long msecs_to_jiffies_timeout(const unsigned int m)
118104
{
119105
unsigned long j = msecs_to_jiffies(m);

0 commit comments

Comments
 (0)