diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-10-14 00:35:19 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-12-21 04:01:18 -0500 |
commit | e6e039d10d08fbdecbdcaf20f29bb7a8c8580d4b (patch) | |
tree | e5764ca80c8db5193a85a60f627cd1cc56923e0d /drivers/gpu/drm/nouveau/nv50_crtc.c | |
parent | a4eaa0a0427ef13468d784953de40c3087e6d870 (diff) |
drm/nv50/disp: move sync routine to where it can be used by other modules
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv50_crtc.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv50_crtc.c | 41 |
1 files changed, 4 insertions, 37 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_crtc.c b/drivers/gpu/drm/nouveau/nv50_crtc.c index e426a9b9865a..f794b4e08f5f 100644 --- a/drivers/gpu/drm/nouveau/nv50_crtc.c +++ b/drivers/gpu/drm/nouveau/nv50_crtc.c | |||
@@ -38,39 +38,6 @@ | |||
38 | #include "nouveau_connector.h" | 38 | #include "nouveau_connector.h" |
39 | #include "nv50_display.h" | 39 | #include "nv50_display.h" |
40 | 40 | ||
41 | static int | ||
42 | nv50_crtc_wait_complete(struct drm_crtc *crtc) | ||
43 | { | ||
44 | struct drm_device *dev = crtc->dev; | ||
45 | struct drm_nouveau_private *dev_priv = dev->dev_private; | ||
46 | struct nouveau_timer_engine *ptimer = &dev_priv->engine.timer; | ||
47 | struct nv50_display *disp = nv50_display(dev); | ||
48 | struct nouveau_channel *evo = disp->master; | ||
49 | u64 start; | ||
50 | int ret; | ||
51 | |||
52 | ret = RING_SPACE(evo, 6); | ||
53 | if (ret) | ||
54 | return ret; | ||
55 | BEGIN_RING(evo, 0, 0x0084, 1); | ||
56 | OUT_RING (evo, 0x80000000); | ||
57 | BEGIN_RING(evo, 0, 0x0080, 1); | ||
58 | OUT_RING (evo, 0); | ||
59 | BEGIN_RING(evo, 0, 0x0084, 1); | ||
60 | OUT_RING (evo, 0x00000000); | ||
61 | |||
62 | nv_wo32(disp->ntfy, 0x000, 0x00000000); | ||
63 | FIRE_RING (evo); | ||
64 | |||
65 | start = ptimer->read(dev); | ||
66 | do { | ||
67 | if (nv_ro32(disp->ntfy, 0x000)) | ||
68 | return 0; | ||
69 | } while (ptimer->read(dev) - start < 2000000000ULL); | ||
70 | |||
71 | return -EBUSY; | ||
72 | } | ||
73 | |||
74 | static void | 41 | static void |
75 | nv50_crtc_lut_load(struct drm_crtc *crtc) | 42 | nv50_crtc_lut_load(struct drm_crtc *crtc) |
76 | { | 43 | { |
@@ -303,7 +270,7 @@ nv50_crtc_set_scale(struct nouveau_crtc *nv_crtc, int scaling_mode, bool update) | |||
303 | 270 | ||
304 | if (update) { | 271 | if (update) { |
305 | nv50_display_flip_stop(crtc); | 272 | nv50_display_flip_stop(crtc); |
306 | nv50_crtc_wait_complete(crtc); | 273 | nv50_display_sync(dev); |
307 | nv50_display_flip_next(crtc, crtc->fb, NULL); | 274 | nv50_display_flip_next(crtc, crtc->fb, NULL); |
308 | } | 275 | } |
309 | 276 | ||
@@ -515,7 +482,7 @@ nv50_crtc_commit(struct drm_crtc *crtc) | |||
515 | 482 | ||
516 | nv50_crtc_blank(nv_crtc, false); | 483 | nv50_crtc_blank(nv_crtc, false); |
517 | drm_vblank_post_modeset(dev, nv_crtc->index); | 484 | drm_vblank_post_modeset(dev, nv_crtc->index); |
518 | nv50_crtc_wait_complete(crtc); | 485 | nv50_display_sync(dev); |
519 | nv50_display_flip_next(crtc, crtc->fb, NULL); | 486 | nv50_display_flip_next(crtc, crtc->fb, NULL); |
520 | } | 487 | } |
521 | 488 | ||
@@ -710,7 +677,7 @@ nv50_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, | |||
710 | if (ret) | 677 | if (ret) |
711 | return ret; | 678 | return ret; |
712 | 679 | ||
713 | ret = nv50_crtc_wait_complete(crtc); | 680 | ret = nv50_display_sync(crtc->dev); |
714 | if (ret) | 681 | if (ret) |
715 | return ret; | 682 | return ret; |
716 | 683 | ||
@@ -729,7 +696,7 @@ nv50_crtc_mode_set_base_atomic(struct drm_crtc *crtc, | |||
729 | if (ret) | 696 | if (ret) |
730 | return ret; | 697 | return ret; |
731 | 698 | ||
732 | return nv50_crtc_wait_complete(crtc); | 699 | return nv50_display_sync(crtc->dev); |
733 | } | 700 | } |
734 | 701 | ||
735 | static const struct drm_crtc_helper_funcs nv50_crtc_helper_funcs = { | 702 | static const struct drm_crtc_helper_funcs nv50_crtc_helper_funcs = { |