Re: [PATCH] drm/amd: Exclude dGPUs in eGPU enclosures from DPM quirks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/6/2023 15:40, Alex Deucher wrote:
On Mon, Nov 6, 2023 at 3:07 PM Mario Limonciello
<mario.limonciello@xxxxxxx> wrote:

DPM should be enabled on dGPUs that are used in eGPU enclosures
regardless of the host support.

Are you sure?  Seems like this would be dependent on whether the eGPU
bridge supports dynamic switching or not.

Right; but the bridge the eGPU is connected to is "outside" the host.

We shouldn't be blocking the bridge 100% of the time if it's connected to an Intel host.

I *believe* right now the way the code is put together if you take an otherwise identical OS image with amd-staging-drm-next and connect an eGPU to an Intel USB4 host you'll end up with DPM turned off and an AMD USB4 host will have it enabled.


Alex


Signed-off-by: Mario Limonciello <mario.limonciello@xxxxxxx>
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index e2199d8fd30e..29d5820e912b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1466,11 +1466,15 @@ bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
   * https://edc.intel.com/content/www/us/en/design/products/platforms/details/raptor-lake-s/13th-generation-core-processors-datasheet-volume-1-of-2/005/pci-express-support/
   * https://gitlab.freedesktop.org/drm/amd/-/issues/2663
   */
-static bool amdgpu_device_pcie_dynamic_switching_supported(void)
+static bool amdgpu_device_pcie_dynamic_switching_supported(struct amdgpu_device *adev)
  {
  #if IS_ENABLED(CONFIG_X86)
         struct cpuinfo_x86 *c = &cpu_data(0);

+       /* don't worry about external dGPUs */
+       if (dev_is_removable(adev->dev))
+               return true;
+
         if (c->x86_vendor == X86_VENDOR_INTEL)
                 return false;
  #endif
@@ -2310,7 +2314,7 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
                 adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
         if (amdgpu_sriov_vf(adev) && adev->asic_type == CHIP_SIENNA_CICHLID)
                 adev->pm.pp_feature &= ~PP_OVERDRIVE_MASK;
-       if (!amdgpu_device_pcie_dynamic_switching_supported())
+       if (!amdgpu_device_pcie_dynamic_switching_supported(adev))
                 adev->pm.pp_feature &= ~PP_PCIE_DPM_MASK;

         total = true;
--
2.34.1





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux