drivers/gpu/drm/amd/include/amd_pcie_helpers.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/include/amd_pcie_helpers.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/include/amd_pcie_helpers.h
Extension
.h
Size
3969 bytes
Lines
142
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ns_pcie_lanes == pcie_lanes[i]) {
				if (pcie_lane_width_cap & (0x10000 << i)) {
					break;
				} else {
					for (j = i - 1; j >= 0; j--) {
						if (pcie_lane_width_cap & (0x10000 << j)) {
							new_pcie_lanes = pcie_lanes[j];
							break;
						}
					}

					if (j < 0) {
						for (j = i + 1; j < 7; j++) {
							if (pcie_lane_width_cap & (0x10000 << j)) {
								new_pcie_lanes = pcie_lanes[j];
								break;
							}
						}
						if (j > 7)
							pr_err("Cannot find a valid PCIE lane width!\n");
					}
				}
				break;
			}
		}
		break;
	}

	return new_pcie_lanes;
}

#endif

Annotation

Implementation Notes