diff mbox series

[v2,4/6] drm/i915/gvt: do not use implict dev_priv in DSPSURF_TO_PIPE()

Message ID 2ff78ebd0dc84178f5feacee7ef2a6cb4132b9ae.1717773890.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: gvt register macro cleanups, unused macro removals | expand

Commit Message

Jani Nikula June 7, 2024, 3:25 p.m. UTC
Do not rely on having dev_priv local variable, pass it to the macro.

Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhi Wang <zhi.wang.linux@gmail.com>
Cc: intel-gvt-dev@lists.freedesktop.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/gvt/handlers.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Zhi Wang June 10, 2024, 10:58 a.m. UTC | #1
On Fri,  7 Jun 2024 18:25:38 +0300
Jani Nikula <jani.nikula@intel.com> wrote:

> Do not rely on having dev_priv local variable, pass it to the macro.
> 
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Cc: Zhi Wang <zhi.wang.linux@gmail.com>
> Cc: intel-gvt-dev@lists.freedesktop.org
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/handlers.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/handlers.c
> b/drivers/gpu/drm/i915/gvt/handlers.c index
> f79dd6cfc75b..0f09344d3c20 100644 ---
> a/drivers/gpu/drm/i915/gvt/handlers.c +++
> b/drivers/gpu/drm/i915/gvt/handlers.c @@ -1009,14 +1009,14 @@ static
> int south_chicken2_mmio_write(struct intel_vgpu *vgpu, return 0;
>  }
>  
> -#define DSPSURF_TO_PIPE(offset) \
> +#define DSPSURF_TO_PIPE(dev_priv, offset) \
>  	calc_index(offset, DSPSURF(dev_priv, PIPE_A),
> DSPSURF(dev_priv, PIPE_B), DSPSURF(dev_priv, PIPE_C)) 
>  static int pri_surf_mmio_write(struct intel_vgpu *vgpu, unsigned int
> offset, void *p_data, unsigned int bytes)
>  {
>  	struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915;
> -	u32 pipe = DSPSURF_TO_PIPE(offset);
> +	u32 pipe = DSPSURF_TO_PIPE(dev_priv, offset);
>  	int event = SKL_FLIP_EVENT(pipe, PLANE_PRIMARY);
>  
>  	write_vreg(vgpu, offset, p_data, bytes);

Reviewed-by: Zhi Wang <zhiwang@kernel.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
index f79dd6cfc75b..0f09344d3c20 100644
--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -1009,14 +1009,14 @@  static int south_chicken2_mmio_write(struct intel_vgpu *vgpu,
 	return 0;
 }
 
-#define DSPSURF_TO_PIPE(offset) \
+#define DSPSURF_TO_PIPE(dev_priv, offset) \
 	calc_index(offset, DSPSURF(dev_priv, PIPE_A), DSPSURF(dev_priv, PIPE_B), DSPSURF(dev_priv, PIPE_C))
 
 static int pri_surf_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
 		void *p_data, unsigned int bytes)
 {
 	struct drm_i915_private *dev_priv = vgpu->gvt->gt->i915;
-	u32 pipe = DSPSURF_TO_PIPE(offset);
+	u32 pipe = DSPSURF_TO_PIPE(dev_priv, offset);
 	int event = SKL_FLIP_EVENT(pipe, PLANE_PRIMARY);
 
 	write_vreg(vgpu, offset, p_data, bytes);