aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_display.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-10-21 12:19:29 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-12-03 00:11:11 -0500
commit042206c0cd4924879c4292c5ffa2bf1e8023ae5a (patch)
treec775b823b4e3d598e4fc41023a96e2e4b3126c20 /drivers/gpu/drm/nouveau/nouveau_display.c
parent63f7fcfebd2ff1995b649101d6120b60fa0e5b06 (diff)
drm/nouveau: Implement the vblank DRM hooks.
Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_display.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 2e11fd65b4dd..f8987bcb7f51 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -29,6 +29,7 @@
29#include "nouveau_drv.h" 29#include "nouveau_drv.h"
30#include "nouveau_fb.h" 30#include "nouveau_fb.h"
31#include "nouveau_fbcon.h" 31#include "nouveau_fbcon.h"
32#include "nouveau_hw.h"
32 33
33static void 34static void
34nouveau_user_framebuffer_destroy(struct drm_framebuffer *drm_fb) 35nouveau_user_framebuffer_destroy(struct drm_framebuffer *drm_fb)
@@ -104,3 +105,29 @@ const struct drm_mode_config_funcs nouveau_mode_config_funcs = {
104 .output_poll_changed = nouveau_fbcon_output_poll_changed, 105 .output_poll_changed = nouveau_fbcon_output_poll_changed,
105}; 106};
106 107
108int
109nouveau_vblank_enable(struct drm_device *dev, int crtc)
110{
111 struct drm_nouveau_private *dev_priv = dev->dev_private;
112
113 if (dev_priv->card_type >= NV_50)
114 nv_mask(dev, NV50_PDISPLAY_INTR_EN_1, 0,
115 NV50_PDISPLAY_INTR_EN_1_VBLANK_CRTC_(crtc));
116 else
117 NVWriteCRTC(dev, crtc, NV_PCRTC_INTR_EN_0,
118 NV_PCRTC_INTR_0_VBLANK);
119
120 return 0;
121}
122
123void
124nouveau_vblank_disable(struct drm_device *dev, int crtc)
125{
126 struct drm_nouveau_private *dev_priv = dev->dev_private;
127
128 if (dev_priv->card_type >= NV_50)
129 nv_mask(dev, NV50_PDISPLAY_INTR_EN_1,
130 NV50_PDISPLAY_INTR_EN_1_VBLANK_CRTC_(crtc), 0);
131 else
132 NVWriteCRTC(dev, crtc, NV_PCRTC_INTR_EN_0, 0);
133}