All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: move i915_fence_{context_, }timeout() to i915_sw_fence.[ch]
Date: Thu, 15 Sep 2022 08:47:28 +0100	[thread overview]
Message-ID: <976bfcc8-2939-1537-7810-fba57af75e6e@linux.intel.com> (raw)
In-Reply-To: <20220914165903.1905962-1-jani.nikula@intel.com>


On 14/09/2022 17:59, Jani Nikula wrote:
> Maybe there was a grand plan with i915_fence_timeout() and
> i915_fence_context_timeout() and i915_config.c, but that seems to have
> been lost a bit.
> 
> Just move the functions to i915_sw_fence.[ch] from i915_drv.h and
> i915_config.c, and remove the latter.

Sorry this does not fit - i915_sw_fence is a low level agnostic code 
which should have no connection to fence timeouts as defined by higher 
levels. How about i915_config.h? Even if only as a temporary solution 
which requires least thinking. Because I am not coming with any obvious 
new homes among the existing headers..

Regards,

Tvrtko

> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/Makefile        |  1 -
>   drivers/gpu/drm/i915/i915_config.c   | 15 ---------------
>   drivers/gpu/drm/i915/i915_drv.h      |  9 ---------
>   drivers/gpu/drm/i915/i915_sw_fence.c | 15 +++++++++++++++
>   drivers/gpu/drm/i915/i915_sw_fence.h |  5 +++++
>   5 files changed, 20 insertions(+), 25 deletions(-)
>   delete mode 100644 drivers/gpu/drm/i915/i915_config.c
> 
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index a26edcdadc21..0221682d3a0f 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -34,7 +34,6 @@ subdir-ccflags-y += -I$(srctree)/$(src)
>   # core driver code
>   i915-y += i915_driver.o \
>   	  i915_drm_client.o \
> -	  i915_config.o \
>   	  i915_getparam.o \
>   	  i915_ioctl.o \
>   	  i915_irq.o \
> diff --git a/drivers/gpu/drm/i915/i915_config.c b/drivers/gpu/drm/i915/i915_config.c
> deleted file mode 100644
> index afb828dab53b..000000000000
> --- a/drivers/gpu/drm/i915/i915_config.c
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -// SPDX-License-Identifier: MIT
> -/*
> - * Copyright © 2020 Intel Corporation
> - */
> -
> -#include "i915_drv.h"
> -
> -unsigned long
> -i915_fence_context_timeout(const struct drm_i915_private *i915, u64 context)
> -{
> -	if (CONFIG_DRM_I915_FENCE_TIMEOUT && context)
> -		return msecs_to_jiffies_timeout(CONFIG_DRM_I915_FENCE_TIMEOUT);
> -
> -	return 0;
> -}
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 524b5ee495be..02956385d32d 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -167,15 +167,6 @@ struct i915_gem_mm {
>   
>   #define I915_IDLE_ENGINES_TIMEOUT (200) /* in ms */
>   
> -unsigned long i915_fence_context_timeout(const struct drm_i915_private *i915,
> -					 u64 context);
> -
> -static inline unsigned long
> -i915_fence_timeout(const struct drm_i915_private *i915)
> -{
> -	return i915_fence_context_timeout(i915, U64_MAX);
> -}
> -
>   #define HAS_HW_SAGV_WM(i915) (DISPLAY_VER(i915) >= 13 && !IS_DGFX(i915))
>   
>   struct i915_virtual_gpu {
> diff --git a/drivers/gpu/drm/i915/i915_sw_fence.c b/drivers/gpu/drm/i915/i915_sw_fence.c
> index 6fc0d1b89690..2a90987799e7 100644
> --- a/drivers/gpu/drm/i915/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/i915_sw_fence.c
> @@ -11,6 +11,7 @@
>   
>   #include "i915_sw_fence.h"
>   #include "i915_selftest.h"
> +#include "i915_utils.h"
>   
>   #if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
>   #define I915_SW_FENCE_BUG_ON(expr) BUG_ON(expr)
> @@ -471,6 +472,20 @@ static void irq_i915_sw_fence_work(struct irq_work *wrk)
>   	kfree_rcu(cb, rcu);
>   }
>   
> +unsigned long i915_fence_context_timeout(const struct drm_i915_private *i915,
> +					 u64 context)
> +{
> +	if (CONFIG_DRM_I915_FENCE_TIMEOUT && context)
> +		return msecs_to_jiffies_timeout(CONFIG_DRM_I915_FENCE_TIMEOUT);
> +
> +	return 0;
> +}
> +
> +unsigned long i915_fence_timeout(const struct drm_i915_private *i915)
> +{
> +	return i915_fence_context_timeout(i915, U64_MAX);
> +}
> +
>   int i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence,
>   				  struct dma_fence *dma,
>   				  unsigned long timeout,
> diff --git a/drivers/gpu/drm/i915/i915_sw_fence.h b/drivers/gpu/drm/i915/i915_sw_fence.h
> index 619fc5a22f0c..cdef7dabafbd 100644
> --- a/drivers/gpu/drm/i915/i915_sw_fence.h
> +++ b/drivers/gpu/drm/i915/i915_sw_fence.h
> @@ -17,6 +17,7 @@
>   
>   struct completion;
>   struct dma_resv;
> +struct drm_i915_private;
>   struct i915_sw_fence;
>   
>   enum i915_sw_fence_notify {
> @@ -81,6 +82,10 @@ struct i915_sw_dma_fence_cb {
>   	struct i915_sw_fence *fence;
>   };
>   
> +unsigned long i915_fence_context_timeout(const struct drm_i915_private *i915,
> +					 u64 context);
> +unsigned long i915_fence_timeout(const struct drm_i915_private *i915);
> +
>   int __i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence,
>   				    struct dma_fence *dma,
>   				    struct i915_sw_dma_fence_cb *cb);

  parent reply	other threads:[~2022-09-15  7:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 16:59 [Intel-gfx] [PATCH] drm/i915: move i915_fence_{context_, }timeout() to i915_sw_fence.[ch] Jani Nikula
2022-09-14 19:35 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2022-09-14 19:35 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-09-14 19:56 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-15  7:47 ` Tvrtko Ursulin [this message]
2022-09-15 12:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=976bfcc8-2939-1537-7810-fba57af75e6e@linux.intel.com \
    --to=tvrtko.ursulin@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.