intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 4/5] drm/i915: split out i915_list_util.h
Date: Tue, 9 Sep 2025 09:39:09 -0400	[thread overview]
Message-ID: <aMAt_T1nCt0-XOX0@intel.com> (raw)
In-Reply-To: <73279e53f57d803f0d4b9a1572613ea0be87c5b8.1757340521.git.jani.nikula@intel.com>

On Mon, Sep 08, 2025 at 05:11:48PM +0300, Jani Nikula wrote:
> Move list related utilities from i915_utils.h to separate new file
> i915_list_util.h. Clean up related includes.
> 

here as well I believe it would be better to have an i915_ prefix.

but up to you

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>


> Note: Arguably none of this should exist in i915 in the first place. At
> least isolate it better.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  .../drm/i915/gt/intel_execlists_submission.c  |  1 +
>  .../gpu/drm/i915/gt/intel_gt_buffer_pool.c    |  1 +
>  drivers/gpu/drm/i915/gt/intel_timeline.h      |  2 +-
>  drivers/gpu/drm/i915/i915_list_util.h         | 23 +++++++++++++++++++
>  drivers/gpu/drm/i915/i915_utils.h             | 14 -----------
>  5 files changed, 26 insertions(+), 15 deletions(-)
>  create mode 100644 drivers/gpu/drm/i915/i915_list_util.h
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> index 52c8fddedfce..0c1b2df02d26 100644
> --- a/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> +++ b/drivers/gpu/drm/i915/gt/intel_execlists_submission.c
> @@ -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"
> diff --git a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
> index 86b5a9ba323d..c7befc5c20d0 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
> +++ b/drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
> @@ -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"
>  
> diff --git a/drivers/gpu/drm/i915/gt/intel_timeline.h b/drivers/gpu/drm/i915/gt/intel_timeline.h
> index 5f8c8f79714e..85b43f9b9d95 100644
> --- a/drivers/gpu/drm/i915/gt/intel_timeline.h
> +++ b/drivers/gpu/drm/i915/gt/intel_timeline.h
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_list_util.h b/drivers/gpu/drm/i915/i915_list_util.h
> new file mode 100644
> index 000000000000..4e515dc8a3e0
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/i915_list_util.h
> @@ -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__ */
> diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
> index 6278a74d08c2..4a6437d6e00e 100644
> --- a/drivers/gpu/drm/i915/i915_utils.h
> +++ b/drivers/gpu/drm/i915/i915_utils.h
> @@ -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);
> -- 
> 2.47.3
> 

  reply	other threads:[~2025-09-09 13:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 14:11 [PATCH 0/5] drm/i915: clean up i915_utils.h Jani Nikula
2025-09-08 14:11 ` [PATCH 1/5] drm/i915: redundant i915_utils.h includes Jani Nikula
2025-09-09 13:36   ` Rodrigo Vivi
2025-09-08 14:11 ` [PATCH 2/5] drm/i915: split out i915_ptr_util.h Jani Nikula
2025-09-09 13:37   ` Rodrigo Vivi
2025-09-08 14:11 ` [PATCH 3/5] drm/i915: split out i915_timer_util.[ch] Jani Nikula
2025-09-09 13:38   ` Rodrigo Vivi
2025-09-08 14:11 ` [PATCH 4/5] drm/i915: split out i915_list_util.h Jani Nikula
2025-09-09 13:39   ` Rodrigo Vivi [this message]
2025-09-08 14:11 ` [PATCH 5/5] drm/i915: split out i915_wait_util.h Jani Nikula
2025-09-09 13:40   ` Rodrigo Vivi
2025-09-10 12:06     ` Jani Nikula
2025-09-10 16:45       ` Rodrigo Vivi
2025-09-08 19:07 ` ✗ Fi.CI.BUILD: failure for drm/i915: clean up i915_utils.h Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aMAt_T1nCt0-XOX0@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).