Skip to content

Commit 31462d9

Browse files
committed
Merge tag 'drm-fixes-2022-02-04' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Regular fixes for the week. Daniel has agreed to bring back the fbcon hw acceleration under a CONFIG option for the non-drm fbdev users, we don't advise turning this on unless you are in the niche that is old fbdev drivers, Since it's essentially a revert and shouldn't be high impact seemed like a good time to do it now. Otherwise, i915 and amdgpu fixes are most of it, along with some minor fixes elsewhere. fbdev: - readd fbcon acceleration i915: - fix DP monitor via type-c dock - fix for engine busyness and read timeout with GuC - use ALLOW_FAIL for error capture buffer allocs - don't use interruptible lock on error paths - smatch fix to reject zero sized overlays. amdgpu: - mGPU fan boost fix for beige goby - S0ix fixes - Cyan skillfish hang fix - DCN fixes for DCN 3.1 - DCN fixes for DCN 3.01 - Apple retina panel fix - ttm logic inversion fix dma-buf: - heaps: fix potential spectre v1 gadget kmb: - fix potential oob access mxsfb: - fix NULL ptr deref nouveau: - fix potential oob access during BIOS decode" * tag 'drm-fixes-2022-02-04' of git://anongit.freedesktop.org/drm/drm: (24 commits) drm: mxsfb: Fix NULL pointer dereference drm/amdgpu: fix logic inversion in check drm/amd: avoid suspend on dGPUs w/ s2idle support when runtime PM enabled drm/amd/display: Force link_rate as LINK_RATE_RBR2 for 2018 15" Apple Retina panels drm/amd/display: revert "Reset fifo after enable otg" drm/amd/display: watermark latencies is not enough on DCN31 drm/amd/display: Update watermark values for DCN301 drm/amdgpu: fix a potential GPU hang on cyan skillfish drm/amd: Only run s3 or s0ix if system is configured properly drm/amd: add support to check whether the system is set to s3 fbcon: Add option to enable legacy hardware acceleration Revert "fbcon: Disable accelerated scrolling" Revert "fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list)" drm/i915/pmu: Fix KMD and GuC race on accessing busyness dma-buf: heaps: Fix potential spectre v1 gadget drm/amd: Warn users about potential s0ix problems drm/amd/pm: correct the MGpuFanBoost support for Beige Goby drm/nouveau: fix off by one in BIOS boundary checking drm/i915/adlp: Fix TypeC PHY-ready status readout drm/i915/pmu: Use PM timestamp instead of RING TIMESTAMP for reference ...
2 parents f9aaa5b + 9ca3d3c commit 31462d9

38 files changed

+972
-160
lines changed

Documentation/gpu/todo.rst

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -300,30 +300,6 @@ Contact: Daniel Vetter, Noralf Tronnes
300300

301301
Level: Advanced
302302

303-
Garbage collect fbdev scrolling acceleration
304-
--------------------------------------------
305-
306-
Scroll acceleration has been disabled in fbcon. Now it works as the old
307-
SCROLL_REDRAW mode. A ton of code was removed in fbcon.c and the hook bmove was
308-
removed from fbcon_ops.
309-
Remaining tasks:
310-
311-
- a bunch of the hooks in fbcon_ops could be removed or simplified by calling
312-
directly instead of the function table (with a switch on p->rotate)
313-
314-
- fb_copyarea is unused after this, and can be deleted from all drivers
315-
316-
- after that, fb_copyarea can be deleted from fb_ops in include/linux/fb.h as
317-
well as cfb_copyarea
318-
319-
Note that not all acceleration code can be deleted, since clearing and cursor
320-
support is still accelerated, which might be good candidates for further
321-
deletion projects.
322-
323-
Contact: Daniel Vetter
324-
325-
Level: Intermediate
326-
327303
idr_init_base()
328304
---------------
329305

drivers/dma-buf/dma-heap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/xarray.h>
1515
#include <linux/list.h>
1616
#include <linux/slab.h>
17+
#include <linux/nospec.h>
1718
#include <linux/uaccess.h>
1819
#include <linux/syscalls.h>
1920
#include <linux/dma-heap.h>
@@ -135,6 +136,7 @@ static long dma_heap_ioctl(struct file *file, unsigned int ucmd,
135136
if (nr >= ARRAY_SIZE(dma_heap_ioctl_cmds))
136137
return -EINVAL;
137138

139+
nr = array_index_nospec(nr, ARRAY_SIZE(dma_heap_ioctl_cmds));
138140
/* Get the kernel ioctl cmd that matches */
139141
kcmd = dma_heap_ioctl_cmds[nr];
140142

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,12 +1408,10 @@ int amdgpu_acpi_smart_shift_update(struct drm_device *dev, enum amdgpu_ss ss_sta
14081408
int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
14091409

14101410
void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps);
1411-
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
14121411
void amdgpu_acpi_detect(void);
14131412
#else
14141413
static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; }
14151414
static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { }
1416-
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
14171415
static inline void amdgpu_acpi_detect(void) { }
14181416
static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
14191417
static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,
@@ -1422,6 +1420,14 @@ static inline int amdgpu_acpi_smart_shift_update(struct drm_device *dev,
14221420
enum amdgpu_ss ss_state) { return 0; }
14231421
#endif
14241422

1423+
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
1424+
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
1425+
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
1426+
#else
1427+
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
1428+
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
1429+
#endif
1430+
14251431
int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,
14261432
uint64_t addr, struct amdgpu_bo **bo,
14271433
struct amdgpu_bo_va_mapping **mapping);

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

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,20 @@ void amdgpu_acpi_detect(void)
10311031
}
10321032
}
10331033

1034+
#if IS_ENABLED(CONFIG_SUSPEND)
1035+
/**
1036+
* amdgpu_acpi_is_s3_active
1037+
*
1038+
* @adev: amdgpu_device_pointer
1039+
*
1040+
* returns true if supported, false if not.
1041+
*/
1042+
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
1043+
{
1044+
return !(adev->flags & AMD_IS_APU) ||
1045+
(pm_suspend_target_state == PM_SUSPEND_MEM);
1046+
}
1047+
10341048
/**
10351049
* amdgpu_acpi_is_s0ix_active
10361050
*
@@ -1040,11 +1054,24 @@ void amdgpu_acpi_detect(void)
10401054
*/
10411055
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
10421056
{
1043-
#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)
1044-
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
1045-
if (adev->flags & AMD_IS_APU)
1046-
return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
1057+
if (!(adev->flags & AMD_IS_APU) ||
1058+
(pm_suspend_target_state != PM_SUSPEND_TO_IDLE))
1059+
return false;
1060+
1061+
if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) {
1062+
dev_warn_once(adev->dev,
1063+
"Power consumption will be higher as BIOS has not been configured for suspend-to-idle.\n"
1064+
"To use suspend-to-idle change the sleep mode in BIOS setup.\n");
1065+
return false;
10471066
}
1048-
#endif
1067+
1068+
#if !IS_ENABLED(CONFIG_AMD_PMC)
1069+
dev_warn_once(adev->dev,
1070+
"Power consumption will be higher as the kernel has not been compiled with CONFIG_AMD_PMC.\n");
10491071
return false;
1072+
#else
1073+
return true;
1074+
#endif /* CONFIG_AMD_PMC */
10501075
}
1076+
1077+
#endif /* CONFIG_SUSPEND */

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,13 +2246,20 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)
22462246
static int amdgpu_pmops_prepare(struct device *dev)
22472247
{
22482248
struct drm_device *drm_dev = dev_get_drvdata(dev);
2249+
struct amdgpu_device *adev = drm_to_adev(drm_dev);
22492250

22502251
/* Return a positive number here so
22512252
* DPM_FLAG_SMART_SUSPEND works properly
22522253
*/
22532254
if (amdgpu_device_supports_boco(drm_dev))
2254-
return pm_runtime_suspended(dev) &&
2255-
pm_suspend_via_firmware();
2255+
return pm_runtime_suspended(dev);
2256+
2257+
/* if we will not support s3 or s2i for the device
2258+
* then skip suspend
2259+
*/
2260+
if (!amdgpu_acpi_is_s0ix_active(adev) &&
2261+
!amdgpu_acpi_is_s3_active(adev))
2262+
return 1;
22562263

22572264
return 0;
22582265
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
19041904
unsigned i;
19051905
int r;
19061906

1907-
if (direct_submit && !ring->sched.ready) {
1907+
if (!direct_submit && !ring->sched.ready) {
19081908
DRM_ERROR("Trying to move memory with ring turned off.\n");
19091909
return -EINVAL;
19101910
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,9 @@ static void gmc_v10_0_get_clockgating_state(void *handle, u32 *flags)
11401140
{
11411141
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
11421142

1143+
if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(10, 1, 3))
1144+
return;
1145+
11431146
adev->mmhub.funcs->get_clockgating(adev, flags);
11441147

11451148
if (adev->ip_versions[ATHUB_HWIP][0] >= IP_VERSION(2, 1, 0))

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,32 +570,32 @@ static struct wm_table lpddr5_wm_table = {
570570
.wm_inst = WM_A,
571571
.wm_type = WM_TYPE_PSTATE_CHG,
572572
.pstate_latency_us = 11.65333,
573-
.sr_exit_time_us = 7.95,
574-
.sr_enter_plus_exit_time_us = 9,
573+
.sr_exit_time_us = 13.5,
574+
.sr_enter_plus_exit_time_us = 16.5,
575575
.valid = true,
576576
},
577577
{
578578
.wm_inst = WM_B,
579579
.wm_type = WM_TYPE_PSTATE_CHG,
580580
.pstate_latency_us = 11.65333,
581-
.sr_exit_time_us = 9.82,
582-
.sr_enter_plus_exit_time_us = 11.196,
581+
.sr_exit_time_us = 13.5,
582+
.sr_enter_plus_exit_time_us = 16.5,
583583
.valid = true,
584584
},
585585
{
586586
.wm_inst = WM_C,
587587
.wm_type = WM_TYPE_PSTATE_CHG,
588588
.pstate_latency_us = 11.65333,
589-
.sr_exit_time_us = 9.89,
590-
.sr_enter_plus_exit_time_us = 11.24,
589+
.sr_exit_time_us = 13.5,
590+
.sr_enter_plus_exit_time_us = 16.5,
591591
.valid = true,
592592
},
593593
{
594594
.wm_inst = WM_D,
595595
.wm_type = WM_TYPE_PSTATE_CHG,
596596
.pstate_latency_us = 11.65333,
597-
.sr_exit_time_us = 9.748,
598-
.sr_enter_plus_exit_time_us = 11.102,
597+
.sr_exit_time_us = 13.5,
598+
.sr_enter_plus_exit_time_us = 16.5,
599599
.valid = true,
600600
},
601601
}

drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -329,38 +329,38 @@ static struct clk_bw_params dcn31_bw_params = {
329329

330330
};
331331

332-
static struct wm_table ddr4_wm_table = {
332+
static struct wm_table ddr5_wm_table = {
333333
.entries = {
334334
{
335335
.wm_inst = WM_A,
336336
.wm_type = WM_TYPE_PSTATE_CHG,
337337
.pstate_latency_us = 11.72,
338-
.sr_exit_time_us = 6.09,
339-
.sr_enter_plus_exit_time_us = 7.14,
338+
.sr_exit_time_us = 9,
339+
.sr_enter_plus_exit_time_us = 11,
340340
.valid = true,
341341
},
342342
{
343343
.wm_inst = WM_B,
344344
.wm_type = WM_TYPE_PSTATE_CHG,
345345
.pstate_latency_us = 11.72,
346-
.sr_exit_time_us = 10.12,
347-
.sr_enter_plus_exit_time_us = 11.48,
346+
.sr_exit_time_us = 9,
347+
.sr_enter_plus_exit_time_us = 11,
348348
.valid = true,
349349
},
350350
{
351351
.wm_inst = WM_C,
352352
.wm_type = WM_TYPE_PSTATE_CHG,
353353
.pstate_latency_us = 11.72,
354-
.sr_exit_time_us = 10.12,
355-
.sr_enter_plus_exit_time_us = 11.48,
354+
.sr_exit_time_us = 9,
355+
.sr_enter_plus_exit_time_us = 11,
356356
.valid = true,
357357
},
358358
{
359359
.wm_inst = WM_D,
360360
.wm_type = WM_TYPE_PSTATE_CHG,
361361
.pstate_latency_us = 11.72,
362-
.sr_exit_time_us = 10.12,
363-
.sr_enter_plus_exit_time_us = 11.48,
362+
.sr_exit_time_us = 9,
363+
.sr_enter_plus_exit_time_us = 11,
364364
.valid = true,
365365
},
366366
}
@@ -687,7 +687,7 @@ void dcn31_clk_mgr_construct(
687687
if (ctx->dc_bios->integrated_info->memory_type == LpDdr5MemType) {
688688
dcn31_bw_params.wm_table = lpddr5_wm_table;
689689
} else {
690-
dcn31_bw_params.wm_table = ddr4_wm_table;
690+
dcn31_bw_params.wm_table = ddr5_wm_table;
691691
}
692692
/* Saved clocks configured at boot for debug purposes */
693693
dcn31_dump_clk_registers(&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info);

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5597,6 +5597,26 @@ static bool retrieve_link_cap(struct dc_link *link)
55975597
dp_hw_fw_revision.ieee_fw_rev,
55985598
sizeof(dp_hw_fw_revision.ieee_fw_rev));
55995599

5600+
/* Quirk for Apple MBP 2018 15" Retina panels: wrong DP_MAX_LINK_RATE */
5601+
{
5602+
uint8_t str_mbp_2018[] = { 101, 68, 21, 103, 98, 97 };
5603+
uint8_t fwrev_mbp_2018[] = { 7, 4 };
5604+
uint8_t fwrev_mbp_2018_vega[] = { 8, 4 };
5605+
5606+
/* We also check for the firmware revision as 16,1 models have an
5607+
* identical device id and are incorrectly quirked otherwise.
5608+
*/
5609+
if ((link->dpcd_caps.sink_dev_id == 0x0010fa) &&
5610+
!memcmp(link->dpcd_caps.sink_dev_id_str, str_mbp_2018,
5611+
sizeof(str_mbp_2018)) &&
5612+
(!memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018,
5613+
sizeof(fwrev_mbp_2018)) ||
5614+
!memcmp(link->dpcd_caps.sink_fw_revision, fwrev_mbp_2018_vega,
5615+
sizeof(fwrev_mbp_2018_vega)))) {
5616+
link->reported_link_cap.link_rate = LINK_RATE_RBR2;
5617+
}
5618+
}
5619+
56005620
memset(&link->dpcd_caps.dsc_caps, '\0',
56015621
sizeof(link->dpcd_caps.dsc_caps));
56025622
memset(&link->dpcd_caps.fec_cap, '\0', sizeof(link->dpcd_caps.fec_cap));

0 commit comments

Comments
 (0)