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 34D811F8906 for ; Wed, 8 Jan 2025 13:16:39 +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=1736342201; cv=none; b=Z7wmBKpQmTlKmAgJtx0JyvpDuQ+D+NTq0wm5RsO0d7wzR+4yoa1p52/EPgK0h5gBF077pUARwOzS1YI5UbDSWEGrNXnymSDvoo79cfIGtJBRI0TvtPUyB1dqbiGvXs2qNCdEwp2Djw5+8LYTX6am3xnneeNpdzCgmTq273kGV4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736342201; c=relaxed/simple; bh=58fHc2ylZsBzk/+g0gPOZYXbq7Taq9dz4tCVApLQD6M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cd2fuiDFmiLKJhcA+/iTatrUwz5YmRHB0C3KfrKoReHOTyHA9zgVnQfJCzIoaFgx50vFnNEcaprxdRt9XWw5eeQca+mVVw8lqr2y6+fAMtxpY9QYJ7HeAtkip+MSMwoy7sga7JddROC3goW8OV7PomdVtrXeYT1/RSDTfzvqV8I= 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=naKhyRqE; 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="naKhyRqE" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-386329da1d9so7879551f8f.1 for ; Wed, 08 Jan 2025 05:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736342197; x=1736946997; 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=go7fn8G/ymJBJOoBu9CCL9fg2QtY/C41teH6UPJDvwo=; b=naKhyRqEfMY+edEs6oYsbr8xfaGwHwXKxyy2kcy+XSEyP81X6WUxZ6m85+ExOK93OK bUq/xCSsZnu++oLIVRYYkFIGWj2tc9Ni9r8102VTAw4vlhQyb9oKmSZUZNBNwro1ypwd /3tsT5xZr+IBz/ibpGkCYhfzU5tCnbiUlU3OFED9Qkbw0VX8tJItlj3HLjZ1XH4u/wDg vqeM38pJkzNGr/0ZOAas5y1nJBKP1PvD2XeQD9HryaFPHAD4ceZYhLgjBDBE7RVM7fyu V3u6k0ddV5pspSipVnSGwu3JXy2Ef5HRQ7i8cwe9BmImE3JU8RFjoKlYilsAiNXJKh2R yMFg== 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=n1JP12gVaNwMXZjzTEYirLyK5CoUivHyi3Ta+FBKeLFz4akXUDKM7ogHlIZ/evY2k2 Vx1zSkoRFMQLycXMgkO25CSevnj/A0u2OohNSXrZShPAtnP7kVBFaUxQcAsHmAu4Kovs SZKnF6ObiJfExmAdiO6ls/kW1XZYx+xnWPRM298cTIztETkXwYrkk8SLQce25ZoWNF5L JzNahdfQjpk2702EskBLJ5T03w3XciunhheuxSHWW/klxLRj836foiDLDMm6aQdUAFlA LHgBeZWa1oMIO/LRFWqEstyj5ueNIqYBLB/htu5vap6+7Ckvp72q7MVoVj2WaeiyRU6h zV1g== X-Forwarded-Encrypted: i=1; AJvYcCWpGCbGfFgtkIg6DKJDRFMPGpeYg1IHjKIqU35urzKX7FVUS1+UPmJVuKLLtitPto1fnAKqvkUzICowt+M=@vger.kernel.org X-Gm-Message-State: AOJu0YwIEH2wx6C6L1hqC9qNrIxM72mRIL3WPfrD07aICm+q7GV7az7T fIo9WkS191rsBCXbernMpaNqmKplC85jWGhbJqfFG1tTwQhBqytR+YpKpRfFqB4= X-Gm-Gg: ASbGncsv2/Km0a5/+iGV3Quw5YdTrXrfv3Nc0Npnxvx8iwNov3JL0qlkgPw8LjtsCR2 NUFr6yLWbT5jX7P/ULVG/DqB2mqV/wrDmUri9uMzMbH9aok0X7a7XYUbu6AWmQNUiCYh7owzUZH wKPM4JjX1SDdZMAveFD/c/0otH7kECfVRwt3uwNfd6RQTZJlISXSbCl5DJjSdPXrIeKfPxim6p8 Fd7TNAO9wOzvRQaLxLZHp6C3pX3HloGVwWFjt5irAtbKXWVBkSHR5g= 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> 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-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