Skip to content

Commit ebbc04b

Browse files
committed
Merge tag 'amd-drm-fixes-5.18-2022-05-04' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-5.18-2022-05-04: amdgpu: - Fix a xen dom0 regression on APUs - Fix a potential array overflow if a receiver were to send an erroneous audio channel count Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 672c0c5 + 3dfe85f commit ebbc04b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/module.h>
2525

2626
#include <drm/drm_drv.h>
27+
#include <xen/xen.h>
2728

2829
#include "amdgpu.h"
2930
#include "amdgpu_ras.h"
@@ -710,7 +711,8 @@ void amdgpu_detect_virtualization(struct amdgpu_device *adev)
710711
adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
711712

712713
if (!reg) {
713-
if (is_virtual_machine()) /* passthrough mode exclus sriov mod */
714+
/* passthrough mode exclus sriov mod */
715+
if (is_virtual_machine() && !xen_initial_domain())
714716
adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
715717
}
716718

drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4440,7 +4440,7 @@ static void dp_test_get_audio_test_data(struct dc_link *link, bool disable_video
44404440
&dpcd_pattern_type.value,
44414441
sizeof(dpcd_pattern_type));
44424442

4443-
channel_count = dpcd_test_mode.bits.channel_count + 1;
4443+
channel_count = min(dpcd_test_mode.bits.channel_count + 1, AUDIO_CHANNELS_COUNT);
44444444

44454445
// read pattern periods for requested channels when sawTooth pattern is requested
44464446
if (dpcd_pattern_type.value == AUDIO_TEST_PATTERN_SAWTOOTH ||

0 commit comments

Comments
 (0)