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 <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/d7526809735194137116682f37cfa126a6a87ec9.1757582214.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
Jani Nikula 2025-09-11 12:17:39 +03:00
parent df7d085b58
commit 2f04432fcf
5 changed files with 26 additions and 15 deletions

View File

@ -112,6 +112,7 @@
#include "gen8_engine_cs.h"
#include "i915_drv.h"
#include "i915_list_util.h"
#include "i915_reg.h"
#include "i915_timer_util.h"
#include "i915_trace.h"

View File

@ -7,6 +7,7 @@
#include "gem/i915_gem_object.h"
#include "i915_drv.h"
#include "i915_list_util.h"
#include "intel_engine_pm.h"
#include "intel_gt_buffer_pool.h"

View File

@ -9,8 +9,8 @@
#include <linux/lockdep.h>
#include "i915_active.h"
#include "i915_list_util.h"
#include "i915_syncmap.h"
#include "i915_utils.h"
#include "intel_timeline_types.h"
struct drm_printer;

View File

@ -0,0 +1,23 @@
/* SPDX-License-Identifier: MIT */
/* Copyright © 2025 Intel Corporation */
#ifndef __I915_LIST_UTIL_H__
#define __I915_LIST_UTIL_H__
#include <linux/list.h>
#include <asm/rwonce.h>
static inline void __list_del_many(struct list_head *head,
struct list_head *first)
{
first->prev = head;
WRITE_ONCE(head->next, first);
}
static inline int list_is_last_rcu(const struct list_head *list,
const struct list_head *head)
{
return READ_ONCE(list->next) == head;
}
#endif /* __I915_LIST_UTIL_H__ */

View File

@ -25,7 +25,6 @@
#ifndef __I915_UTILS_H
#define __I915_UTILS_H
#include <linux/list.h>
#include <linux/overflow.h>
#include <linux/sched.h>
#include <linux/string_helpers.h>
@ -101,19 +100,6 @@ static inline bool is_power_of_2_u64(u64 n)
return (n != 0 && ((n & (n - 1)) == 0));
}
static inline void __list_del_many(struct list_head *head,
struct list_head *first)
{
first->prev = head;
WRITE_ONCE(head->next, first);
}
static inline int list_is_last_rcu(const struct list_head *list,
const struct list_head *head)
{
return READ_ONCE(list->next) == head;
}
static inline unsigned long msecs_to_jiffies_timeout(const unsigned int m)
{
unsigned long j = msecs_to_jiffies(m);