Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 01/11] drm/i915/de: Add more macros to remove all direct calls to uncore
Date: Thu, 8 Dec 2022 11:29:34 +0100	[thread overview]
Message-ID: <51dae3e3-8ebd-9d81-e20c-937144bcd599@intel.com> (raw)
In-Reply-To: <0d051554dfeeb4d8aa3bc9136ed111fa35f647d8.1670433372.git.jani.nikula@intel.com>

On 07.12.2022 18:17, Jani Nikula wrote:
> From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> 
> Add more de helpers to be able to avoid direct calls to uncore.
> 
> v3 by Jani:
> - drop intel_de_write_samevalue/intel_de_rewrite_fw altogether
> 
> v2 by Jani:
> - drop pcode stuff for now
> - rename intel_de_write_samevalue -> intel_de_rewrite_fw
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_de.h | 35 +++++++++++++++++++++++++
>   1 file changed, 35 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_de.h b/drivers/gpu/drm/i915/display/intel_de.h
> index 9c104f65e4c8..004f01906fd7 100644
> --- a/drivers/gpu/drm/i915/display/intel_de.h
> +++ b/drivers/gpu/drm/i915/display/intel_de.h
> @@ -16,6 +16,12 @@ intel_de_read(struct drm_i915_private *i915, i915_reg_t reg)
>   	return intel_uncore_read(&i915->uncore, reg);
>   }
>   
> +static inline u8
> +intel_de_read8(struct drm_i915_private *i915, i915_reg_t reg)
> +{
> +	return intel_uncore_read8(&i915->uncore, reg);
> +}
> +
>   static inline void
>   intel_de_posting_read(struct drm_i915_private *i915, i915_reg_t reg)
>   {
> @@ -41,6 +47,23 @@ intel_de_wait_for_register(struct drm_i915_private *i915, i915_reg_t reg,
>   	return intel_wait_for_register(&i915->uncore, reg, mask, value, timeout);
>   }
>   
> +static inline int
> +intel_de_wait_for_register_fw(struct drm_i915_private *i915, i915_reg_t reg,
> +			      u32 mask, u32 value, unsigned int timeout)
> +{
> +	return intel_wait_for_register_fw(&i915->uncore, reg, mask, value, timeout);
> +}
> +
> +static inline int
> +__intel_de_wait_for_register(struct drm_i915_private *i915, i915_reg_t reg,
> +			     u32 mask, u32 value,
> +			     unsigned int fast_timeout_us,
> +			     unsigned int slow_timeout_ms, u32 *out_value)
> +{
> +	return __intel_wait_for_register(&i915->uncore, reg, mask, value,
> +					 fast_timeout_us, slow_timeout_ms, out_value);
> +}
> +
>   static inline int
>   intel_de_wait_for_set(struct drm_i915_private *i915, i915_reg_t reg,
>   		      u32 mask, unsigned int timeout)
> @@ -81,4 +104,16 @@ intel_de_write_fw(struct drm_i915_private *i915, i915_reg_t reg, u32 val)
>   	intel_uncore_write_fw(&i915->uncore, reg, val);
>   }
>   
> +static inline u32
> +intel_de_read_notrace(struct drm_i915_private *i915, i915_reg_t reg)
> +{
> +	return intel_uncore_read_notrace(&i915->uncore, reg);
> +}
> +
> +static inline void
> +intel_de_write_notrace(struct drm_i915_private *i915, i915_reg_t reg, u32 val)
> +{
> +	intel_uncore_write_notrace(&i915->uncore, reg, val);
> +}
> +

I wonder why intel_de_* helpers are only in display subsystem, I guess 
whole i915 could benefit from it.

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej


>   #endif /* __INTEL_DE_H__ */


  reply	other threads:[~2022-12-08 10:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 17:17 [Intel-gfx] [PATCH v2 00/11] drm/i915/display: switch to intel_de_* register accessors Jani Nikula
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 01/11] drm/i915/de: Add more macros to remove all direct calls to uncore Jani Nikula
2022-12-08 10:29   ` Andrzej Hajda [this message]
2022-12-08 13:14     ` Jani Nikula
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 02/11] drm/i915/de: return the old register value from intel_de_rmw() Jani Nikula
2022-12-08 10:30   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 03/11] drm/i915/crt: drop a bunch of unnecessary register variables Jani Nikula
2022-12-08 10:35   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 04/11] drm/i915/crt: switch to intel_de_* register accessors in display code Jani Nikula
2022-12-08 10:38   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 05/11] drm/i915/power: " Jani Nikula
2022-12-08 10:39   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 06/11] drm/i915/dmc: " Jani Nikula
2022-12-08 10:40   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 07/11] drm/i915/dp-aux: " Jani Nikula
2022-12-08 10:41   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 08/11] drm/i915/gmbus: " Jani Nikula
2022-12-08 10:41   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 09/11] drm/i915/wm: " Jani Nikula
2022-12-08 10:42   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 10/11] drm/i915/snps: " Jani Nikula
2022-12-08 10:43   ` Andrzej Hajda
2022-12-07 17:17 ` [Intel-gfx] [PATCH v2 11/11] drm/i915/tc: " Jani Nikula
2022-12-08 10:44   ` Andrzej Hajda
2022-12-07 19:45 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/display: switch to intel_de_* register accessors (rev2) Patchwork
2022-12-07 20:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-12-08  2:50 ` [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=51dae3e3-8ebd-9d81-e20c-937144bcd599@intel.com \
    --to=andrzej.hajda@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