All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wayne Lin <Wayne.Lin@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>,
	Daniel Wheeler <daniel.wheeler@amd.com>, Ray Wu <Ray.Wu@amd.com>,
	Alex Hung <alex.hung@amd.com>,
	Taimur Hassan <Syed.Hassan@amd.com>
Subject: [PATCH 16/24] drm/amd/display: [FW Promotion] Release 0.1.12.0
Date: Wed, 28 May 2025 10:49:11 +0800	[thread overview]
Message-ID: <20250528025204.79578-17-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20250528025204.79578-1-Wayne.Lin@amd.com>

From: Taimur Hassan <Syed.Hassan@amd.com>

Add dmub command to support LSDMA

Acked-by: ChiaHsuan Chung <chiahsuan.chung@amd.com>
Signed-off-by: Taimur Hassan <Syed.Hassan@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
---
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   | 156 ++++++++++++++++++
 1 file changed, 156 insertions(+)

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 346d843b45bf..dc4a8b83e6c6 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -1516,6 +1516,11 @@ enum dmub_cmd_type {
 	 */
 	DMUB_CMD__FUSED_IO = 89,
 
+	/**
+	 * Command type used for all LSDMA commands.
+	 */
+	DMUB_CMD__LSDMA = 90,
+
 	DMUB_CMD__VBIOS = 128,
 };
 
@@ -1926,6 +1931,121 @@ struct dmub_rb_cmd_fams2_flip {
 	struct dmub_fams2_flip_info flip_info;
 };
 
+struct dmub_cmd_lsdma_data {
+	union {
+		struct lsdma_init_data {
+			union dmub_addr gpu_addr_base;
+			uint32_t ring_size;
+		} init_data;
+		struct lsdma_tiled_copy_data {
+			uint32_t src_addr_lo;
+			uint32_t src_addr_hi;
+			uint32_t dst_addr_lo;
+			uint32_t dst_addr_hi;
+
+			uint32_t src_x            : 16;
+			uint32_t src_y            : 16;
+
+			uint32_t src_width        : 16;
+			uint32_t src_height       : 16;
+
+			uint32_t dst_x            : 16;
+			uint32_t dst_y            : 16;
+
+			uint32_t dst_width        : 16;
+			uint32_t dst_height       : 16;
+
+			uint32_t rect_x           : 16;
+			uint32_t rect_y           : 16;
+
+			uint32_t src_swizzle_mode : 5;
+			uint32_t src_mip_max      : 5;
+			uint32_t src_mip_id       : 5;
+			uint32_t dst_mip_max      : 5;
+			uint32_t dst_swizzle_mode : 5;
+			uint32_t dst_mip_id       : 5;
+			uint32_t tmz              : 1;
+			uint32_t dcc              : 1;
+
+			uint32_t data_format      : 6;
+			uint32_t padding1         : 4;
+			uint32_t dst_element_size : 3;
+			uint32_t num_type         : 3;
+			uint32_t src_element_size : 3;
+			uint32_t write_compress   : 2;
+			uint32_t cache_policy_dst : 2;
+			uint32_t cache_policy_src : 2;
+			uint32_t read_compress    : 2;
+			uint32_t src_dim          : 2;
+			uint32_t dst_dim          : 2;
+			uint32_t max_uncom        : 1;
+
+			uint32_t max_com          : 2;
+			uint32_t padding          : 30;
+		} tiled_copy_data;
+		struct lsdma_linear_copy_data {
+			uint32_t count            : 30;
+			uint32_t cache_policy_dst : 2;
+
+			uint32_t tmz              : 1;
+			uint32_t cache_policy_src : 2;
+			uint32_t padding          : 29;
+
+			uint32_t src_lo;
+			uint32_t src_hi;
+			uint32_t dst_lo;
+			uint32_t dst_hi;
+		} linear_copy_data;
+		struct lsdma_reg_write_data {
+			uint32_t reg_addr;
+			uint32_t reg_data;
+		} reg_write_data;
+		struct lsdma_pio_copy_data {
+			union {
+				struct {
+					uint32_t byte_count      : 26;
+					uint32_t src_loc         : 1;
+					uint32_t dst_loc         : 1;
+					uint32_t src_addr_inc    : 1;
+					uint32_t dst_addr_inc    : 1;
+					uint32_t overlap_disable : 1;
+					uint32_t constant_fill   : 1;
+				} fields;
+				uint32_t raw;
+			} packet;
+			uint32_t src_lo;
+			uint32_t src_hi;
+			uint32_t dst_lo;
+			uint32_t dst_hi;
+		} pio_copy_data;
+		struct lsdma_pio_constfill_data {
+			union {
+				struct {
+					uint32_t byte_count      : 26;
+					uint32_t src_loc         : 1;
+					uint32_t dst_loc         : 1;
+					uint32_t src_addr_inc    : 1;
+					uint32_t dst_addr_inc    : 1;
+					uint32_t overlap_disable : 1;
+					uint32_t constant_fill   : 1;
+				} fields;
+				uint32_t raw;
+			} packet;
+			uint32_t dst_lo;
+			uint32_t dst_hi;
+			uint32_t data;
+		} pio_constfill_data;
+
+		uint32_t all[14];
+	} u;
+
+};
+
+struct dmub_rb_cmd_lsdma {
+	struct dmub_cmd_header header;
+	struct dmub_cmd_lsdma_data lsdma_data;
+};
+
 struct dmub_optc_state_v2 {
 	uint32_t v_total_min;
 	uint32_t v_total_max;
@@ -4453,6 +4573,37 @@ enum dmub_cmd_abm_type {
 	DMUB_CMD__ABM_GET_HISTOGRAM_DATA = 11,
 };
 
+/**
+ * LSDMA command sub-types.
+ */
+enum dmub_cmd_lsdma_type {
+	/**
+	 * Initialize parameters for LSDMA.
+	 * Ring buffer is mapped to the ring buffer
+	 */
+	DMUB_CMD__LSDMA_INIT_CONFIG	= 0,
+	/**
+	 * LSDMA copies data from source to destination linearly
+	 */
+	DMUB_CMD__LSDMA_LINEAR_COPY = 1,
+	/**
+	 * Send the tiled-to-tiled copy command
+	 */
+	DMUB_CMD__LSDMA_TILED_TO_TILED_COPY = 2,
+	/**
+	 * Send the poll reg write command
+	 */
+	DMUB_CMD__LSDMA_POLL_REG_WRITE = 3,
+	/**
+	 * Send the pio copy command
+	 */
+	DMUB_CMD__LSDMA_PIO_COPY = 4,
+	/**
+	 * Send the pio constfill command
+	 */
+	DMUB_CMD__LSDMA_PIO_CONSTFILL = 5,
+};
+
 struct abm_ace_curve {
 	/**
 	 * @offsets: ACE curve offsets.
@@ -5973,6 +6124,11 @@ union dmub_rb_cmd {
 	struct dmub_rb_cmd_fams2_flip fams2_flip;
 
 	struct dmub_rb_cmd_fused_io fused_io;
+
+	/**
+	 * Definition of a DMUB_CMD__LSDMA command.
+	 */
+	struct dmub_rb_cmd_lsdma lsdma;
 };
 
 /**
-- 
2.43.0


  parent reply	other threads:[~2025-05-28  2:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28  2:48 [PATCH 00/24] DC Patches June 2nd, 2025 Wayne Lin
2025-05-28  2:48 ` [PATCH 01/24] drm/amd/display: [FW Promotion] Release 0.1.11.0 Wayne Lin
2025-05-28  2:48 ` [PATCH 02/24] drm/amd/display: Re-order FAMS2 sub commands Wayne Lin
2025-05-28  2:48 ` [PATCH 03/24] drm/amd/display: DML21 Fixes Wayne Lin
2025-05-28  2:48 ` [PATCH 04/24] drm/amd/display: Support OLED SDR with AMD ABC Wayne Lin
2025-05-28  2:49 ` [PATCH 05/24] drm/amd/display: move RMCM programming Wayne Lin
2025-05-28  2:49 ` [PATCH 06/24] drm/amd/display: Indirect buffer transport for FAMS2 commands Wayne Lin
2025-05-28  2:49 ` [PATCH 07/24] drm/amd/display: Drop unnecessary `amdgpu` prefix Wayne Lin
2025-05-28  2:49 ` [PATCH 08/24] drm/amd/display: Call setup_stream_attribute after stream enc clk is ungated Wayne Lin
2025-05-28  2:49 ` [PATCH 09/24] drm/amd/display: Correct non-OLED pre_T11_delay Wayne Lin
2025-05-28  2:49 ` [PATCH 10/24] drm/amd/display: Avoid trying AUX transactions on disconnected ports Wayne Lin
2025-05-28  2:49 ` [PATCH 11/24] drm/amd/display: Add disconnect case on dongle check Wayne Lin
2025-05-28  2:49 ` [PATCH 12/24] drm/amd/display: Add DML path for FAMS methods Wayne Lin
2025-05-28  2:49 ` [PATCH 13/24] drm/amd/display: Do not bypass chroma scaling in 1:1 case Wayne Lin
2025-05-28  2:49 ` [PATCH 14/24] drm/amd/display: Add support for 2nd sharpening range Wayne Lin
2025-05-28  2:49 ` [PATCH 15/24] drm/amd/display: Move vmalloc include to header file Wayne Lin
2025-05-28  2:49 ` Wayne Lin [this message]
2025-05-28  2:49 ` [PATCH 17/24] drm/amd/display: Promote DAL to 3.2.335 Wayne Lin
2025-05-28  2:49 ` [PATCH 18/24] drm/amd/display: Update DMCUB loading sequence for DCN3.5 Wayne Lin
2025-05-28  2:49 ` [PATCH 19/24] drm/amd/display: replace fast_validate with enum dc_validate_mode Wayne Lin
2025-05-28  2:49 ` [PATCH 20/24] drm/amd/display: Avoid calling blank_stream() twice Wayne Lin
2025-05-28  2:49 ` [PATCH 21/24] drm/amd/display: Use DC log instead of using DM error msg Wayne Lin
2025-05-28  2:49 ` [PATCH 22/24] drm/amd/display: Add debugging message for brightness caps Wayne Lin
2025-05-28  2:49 ` [PATCH 23/24] drm/amd/display: Fix default DC and AC levels Wayne Lin
2025-05-28  2:49 ` [PATCH 24/24] drm/amd/display: Promote DAL to 3.2.336 Wayne Lin
2025-06-02 13:24 ` [PATCH 00/24] DC Patches June 2nd, 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=20250528025204.79578-17-Wayne.Lin@amd.com \
    --to=wayne.lin@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=Syed.Hassan@amd.com \
    --cc=alex.hung@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=daniel.wheeler@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=jerry.zuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=sunpeng.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.