From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B372F17588 for ; Wed, 8 Jan 2025 13:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736342138; cv=none; b=IhQKS48NVFaBi3O0rUU+HWBeFCdboXYgc5xqC3UqDcvNKPQWmWshRvkkiUkuLAaA+Sz+/p2oAJUS0z+aRiCvEQqxYUhPRB1Ip6oMeYmmneuRPI2BuZbLxjqqXriH1rWfFQUI04FGyXeWLaoY7IC0FK9JmdAOySgvHAtzE/mH2pE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736342138; c=relaxed/simple; bh=ow/aSlCEf2Hi14L6VuMKcpD9Uxo7OK+XkrVWkv7Gr1w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aljrnKguD8/r/asXIG3rytPE0/cb3ltkK/vMNmNbXj+P89+0YHBCdHTt5vdzY9hk60TalADrMZYput6+82j4GU4dCCNOrr9eSgYHueweKp81lsH2R4U9OMhRJdhQBL06DnbIF95UFF+Re314z5EOysgrMupQIk4HJTsPnLuOdDA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BdAel2OR; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BdAel2OR" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-43690d4605dso78959135e9.0 for ; Wed, 08 Jan 2025 05:15:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736342135; x=1736946935; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RJuigyfwmP8g+AjzZPBKqd3NanhyQaBWQuNEBkBgD08=; b=BdAel2ORKhaY7x+YrdKI63NhsjzBCuguCOWsj2BdwZB8xY59rRVw2/anKjGOo1EdT4 OaU53CSr56aa0fuR97Y2znGyR/5Z3aZQIzxRm7njH/wPAUff9ObzRq4Sd7jl/yMR/a8p 5QZfsyvGcVUJzanXBSTyQfMuEzrNMqoV1nLUR4yEPCiuS+bd2YdUTja2g6o9FYixOKLo pE/cZls0KCOSzbacwPJRHemFLpFlmpAiwn1eMU0fGGVvBxQs44XwilWOOeOqynyPDRgN P5UzB6dGZds2WvSK3TNbbdA5kzSKvG8H7rvHpC0IaBkHqiswGE2QNLKq8RGYdXKWO7Ob n0Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736342135; x=1736946935; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RJuigyfwmP8g+AjzZPBKqd3NanhyQaBWQuNEBkBgD08=; b=rtulj5jpw0EKA92PSp3/l2RGpLxQaefR+/9n+sGbcK+txn19YzYFJgD7bAhUFH3NHt E36Oy4caTRgCh39sELEkYeaEKBVN1PNtTqdMH2RpZB0a2l/ikKV5exHPYNnZ0+e51+ws tvDlrE0WcN0mOhVP1/P0WEBdYTmECG36wP8WfJoHdh9WmItKPENTe34xY3gMCMRs1W0W 0pQuIZCZykVFtiISsG1lska0ckT/wdy3rSQtla4qOSv8NquvyQqJhzwWoGVlQX39jNqW 95lFvCWG8nld68gYYEtsvWheAISbHVz5hyIA/Xb5Hl3o68vWs5FdY3mSxh/3pVLmto2K 166w== X-Forwarded-Encrypted: i=1; AJvYcCUNRaupvpRBGU97RiOldRoDqpTNwmCzVA/X83RYh/ata2uJkDOGuedinGZ8ekD2ZiXN00T2Pl9QyCMdZ0c=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+w6ElbdlcHh5Mo3MelA7ETXfHCcLhf3ZpCJPZDrb5BRjL3UAA wHB3q6qqxVpFgw3kH09fxYAxBXpr1EtkSyJ5G53SWwEY0Ta3tqIUcgMslhltNI0= X-Gm-Gg: ASbGncvU0dTSr5QXYgT1qu9E1coOB8lrYr44P02MXJSq0mo5KvG/8Q48/wIb185C9YH N+jeS1ZfXPkRE7MWz7hv+4r69NpzSmpcXd4dsk8j2zFg5hjAyjVcpKtjS47FK5umgJn145goTZK bZjICvWSXV1gAqgExfmoFnMbI4RVrEdYdkvMdjW4G/d6VPMekX+VKFrT66PLZfTRNLbuP75wl7E cowt5+VO+btQW8T8QJ/tk8GS4coEIguCfyJuKgS4G8+B5hrgg/hDlQ= X-Google-Smtp-Source: AGHT+IEBlTrxBtjf7901ssDCnGeSN4NcUwtvM8JV72Q4zJ9UCPrPz4BdIknjwwKXyCc18LVEe1ItmQ== X-Received: by 2002:a05:600c:3b91:b0:436:46f9:4fc6 with SMTP id 5b1f17b1804b1-436e26928e6mr24415245e9.8.1736342135088; Wed, 08 Jan 2025 05:15:35 -0800 (PST) Received: from linaro.org ([86.121.162.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e21e1esm20577465e9.38.2025.01.08.05.15.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 05:15:34 -0800 (PST) Date: Wed, 8 Jan 2025 15:15:29 +0200 From: Abel Vesa To: Dmitry Baryshkov Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Karol Herbst , Lyude Paul , Danilo Krummrich , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Bjorn Andersson , Konrad Dybcio , Johan Hovold , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Imre Deak Subject: Re: [PATCH v3 3/4] drm/i915/dp: Use the generic helper to control LTTPR transparent mode Message-ID: References: <20250103-drm-dp-msm-add-lttpr-transparent-mode-set-v3-0-5c367f4b0763@linaro.org> <20250103-drm-dp-msm-add-lttpr-transparent-mode-set-v3-3-5c367f4b0763@linaro.org> <3p3wgzhtptjexplxrluod6sk36xeltpoh4hxg2yagssw7nh7hj@ikc4rssp6zej> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 25-01-08 15:11:50, Dmitry Baryshkov wrote: > On Mon, Jan 06, 2025 at 02:45:48PM +0200, Abel Vesa wrote: > > On 25-01-03 20:09:42, Dmitry Baryshkov wrote: > > > On Fri, Jan 03, 2025 at 02:58:17PM +0200, Abel Vesa wrote: > > > > LTTPRs operating modes are defined by the DisplayPort standard and the > > > > generic framework now provides a helper to switch between them, which > > > > is handling the explicit disabling of non-transparent mode and its > > > > disable->enable sequence mentioned in the DP Standard v2.0 section > > > > 3.6.6.1. > > > > > > > > So use the new drm generic helper instead as it makes the code a bit > > > > cleaner. > > > > > > > > Acked-by: Imre Deak > > > > Signed-off-by: Abel Vesa > > > > --- > > > > .../gpu/drm/i915/display/intel_dp_link_training.c | 24 +++++----------------- > > > > 1 file changed, 5 insertions(+), 19 deletions(-) > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c > > > > index 8b1977cfec503c70f07af716ee2c00e7605c6adf..c5bad311edf7b9a5cebb633b9e9692bae397f9ed 100644 > > > > --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c > > > > +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c > > > > @@ -119,9 +119,6 @@ intel_dp_set_lttpr_transparent_mode(struct intel_dp *intel_dp, bool enable) > > > > u8 val = enable ? DP_PHY_REPEATER_MODE_TRANSPARENT : > > > > DP_PHY_REPEATER_MODE_NON_TRANSPARENT; > > > > > > > > - if (drm_dp_dpcd_write(&intel_dp->aux, DP_PHY_REPEATER_MODE, &val, 1) != 1) > > > > - return false; > > > > - > > > > intel_dp->lttpr_common_caps[DP_PHY_REPEATER_MODE - > > > > DP_LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV] = val; > > > > > > > > @@ -146,6 +143,7 @@ static bool intel_dp_lttpr_transparent_mode_enabled(struct intel_dp *intel_dp) > > > > static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_RECEIVER_CAP_SIZE]) > > > > { > > > > int lttpr_count; > > > > + int ret; > > > > > > > > if (!intel_dp_read_lttpr_common_caps(intel_dp, dpcd)) > > > > return 0; > > > > @@ -172,22 +170,8 @@ static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_ > > > > return lttpr_count; > > > > } > > > > > > > > - /* > > > > - * See DP Standard v2.0 3.6.6.1. about the explicit disabling of > > > > - * non-transparent mode and the disable->enable non-transparent mode > > > > - * sequence. > > > > - */ > > > > - intel_dp_set_lttpr_transparent_mode(intel_dp, true); > > > > - > > > > - /* > > > > - * In case of unsupported number of LTTPRs or failing to switch to > > > > - * non-transparent mode fall-back to transparent link training mode, > > > > - * still taking into account any LTTPR common lane- rate/count limits. > > > > - */ > > > > - if (lttpr_count < 0) > > > > - goto out_reset_lttpr_count; > > > > - > > > > - if (!intel_dp_set_lttpr_transparent_mode(intel_dp, false)) { > > > > + ret = drm_dp_lttpr_init(&intel_dp->aux, lttpr_count); > > > > + if (ret) { > > > > lt_dbg(intel_dp, DP_PHY_DPRX, > > > > "Switching to LTTPR non-transparent LT mode failed, fall-back to transparent mode\n"); > > > > > > > > @@ -196,6 +180,8 @@ static int intel_dp_init_lttpr_phys(struct intel_dp *intel_dp, const u8 dpcd[DP_ > > > > goto out_reset_lttpr_count; > > > > } > > > > > > > > + intel_dp_set_lttpr_transparent_mode(intel_dp, false); > > > > + > > > > > > I think the code now misses a way to update intel_dp->lttpr_common_caps > > > in a transparent-mode case: > > > intel_dp_set_lttpr_transparent_mode(intel_dp, true). > > > > It is being called if the drm_dp_lttpr_init() returns a non-zero value, > > but that is not part of the diff here. > > Ack, thanks for the explanation. I'd suggest mentioning that in the > commit message. Sure. Will do. > > > > > > > > > > return lttpr_count; > > > > > > > > out_reset_lttpr_count: > > > > > > > > -- > > > > 2.34.1 > > > > > > > > > > -- > > > With best wishes > > > Dmitry > > -- > With best wishes > Dmitry Thanks for reviewing! Abel