diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-03-12 01:23:44 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-03-13 03:15:07 -0400 |
commit | 4cbb0f8d2b06c72aae3552ff1a0a57814c6ce7d2 (patch) | |
tree | 6ada0cffdd7f0f6f19e398b79cf77d669658e336 /drivers/gpu/drm | |
parent | 3488c57b983546e6bf4c9e0bfd0f7f2a1292267a (diff) |
drm/nvd0/disp: disconnect encoders before reprogramming them
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvd0_display.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/gpu/drm/nouveau/nvd0_display.c b/drivers/gpu/drm/nouveau/nvd0_display.c index ae6d80fff4bd..dfb8a951cbbe 100644 --- a/drivers/gpu/drm/nouveau/nvd0_display.c +++ b/drivers/gpu/drm/nouveau/nvd0_display.c | |||
@@ -284,6 +284,8 @@ nvd0_display_flip_next(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
284 | u32 *push; | 284 | u32 *push; |
285 | int ret; | 285 | int ret; |
286 | 286 | ||
287 | evo_sync(crtc->dev, EVO_MASTER); | ||
288 | |||
287 | swap_interval <<= 4; | 289 | swap_interval <<= 4; |
288 | if (swap_interval == 0) | 290 | if (swap_interval == 0) |
289 | swap_interval |= 0x100; | 291 | swap_interval |= 0x100; |
@@ -593,7 +595,7 @@ nvd0_crtc_commit(struct drm_crtc *crtc) | |||
593 | evo_kick(push, crtc->dev, EVO_MASTER); | 595 | evo_kick(push, crtc->dev, EVO_MASTER); |
594 | } | 596 | } |
595 | 597 | ||
596 | nvd0_crtc_cursor_show(nv_crtc, nv_crtc->cursor.visible, false); | 598 | nvd0_crtc_cursor_show(nv_crtc, nv_crtc->cursor.visible, true); |
597 | nvd0_display_flip_next(crtc, crtc->fb, NULL, 1); | 599 | nvd0_display_flip_next(crtc, crtc->fb, NULL, 1); |
598 | } | 600 | } |
599 | 601 | ||
@@ -948,11 +950,6 @@ nvd0_dac_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
948 | } | 950 | } |
949 | 951 | ||
950 | static void | 952 | static void |
951 | nvd0_dac_prepare(struct drm_encoder *encoder) | ||
952 | { | ||
953 | } | ||
954 | |||
955 | static void | ||
956 | nvd0_dac_commit(struct drm_encoder *encoder) | 953 | nvd0_dac_commit(struct drm_encoder *encoder) |
957 | { | 954 | { |
958 | } | 955 | } |
@@ -1045,7 +1042,7 @@ nvd0_dac_destroy(struct drm_encoder *encoder) | |||
1045 | static const struct drm_encoder_helper_funcs nvd0_dac_hfunc = { | 1042 | static const struct drm_encoder_helper_funcs nvd0_dac_hfunc = { |
1046 | .dpms = nvd0_dac_dpms, | 1043 | .dpms = nvd0_dac_dpms, |
1047 | .mode_fixup = nvd0_dac_mode_fixup, | 1044 | .mode_fixup = nvd0_dac_mode_fixup, |
1048 | .prepare = nvd0_dac_prepare, | 1045 | .prepare = nvd0_dac_disconnect, |
1049 | .commit = nvd0_dac_commit, | 1046 | .commit = nvd0_dac_commit, |
1050 | .mode_set = nvd0_dac_mode_set, | 1047 | .mode_set = nvd0_dac_mode_set, |
1051 | .disable = nvd0_dac_disconnect, | 1048 | .disable = nvd0_dac_disconnect, |
@@ -1386,8 +1383,37 @@ nvd0_sor_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
1386 | } | 1383 | } |
1387 | 1384 | ||
1388 | static void | 1385 | static void |
1386 | nvd0_sor_disconnect(struct drm_encoder *encoder) | ||
1387 | { | ||
1388 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | ||
1389 | struct drm_device *dev = encoder->dev; | ||
1390 | u32 *push; | ||
1391 | |||
1392 | if (nv_encoder->crtc) { | ||
1393 | nvd0_crtc_prepare(nv_encoder->crtc); | ||
1394 | |||
1395 | push = evo_wait(dev, EVO_MASTER, 4); | ||
1396 | if (push) { | ||
1397 | evo_mthd(push, 0x0200 + (nv_encoder->or * 0x20), 1); | ||
1398 | evo_data(push, 0x00000000); | ||
1399 | evo_mthd(push, 0x0080, 1); | ||
1400 | evo_data(push, 0x00000000); | ||
1401 | evo_kick(push, dev, EVO_MASTER); | ||
1402 | } | ||
1403 | |||
1404 | nvd0_hdmi_disconnect(encoder); | ||
1405 | |||
1406 | nv_encoder->crtc = NULL; | ||
1407 | nv_encoder->last_dpms = DRM_MODE_DPMS_OFF; | ||
1408 | } | ||
1409 | } | ||
1410 | |||
1411 | static void | ||
1389 | nvd0_sor_prepare(struct drm_encoder *encoder) | 1412 | nvd0_sor_prepare(struct drm_encoder *encoder) |
1390 | { | 1413 | { |
1414 | nvd0_sor_disconnect(encoder); | ||
1415 | if (nouveau_encoder(encoder)->dcb->type == OUTPUT_DP) | ||
1416 | evo_sync(encoder->dev, EVO_MASTER); | ||
1391 | } | 1417 | } |
1392 | 1418 | ||
1393 | static void | 1419 | static void |
@@ -1509,32 +1535,6 @@ nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode, | |||
1509 | } | 1535 | } |
1510 | 1536 | ||
1511 | static void | 1537 | static void |
1512 | nvd0_sor_disconnect(struct drm_encoder *encoder) | ||
1513 | { | ||
1514 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | ||
1515 | struct drm_device *dev = encoder->dev; | ||
1516 | u32 *push; | ||
1517 | |||
1518 | if (nv_encoder->crtc) { | ||
1519 | nvd0_crtc_prepare(nv_encoder->crtc); | ||
1520 | |||
1521 | push = evo_wait(dev, EVO_MASTER, 4); | ||
1522 | if (push) { | ||
1523 | evo_mthd(push, 0x0200 + (nv_encoder->or * 0x20), 1); | ||
1524 | evo_data(push, 0x00000000); | ||
1525 | evo_mthd(push, 0x0080, 1); | ||
1526 | evo_data(push, 0x00000000); | ||
1527 | evo_kick(push, dev, EVO_MASTER); | ||
1528 | } | ||
1529 | |||
1530 | nvd0_hdmi_disconnect(encoder); | ||
1531 | |||
1532 | nv_encoder->crtc = NULL; | ||
1533 | nv_encoder->last_dpms = DRM_MODE_DPMS_OFF; | ||
1534 | } | ||
1535 | } | ||
1536 | |||
1537 | static void | ||
1538 | nvd0_sor_destroy(struct drm_encoder *encoder) | 1538 | nvd0_sor_destroy(struct drm_encoder *encoder) |
1539 | { | 1539 | { |
1540 | drm_encoder_cleanup(encoder); | 1540 | drm_encoder_cleanup(encoder); |