All of lore.kernel.org
 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>,
	<intel-xe@lists.freedesktop.org>, <lucas.demarchi@intel.com>
Subject: Re: [PATCH 3/6] drm/xe/pcode: add struct drm_device based interface
Date: Mon, 16 Jun 2025 16:44:52 -0400	[thread overview]
Message-ID: <aFCCRKolGMjo9p04@intel.com> (raw)
In-Reply-To: <d121307f4b50473cf0fbba8f8859c72de5f6fceb.1749119274.git.jani.nikula@intel.com>

On Thu, Jun 05, 2025 at 01:29:35PM +0300, Jani Nikula wrote:
> In preparation for dropping the dependency on struct intel_uncore or
> struct xe_tile from display code, add a struct drm_device based
> interface to pcode.

great idea!

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

> 
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_pcode.c | 26 ++++++++++++++++++++++++++
>  drivers/gpu/drm/xe/xe_pcode.h | 12 +++++++++++-
>  2 files changed, 37 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
> index 9189117fe825..87323ad0cbbb 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.c
> +++ b/drivers/gpu/drm/xe/xe_pcode.c
> @@ -336,3 +336,29 @@ int xe_pcode_probe_early(struct xe_device *xe)
>  	return xe_pcode_ready(xe, false);
>  }
>  ALLOW_ERROR_INJECTION(xe_pcode_probe_early, ERRNO); /* See xe_pci_probe */
> +
> +/* Helpers with drm device */
> +int intel_pcode_read(struct drm_device *drm, u32 mbox, u32 *val, u32 *val1)
> +{
> +	struct xe_device *xe = to_xe_device(drm);
> +	struct xe_tile *tile = xe_device_get_root_tile(xe);
> +
> +	return xe_pcode_read(tile, mbox, val, val1);
> +}
> +
> +int intel_pcode_write_timeout(struct drm_device *drm, u32 mbox, u32 val, int timeout_ms)
> +{
> +	struct xe_device *xe = to_xe_device(drm);
> +	struct xe_tile *tile = xe_device_get_root_tile(xe);
> +
> +	return xe_pcode_write_timeout(tile, mbox, val, timeout_ms);
> +}
> +
> +int intel_pcode_request(struct drm_device *drm, u32 mbox, u32 request,
> +			u32 reply_mask, u32 reply, int timeout_base_ms)
> +{
> +	struct xe_device *xe = to_xe_device(drm);
> +	struct xe_tile *tile = xe_device_get_root_tile(xe);
> +
> +	return xe_pcode_request(tile, mbox, request, reply_mask, reply, timeout_base_ms);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_pcode.h b/drivers/gpu/drm/xe/xe_pcode.h
> index de38f44f3201..a5584c1c75f9 100644
> --- a/drivers/gpu/drm/xe/xe_pcode.h
> +++ b/drivers/gpu/drm/xe/xe_pcode.h
> @@ -7,8 +7,10 @@
>  #define _XE_PCODE_H_
>  
>  #include <linux/types.h>
> -struct xe_tile;
> +
> +struct drm_device;
>  struct xe_device;
> +struct xe_tile;
>  
>  void xe_pcode_init(struct xe_tile *tile);
>  int xe_pcode_probe_early(struct xe_device *xe);
> @@ -32,4 +34,12 @@ int xe_pcode_request(struct xe_tile *tile, u32 mbox, u32 request,
>  	| FIELD_PREP(PCODE_MB_PARAM1, param1)\
>  	| FIELD_PREP(PCODE_MB_PARAM2, param2))
>  
> +/* Helpers with drm device */
> +int intel_pcode_read(struct drm_device *drm, u32 mbox, u32 *val, u32 *val1);
> +int intel_pcode_write_timeout(struct drm_device *drm, u32 mbox, u32 val, int timeout_ms);
> +#define intel_pcode_write(drm, mbox, val) \
> +	intel_pcode_write_timeout((drm), (mbox), (val), 1)
> +int intel_pcode_request(struct drm_device *drm, u32 mbox, u32 request,
> +			u32 reply_mask, u32 reply, int timeout_base_ms);
> +
>  #endif
> -- 
> 2.39.5
> 

  reply	other threads:[~2025-06-16 20:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-05 10:29 [PATCH 0/6] drm/i915, drm/xe: add drm device based pcode interface for display Jani Nikula
2025-06-05 10:29 ` [PATCH 1/6] drm/i915/pcode: drop fast wait from snb_pcode_write_timeout() Jani Nikula
2025-06-16 20:41   ` Rodrigo Vivi
2025-06-16 20:48   ` Rodrigo Vivi
2025-06-16 20:48   ` Rodrigo Vivi
2025-06-05 10:29 ` [PATCH 2/6] drm/i915/pcode: add struct drm_device based interface Jani Nikula
2025-06-16 20:45   ` Rodrigo Vivi
2025-06-05 10:29 ` [PATCH 3/6] drm/xe/pcode: " Jani Nikula
2025-06-16 20:44   ` Rodrigo Vivi [this message]
2025-06-05 10:29 ` [PATCH 4/6] drm/i915/display: switch to struct drm_device based pcode interface Jani Nikula
2025-06-16 20:47   ` Rodrigo Vivi
2025-06-17  8:29     ` Jani Nikula
2025-06-18 13:48       ` Rodrigo Vivi
2025-06-05 10:29 ` [PATCH 5/6] drm/i915/dram: " Jani Nikula
2025-06-18 13:49   ` Rodrigo Vivi
2025-06-05 10:29 ` [PATCH 6/6] drm/xe/compat: remove old pcode compat interface Jani Nikula
2025-06-18 13:49   ` Rodrigo Vivi
2025-06-05 12:33 ` ✗ Fi.CI.SPARSE: warning for drm/i915, drm/xe: add drm device based pcode interface for display Patchwork
2025-06-05 12:56 ` ✓ i915.CI.BAT: success " Patchwork
2025-06-18 15:27   ` Jani Nikula
2025-06-05 14:51 ` ✓ CI.Patch_applied: " Patchwork
2025-06-05 14:51 ` ✓ CI.checkpatch: " Patchwork
2025-06-05 14:52 ` ✓ CI.KUnit: " Patchwork
2025-06-05 15:03 ` ✓ CI.Build: " Patchwork
2025-06-05 15:06 ` ✓ CI.Hooks: " Patchwork
2025-06-05 15:08 ` ✗ CI.checksparse: warning " Patchwork
2025-06-06  5:29 ` ✓ Xe.CI.BAT: success " Patchwork
2025-06-06 23:06 ` ✗ Xe.CI.Full: failure " Patchwork
2025-06-23 10:49 ` ✗ Fi.CI.BUILD: failure for drm/i915, drm/xe: add drm device based pcode interface for display (rev2) 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=aFCCRKolGMjo9p04@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=lucas.demarchi@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.