* [PATCH] drm/amdgpu/display: add quirk handling for stutter mode
@ 2021-10-25 18:52 Alex Deucher
2021-10-25 19:24 ` Harry Wentland
0 siblings, 1 reply; 2+ messages in thread
From: Alex Deucher @ 2021-10-25 18:52 UTC (permalink / raw)
To: amd-gfx; +Cc: Alex Deucher
Stutter mode is a power saving feature on GPUs, however at
least one early raven system exhibits stability issues with
it. Add a quirk to disable it for that system.
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214417
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 33 +++++++++++++++++++
1 file changed, 33 insertions(+)
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 5b8d1635da5c..b635b893837b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1295,6 +1295,37 @@ static struct hpd_rx_irq_offload_work_queue *hpd_rx_irq_create_workqueue(struct
return hpd_rx_offload_wq;
}
+struct amdgpu_stutter_quirk {
+ u16 chip_vendor;
+ u16 chip_device;
+ u16 subsys_vendor;
+ u16 subsys_device;
+ u8 revision;
+};
+
+static const struct amdgpu_stutter_quirk amdgpu_stutter_quirk_list[] = {
+ /* https://bugzilla.kernel.org/show_bug.cgi?id=214417 */
+ { 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
+ { 0, 0, 0, 0, 0 },
+};
+
+static bool dm_should_disable_stutter(struct pci_dev *pdev)
+{
+ const struct amdgpu_stutter_quirk *p = amdgpu_stutter_quirk_list;
+
+ while (p && p->chip_device != 0) {
+ if (pdev->vendor == p->chip_vendor &&
+ pdev->device == p->chip_device &&
+ pdev->subsystem_vendor == p->subsys_vendor &&
+ pdev->subsystem_device == p->subsys_device &&
+ pdev->revision == p->revision) {
+ return true;
+ }
+ ++p;
+ }
+ return false;
+}
+
static int amdgpu_dm_init(struct amdgpu_device *adev)
{
struct dc_init_data init_data;
@@ -1406,6 +1437,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
if (adev->asic_type != CHIP_CARRIZO && adev->asic_type != CHIP_STONEY)
adev->dm.dc->debug.disable_stutter = amdgpu_pp_feature_mask & PP_STUTTER_MODE ? false : true;
+ if (dm_should_disable_stutter(adev->pdev))
+ adev->dm.dc->debug.disable_stutter = true;
if (amdgpu_dc_debug_mask & DC_DISABLE_STUTTER)
adev->dm.dc->debug.disable_stutter = true;
--
2.31.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amdgpu/display: add quirk handling for stutter mode
2021-10-25 18:52 [PATCH] drm/amdgpu/display: add quirk handling for stutter mode Alex Deucher
@ 2021-10-25 19:24 ` Harry Wentland
0 siblings, 0 replies; 2+ messages in thread
From: Harry Wentland @ 2021-10-25 19:24 UTC (permalink / raw)
To: Alex Deucher, amd-gfx
On 2021-10-25 14:52, Alex Deucher wrote:
> Stutter mode is a power saving feature on GPUs, however at
> least one early raven system exhibits stability issues with
> it. Add a quirk to disable it for that system.
>
> Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214417
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 33 +++++++++++++++++++
> 1 file changed, 33 insertions(+)
>
> 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 5b8d1635da5c..b635b893837b 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1295,6 +1295,37 @@ static struct hpd_rx_irq_offload_work_queue *hpd_rx_irq_create_workqueue(struct
> return hpd_rx_offload_wq;
> }
>
> +struct amdgpu_stutter_quirk {
> + u16 chip_vendor;
> + u16 chip_device;
> + u16 subsys_vendor;
> + u16 subsys_device;
> + u8 revision;
> +};
> +
> +static const struct amdgpu_stutter_quirk amdgpu_stutter_quirk_list[] = {
> + /* https://bugzilla.kernel.org/show_bug.cgi?id=214417 */
> + { 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
> + { 0, 0, 0, 0, 0 },
> +};
> +
> +static bool dm_should_disable_stutter(struct pci_dev *pdev)
> +{
> + const struct amdgpu_stutter_quirk *p = amdgpu_stutter_quirk_list;
> +
> + while (p && p->chip_device != 0) {
> + if (pdev->vendor == p->chip_vendor &&
> + pdev->device == p->chip_device &&
> + pdev->subsystem_vendor == p->subsys_vendor &&
> + pdev->subsystem_device == p->subsys_device &&
> + pdev->revision == p->revision) {
> + return true;
> + }
> + ++p;
> + }
> + return false;
> +}
> +
> static int amdgpu_dm_init(struct amdgpu_device *adev)
> {
> struct dc_init_data init_data;
> @@ -1406,6 +1437,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
>
> if (adev->asic_type != CHIP_CARRIZO && adev->asic_type != CHIP_STONEY)
> adev->dm.dc->debug.disable_stutter = amdgpu_pp_feature_mask & PP_STUTTER_MODE ? false : true;
> + if (dm_should_disable_stutter(adev->pdev))
> + adev->dm.dc->debug.disable_stutter = true;
>
> if (amdgpu_dc_debug_mask & DC_DISABLE_STUTTER)
> adev->dm.dc->debug.disable_stutter = true;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-25 19:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 18:52 [PATCH] drm/amdgpu/display: add quirk handling for stutter mode Alex Deucher
2021-10-25 19:24 ` Harry Wentland
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.