drivers/gpu/drm/amd/pm/powerplay/hwmgr/pppcielanes.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/pm/powerplay/hwmgr/pppcielanes.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/pm/powerplay/hwmgr/pppcielanes.c
Extension
.c
Size
2291 bytes
Lines
65
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

#include <linux/types.h>
#include "atom-types.h"
#include "atombios.h"
#include "pppcielanes.h"

/** \file
 * Functions related to PCIe lane changes.
 */

/* For converting from number of lanes to lane bits.  */
static const unsigned char pp_r600_encode_lanes[] = {
	0,          /*  0 Not Supported  */
	1,          /*  1 Lane  */
	2,          /*  2 Lanes  */
	0,          /*  3 Not Supported  */
	3,          /*  4 Lanes  */
	0,          /*  5 Not Supported  */
	0,          /*  6 Not Supported  */
	0,          /*  7 Not Supported  */
	4,          /*  8 Lanes  */
	0,          /*  9 Not Supported  */
	0,          /* 10 Not Supported  */
	0,          /* 11 Not Supported  */
	5,          /* 12 Lanes (Not actually supported)  */
	0,          /* 13 Not Supported  */
	0,          /* 14 Not Supported  */
	0,          /* 15 Not Supported  */
	6           /* 16 Lanes  */
};

static const unsigned char pp_r600_decoded_lanes[8] = { 16, 1, 2, 4, 8, 12, 16, };

uint8_t encode_pcie_lane_width(uint32_t num_lanes)
{
	return pp_r600_encode_lanes[num_lanes];
}

uint8_t decode_pcie_lane_width(uint32_t num_lanes)
{
	return pp_r600_decoded_lanes[num_lanes];
}

Annotation

Implementation Notes