From: Sasha Levin Date: Thu, 21 Dec 2023 14:52:41 +0000 (-0500) Subject: Fixes for 6.1 X-Git-Tag: v5.15.145~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95b52b241478c393e5238d0760c53522d3ec90c3;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.1 Signed-off-by: Sasha Levin --- diff --git a/queue-6.1/drm-amd-display-fix-hw-rotated-modes-when-psr-su-is-.patch b/queue-6.1/drm-amd-display-fix-hw-rotated-modes-when-psr-su-is-.patch new file mode 100644 index 00000000000..e3f59629648 --- /dev/null +++ b/queue-6.1/drm-amd-display-fix-hw-rotated-modes-when-psr-su-is-.patch @@ -0,0 +1,96 @@ +From be6c72ac6396f4200b2884d1910fd35265e42152 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Dec 2023 14:55:04 -0500 +Subject: drm/amd/display: fix hw rotated modes when PSR-SU is enabled + +From: Hamza Mahfooz + +[ Upstream commit f528ee145bd0076cd0ed7e7b2d435893e6329e98 ] + +We currently don't support dirty rectangles on hardware rotated modes. +So, if a user is using hardware rotated modes with PSR-SU enabled, +use PSR-SU FFU for all rotated planes (including cursor planes). + +Cc: stable@vger.kernel.org +Fixes: 30ebe41582d1 ("drm/amd/display: add FB_DAMAGE_CLIPS support") +Reported-by: Kai-Heng Feng +Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2952 +Tested-by: Kai-Heng Feng +Tested-by: Bin Li +Reviewed-by: Mario Limonciello +Signed-off-by: Hamza Mahfooz +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ + drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 1 + + .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++- + drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 12 ++++++++++-- + 4 files changed, 16 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +index 6d5f3c5fb4a62..13e0b521e3dba 100644 +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -5104,6 +5104,9 @@ static void fill_dc_dirty_rects(struct drm_plane *plane, + if (plane->type == DRM_PLANE_TYPE_CURSOR) + return; + ++ if (new_plane_state->rotation != DRM_MODE_ROTATE_0) ++ goto ffu; ++ + num_clips = drm_plane_get_damage_clips_count(new_plane_state); + clips = drm_plane_get_damage_clips(new_plane_state); + +diff --git a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h +index 848db8676adfd..46c2b991aa108 100644 +--- a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h ++++ b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h +@@ -465,6 +465,7 @@ struct dc_cursor_mi_param { + struct fixed31_32 v_scale_ratio; + enum dc_rotation_angle rotation; + bool mirror; ++ struct dc_stream_state *stream; + }; + + /* IPP related types */ +diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +index d84579da64003..009b5861a3fec 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +@@ -3427,7 +3427,8 @@ void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) + .h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz, + .v_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.vert, + .rotation = pipe_ctx->plane_state->rotation, +- .mirror = pipe_ctx->plane_state->horizontal_mirror ++ .mirror = pipe_ctx->plane_state->horizontal_mirror, ++ .stream = pipe_ctx->stream, + }; + bool pipe_split_on = false; + bool odm_combine_on = (pipe_ctx->next_odm_pipe != NULL) || +diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +index 4566bc7abf17e..aa252dc263267 100644 +--- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c ++++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +@@ -1075,8 +1075,16 @@ void hubp2_cursor_set_position( + if (src_y_offset < 0) + src_y_offset = 0; + /* Save necessary cursor info x, y position. w, h is saved in attribute func. */ +- hubp->cur_rect.x = src_x_offset + param->viewport.x; +- hubp->cur_rect.y = src_y_offset + param->viewport.y; ++ if (param->stream->link->psr_settings.psr_version >= DC_PSR_VERSION_SU_1 && ++ param->rotation != ROTATION_ANGLE_0) { ++ hubp->cur_rect.x = 0; ++ hubp->cur_rect.y = 0; ++ hubp->cur_rect.w = param->stream->timing.h_addressable; ++ hubp->cur_rect.h = param->stream->timing.v_addressable; ++ } else { ++ hubp->cur_rect.x = src_x_offset + param->viewport.x; ++ hubp->cur_rect.y = src_y_offset + param->viewport.y; ++ } + } + + void hubp2_clk_cntl(struct hubp *hubp, bool enable) +-- +2.43.0 + diff --git a/queue-6.1/hid-i2c-hid-acpi-unify-acpi-id-tables-format.patch b/queue-6.1/hid-i2c-hid-acpi-unify-acpi-id-tables-format.patch new file mode 100644 index 00000000000..dfda72f46a3 --- /dev/null +++ b/queue-6.1/hid-i2c-hid-acpi-unify-acpi-id-tables-format.patch @@ -0,0 +1,53 @@ +From ea85bb63344efd9479e761081d4cac803d7484ec Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Jan 2023 17:46:21 +0200 +Subject: HID: i2c-hid: acpi: Unify ACPI ID tables format + +From: Andy Shevchenko + +[ Upstream commit 4122abfed2193e752485282370abf5c419f05cad ] + +Unify ACPI ID tables format by: +- surrounding HID by spaces +- dropping unnecessary driver_data assignment to 0 +- dropping comma at the terminator entry + +Signed-off-by: Andy Shevchenko +Signed-off-by: Jiri Kosina +Stable-dep-of: a9f68ffe1170 ("HID: i2c-hid: Add IDEA5002 to i2c_hid_acpi_blacklist[]") +Signed-off-by: Sasha Levin +--- + drivers/hid/i2c-hid/i2c-hid-acpi.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/drivers/hid/i2c-hid/i2c-hid-acpi.c b/drivers/hid/i2c-hid/i2c-hid-acpi.c +index b96ae15e0ad91..171332fef6d14 100644 +--- a/drivers/hid/i2c-hid/i2c-hid-acpi.c ++++ b/drivers/hid/i2c-hid/i2c-hid-acpi.c +@@ -39,8 +39,8 @@ static const struct acpi_device_id i2c_hid_acpi_blacklist[] = { + * The CHPN0001 ACPI device, which is used to describe the Chipone + * ICN8505 controller, has a _CID of PNP0C50 but is not HID compatible. + */ +- {"CHPN0001", 0 }, +- { }, ++ { "CHPN0001" }, ++ { } + }; + + /* HID I²C Device: 3cdff6f7-4267-4555-ad05-b30a3d8938de */ +@@ -115,9 +115,9 @@ static int i2c_hid_acpi_probe(struct i2c_client *client) + } + + static const struct acpi_device_id i2c_hid_acpi_match[] = { +- {"ACPI0C50", 0 }, +- {"PNP0C50", 0 }, +- { }, ++ { "ACPI0C50" }, ++ { "PNP0C50" }, ++ { } + }; + MODULE_DEVICE_TABLE(acpi, i2c_hid_acpi_match); + +-- +2.43.0 + diff --git a/queue-6.1/hid-i2c-hid-add-idea5002-to-i2c_hid_acpi_blacklist.patch b/queue-6.1/hid-i2c-hid-add-idea5002-to-i2c_hid_acpi_blacklist.patch new file mode 100644 index 00000000000..2cc945b2854 --- /dev/null +++ b/queue-6.1/hid-i2c-hid-add-idea5002-to-i2c_hid_acpi_blacklist.patch @@ -0,0 +1,52 @@ +From ae2a6b03016b99929d0e70bf8c9a09da452c326e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 2 Dec 2023 21:24:30 -0600 +Subject: HID: i2c-hid: Add IDEA5002 to i2c_hid_acpi_blacklist[] + +From: Mario Limonciello + +[ Upstream commit a9f68ffe1170ca4bc17ab29067d806a354a026e0 ] + +Users have reported problems with recent Lenovo laptops that contain +an IDEA5002 I2C HID device. Reports include fans turning on and +running even at idle and spurious wakeups from suspend. + +Presumably in the Windows ecosystem there is an application that +uses the HID device. Maybe that puts it into a lower power state so +it doesn't cause spurious events. + +This device doesn't serve any functional purpose in Linux as nothing +interacts with it so blacklist it from being probed. This will +prevent the GPIO driver from setting up the GPIO and the spurious +interrupts and wake events will not occur. + +Cc: stable@vger.kernel.org # 6.1 +Reported-and-tested-by: Marcus Aram +Reported-and-tested-by: Mark Herbert +Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/2812 +Signed-off-by: Mario Limonciello +Signed-off-by: Jiri Kosina +Signed-off-by: Sasha Levin +--- + drivers/hid/i2c-hid/i2c-hid-acpi.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/hid/i2c-hid/i2c-hid-acpi.c b/drivers/hid/i2c-hid/i2c-hid-acpi.c +index 171332fef6d14..6d35bb3974818 100644 +--- a/drivers/hid/i2c-hid/i2c-hid-acpi.c ++++ b/drivers/hid/i2c-hid/i2c-hid-acpi.c +@@ -40,6 +40,11 @@ static const struct acpi_device_id i2c_hid_acpi_blacklist[] = { + * ICN8505 controller, has a _CID of PNP0C50 but is not HID compatible. + */ + { "CHPN0001" }, ++ /* ++ * The IDEA5002 ACPI device causes high interrupt usage and spurious ++ * wakeups from suspend. ++ */ ++ { "IDEA5002" }, + { } + }; + +-- +2.43.0 + diff --git a/queue-6.1/series b/queue-6.1/series index cd5d2a1814f..d4ee11fc11b 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -1,2 +1,5 @@ kasan-disable-kasan_non_canonical_hook-for-hw-tags.patch bpf-fix-prog_array_map_poke_run-map-poke-update.patch +hid-i2c-hid-acpi-unify-acpi-id-tables-format.patch +hid-i2c-hid-add-idea5002-to-i2c_hid_acpi_blacklist.patch +drm-amd-display-fix-hw-rotated-modes-when-psr-su-is-.patch