drm/amd/display: Align the returned error code with legacy DP
authorjsg <jsg@openbsd.org>
Fri, 2 Feb 2024 03:27:33 +0000 (03:27 +0000)
committerjsg <jsg@openbsd.org>
Fri, 2 Feb 2024 03:27:33 +0000 (03:27 +0000)
From Wayne Lin
d3af41be094a39e1a1392d1d42cdf3eb90922476 in linux-6.6.y/6.6.15
bfe79f5fff1300d96203383582b078c7b0aec80a in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

index cb0142f..f50a0d6 100644 (file)
@@ -956,6 +956,11 @@ int dm_helper_dmub_aux_transfer_sync(
                struct aux_payload *payload,
                enum aux_return_code_type *operation_result)
 {
+       if (!link->hpd_status) {
+               *operation_result = AUX_RET_ERROR_HPD_DISCON;
+               return -1;
+       }
+
        return amdgpu_dm_process_dmub_aux_transfer_sync(ctx, link->link_index, payload,
                        operation_result);
 }