All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "drm/amdgpu: simplify ATPX detection"
@ 2019-12-21  0:11 Alex Deucher
  2019-12-23 18:52 ` Alex Deucher
  2019-12-24  2:03 ` Quan, Evan
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Deucher @ 2019-12-21  0:11 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher

This reverts commit f5fda6d89afe6e9cedaa1c3303903c905262f6e8.

You can't use BASE_CLASS in pci_get_class.

Bug: https://gitlab.freedesktop.org/drm/amd/issues/995
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
index a97fb759e2f4..3e35a8f2c5e5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
@@ -613,7 +613,17 @@ static bool amdgpu_atpx_detect(void)
 	bool d3_supported = false;
 	struct pci_dev *parent_pdev;
 
-	while ((pdev = pci_get_class(PCI_BASE_CLASS_DISPLAY << 16, pdev)) != NULL) {
+	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
+		vga_count++;
+
+		has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
+
+		parent_pdev = pci_upstream_bridge(pdev);
+		d3_supported |= parent_pdev && parent_pdev->bridge_d3;
+		amdgpu_atpx_get_quirks(pdev);
+	}
+
+	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
 		vga_count++;
 
 		has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
-- 
2.24.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Revert "drm/amdgpu: simplify ATPX detection"
  2019-12-21  0:11 [PATCH] Revert "drm/amdgpu: simplify ATPX detection" Alex Deucher
@ 2019-12-23 18:52 ` Alex Deucher
  2019-12-24  2:03 ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2019-12-23 18:52 UTC (permalink / raw)
  To: amd-gfx list; +Cc: Alex Deucher

Ping?

On Fri, Dec 20, 2019 at 7:11 PM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> This reverts commit f5fda6d89afe6e9cedaa1c3303903c905262f6e8.
>
> You can't use BASE_CLASS in pci_get_class.
>
> Bug: https://gitlab.freedesktop.org/drm/amd/issues/995
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> index a97fb759e2f4..3e35a8f2c5e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> @@ -613,7 +613,17 @@ static bool amdgpu_atpx_detect(void)
>         bool d3_supported = false;
>         struct pci_dev *parent_pdev;
>
> -       while ((pdev = pci_get_class(PCI_BASE_CLASS_DISPLAY << 16, pdev)) != NULL) {
> +       while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) != NULL) {
> +               vga_count++;
> +
> +               has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
> +
> +               parent_pdev = pci_upstream_bridge(pdev);
> +               d3_supported |= parent_pdev && parent_pdev->bridge_d3;
> +               amdgpu_atpx_get_quirks(pdev);
> +       }
> +
> +       while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8, pdev)) != NULL) {
>                 vga_count++;
>
>                 has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
> --
> 2.24.1
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] Revert "drm/amdgpu: simplify ATPX detection"
  2019-12-21  0:11 [PATCH] Revert "drm/amdgpu: simplify ATPX detection" Alex Deucher
  2019-12-23 18:52 ` Alex Deucher
@ 2019-12-24  2:03 ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2019-12-24  2:03 UTC (permalink / raw)
  To: Alex Deucher, amd-gfx; +Cc: Deucher, Alexander

Acked-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex
> Deucher
> Sent: Saturday, December 21, 2019 8:12 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: [PATCH] Revert "drm/amdgpu: simplify ATPX detection"
> 
> This reverts commit f5fda6d89afe6e9cedaa1c3303903c905262f6e8.
> 
> You can't use BASE_CLASS in pci_get_class.
> 
> Bug:
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.fre
> edesktop.org%2Fdrm%2Famd%2Fissues%2F995&amp;data=02%7C01%7Cevan.q
> uan%40amd.com%7C2347975d48674464206608d785aa63d1%7C3dd8961fe488
> 4e608e11a82d994e183d%7C0%7C0%7C637124839286316424&amp;sdata=iIVA
> BG6tvVYviqAYF8ywRM41C82TNkr1PGgj8%2BAjGjQ%3D&amp;reserved=0
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> index a97fb759e2f4..3e35a8f2c5e5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
> @@ -613,7 +613,17 @@ static bool amdgpu_atpx_detect(void)
>  	bool d3_supported = false;
>  	struct pci_dev *parent_pdev;
> 
> -	while ((pdev = pci_get_class(PCI_BASE_CLASS_DISPLAY << 16, pdev)) !=
> NULL) {
> +	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_VGA << 8, pdev)) !=
> NULL) {
> +		vga_count++;
> +
> +		has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
> +
> +		parent_pdev = pci_upstream_bridge(pdev);
> +		d3_supported |= parent_pdev && parent_pdev->bridge_d3;
> +		amdgpu_atpx_get_quirks(pdev);
> +	}
> +
> +	while ((pdev = pci_get_class(PCI_CLASS_DISPLAY_OTHER << 8,
> pdev)) != NULL) {
>  		vga_count++;
> 
>  		has_atpx |= (amdgpu_atpx_pci_probe_handle(pdev) == true);
> --
> 2.24.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.free
> desktop.org%2Fmailman%2Flistinfo%2Famd-
> gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C2347975d4867446420
> 6608d785aa63d1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637
> 124839286316424&amp;sdata=HAa2GZfLSVJnQzPSxwYadxXvaKUIhLIQ30REX%2
> FJN6gU%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-24  2:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-21  0:11 [PATCH] Revert "drm/amdgpu: simplify ATPX detection" Alex Deucher
2019-12-23 18:52 ` Alex Deucher
2019-12-24  2:03 ` Quan, Evan

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.