Gustavo Padovan
2016-Jun-06 14:41 UTC
[Nouveau] [PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2
From: Gustavo Padovan <gustavo.padovan at collabora.co.uk> Replace the legacy drm_send_vblank_event() with the new helper function. v2: add crtc to nouveau_page_flip_state (comment from Mario Kleiner) Cc: Mario Kleiner <mario.kleiner.de at gmail.com> Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk> --- drivers/gpu/drm/nouveau/nouveau_display.c | 19 ++++++++++--------- drivers/gpu/drm/nouveau/nouveau_display.h | 3 ++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 7c77f96..9d72467 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -760,8 +760,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, /* Initialize a page flip struct */ *s = (struct nouveau_page_flip_state) - { { }, event, nouveau_crtc(crtc)->index, - fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y, + { { }, event, crtc, fb->bits_per_pixel, fb->pitches[0], new_bo->bo.offset }; /* Keep vblanks on during flip, for the target crtc of this flip */ @@ -842,17 +841,18 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); if (s->event) { if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { - drm_arm_vblank_event(dev, s->crtc, s->event); + drm_arm_vblank_event(dev, drm_crtc_index(s->crtc), + s->event); } else { - drm_send_vblank_event(dev, s->crtc, s->event); + drm_crtc_send_vblank_event(s->crtc, s->event); /* Give up ownership of vblank for page-flipped crtc */ - drm_vblank_put(dev, s->crtc); + drm_vblank_put(dev, drm_crtc_index(s->crtc)); } } else { /* Give up ownership of vblank for page-flipped crtc */ - drm_vblank_put(dev, s->crtc); + drm_vblank_put(dev, drm_crtc_index(state->crtc)); } list_del(&s->head); @@ -873,9 +873,10 @@ nouveau_flip_complete(struct nvif_notify *notify) if (!nouveau_finish_page_flip(chan, &state)) { if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { - nv_set_crtc_base(drm->dev, state.crtc, state.offset + - state.y * state.pitch + - state.x * state.bpp / 8); + nv_set_crtc_base(drm->dev, drm_crtc_index(state.crtc), + state.offset + state.crtc->y * + state.pitch + state.crtc->x * + state.bpp / 8); } } diff --git a/drivers/gpu/drm/nouveau/nouveau_display.h b/drivers/gpu/drm/nouveau/nouveau_display.h index 24273ba..0420ee8 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.h +++ b/drivers/gpu/drm/nouveau/nouveau_display.h @@ -28,7 +28,8 @@ int nouveau_framebuffer_init(struct drm_device *, struct nouveau_framebuffer *, struct nouveau_page_flip_state { struct list_head head; struct drm_pending_vblank_event *event; - int crtc, bpp, pitch, x, y; + struct drm_crtc *crtc; + int bpp, pitch; u64 offset; }; -- 2.5.5
Gustavo Padovan
2016-Jun-06 14:41 UTC
[PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event()
From: Gustavo Padovan <gustavo.padovan at collabora.co.uk> Replace the legacy drm_send_vblank_event() with the new helper function. Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk> --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index d4305da..ba5e11b 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -156,7 +156,7 @@ static int virtio_gpu_page_flip(struct drm_crtc *crtc, if (event) { spin_lock_irqsave(&crtc->dev->event_lock, irqflags); - drm_send_vblank_event(crtc->dev, -1, event); + drm_crtc_send_vblank_event(crtc, event); spin_unlock_irqrestore(&crtc->dev->event_lock, irqflags); } -- 2.5.5
Gustavo Padovan
2016-Jun-06 14:41 UTC
[Nouveau] [PATCH 11/14] drm/nouveau: use drm_crtc_vblank_{get, put}()
From: Gustavo Padovan <gustavo.padovan at collabora.co.uk> Replace the legacy drm_vblank_{get,put}() with the new helper functions. Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk> --- drivers/gpu/drm/nouveau/nouveau_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 9d72467..7898459f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -764,7 +764,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, new_bo->bo.offset }; /* Keep vblanks on during flip, for the target crtc of this flip */ - drm_vblank_get(dev, nouveau_crtc(crtc)->index); + drm_crtc_vblank_get(crtc); /* Emit a page flip */ if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { @@ -809,7 +809,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, return 0; fail_unreserve: - drm_vblank_put(dev, nouveau_crtc(crtc)->index); + drm_crtc_vblank_put(crtc); ttm_bo_unreserve(&old_bo->bo); fail_unpin: mutex_unlock(&cli->mutex); @@ -847,12 +847,12 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, drm_crtc_send_vblank_event(s->crtc, s->event); /* Give up ownership of vblank for page-flipped crtc */ - drm_vblank_put(dev, drm_crtc_index(s->crtc)); + drm_crtc_vblank_put(s->crtc); } } else { /* Give up ownership of vblank for page-flipped crtc */ - drm_vblank_put(dev, drm_crtc_index(state->crtc)); + drm_crtc_vblank_put(state->crtc); } list_del(&s->head); -- 2.5.5
Daniel Vetter
2016-Jun-06 16:02 UTC
[Nouveau] [PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2
On Mon, Jun 06, 2016 at 11:41:32AM -0300, Gustavo Padovan wrote:> From: Gustavo Padovan <gustavo.padovan at collabora.co.uk> > > Replace the legacy drm_send_vblank_event() with the new helper function. > > v2: add crtc to nouveau_page_flip_state (comment from Mario Kleiner) > > Cc: Mario Kleiner <mario.kleiner.de at gmail.com> > Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk>Forgot to squash this into the main nouveau patch as fixup? -Daniel> --- > drivers/gpu/drm/nouveau/nouveau_display.c | 19 ++++++++++--------- > drivers/gpu/drm/nouveau/nouveau_display.h | 3 ++- > 2 files changed, 12 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c > index 7c77f96..9d72467 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_display.c > +++ b/drivers/gpu/drm/nouveau/nouveau_display.c > @@ -760,8 +760,7 @@ nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, > > /* Initialize a page flip struct */ > *s = (struct nouveau_page_flip_state) > - { { }, event, nouveau_crtc(crtc)->index, > - fb->bits_per_pixel, fb->pitches[0], crtc->x, crtc->y, > + { { }, event, crtc, fb->bits_per_pixel, fb->pitches[0], > new_bo->bo.offset }; > > /* Keep vblanks on during flip, for the target crtc of this flip */ > @@ -842,17 +841,18 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, > s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); > if (s->event) { > if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { > - drm_arm_vblank_event(dev, s->crtc, s->event); > + drm_arm_vblank_event(dev, drm_crtc_index(s->crtc), > + s->event); > } else { > - drm_send_vblank_event(dev, s->crtc, s->event); > + drm_crtc_send_vblank_event(s->crtc, s->event); > > /* Give up ownership of vblank for page-flipped crtc */ > - drm_vblank_put(dev, s->crtc); > + drm_vblank_put(dev, drm_crtc_index(s->crtc)); > } > } > else { > /* Give up ownership of vblank for page-flipped crtc */ > - drm_vblank_put(dev, s->crtc); > + drm_vblank_put(dev, drm_crtc_index(state->crtc)); > } > > list_del(&s->head); > @@ -873,9 +873,10 @@ nouveau_flip_complete(struct nvif_notify *notify) > > if (!nouveau_finish_page_flip(chan, &state)) { > if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { > - nv_set_crtc_base(drm->dev, state.crtc, state.offset + > - state.y * state.pitch + > - state.x * state.bpp / 8); > + nv_set_crtc_base(drm->dev, drm_crtc_index(state.crtc), > + state.offset + state.crtc->y * > + state.pitch + state.crtc->x * > + state.bpp / 8); > } > } > > diff --git a/drivers/gpu/drm/nouveau/nouveau_display.h b/drivers/gpu/drm/nouveau/nouveau_display.h > index 24273ba..0420ee8 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_display.h > +++ b/drivers/gpu/drm/nouveau/nouveau_display.h > @@ -28,7 +28,8 @@ int nouveau_framebuffer_init(struct drm_device *, struct nouveau_framebuffer *, > struct nouveau_page_flip_state { > struct list_head head; > struct drm_pending_vblank_event *event; > - int crtc, bpp, pitch, x, y; > + struct drm_crtc *crtc; > + int bpp, pitch; > u64 offset; > }; > > -- > 2.5.5 > > _______________________________________________ > dri-devel mailing list > dri-devel at lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel-- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Gerd Hoffmann
2016-Jun-07 08:39 UTC
[PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event()
On Mo, 2016-06-06 at 11:41 -0300, Gustavo Padovan wrote:> From: Gustavo Padovan <gustavo.padovan at collabora.co.uk> > > Replace the legacy drm_send_vblank_event() with the new helper function. > > Signed-off-by: Gustavo Padovan <gustavo.padovan at collabora.co.uk> > --- > drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c > index d4305da..ba5e11b 100644 > --- a/drivers/gpu/drm/virtio/virtgpu_display.c > +++ b/drivers/gpu/drm/virtio/virtgpu_display.c > @@ -156,7 +156,7 @@ static int virtio_gpu_page_flip(struct drm_crtc *crtc, > > if (event) { > spin_lock_irqsave(&crtc->dev->event_lock, irqflags); > - drm_send_vblank_event(crtc->dev, -1, event); > + drm_crtc_send_vblank_event(crtc, event); > spin_unlock_irqrestore(&crtc->dev->event_lock, irqflags); > }Daniel Vetter has a series in flight which drops the whole virtio_gpu_page_flip function in favor of drm_atomic_helper_page_flip. https://lists.freedesktop.org/archives/dri-devel/2016-May/108699.html cheers, Gerd
Seemingly Similar Threads
- [PATCH 13/14] drm/virtio: use drm_crtc_send_vblank_event()
- [PATCH 13/14] drm/virtio: use drm_crtc_send_vblank_event()
- [PATCH 1/2] drm/virtio: use new drm_crtc_send_vblank_event()
- [PATCH 1/2] drm/virtio: use new drm_crtc_send_vblank_event()
- [PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2