All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
Cc: Michael Jamet
	<michael.jamet-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	amd-gfx list
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Bjorn Helgaas <bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
	Maling list - DRI developers
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	Mika Westerberg
	<mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Christian Koenig <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	Peter Wu <peter-VTkQYDcBqhK7DlmcbJSQ7g@public.gmane.org>
Subject: Re: [PATCH 4/5] drm/radeon: Don't register Thunderbolt eGPU with vga_switcheroo
Date: Tue, 7 Mar 2017 15:30:30 -0500	[thread overview]
Message-ID: <CADnq5_MgKOOaxTGx3=bs=ZopSKkZqxoOnxd=+hv-ik5PzRi4Gw@mail.gmail.com> (raw)
In-Reply-To: <d466d25ba40b5289f2cafa881b990bf687b29abd.1487938189.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>

On Fri, Feb 24, 2017 at 2:19 PM, Lukas Wunner <lukas@wunner.de> wrote:
> An external Thunderbolt GPU can neither drive the laptop's panel nor be
> powered off by the platform, so there's no point in registering it with
> vga_switcheroo.  In fact, when the external GPU is runtime suspended,
> vga_switcheroo will cut power to the internal discrete GPU, resulting in
> a lockup.

I'm not necessarily opposed to this, but I'd prefer something more
generic.  E.g., what happens if someone uses another dGPU in a docking
station or some other sort of PCIe bridge?  I think on AMD platforms
at least we should be able to determine what devices are the
switcheroo devices based on information in the ATIF and ATPX ACPI
methods.  In that case, we can be explicit in which devices we
register with vga_switcheroo.

Alex

>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
> ---
>  drivers/gpu/drm/radeon/radeon_device.c | 7 +++++--
>  drivers/gpu/drm/radeon/radeon_kms.c    | 3 ++-
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index 4b0c388be3f5..27be17f0b227 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -1471,7 +1471,9 @@ int radeon_device_init(struct radeon_device *rdev,
>
>         if (rdev->flags & RADEON_IS_PX)
>                 runtime = true;
> -       vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime);
> +       if (!pci_is_thunderbolt_attached(rdev->pdev))
> +               vga_switcheroo_register_client(rdev->pdev,
> +                                              &radeon_switcheroo_ops, runtime);
>         if (runtime)
>                 vga_switcheroo_init_domain_pm_ops(rdev->dev, &rdev->vga_pm_domain);
>
> @@ -1564,7 +1566,8 @@ void radeon_device_fini(struct radeon_device *rdev)
>         /* evict vram memory */
>         radeon_bo_evict_vram(rdev);
>         radeon_fini(rdev);
> -       vga_switcheroo_unregister_client(rdev->pdev);
> +       if (!pci_is_thunderbolt_attached(rdev->pdev))
> +               vga_switcheroo_unregister_client(rdev->pdev);
>         if (rdev->flags & RADEON_IS_PX)
>                 vga_switcheroo_fini_domain_pm_ops(rdev->dev);
>         vga_client_register(rdev->pdev, NULL, NULL, NULL);
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index 56f35c06742c..e95ceec1c97a 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -115,7 +115,8 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
>
>         if ((radeon_runtime_pm != 0) &&
>             radeon_has_atpx() &&
> -           ((flags & RADEON_IS_IGP) == 0))
> +           ((flags & RADEON_IS_IGP) == 0) &&
> +           !pci_is_thunderbolt_attached(rdev->pdev))
>                 flags |= RADEON_IS_PX;
>
>         /* radeon_device_init should report only fatal error
> --
> 2.11.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-03-07 20:30 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24 19:19 [PATCH 0/5] Thunderbolt GPU fixes Lukas Wunner
2017-02-24 19:19 ` Lukas Wunner
2017-02-24 19:19 ` [PATCH 4/5] drm/radeon: Don't register Thunderbolt eGPU with vga_switcheroo Lukas Wunner
     [not found]   ` <d466d25ba40b5289f2cafa881b990bf687b29abd.1487938189.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-03-07 20:30     ` Alex Deucher [this message]
2017-03-08  5:01       ` Lukas Wunner
2017-03-08 10:46         ` Peter Wu
2017-03-08 12:22           ` Lukas Wunner
     [not found]         ` <20170308050154.GA4250-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-03-08 20:34           ` Alex Deucher
2017-03-09 10:55             ` Lukas Wunner
2017-03-09 13:57               ` Alex Deucher
2017-02-24 19:19 ` [PATCH 3/5] drm/nouveau: " Lukas Wunner
2017-02-24 20:59   ` Bjorn Helgaas
2017-03-04 10:16     ` Lukas Wunner
2017-02-24 19:19 ` [PATCH 2/5] apple-gmux: Don't switch external DP port on 2011+ MacBook Pros Lukas Wunner
     [not found] ` <cover.1487938188.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2017-02-24 19:19   ` [PATCH 5/5] drm/amdgpu: Don't register Thunderbolt eGPU with vga_switcheroo Lukas Wunner
2017-02-24 19:19   ` [PATCH 1/5] PCI: Recognize Thunderbolt devices Lukas Wunner
2017-02-24 19:19     ` Lukas Wunner
2017-02-24 22:17     ` Bjorn Helgaas
2017-02-24 22:17       ` Bjorn Helgaas
2017-02-25  7:40       ` Lukas Wunner
2017-02-25 14:44         ` Bjorn Helgaas
     [not found]       ` <20170224221724.GA26430-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2017-03-04 11:14         ` Lukas Wunner
2017-03-04 11:14           ` Lukas Wunner
2017-03-09 15:03 ` [PATCH 0/5] Thunderbolt GPU fixes Daniel Vetter
2017-03-09 15:03   ` Daniel Vetter
     [not found]   ` <20170309150347.a4k4w2sclox2365t-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-03-10 12:07     ` Lukas Wunner
2017-03-10 12:07       ` Lukas Wunner
2017-03-10 12:15       ` Andy Shevchenko
2017-03-10 12:15         ` Andy Shevchenko

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='CADnq5_MgKOOaxTGx3=bs=ZopSKkZqxoOnxd=+hv-ik5PzRi4Gw@mail.gmail.com' \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=bhelgaas-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org \
    --cc=michael.jamet-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=peter-VTkQYDcBqhK7DlmcbJSQ7g@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.