Skip to content

Commit 5fa576d

Browse files
committed
Merge tag 'drm-fixes-2022-05-06' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "A pretty quiet week, one fbdev, msm, kconfig, and two amdgpu fixes, about what I'd expect for rc6. fbdev: - hotunplugging fix amdgpu: - Fix a xen dom0 regression on APUs - Fix a potential array overflow if a receiver were to send an erroneous audio channel count msm: - lockdep fix. it6505: - kconfig fix" * tag 'drm-fixes-2022-05-06' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Avoid reading audio pattern past AUDIO_CHANNELS_COUNT drm/amdgpu: do not use passthrough mode in Xen dom0 drm/bridge: ite-it6505: add missing Kconfig option select fbdev: Make fb_release() return -ENODEV if fbdev was unregistered drm/msm/dp: remove fail safe mode related code
2 parents fe27d18 + 5727375 commit 5fa576d

7 files changed

Lines changed: 9 additions & 21 deletions

File tree

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 ||

drivers/gpu/drm/bridge/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ config DRM_ITE_IT6505
7878
tristate "ITE IT6505 DisplayPort bridge"
7979
depends on OF
8080
select DRM_KMS_HELPER
81+
select DRM_DP_HELPER
8182
select EXTCON
8283
help
8384
ITE IT6505 DisplayPort bridge chip driver.

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,12 +580,6 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)
580580
dp->dp_display.connector_type, state);
581581
mutex_unlock(&dp->event_mutex);
582582

583-
/*
584-
* add fail safe mode outside event_mutex scope
585-
* to avoid potiential circular lock with drm thread
586-
*/
587-
dp_panel_add_fail_safe_mode(dp->dp_display.connector);
588-
589583
/* uevent will complete connection part */
590584
return 0;
591585
};

drivers/gpu/drm/msm/dp/dp_panel.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,6 @@ static int dp_panel_update_modes(struct drm_connector *connector,
151151
return rc;
152152
}
153153

154-
void dp_panel_add_fail_safe_mode(struct drm_connector *connector)
155-
{
156-
/* fail safe edid */
157-
mutex_lock(&connector->dev->mode_config.mutex);
158-
if (drm_add_modes_noedid(connector, 640, 480))
159-
drm_set_preferred_mode(connector, 640, 480);
160-
mutex_unlock(&connector->dev->mode_config.mutex);
161-
}
162-
163154
int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
164155
struct drm_connector *connector)
165156
{
@@ -215,8 +206,6 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
215206
rc = -ETIMEDOUT;
216207
goto end;
217208
}
218-
219-
dp_panel_add_fail_safe_mode(connector);
220209
}
221210

222211
if (panel->aux_cfg_update_done) {

drivers/gpu/drm/msm/dp/dp_panel.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ int dp_panel_init_panel_info(struct dp_panel *dp_panel);
5959
int dp_panel_deinit(struct dp_panel *dp_panel);
6060
int dp_panel_timing_cfg(struct dp_panel *dp_panel);
6161
void dp_panel_dump_regs(struct dp_panel *dp_panel);
62-
void dp_panel_add_fail_safe_mode(struct drm_connector *connector);
6362
int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
6463
struct drm_connector *connector);
6564
u32 dp_panel_get_mode_bpp(struct dp_panel *dp_panel, u32 mode_max_bpp,

drivers/video/fbdev/core/fbmem.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,10 @@ fb_release(struct inode *inode, struct file *file)
14341434
__acquires(&info->lock)
14351435
__releases(&info->lock)
14361436
{
1437-
struct fb_info * const info = file->private_data;
1437+
struct fb_info * const info = file_fb_info(file);
1438+
1439+
if (!info)
1440+
return -ENODEV;
14381441

14391442
lock_fb_info(info);
14401443
if (info->fbops->fb_release)

0 commit comments

Comments
 (0)