[Intel-gfx] [PATCH 1/8] drm/i915/display: use drm_crtc_wait_one_vblank() directly when possible

Ville Syrjälä ville.syrjala at linux.intel.com
Thu Nov 25 10:32:46 UTC 2021


On Mon, Nov 22, 2021 at 03:51:02PM +0200, Jani Nikula wrote:
> intel_wait_for_vblank() goes through a pipe to crtc lookup, while in
> most cases we already have the crtc available. Avoid the extra lookups.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_crt.c      |  4 +--
>  drivers/gpu/drm/i915/display/intel_display.c  | 29 +++++++++----------
>  .../drm/i915/display/intel_display_types.h    |  4 +--
>  drivers/gpu/drm/i915/display/intel_dp.c       |  2 +-
>  drivers/gpu/drm/i915/display/intel_sdvo.c     |  2 +-
>  drivers/gpu/drm/i915/display/intel_tv.c       |  7 ++---
>  6 files changed, 23 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_crt.c b/drivers/gpu/drm/i915/display/intel_crt.c
> index f0f28572dfdc..8796527f74e5 100644
> --- a/drivers/gpu/drm/i915/display/intel_crt.c
> +++ b/drivers/gpu/drm/i915/display/intel_crt.c
> @@ -321,8 +321,8 @@ static void hsw_enable_crt(struct intel_atomic_state *state,
>  
>  	intel_crt_set_dpms(encoder, crtc_state, DRM_MODE_DPMS_ON);
>  
> -	intel_wait_for_vblank(dev_priv, pipe);
> -	intel_wait_for_vblank(dev_priv, pipe);
> +	drm_crtc_wait_one_vblank(&crtc->base);
> +	drm_crtc_wait_one_vblank(&crtc->base);

That function really is poorly named. Makes me think it's waiting until
one vblank period has passed or something. We should probably rename it
to actually make sense. Or we could just keep an intel_crtc based wrapper
with a more sensible name. The most honest name might actually be
...wait_for_next_vblank().

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list