From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5F72C433F5 for ; Thu, 25 Nov 2021 10:32:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2EED66E9B2; Thu, 25 Nov 2021 10:32:52 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 06E696E9B2 for ; Thu, 25 Nov 2021 10:32:49 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10178"; a="232986596" X-IronPort-AV: E=Sophos;i="5.87,263,1631602800"; d="scan'208";a="232986596" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Nov 2021 02:32:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,263,1631602800"; d="scan'208";a="591971667" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by FMSMGA003.fm.intel.com with SMTP; 25 Nov 2021 02:32:47 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 25 Nov 2021 12:32:46 +0200 Date: Thu, 25 Nov 2021 12:32:46 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Jani Nikula Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Hint: comment Subject: Re: [Intel-gfx] [PATCH 1/8] drm/i915/display: use drm_crtc_wait_one_vblank() directly when possible X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 > --- > 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