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 5137EE7719A for ; Wed, 8 Jan 2025 13:17:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0FE4D10EBC1; Wed, 8 Jan 2025 13:17:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="QK69zbtC"; dkim-atps=neutral Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 05DF810EBCB for ; Wed, 8 Jan 2025 13:17:39 +0000 (UTC) Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-386329da1d9so7879552f8f.1 for ; Wed, 08 Jan 2025 05:17:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736342197; x=1736946997; darn=lists.freedesktop.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=go7fn8G/ymJBJOoBu9CCL9fg2QtY/C41teH6UPJDvwo=; b=QK69zbtCRAA+1GbXFsdce6Yh9N/oP0+jwYoyp5JabhXb+JdC5iyogPgn/fZs91LXs+ WHkKvfXdD6bV8a+2sTQ7/65Ppx2kcv0sxY1J1pYpCybAfVWmsqOSBfEiPwLgSLPsh8it Sxmecnuk/PyG3GZ9f3CEjbj5T7v9I+8aTDuneI/0mqkVIb0JhTx94gDH9rnEgG2xTpGk qJE67OQu3w4WBOeuCHvmgpyECc3ImX2DuqUrwQzeWRuqmlgF56EJrULV3zRUh8tOKu0C fDpdaCZXQ91ztUtE5L7XT7c1iGZGyXK6DoietEa9hEme8Mzk2Z2GKxp5HXLBX92f8a6T nBIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736342197; x=1736946997; 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=go7fn8G/ymJBJOoBu9CCL9fg2QtY/C41teH6UPJDvwo=; b=KWfw8DOgmkTT6qfD8qeWSaPYIDKJdKnPzGPr0sPR/SzCX/nmkIpZL9q+l+xtF+Pjrn 36yIBK6ceKTqHnix55mh7ZyN1+q3G7N9vGX+eoXPJrwHiyuSscqDa1uiQ9gLRQncR8mu HGC4ulYFBX67ti2tADC4ujuJkAjNB34h46wwkRnwIkEXBNnwyYwwVVFqqV0SCgMzINDU 5WUIcIUxIDXSf1RLSFEatwZ6bpOYaPQ+NY4LUwsEHEqEkEYC0yh/wiJbAxnLnZWud9xK w+Ww0/IgCp+eVT+Zy+WbwXL8yt3PimYK3mOfaoeN5+qzOBuQfXr44tge4LJ44N9WWwl8 kPRQ== X-Forwarded-Encrypted: i=1; AJvYcCVJHAzB5xpCSbWdmKRB4S1cyc9cWjX8IMONcl2Hrwt+baZwyP3FL95ia3kWzvFhZzVgbYumw8NnNQ==@lists.freedesktop.org X-Gm-Message-State: AOJu0YxeMP9eFzX7AS/ZLZQpHUdstNUAKHzmGj3nucxk6S1oASWKF6Ea Xbu5IfV3/9XDypQUPt3vb4g+II9LKIAgZu3jVzBipCmfb4bqH5ZZUuZ0czxEYU8= X-Gm-Gg: ASbGncvdyk9Fln9P7hc/42NZcYTg7sFYbcwsmVy3HMluyRjuJtFR3t/wQ0dJhdUkpat Do35i/FeHPCz7hK4kKYoLkh2+9vBGtXfGIcWJOji3oCh/V7FG0xQxqs4pTNEsyVCj6dslzmHyBc jHzug8v69Hobve1ifT9HXnobujAGwUZabwJ/LAY57AWQsV7vgbINKFSgP3QdFwRHTJjS8NKQ2sY l2ZyeqXhXnZ2ev8WasNl+chPXJhRcdQdbkxiJkvnfAsed59FoV5Jwo= X-Google-Smtp-Source: AGHT+IHuzod8aMhCQ+n6NVLGNnPNVKNs6REXYs0yamrClbVZfZoa7djflMAszxH2qhTaAW4scrTx/w== X-Received: by 2002:a5d:64ed:0:b0:385:e303:8dd8 with SMTP id ffacd0b85a97d-38a872e8b18mr2604012f8f.26.1736342197530; Wed, 08 Jan 2025 05:16:37 -0800 (PST) Received: from linaro.org ([86.121.162.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c832c45sm52417065f8f.32.2025.01.08.05.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 05:16:37 -0800 (PST) Date: Wed, 8 Jan 2025 15:16:29 +0200 From: Abel Vesa To: Johan Hovold 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 , Dmitry Baryshkov , Sean Paul , Marijn Suijten , Bjorn Andersson , Konrad Dybcio , 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, Johan Hovold Subject: Re: [PATCH v3 1/4] drm/dp: Add helper to set LTTPRs in 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-1-5c367f4b0763@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" On 25-01-07 10:30:29, Johan Hovold wrote: > On Fri, Jan 03, 2025 at 02:58:15PM +0200, Abel Vesa wrote: > > According to the DisplayPort standard, LTTPRs have two operating > > modes: > > - non-transparent - it replies to DPCD LTTPR field specific AUX > > requests, while passes through all other AUX requests > > - transparent - it passes through all AUX requests. > > > > Switching between this two modes is done by the DPTX by issuing > > an AUX write to the DPCD PHY_REPEATER_MODE register. > > > > Add a generic helper that allows switching between these modes. > > > > Also add a generic wrapper for the helper that handles the explicit > > disabling of non-transparent mode and its disable->enable sequence > > mentioned in the DP Standard v2.0 section 3.6.6.1. Do this in order > > to move this handling out of the vendor specific driver implementation > > into the generic framework. > > > > Tested-by: Johan Hovold > > Signed-off-by: Abel Vesa > > > +/** > > + * drm_dp_lttpr_init - init LTTPR transparency mode according to DP standard > > + * > > + * @aux: DisplayPort AUX channel > > + * @lttpr_count: Number of LTTPRs. Between 0 and 8, according to DP standard. > > + * Negative error code for any non-valid number. > > + * See drm_dp_lttpr_count(). > > + * > > + * Returns 0 on success or a negative error code on failure. > > + */ > > +int drm_dp_lttpr_init(struct drm_dp_aux *aux, int lttpr_count) > > +{ > > + int ret; > > + > > + if (!lttpr_count) > > + return 0; > > + > > + /* > > + * 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. > > + */ > > + ret = drm_dp_lttpr_set_transparent_mode(aux, true); > > + if (ret) > > + return ret; > > + > > + if (lttpr_count < 0) > > + return -ENODEV; > > + > > + /* > > + * Roll-back to tranparent mode if setting non-tranparent mode failed > > typo: transparent (2x) Will fix. > > > + */ > > I think this comment now needs to go inside the conditional, if you want > to keep it at all. Yes, will move it. > > > + if (drm_dp_lttpr_set_transparent_mode(aux, false)) { > > + drm_dp_lttpr_set_transparent_mode(aux, true); > > + return -EINVAL; > > + } > > + > > + return 0; > > +} > > +EXPORT_SYMBOL(drm_dp_lttpr_init); > > This looks much better to me now, so with the above addressed: > > Reviewed-by: Johan Hovold Thanks for reviewing! Abel