linux-next: manual merge of the amdgpu tree with the drm-fixes tree
Subsystems (3)
Mark Brown
maintainerHi all,
Today's linux-next merge of the amdgpu tree got a conflict in:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
between commit:
04de4007d3238 ("drm/amdgpu: Fix GPU PCIe link capability reporting")
from the drm-fixes tree and commits:
7ea6a47224e2c ("drm/amdgpu: Fix GPU PCIe link capability reporting") 15b2b06744561 ("drm/amdgpu: Reuse cached PCIe link device")
from the amdgpu tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
@@@ -68,6 -68,7 +68,7 @@@#include "amdgpu_vf_error.h" #include "amdgpu_amdkfd.h" +#include "amdgpu_ip.h" #include "amdgpu_pm.h" #include "amdgpu_xgmi.h" #endif } -/* -* Some dGPUs expose their display endpoint below an internal PCIe switch. -* Use the switch upstream port to query the host-facing link. -*/ -static struct pci_dev *amdgpu_device_get_aspm_pdev (struct amdgpu_device *adev) - { -struct pci_dev *swds, *swus; - - swds =pci_upstream_bridge (adev->pdev); -if (!swds || - (swds->vendor !=PCI_VENDOR_ID_ATI && - swds->vendor !=PCI_VENDOR_ID_AMD ) || -pci_pcie_type (swds) !=PCI_EXP_TYPE_DOWNSTREAM ) -return adev->pdev; - - swus =pci_upstream_bridge (swds); -if (!swus || - (swus->vendor !=PCI_VENDOR_ID_ATI && - swus->vendor !=PCI_VENDOR_ID_AMD ) || -pci_pcie_type (swus) !=PCI_EXP_TYPE_UPSTREAM ) -return adev->pdev; - -return swus; - } -/** * amdgpu_device_should_use_aspm - check if the device should program ASPM * * the immediate upstream bridge. Use SWUS for dGPUs with an * internal switch so that this is the host-facing link. */ - aspm_pdev =amdgpu_device_get_aspm_pdev (adev); + aspm_pdev = adev->link_dev; parent =pci_upstream_bridge (aspm_pdev);if (!parent) {dev_dbg (adev->dev,"ASPM: no upstream PCIe link for %s\n" , return atomic_read(&dev->open_count) == 0; } +static void amdgpu_switcheroo_pre_switch(struct pci_dev *pdev) +{ + struct drm_device *dev = pci_get_drvdata(pdev); + +drm_client_dev_acquire_outputs (dev); +} + static const struct vga_switcheroo_client_ops amdgpu_switcheroo_ops = { .set_gpu_state = amdgpu_switcheroo_set_state, - .reprobe = NULL, .can_switch = amdgpu_switcheroo_can_switch, + .pre_switch = amdgpu_switcheroo_pre_switch, };/** static void amdgpu_device_init_pcie_links(struct amdgpu_device *adev) { +struct pci_dev *swds, *swus; +adev->link_dev = adev->pdev; adev->link_partner = pci_upstream_bridge(adev->link_dev); - /* Skip upstream/downstream switches internal to the dGPU. */ -while (adev->link_partner && - adev->link_partner->vendor ==PCI_VENDOR_ID_ATI ) { - adev->link_dev = adev->link_partner; - adev->link_partner =pci_upstream_bridge (adev->link_dev); - } +/* Skip an upstream/downstream switch internal to the dGPU. */ + swds = adev->link_partner; +if (!swds || swds->vendor !=PCI_VENDOR_ID_ATI || +pci_pcie_type (swds) !=PCI_EXP_TYPE_DOWNSTREAM ) +return ; + + swus =pci_upstream_bridge (swds); +if (!swus || + (swus->vendor !=PCI_VENDOR_ID_ATI && + swus->vendor !=PCI_VENDOR_ID_AMD ) || +pci_pcie_type (swus) !=PCI_EXP_TYPE_UPSTREAM ) +return ; + + adev->link_dev = swus; + adev->link_partner =pci_upstream_bridge (swus); }/** spin_lock_init(&adev->irq.lock); + amdgpu_ip_map_init(adev); amdgpu_early_init_rlc_reg_funcs(adev); amdgpu_device_init_apu_flags(adev); struct pci_dev *swus, *swds; int r; + swus = adev->link_dev != adev->pdev ? adev->link_dev : NULL; +if (!swus) +return; swds = pci_upstream_bridge(adev->pdev); -if (!swds || swds->vendor != PCI_VENDOR_ID_ATI || -pci_pcie_type(swds) != PCI_EXP_TYPE_DOWNSTREAM) -return; -swus = pci_upstream_bridge(swds); -if (!swus || -(swus->vendor != PCI_VENDOR_ID_ATI && -swus->vendor != PCI_VENDOR_ID_AMD) || -pci_pcie_type(swus) != PCI_EXP_TYPE_UPSTREAM) -return; /* If already saved, return */ if (adev->pcie_reset_ctx.swus)