Commit 0097ecd0 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Use drm_crtc_vblank_crtc()

Replace the open coded drm_crtc_vblank_crtc() with the real
thing.

Cc: intel-gfx@lists.freedesktop.org
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240408190611.24914-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent cd6891f8
...@@ -78,8 +78,7 @@ void intel_wait_for_vblank_if_active(struct drm_i915_private *i915, ...@@ -78,8 +78,7 @@ void intel_wait_for_vblank_if_active(struct drm_i915_private *i915,
u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc) u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
{ {
struct drm_device *dev = crtc->base.dev; struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(&crtc->base);
struct drm_vblank_crtc *vblank = &dev->vblank[drm_crtc_index(&crtc->base)];
if (!crtc->active) if (!crtc->active)
return 0; return 0;
......
...@@ -132,8 +132,7 @@ u32 g4x_get_vblank_counter(struct drm_crtc *crtc) ...@@ -132,8 +132,7 @@ u32 g4x_get_vblank_counter(struct drm_crtc *crtc)
static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc) static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc)
{ {
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
struct drm_vblank_crtc *vblank = struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(&crtc->base);
&crtc->base.dev->vblank[drm_crtc_index(&crtc->base)];
const struct drm_display_mode *mode = &vblank->hwmode; const struct drm_display_mode *mode = &vblank->hwmode;
u32 htotal = mode->crtc_htotal; u32 htotal = mode->crtc_htotal;
u32 clock = mode->crtc_clock; u32 clock = mode->crtc_clock;
...@@ -178,8 +177,7 @@ static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc) ...@@ -178,8 +177,7 @@ static u32 intel_crtc_scanlines_since_frame_timestamp(struct intel_crtc *crtc)
*/ */
static u32 __intel_get_crtc_scanline_from_timestamp(struct intel_crtc *crtc) static u32 __intel_get_crtc_scanline_from_timestamp(struct intel_crtc *crtc)
{ {
struct drm_vblank_crtc *vblank = struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(&crtc->base);
&crtc->base.dev->vblank[drm_crtc_index(&crtc->base)];
const struct drm_display_mode *mode = &vblank->hwmode; const struct drm_display_mode *mode = &vblank->hwmode;
u32 vblank_start = mode->crtc_vblank_start; u32 vblank_start = mode->crtc_vblank_start;
u32 vtotal = mode->crtc_vtotal; u32 vtotal = mode->crtc_vtotal;
...@@ -200,17 +198,14 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc) ...@@ -200,17 +198,14 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
{ {
struct drm_device *dev = crtc->base.dev; struct drm_device *dev = crtc->base.dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
const struct drm_display_mode *mode; struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(&crtc->base);
struct drm_vblank_crtc *vblank; const struct drm_display_mode *mode = &vblank->hwmode;
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
int position, vtotal; int position, vtotal;
if (!crtc->active) if (!crtc->active)
return 0; return 0;
vblank = &crtc->base.dev->vblank[drm_crtc_index(&crtc->base)];
mode = &vblank->hwmode;
if (crtc->mode_flags & I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP) if (crtc->mode_flags & I915_MODE_FLAG_GET_SCANLINE_FROM_TIMESTAMP)
return __intel_get_crtc_scanline_from_timestamp(crtc); return __intel_get_crtc_scanline_from_timestamp(crtc);
...@@ -254,8 +249,7 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc) ...@@ -254,8 +249,7 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc)
int intel_crtc_scanline_to_hw(struct intel_crtc *crtc, int scanline) int intel_crtc_scanline_to_hw(struct intel_crtc *crtc, int scanline)
{ {
const struct drm_vblank_crtc *vblank = const struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(&crtc->base);
&crtc->base.dev->vblank[drm_crtc_index(&crtc->base)];
const struct drm_display_mode *mode = &vblank->hwmode; const struct drm_display_mode *mode = &vblank->hwmode;
int vtotal; int vtotal;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment