Skip to content

Commit

Permalink
drm/radeon/dpm: add a helper to encode pcie lane setting
Browse files Browse the repository at this point in the history
convert from number of lanes to register setting.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Alex Deucher committed Aug 30, 2013
1 parent c4453e6 commit 61fb192
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/gpu/drm/radeon/r600_dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,3 +1246,13 @@ u16 r600_get_pcie_lane_support(struct radeon_device *rdev,
return 16;
}
}

u8 r600_encode_pci_lane_width(u32 lanes)
{
u8 encoded_lanes[] = { 0, 1, 2, 0, 3, 0, 0, 0, 4, 0, 0, 0, 5, 0, 0, 0, 6 };

if (lanes > 16)
return 0;

return encoded_lanes[lanes];
}
1 change: 1 addition & 0 deletions drivers/gpu/drm/radeon/r600_dpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,6 @@ enum radeon_pcie_gen r600_get_pcie_gen_support(struct radeon_device *rdev,
u16 r600_get_pcie_lane_support(struct radeon_device *rdev,
u16 asic_lanes,
u16 default_lanes);
u8 r600_encode_pci_lane_width(u32 lanes);

#endif

0 comments on commit 61fb192

Please sign in to comment.