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 334D3C2BD09 for ; Wed, 3 Jul 2024 12:10:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF83510E7CB; Wed, 3 Jul 2024 12:10:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Iju8lXXf"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9D19310E7CB for ; Wed, 3 Jul 2024 12:10:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720008604; x=1751544604; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=OOTbCK8DENAo1Hlkx0mqm/U4cDMtqpVw+okoFctDVEE=; b=Iju8lXXfUnXoeOYONf4sFYLNHsCNrUaV8aJpwuIO6IvW6N9+UtVAUspq xziNJmVKAxXzvbOz2mG07u+6bGCxBAnXTGhTOjPPia20XwVAMeEZEtbFU W6bGB0HWc/Bqyrnqw1q0xE/YFTZGkZZCjiQfae5wyDXUwRY4vmQ9jJtLE BOq8RxLxwJ4sp2O3mYxZuhQu5YPaaV9oopcrraKOQ+UEOVdZIAPuc8GyT 8XyUHvc8ZySu0dzWXGU9xzUMtGyODRu2eIg8JXtrJ7/yvSfdnZKrtKpnC dQywRDnJNHkQIJs9jbW1FzlZ8P2wbvdbHHGrGeuF+2wxfUWB7oeESIPQc g==; X-CSE-ConnectionGUID: rI2Z8pWqTGSuv7bbiSrcrg== X-CSE-MsgGUID: n2voNem2TZyR0DRf/XA5Aw== X-IronPort-AV: E=McAfee;i="6700,10204,11121"; a="17069535" X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="17069535" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2024 05:10:04 -0700 X-CSE-ConnectionGUID: GBHrXcF1S9myjzT073ZXIQ== X-CSE-MsgGUID: FU+WWaMhSmWXvKSSKqImhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,182,1716274800"; d="scan'208";a="46211341" Received: from stinkpipe.fi.intel.com (HELO stinkbox) ([10.237.72.74]) by fmviesa008.fm.intel.com with SMTP; 03 Jul 2024 05:10:01 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 03 Jul 2024 15:10:00 +0300 Date: Wed, 3 Jul 2024 15:10:00 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: "Manna, Animesh" Cc: "intel-gfx@lists.freedesktop.org" Subject: Re: [PATCH 09/14] drm/i915/dsb: Introduce intel_dsb_wait_scanline_{in, out}() Message-ID: References: <20240624191032.27333-1-ville.syrjala@linux.intel.com> <20240624191032.27333-10-ville.syrjala@linux.intel.com> 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 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, Jul 03, 2024 at 03:07:04PM +0300, Ville Syrjälä wrote: > On Wed, Jul 03, 2024 at 11:37:33AM +0000, Manna, Animesh wrote: > > > > > > > -----Original Message----- > > > From: Intel-gfx On Behalf Of Ville > > > Syrjala > > > Sent: Tuesday, June 25, 2024 12:40 AM > > > To: intel-gfx@lists.freedesktop.org > > > Subject: [PATCH 09/14] drm/i915/dsb: Introduce > > > intel_dsb_wait_scanline_{in, out}() > > > > > > From: Ville Syrjälä > > > > > > Add functions to emit a DSB scanline window wait instructions. > > > We can either wait for the scanline to be IN the window or OUT of the > > > window. > > > > > > The hardware doesn't handle wraparound so we must manually deal with it > > > by swapping the IN range to the inverse OUT range, or vice versa. > > > > > > Also add a bit of paranoia to catch the edge case of waiting for the entire > > > frame. That doesn't make sense since an IN wait would be a nop, and an > > > OUT wait would imply waiting forever. Most of the time this also results in > > > both scanline ranges (original and inverted) to have lower=upper+1 which is > > > nonsense from the hw POV. > > > > > > For now we are only handling the case where the scanline wait happens prior > > > to latching the double buffered registers during the commit (which might > > > change the timings due to LRR/VRR/etc.) > > > > > > Signed-off-by: Ville Syrjälä > > > --- > > > drivers/gpu/drm/i915/display/intel_dsb.c | 73 ++++++++++++++++++++++++ > > > drivers/gpu/drm/i915/display/intel_dsb.h | 6 ++ > > > 2 files changed, 79 insertions(+) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c > > > b/drivers/gpu/drm/i915/display/intel_dsb.c > > > index 81937908c798..092cf082ac39 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_dsb.c > > > +++ b/drivers/gpu/drm/i915/display/intel_dsb.c > > > @@ -362,6 +362,79 @@ void intel_dsb_nonpost_end(struct intel_dsb *dsb) > > > intel_dsb_noop(dsb, 4); > > > } > > > > > > +static void intel_dsb_emit_wait_dsl(struct intel_dsb *dsb, > > > + u32 opcode, int lower, int upper) { > > > + u64 window = ((u64)upper << DSB_SCANLINE_UPPER_SHIFT) | > > > + ((u64)lower << DSB_SCANLINE_LOWER_SHIFT); > > > + > > > + intel_dsb_emit(dsb, lower_32_bits(window), > > > + (opcode << DSB_OPCODE_SHIFT) | > > > + upper_32_bits(window)); > > > +} > > > + > > > +static void intel_dsb_wait_dsl(struct intel_atomic_state *state, > > > + struct intel_dsb *dsb, > > > + int lower_in, int upper_in, > > > > Lower/upper keyword maybe confusing for during intel_dsb_wait_scanline_out(), maybe good to have name like in_start and in_end, similarly out_start and out_end. > > lower/upper are what bspec calls them. I decided to stick to that > terminology in lower level parts of the code where we actually > deal with hw units. I used start/end in the user facing api to > make it a bit clearer that having start > end is perfectly > valid. I suppose one could argue intel_dsb_wait_dsl() should still use the start/end terminology as the input are not yet in hw units. Shrug. -- Ville Syrjälä Intel