Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362142
b: refs/heads/master
c: e4604d8
h: refs/heads/master
v: v3
  • Loading branch information
Maarten Lankhorst authored and Ben Skeggs committed Mar 29, 2013
1 parent d8ac954 commit f5c6d81
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b43decd2c513ae44a5462a1a4c2622f0fa77c9e0
refs/heads/master: e4604d8fe8492f8120cf92d4b60b3cc90ba87bd0
32 changes: 20 additions & 12 deletions trunk/drivers/gpu/drm/nouveau/nouveau_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,26 @@ module_param_named(modeset, nouveau_modeset, int, 0400);

static struct drm_driver driver;

static int
nouveau_drm_vblank_handler(struct nouveau_eventh *event, int head)
{
struct nouveau_drm *drm =
container_of(event, struct nouveau_drm, vblank[head]);
drm_handle_vblank(drm->dev, head);
return NVKM_EVENT_KEEP;
}

static int
nouveau_drm_vblank_enable(struct drm_device *dev, int head)
{
struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_disp *pdisp = nouveau_disp(drm->device);
nouveau_event_get(pdisp->vblank, head, &drm->vblank);

if (WARN_ON_ONCE(head > ARRAY_SIZE(drm->vblank)))
return -EIO;
WARN_ON_ONCE(drm->vblank[head].func);
drm->vblank[head].func = nouveau_drm_vblank_handler;
nouveau_event_get(pdisp->vblank, head, &drm->vblank[head]);
return 0;
}

Expand All @@ -85,16 +99,11 @@ nouveau_drm_vblank_disable(struct drm_device *dev, int head)
{
struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_disp *pdisp = nouveau_disp(drm->device);
nouveau_event_put(pdisp->vblank, head, &drm->vblank);
}

static int
nouveau_drm_vblank_handler(struct nouveau_eventh *event, int head)
{
struct nouveau_drm *drm =
container_of(event, struct nouveau_drm, vblank);
drm_handle_vblank(drm->dev, head);
return NVKM_EVENT_KEEP;
if (drm->vblank[head].func)
nouveau_event_put(pdisp->vblank, head, &drm->vblank[head]);
else
WARN_ON_ONCE(1);
drm->vblank[head].func = NULL;
}

static u64
Expand Down Expand Up @@ -292,7 +301,6 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)

dev->dev_private = drm;
drm->dev = dev;
drm->vblank.func = nouveau_drm_vblank_handler;

INIT_LIST_HEAD(&drm->clients);
spin_lock_init(&drm->tile.lock);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/nouveau/nouveau_drm.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ struct nouveau_drm {
struct nvbios vbios;
struct nouveau_display *display;
struct backlight_device *backlight;
struct nouveau_eventh vblank;
struct nouveau_eventh vblank[4];

/* power management */
struct nouveau_pm *pm;
Expand Down

0 comments on commit f5c6d81

Please sign in to comment.