aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/nouveau/nvd0_display.c66
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
950static void 952static void
951nvd0_dac_prepare(struct drm_encoder *encoder)
952{
953}
954
955static void
956nvd0_dac_commit(struct drm_encoder *encoder) 953nvd0_dac_commit(struct drm_encoder *encoder)
957{ 954{
958} 955}
@@ -1045,7 +1042,7 @@ nvd0_dac_destroy(struct drm_encoder *encoder)
1045static const struct drm_encoder_helper_funcs nvd0_dac_hfunc = { 1042static 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
1388static void 1385static void
1386nvd0_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
1411static void
1389nvd0_sor_prepare(struct drm_encoder *encoder) 1412nvd0_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
1393static void 1419static void
@@ -1509,32 +1535,6 @@ nvd0_sor_mode_set(struct drm_encoder *encoder, struct drm_display_mode *umode,
1509} 1535}
1510 1536
1511static void 1537static void
1512nvd0_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
1537static void
1538nvd0_sor_destroy(struct drm_encoder *encoder) 1538nvd0_sor_destroy(struct drm_encoder *encoder)
1539{ 1539{
1540 drm_encoder_cleanup(encoder); 1540 drm_encoder_cleanup(encoder);