]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Fix dmub_cmd header alignment
authorOvidiu Bunea <ovidiu.bunea@amd.com>
Tue, 15 Jul 2025 21:26:39 +0000 (17:26 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 28 Jul 2025 20:40:31 +0000 (16:40 -0400)
[why & how]
Header misalignment in struct dmub_cmd_replay_copy_settings_data and
struct dmub_alpm_auxless_data causes incorrect data read between driver
and dmub.
Fix the misalignment and ensure that everything is aligned to 4-byte
boundaries.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h

index a89bf08ffd3799dcdd801357709c6e37a1d1c3d1..dcae768c2cf44cb97db8884a2d166eded5557f8b 100644 (file)
@@ -4048,6 +4048,10 @@ struct dmub_alpm_auxless_data {
        uint16_t lfps_t1_t2_override_us;
        short lfps_t1_t2_offset_us;
        uint8_t lttpr_count;
+       /*
+        * Padding to align structure to 4 byte boundary.
+        */
+       uint8_t pad[1];
 };
 
 /**
@@ -4080,14 +4084,6 @@ struct dmub_cmd_replay_copy_settings_data {
         * DIG BE HW instance.
         */
        uint8_t digbe_inst;
-       /**
-        * @hpo_stream_enc_inst: HPO stream encoder instance
-        */
-       uint8_t hpo_stream_enc_inst;
-       /**
-        * @hpo_link_enc_inst: HPO link encoder instance
-        */
-       uint8_t hpo_link_enc_inst;
        /**
         * AUX HW instance.
         */
@@ -4132,6 +4128,14 @@ struct dmub_cmd_replay_copy_settings_data {
         * Use for AUX-less ALPM LFPS wake operation
         */
        struct dmub_alpm_auxless_data auxless_alpm_data;
+       /**
+        * @hpo_stream_enc_inst: HPO stream encoder instance
+        */
+       uint8_t hpo_stream_enc_inst;
+       /**
+        * @hpo_link_enc_inst: HPO link encoder instance
+        */
+       uint8_t hpo_link_enc_inst;
        /**
         * @pad: Align structure to 4 byte boundary.
         */