All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 3/5] drm/amdgpu: simplify ATPX detection
Date: Thu, 10 Oct 2019 10:26:17 -0500	[thread overview]
Message-ID: <20191010152619.31011-4-alexander.deucher@amd.com> (raw)
In-Reply-To: <20191010152619.31011-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>

Use the base class rather than the specific class and drop
the second loop.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

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

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

  parent reply	other threads:[~2019-10-10 15:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-10 15:26 [PATCH 0/5] Misc runpm and baco fixes Alex Deucher
     [not found] ` <20191010152619.31011-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-10-10 15:26   ` [PATCH 1/5] drm/amdgpu: move pci_save_state into suspend path Alex Deucher
2019-10-10 15:26   ` [PATCH 2/5] drm/amdgpu: move gpu reset out of amdgpu_device_suspend Alex Deucher
     [not found]     ` <20191010152619.31011-3-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-10-11  4:07       ` Quan, Evan
     [not found]         ` <BN8PR12MB3329E4B5DE6B027D43B38F5AE4970-h6+T2+wrnx3WSNCBJ7MpiAdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-10-11  4:09           ` Quan, Evan
2019-10-11 13:25           ` Alex Deucher
     [not found]             ` <CADnq5_Pbi+K=62tY0sJdOARy74wpnh+Owfq3wQb0tcyXE2XtFw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-10-12  1:42               ` Quan, Evan
     [not found]                 ` <MN2PR12MB3344923284A5FF12F631B634E4960-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-10-12  1:49                   ` Alex Deucher
2019-10-10 15:26   ` Alex Deucher [this message]
2019-10-10 15:26   ` [PATCH 4/5] drm/amdgpu: remove in_baco_reset hack Alex Deucher
2019-10-10 15:26   ` [PATCH 5/5] drm/amdgpu/soc15: add support for baco reset with swSMU Alex Deucher
     [not found]     ` <20191010152619.31011-6-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2019-10-11  4:09       ` Quan, Evan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191010152619.31011-4-alexander.deucher@amd.com \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.