linuxkpi: Fix pci_upstream_bridge() with DRM devices
In the case of DRM drivers, the passed device is a child of vgapci. We
want to start the lookup from vgapci, so the parent of the passed
drmn. We use the isdrm flag to determine if we are in this
situation.
This fixes an infinite loop with the amdgpu DRM driver that started to
use this function in Linux 6.8: pci_upstream_bridge() was returning
itself and the code in amdgpu was calling it again, hoping to get a
device with a vendor that is not "ATI".
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49388