diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-08-03 19:59:20 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-03 20:03:50 -0400 |
commit | 5b1714d386a2f0c0d270e3abe1ac39ad1b0ba010 (patch) | |
tree | 8992a96ad5edcbc60b44d3541588309d8b866293 /drivers/gpu/drm/radeon/atombios_crtc.c | |
parent | d65d65b175a29bd7ea2bb69c046419329c4a5db7 (diff) |
drm/radeon/kms: enable underscan option for digital connectors
This connector attribute allows you to enable or disable underscan
on a digital output to compensate for panels that automatically
overscan (e.g., many HDMI TVs). Valid values for the attribute are:
off - forces underscan off
on - forces underscan on
auto - enables underscan if an HDMI TV is connected, off otherwise
default value is auto.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_crtc.c')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index a2e65d9f2a1c..12ad512bd3d3 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -44,10 +44,6 @@ static void atombios_overscan_setup(struct drm_crtc *crtc, | |||
44 | 44 | ||
45 | memset(&args, 0, sizeof(args)); | 45 | memset(&args, 0, sizeof(args)); |
46 | 46 | ||
47 | args.usOverscanRight = 0; | ||
48 | args.usOverscanLeft = 0; | ||
49 | args.usOverscanBottom = 0; | ||
50 | args.usOverscanTop = 0; | ||
51 | args.ucCRTC = radeon_crtc->crtc_id; | 47 | args.ucCRTC = radeon_crtc->crtc_id; |
52 | 48 | ||
53 | switch (radeon_crtc->rmx_type) { | 49 | switch (radeon_crtc->rmx_type) { |
@@ -56,7 +52,6 @@ static void atombios_overscan_setup(struct drm_crtc *crtc, | |||
56 | args.usOverscanBottom = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2; | 52 | args.usOverscanBottom = (adjusted_mode->crtc_vdisplay - mode->crtc_vdisplay) / 2; |
57 | args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2; | 53 | args.usOverscanLeft = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2; |
58 | args.usOverscanRight = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2; | 54 | args.usOverscanRight = (adjusted_mode->crtc_hdisplay - mode->crtc_hdisplay) / 2; |
59 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
60 | break; | 55 | break; |
61 | case RMX_ASPECT: | 56 | case RMX_ASPECT: |
62 | a1 = mode->crtc_vdisplay * adjusted_mode->crtc_hdisplay; | 57 | a1 = mode->crtc_vdisplay * adjusted_mode->crtc_hdisplay; |
@@ -69,17 +64,16 @@ static void atombios_overscan_setup(struct drm_crtc *crtc, | |||
69 | args.usOverscanLeft = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2; | 64 | args.usOverscanLeft = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2; |
70 | args.usOverscanRight = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2; | 65 | args.usOverscanRight = (adjusted_mode->crtc_vdisplay - (a1 / mode->crtc_hdisplay)) / 2; |
71 | } | 66 | } |
72 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
73 | break; | 67 | break; |
74 | case RMX_FULL: | 68 | case RMX_FULL: |
75 | default: | 69 | default: |
76 | args.usOverscanRight = 0; | 70 | args.usOverscanRight = radeon_crtc->h_border; |
77 | args.usOverscanLeft = 0; | 71 | args.usOverscanLeft = radeon_crtc->h_border; |
78 | args.usOverscanBottom = 0; | 72 | args.usOverscanBottom = radeon_crtc->v_border; |
79 | args.usOverscanTop = 0; | 73 | args.usOverscanTop = radeon_crtc->v_border; |
80 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
81 | break; | 74 | break; |
82 | } | 75 | } |
76 | atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args); | ||
83 | } | 77 | } |
84 | 78 | ||
85 | static void atombios_scaler_setup(struct drm_crtc *crtc) | 79 | static void atombios_scaler_setup(struct drm_crtc *crtc) |
@@ -282,22 +276,22 @@ atombios_set_crtc_dtd_timing(struct drm_crtc *crtc, | |||
282 | u16 misc = 0; | 276 | u16 misc = 0; |
283 | 277 | ||
284 | memset(&args, 0, sizeof(args)); | 278 | memset(&args, 0, sizeof(args)); |
285 | args.usH_Size = cpu_to_le16(mode->crtc_hdisplay); | 279 | args.usH_Size = cpu_to_le16(mode->crtc_hdisplay - (radeon_crtc->h_border * 2)); |
286 | args.usH_Blanking_Time = | 280 | args.usH_Blanking_Time = |
287 | cpu_to_le16(mode->crtc_hblank_end - mode->crtc_hdisplay); | 281 | cpu_to_le16(mode->crtc_hblank_end - mode->crtc_hdisplay + (radeon_crtc->h_border * 2)); |
288 | args.usV_Size = cpu_to_le16(mode->crtc_vdisplay); | 282 | args.usV_Size = cpu_to_le16(mode->crtc_vdisplay - (radeon_crtc->v_border * 2)); |
289 | args.usV_Blanking_Time = | 283 | args.usV_Blanking_Time = |
290 | cpu_to_le16(mode->crtc_vblank_end - mode->crtc_vdisplay); | 284 | cpu_to_le16(mode->crtc_vblank_end - mode->crtc_vdisplay + (radeon_crtc->v_border * 2)); |
291 | args.usH_SyncOffset = | 285 | args.usH_SyncOffset = |
292 | cpu_to_le16(mode->crtc_hsync_start - mode->crtc_hdisplay); | 286 | cpu_to_le16(mode->crtc_hsync_start - mode->crtc_hdisplay + radeon_crtc->h_border); |
293 | args.usH_SyncWidth = | 287 | args.usH_SyncWidth = |
294 | cpu_to_le16(mode->crtc_hsync_end - mode->crtc_hsync_start); | 288 | cpu_to_le16(mode->crtc_hsync_end - mode->crtc_hsync_start); |
295 | args.usV_SyncOffset = | 289 | args.usV_SyncOffset = |
296 | cpu_to_le16(mode->crtc_vsync_start - mode->crtc_vdisplay); | 290 | cpu_to_le16(mode->crtc_vsync_start - mode->crtc_vdisplay + radeon_crtc->v_border); |
297 | args.usV_SyncWidth = | 291 | args.usV_SyncWidth = |
298 | cpu_to_le16(mode->crtc_vsync_end - mode->crtc_vsync_start); | 292 | cpu_to_le16(mode->crtc_vsync_end - mode->crtc_vsync_start); |
299 | /*args.ucH_Border = mode->hborder;*/ | 293 | args.ucH_Border = radeon_crtc->h_border; |
300 | /*args.ucV_Border = mode->vborder;*/ | 294 | args.ucV_Border = radeon_crtc->v_border; |
301 | 295 | ||
302 | if (mode->flags & DRM_MODE_FLAG_NVSYNC) | 296 | if (mode->flags & DRM_MODE_FLAG_NVSYNC) |
303 | misc |= ATOM_VSYNC_POLARITY; | 297 | misc |= ATOM_VSYNC_POLARITY; |
@@ -1176,10 +1170,8 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc, | |||
1176 | atombios_crtc_set_pll(crtc, adjusted_mode); | 1170 | atombios_crtc_set_pll(crtc, adjusted_mode); |
1177 | atombios_enable_ss(crtc); | 1171 | atombios_enable_ss(crtc); |
1178 | 1172 | ||
1179 | if (ASIC_IS_DCE4(rdev)) | 1173 | if (ASIC_IS_AVIVO(rdev)) |
1180 | atombios_set_crtc_dtd_timing(crtc, adjusted_mode); | 1174 | atombios_set_crtc_dtd_timing(crtc, adjusted_mode); |
1181 | else if (ASIC_IS_AVIVO(rdev)) | ||
1182 | atombios_crtc_set_timing(crtc, adjusted_mode); | ||
1183 | else { | 1175 | else { |
1184 | atombios_crtc_set_timing(crtc, adjusted_mode); | 1176 | atombios_crtc_set_timing(crtc, adjusted_mode); |
1185 | if (radeon_crtc->crtc_id == 0) | 1177 | if (radeon_crtc->crtc_id == 0) |