Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345159
b: refs/heads/master
c: 397fe15
h: refs/heads/master
i:
  345157: 6c476b8
  345155: 2e529c1
  345151: 7091ba8
v: v3
  • Loading branch information
Daniel Vetter committed Oct 22, 2012
1 parent c3e81eb commit b8d3f7b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b5c662e8f536ca47396116de82f08d771727076
refs/heads/master: 397fe15715ef1457d89f52666d0e249eb5eae64c
17 changes: 2 additions & 15 deletions trunk/drivers/gpu/drm/i915/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,6 @@ intel_edp_target_clock(struct intel_encoder *intel_encoder,
return mode->clock;
}

static int
intel_dp_max_lane_count(struct intel_dp *intel_dp)
{
int max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f;
switch (max_lane_count) {
case 1: case 2: case 4:
break;
default:
max_lane_count = 4;
}
return max_lane_count;
}

static int
intel_dp_max_link_bw(struct intel_dp *intel_dp)
{
Expand Down Expand Up @@ -197,7 +184,7 @@ intel_dp_adjust_dithering(struct intel_dp *intel_dp,
bool adjust_mode)
{
int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_dp));
int max_lanes = intel_dp_max_lane_count(intel_dp);
int max_lanes = drm_dp_max_lane_count(intel_dp->dpcd);
int max_rate, mode_rate;

mode_rate = intel_dp_link_required(mode->clock, 24);
Expand Down Expand Up @@ -699,7 +686,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder,
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
struct intel_connector *intel_connector = intel_dp->attached_connector;
int lane_count, clock;
int max_lane_count = intel_dp_max_lane_count(intel_dp);
int max_lane_count = drm_dp_max_lane_count(intel_dp->dpcd);
int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0;
int bpp, mode_rate;
static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/gpu/drm/radeon/atombios_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,6 @@ static int dp_get_max_dp_pix_clock(int link_rate,
return (link_rate * lane_num * 8) / bpp;
}

static u8 dp_get_max_lane_number(u8 dpcd[DP_DPCD_SIZE])
{
return dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK;
}

/***** radeon specific DP functions *****/

/* First get the min lane# when low rate is used according to pixel clock
Expand All @@ -364,7 +359,7 @@ static int radeon_dp_get_dp_lane_number(struct drm_connector *connector,
{
int bpp = convert_bpc_to_bpp(radeon_get_monitor_bpc(connector));
int max_link_rate = drm_dp_max_link_rate(dpcd);
int max_lane_num = dp_get_max_lane_number(dpcd);
int max_lane_num = drm_dp_max_lane_count(dpcd);
int lane_num;
int max_dp_pix_clock;

Expand Down
7 changes: 7 additions & 0 deletions trunk/include/drm/drm_dp_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,4 +346,11 @@ drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE])
{
return drm_dp_bw_code_to_link_rate(dpcd[DP_MAX_LINK_RATE]);
}

static inline u8
drm_dp_max_lane_count(u8 dpcd[DP_RECEIVER_CAP_SIZE])
{
return dpcd[DP_MAX_LANE_COUNT] & DP_MAX_LANE_COUNT_MASK;
}

#endif /* _DRM_DP_HELPER_H_ */

0 comments on commit b8d3f7b

Please sign in to comment.