[PATCH 1/7] drm/i915/vblank: use drm_crtc_vblank_crtc() instead of open-coding
Rodrigo Vivi
rodrigo.vivi at intel.com
Thu Aug 22 21:37:26 UTC 2024
On Thu, Aug 22, 2024 at 07:04:49PM +0300, Jani Nikula wrote:
> There's a helper for drm->vblank[drm_crtc_index(crtc)], use it.
>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_vblank.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_vblank.c b/drivers/gpu/drm/i915/display/intel_vblank.c
> index f183e0d4b2ba..551e9ca9bb99 100644
> --- a/drivers/gpu/drm/i915/display/intel_vblank.c
> +++ b/drivers/gpu/drm/i915/display/intel_vblank.c
> @@ -68,7 +68,7 @@
> u32 i915_get_vblank_counter(struct drm_crtc *crtc)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> - struct drm_vblank_crtc *vblank = &dev_priv->drm.vblank[drm_crtc_index(crtc)];
> + struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
> const struct drm_display_mode *mode = &vblank->hwmode;
> enum pipe pipe = to_intel_crtc(crtc)->pipe;
> u32 pixel, vbl_start, hsync_start, htotal;
> @@ -120,7 +120,7 @@ u32 i915_get_vblank_counter(struct drm_crtc *crtc)
> u32 g4x_get_vblank_counter(struct drm_crtc *crtc)
> {
> struct drm_i915_private *dev_priv = to_i915(crtc->dev);
> - struct drm_vblank_crtc *vblank = &dev_priv->drm.vblank[drm_crtc_index(crtc)];
> + struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
> enum pipe pipe = to_intel_crtc(crtc)->pipe;
>
> if (!vblank->max_vblank_count)
> --
> 2.39.2
>
More information about the Intel-gfx
mailing list