From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 F31321D416A for ; Thu, 26 Dec 2024 12:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735214993; cv=none; b=kSQt1EgN5huvRlCraUZJoD6YhopcAsuWqNgvwpPR9w1F/8EWbYEewnqVY2fEkRtU13q3Yo7Vsiz2e1xAECyLi1ssiABnrIRp4jk9I/G7AZN1Ka2GRpAqvqpF8eDO2kL1ee549jwTTyMk1iGdwCA5IkDc215aPOQuSEfcUjYEn+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735214993; c=relaxed/simple; bh=PX0BTHSpAU0RgYKAPrHiU3ux6VgUOu7WTStvXJfqFnI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wa0R7mHTW/Hichkjgzm5Dz6ON52DgxtZ5OHlHx5Ya08SVDx5HTXqCM8aKLC4yDE2slaJjgA8JsHQE7nvOm30gKDSyBwu+jk+QpJocIB5WCNxSBTH3ctrw+VtGVyJF7IcfZ89dq27zSk89f7eWm6wATzvA7oQaS0uwDYZj75S0FQ= 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=E7XB8eSz; arc=none smtp.client-ip=209.85.221.53 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="E7XB8eSz" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-385d7b4da2bso5511813f8f.1 for ; Thu, 26 Dec 2024 04:09:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735214990; x=1735819790; 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=4yE0d6/fT2fHAjzAIYMLLWaXzKg6hYqakVFryoy6JvQ=; b=E7XB8eSz5Lmvlx9kPlcBUnznkOpCQQFtE4xLrBWLdFSenonS5qZPU43quXWYxDAlMB 03yKAkixeJxfMYjzMfTt703uEt8PddGHzbHRJ98qWyWaC/6C64qyT8HLz/q7Mlbxqora P9UfRMWr3y0f3KZVKLkDp13k0cJe8gLJ5t3R8JYkWbVZ485SFmzXQ/UICbM3PnP6ypkF on/axKVV0o8acjQPhdGFRoIB4yez/uocXcwnwl67BnDr09Uj5XRKC/lxSbb7HGGCl47C YModTUIrXYKv51UW44tNu7PPki6qJClsCkqmkWtYvJ2rvmTnPaZmOp2IsdNS43dmncIH egJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735214990; x=1735819790; 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=4yE0d6/fT2fHAjzAIYMLLWaXzKg6hYqakVFryoy6JvQ=; b=JRmkf1ATki5FuUOk0nUpSbdQdVidL654yJPgTaQolLDwhcqY72LvNazkf/+CMgdJxb 6wAD0ehd+Tziz+P5BpaVN8IdtJOd6Kf0M0KUgN9YiOuV+MHGhniXn7pAF1jvu5i3inT7 7vOnWKw7ltZ5bolBulGXbjtFtTC6sX0+VV/49ItSYzBZd+005tM9TRGtUos4Oh10lF4P YiSTOLMsvlkodWb55q0pVD8MXsHiYwRv0+vlMbVlKqYo833wbiuGrM7fq2A7DXnOfB02 aZopwFzdR8kqCdbwLpEJv8KuGLsCOw4trFs5e1zQvOw5MMhM7a3O10YYZUoOeF9h+xaN n+5Q== X-Forwarded-Encrypted: i=1; AJvYcCXBWt2K/HKJVIFvjijqJS78iJdf0neFix35nwuGLZ3HgWLFzQ0RgZTHedZJlQ5/pEHE2rTL0SNzuxXUeus=@vger.kernel.org X-Gm-Message-State: AOJu0YwUg01a3QtAKyAKHj4rQpjA8jDZ47UW9Q/xtqkMljP7eH1f7ygJ 4X07c4o5EzSD3F7WB94f0aFnrSKnNBhQAGyV+mfL3KNgYwiOyyfPxrFCDDVr7jw= X-Gm-Gg: ASbGncv7HOO3Q3THUqG+2efM7+sGP76o2oERZ13D+apWeCfBI+mAOQt5B57AW9Br/+v EH9yQcnvokvydGNy3uEdWcPwoUrzRPzY0+lpEPE79DZs8mKStGN64NwAQeSj+e3JJACrw7Eyroc gkC4b9vJEFpa5pET6gubjzjNOucCUHKRGKUlikXMcq+4qG5pH0ySMZEq8Tm6i+grco0La4JNITN XJcnNwWRxXoi/DdpDicUq+Ai1/NKBglcF0nWixQIBeh5M/IlkiF+qY= X-Google-Smtp-Source: AGHT+IE7Mzk62uTd4yycH28u5xCSB39eiD96qbQg0fIjJMfiTxkRYB+ECRA3AUQrSJ8HACLT9c1tFw== X-Received: by 2002:a05:6000:400b:b0:385:ee3f:5cbf with SMTP id ffacd0b85a97d-38a221eab74mr22082237f8f.20.1735214990215; Thu, 26 Dec 2024 04:09:50 -0800 (PST) Received: from linaro.org ([82.76.168.176]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c89e1cesm19043982f8f.64.2024.12.26.04.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 04:09:48 -0800 (PST) Date: Thu, 26 Dec 2024 14:09:46 +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 Subject: Re: [PATCH v2 1/4] drm/dp: Add helper to set LTTPRs in transparent mode Message-ID: References: <20241211-drm-dp-msm-add-lttpr-transparent-mode-set-v2-0-d5906ed38b28@linaro.org> <20241211-drm-dp-msm-add-lttpr-transparent-mode-set-v2-1-d5906ed38b28@linaro.org> 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 24-12-11 21:22:00, Dmitry Baryshkov wrote: > On Wed, Dec 11, 2024 at 03:04:12PM +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. > > > > Signed-off-by: Abel Vesa > > --- > > drivers/gpu/drm/display/drm_dp_helper.c | 50 +++++++++++++++++++++++++++++++++ > > include/drm/display/drm_dp_helper.h | 2 ++ > > 2 files changed, 52 insertions(+) > > > > > > +/** > > + * drm_dp_lttpr_init - init LTTPR transparency mode according to DP standard > > + * > > + * @aux: DisplayPort AUX channel > > + * @lttpr_count: Number of LTTPRs > > + * > > + * Returns 0 on success or a negative error code on failure. > > + */ > > +int drm_dp_lttpr_init(struct drm_dp_aux *aux, int lttpr_count) > > +{ > > + 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. > > + */ > > + drm_dp_lttpr_set_transparent_mode(aux, true); > > + > > + if (lttpr_count > 0 && !drm_dp_lttpr_set_transparent_mode(aux, false)) > > + return 0; > > + > > + /* > > + * Roll-back to tranparent mode if setting non-tranparent mode failed or > > + * the number of LTTPRs is invalid > > + */ > > + drm_dp_lttpr_set_transparent_mode(aux, true); > > This means that if lttpr_count < 0, then there will be two requests to > set LTTPRs to a transparent mode. Is that expected? Yes, exactly. If counting the LTTPRs (see drm_dp_lttpr_count) results in an invalid number (e.g. more than 8), then according to the DP standard, we need to roll back to transparent mode. Do you think I need to re-word the comment above more to make it more clearer? > > > + > > + return -EINVAL; > > +} > > +EXPORT_SYMBOL(drm_dp_lttpr_init); > > + > > -- > With best wishes > Dmitry Thanks for reviewing, Abel