AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ray Wu <ray.wu@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Harry Wentland <harry.wentland@amd.com>,
	Leo Li <sunpeng.li@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Roman Li <roman.li@amd.com>, Wayne Lin <wayne.lin@amd.com>,
	Tom Chung <chiahsuan.chung@amd.com>,
	"Fangzhi Zuo" <jerry.zuo@amd.com>,
	Zaeem Mohamed <zaeem.mohamed@amd.com>,
	"Daniel Wheeler" <daniel.wheeler@amd.com>,
	Alex Hung <alex.hung@amd.com>,
	"Dominik Kaszewski" <dominik.kaszewski@amd.com>,
	Alvin Lee <alvin.lee2@amd.com>, Ray Wu <ray.wu@amd.com>
Subject: [PATCH 07/28] drm/amd/display: Prepare for Fused I2C-over-AUX
Date: Mon, 28 Apr 2025 21:50:37 +0800	[thread overview]
Message-ID: <20250428135514.20775-8-ray.wu@amd.com> (raw)
In-Reply-To: <20250428135514.20775-1-ray.wu@amd.com>

From: Dominik Kaszewski <dominik.kaszewski@amd.com>

[Why]
Passive DP-HDMI dongles use I2C-over-AUX protocol which is currently
not supported using HDCP Locality Check FW path.

[How]
Prepare code for switching to I2C-over-AUX protocol. Passive dongle
detection to be added in another commit.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Dominik Kaszewski <dominik.kaszewski@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc_fused_io.c    | 12 ++++++++----
 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h |  3 ++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc_fused_io.c b/drivers/gpu/drm/amd/display/dc/dc_fused_io.c
index fff41b0a0a5a..fee69642fb93 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_fused_io.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_fused_io.c
@@ -11,7 +11,8 @@ static bool op_i2c_convert(
 		union dmub_rb_cmd *cmd,
 		const struct mod_hdcp_atomic_op_i2c *op,
 		enum dmub_cmd_fused_request_type type,
-		uint32_t ddc_line
+		uint32_t ddc_line,
+		bool over_aux
 )
 {
 	struct dmub_cmd_fused_request *req = &cmd->fused_io.request;
@@ -23,6 +24,7 @@ static bool op_i2c_convert(
 	req->type = type;
 	loc->is_aux = false;
 	loc->ddc_line = ddc_line;
+	loc->over_aux = over_aux;
 	loc->address = op->address;
 	loc->offset = op->offset;
 	loc->length = op->size;
@@ -100,11 +102,13 @@ bool dm_atomic_write_poll_read_i2c(
 	if (!link)
 		return false;
 
+	const bool over_aux = false;
 	const uint32_t ddc_line = link->ddc->ddc_pin->pin_data->en;
+
 	union dmub_rb_cmd commands[3] = { 0 };
-	const bool converted = op_i2c_convert(&commands[0], write, FUSED_REQUEST_WRITE, ddc_line)
-			&& op_i2c_convert(&commands[1], poll, FUSED_REQUEST_POLL, ddc_line)
-			&& op_i2c_convert(&commands[2], read, FUSED_REQUEST_READ, ddc_line);
+	const bool converted = op_i2c_convert(&commands[0], write, FUSED_REQUEST_WRITE, ddc_line, over_aux)
+			&& op_i2c_convert(&commands[1], poll, FUSED_REQUEST_POLL, ddc_line, over_aux)
+			&& op_i2c_convert(&commands[2], read, FUSED_REQUEST_READ, ddc_line, over_aux);
 
 	if (!converted)
 		return false;
diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
index b11cf41c2d51..3ae31449983a 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -5447,7 +5447,8 @@ struct dmub_cmd_fused_request {
 		struct dmub_cmd_fused_request_location_i2c {
 			uint8_t is_aux : 1;  // False
 			uint8_t ddc_line : 3;
-			uint8_t _reserved0 : 4;
+			uint8_t over_aux : 1;
+			uint8_t _reserved0 : 3;
 			uint8_t address;
 			uint8_t offset;
 			uint8_t length;
-- 
2.43.0


  parent reply	other threads:[~2025-04-28 13:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 13:50 [PATCH 00/28] DC Patches May 05 2025 Ray Wu
2025-04-28 13:50 ` [PATCH 01/28] drm/amd/display: Update IPS sequential_ono requirement checks Ray Wu
2025-04-28 13:50 ` [PATCH 02/28] drm/amd/display: Refactoring DSC enum dsc_bits_per_comp Ray Wu
2025-04-28 13:50 ` [PATCH 03/28] drm/amd/display: Promote DAL to 3.2.330 Ray Wu
2025-04-28 13:50 ` [PATCH 04/28] drm/amd/display: Always Scale Flag Ray Wu
2025-04-28 13:50 ` [PATCH 05/28] drm/amd/display: Remove redundant null check Ray Wu
2025-04-28 13:50 ` [PATCH 06/28] drm/amd/display: Fix invalid context error in dml helper Ray Wu
2025-04-28 13:50 ` Ray Wu [this message]
2025-04-28 13:50 ` [PATCH 08/28] Revert "drm/amd/display: Refactor SubVP cursor limiting logic" Ray Wu
2025-04-28 13:50 ` [PATCH 09/28] drm/amd/display: allow dscclk disable Ray Wu
2025-04-28 13:50 ` [PATCH 10/28] drm/amd/display: more liberal vmin/vmax update for freesync Ray Wu
2025-04-28 13:50 ` [PATCH 11/28] drm/amd/display: disable DPP RCG before DPP CLK enable Ray Wu
2025-04-28 13:50 ` [PATCH 12/28] drm/amd/display: [FW Promotion] Release 0.1.8.0 Ray Wu
2025-04-28 13:50 ` [PATCH 13/28] drm/amd/display: Promote DAL to 3.2.331 Ray Wu
2025-04-28 13:50 ` [PATCH 14/28] drm/amd/display: Allow 0 dtbclk for DCN35 and above Ray Wu
2025-04-28 13:50 ` [PATCH 15/28] Revert "drm/amd/display: turn off eDP lcdvdd and backlight if not required" Ray Wu
2025-04-28 13:50 ` [PATCH 16/28] drm/amd/display: Add skip rIOMMU dc config option Ray Wu
2025-04-28 13:50 ` [PATCH 17/28] drm/amd/display: Send IPSExit unconditionally Ray Wu
2025-04-28 13:50 ` [PATCH 18/28] drm/amd/display: Remove unnecessary DC_FP_START/DC_FP_END Ray Wu
2025-04-29 15:04   ` Alex Deucher
2025-04-29 16:01     ` Alex Hung
2025-04-29 16:03       ` Alex Deucher
2025-04-28 13:50 ` [PATCH 19/28] drm/amd/display: Call FP Protect Before Mode Programming/Mode Support Ray Wu
2025-04-28 13:50 ` [PATCH 20/28] drm/amd/display: DML21 Fixes Ray Wu
2025-04-28 13:50 ` [PATCH 21/28] drm/amd/display: Refactor SubVP cursor limiting logic Ray Wu
2025-04-28 13:50 ` [PATCH 22/28] drm/amd/display: Shift DMUB AUX reply command if necessary Ray Wu
2025-04-28 13:50 ` [PATCH 23/28] drm/amd/display: Fix the checking condition in dmub aux handling Ray Wu
2025-04-28 13:50 ` [PATCH 24/28] drm/amd/display: Remove incorrect checking in dmub aux handler Ray Wu
2025-04-28 13:50 ` [PATCH 25/28] drm/amd/display: Copy AUX read reply data whenever length > 0 Ray Wu
2025-04-28 13:50 ` [PATCH 26/28] drm/amd/display: Fix wrong handling for AUX_DEFER case Ray Wu
2025-04-28 13:50 ` [PATCH 27/28] drm/amd/display: Assign preferred stream encoder instance to dpia Ray Wu
2025-04-28 13:50 ` [PATCH 28/28] drm/amd/display: Only wait for required free space in DMUB mailbox Ray Wu
2025-05-05 13:13 ` [PATCH 00/28] DC Patches May 05 2025 Wheeler, Daniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250428135514.20775-8-ray.wu@amd.com \
    --to=ray.wu@amd.com \
    --cc=alex.hung@amd.com \
    --cc=alvin.lee2@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=dominik.kaszewski@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=wayne.lin@amd.com \
    --cc=zaeem.mohamed@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox