Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1415165 > unrolled thread

[PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2

Started byGustavo Padovan <gustavo@padovan.org>
First post2016-06-06 16:50 +0200
Last post2016-06-06 18:10 +0200
Articles 16 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2 Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
    [PATCH 10/14] drm/atmel: use drm_crtc_vblank_{get,put}() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
      Re: [PATCH 10/14] drm/atmel: use drm_crtc_vblank_{get,put}() Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-06-07 13:10 +0200
    [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
      Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}() Alex Deucher <alexdeucher@gmail.com> - 2016-06-06 17:30 +0200
        Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 17:40 +0200
          Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}() Daniel Vetter <daniel@ffwll.ch> - 2016-06-06 18:10 +0200
      Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}() Michel Dänzer <michel@daenzer.net> - 2016-06-07 06:00 +0200
    [PATCH RESEND 04/14] drm/qxl: use drm_crtc_send_vblank_event() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
    [PATCH RESEND 03/14] drm/atmel: use drm_crtc_send_vblank_event() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
      Re: [PATCH RESEND 03/14] drm/atmel: use  drm_crtc_send_vblank_event() Boris Brezillon <boris.brezillon@free-electrons.com> - 2016-06-07 13:10 +0200
    [PATCH 09/14] drm/armada: use drm_crtc_vblank_{get,put}() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
    [PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
      Re: [PATCH RESEND 06/14] drm/virtio: use  drm_crtc_send_vblank_event() Gerd Hoffmann <kraxel@redhat.com> - 2016-06-07 10:40 +0200
    [PATCH 07/14] drm: remove legacy drm_send_vblank_event() Gustavo Padovan <gustavo@padovan.org> - 2016-06-06 16:50 +0200
    Re: [PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2 Daniel Vetter <daniel@ffwll.ch> - 2016-06-06 18:10 +0200

#1415165 — [PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH 01/14] drm/nouveau: use drm_crtc_send_vblank_event() v2
Message-ID<rH40N-6ct-7@gated-at.bofh.it>
From: Gustavo Padovan <gustavo.padovan@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@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@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

[toc] | [next] | [standalone]


#1415167 — [PATCH 10/14] drm/atmel: use drm_crtc_vblank_{get,put}()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH 10/14] drm/atmel: use drm_crtc_vblank_{get,put}()
Message-ID<rH40O-6ct-37@gated-at.bofh.it>
In reply to#1415165
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Replace the legacy drm_vblank_{get,put}() with the new helper functions.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
index 6fca9c4..461b39c 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
@@ -375,7 +375,7 @@ static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc)
 	spin_lock_irqsave(&dev->event_lock, flags);
 	if (crtc->event) {
 		drm_crtc_send_vblank_event(&crtc->base, crtc->event);
-		drm_vblank_put(dev, crtc->id);
+		drm_crtc_vblank_put(&crtc->base);
 		crtc->event = NULL;
 	}
 	spin_unlock_irqrestore(&dev->event_lock, flags);
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1416016 — Re: [PATCH 10/14] drm/atmel: use drm_crtc_vblank_{get,put}()

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-06-07 13:10 +0200
SubjectRe: [PATCH 10/14] drm/atmel: use drm_crtc_vblank_{get,put}()
Message-ID<rHn3t-1Vt-69@gated-at.bofh.it>
In reply to#1415167
On Mon,  6 Jun 2016 11:41:41 -0300
Gustavo Padovan <gustavo@padovan.org> wrote:

> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Replace the legacy drm_vblank_{get,put}() with the new helper functions.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index 6fca9c4..461b39c 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -375,7 +375,7 @@ static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc)
>  	spin_lock_irqsave(&dev->event_lock, flags);
>  	if (crtc->event) {
>  		drm_crtc_send_vblank_event(&crtc->base, crtc->event);
> -		drm_vblank_put(dev, crtc->id);
> +		drm_crtc_vblank_put(&crtc->base);
>  		crtc->event = NULL;
>  	}
>  	spin_unlock_irqrestore(&dev->event_lock, flags);



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1415168 — [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()
Message-ID<rH40O-6ct-39@gated-at.bofh.it>
In reply to#1415165
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Replace the legacy drm_vblank_{get,put}() with the new helper functions.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++--
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c      | 2 +-
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c      | 2 +-
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c       | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index b0832da..0b5f3ac 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -240,7 +240,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
 
 	work->base = base;
 
-	r = drm_vblank_get(crtc->dev, amdgpu_crtc->crtc_id);
+	r = drm_crtc_vblank_get(crtc);
 	if (r) {
 		DRM_ERROR("failed to get vblank before flip\n");
 		goto pflip_cleanup;
@@ -268,7 +268,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
 	return 0;
 
 vblank_cleanup:
-	drm_vblank_put(crtc->dev, amdgpu_crtc->crtc_id);
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
 
 pflip_cleanup:
 	if (unlikely(amdgpu_bo_reserve(new_rbo, false) != 0)) {
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index 8227344..7e57447 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -3372,7 +3372,7 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev,
 
 	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
 
-	drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
 	schedule_work(&works->unpin_work);
 
 	return 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index c11b600..6c51d9c 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -3433,7 +3433,7 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev,
 
 	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
 
-	drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
 	schedule_work(&works->unpin_work);
 
 	return 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 3fb65e4..41d9bc5 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -3376,7 +3376,7 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev,
 
 	spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
 
-	drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
+	drm_crtc_vblank_put(&amdgpu_crtc->base);
 	schedule_work(&works->unpin_work);
 
 	return 0;
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1415222 — Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()

FromAlex Deucher <alexdeucher@gmail.com>
Date2016-06-06 17:30 +0200
SubjectRe: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()
Message-ID<rH4Dw-6Hq-19@gated-at.bofh.it>
In reply to#1415168
On Mon, Jun 6, 2016 at 10:41 AM, Gustavo Padovan <gustavo@padovan.org> wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>
> Replace the legacy drm_vblank_{get,put}() with the new helper functions.
>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

This and the radeon patch are:

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

Should I pick this up, or are you planning to upstream this as a big batch?

Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c      | 2 +-
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c      | 2 +-
>  drivers/gpu/drm/amd/amdgpu/dce_v8_0.c       | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> index b0832da..0b5f3ac 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
> @@ -240,7 +240,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
>
>         work->base = base;
>
> -       r = drm_vblank_get(crtc->dev, amdgpu_crtc->crtc_id);
> +       r = drm_crtc_vblank_get(crtc);
>         if (r) {
>                 DRM_ERROR("failed to get vblank before flip\n");
>                 goto pflip_cleanup;
> @@ -268,7 +268,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
>         return 0;
>
>  vblank_cleanup:
> -       drm_vblank_put(crtc->dev, amdgpu_crtc->crtc_id);
> +       drm_crtc_vblank_put(&amdgpu_crtc->base);
>
>  pflip_cleanup:
>         if (unlikely(amdgpu_bo_reserve(new_rbo, false) != 0)) {
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> index 8227344..7e57447 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> @@ -3372,7 +3372,7 @@ static int dce_v10_0_pageflip_irq(struct amdgpu_device *adev,
>
>         spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
>
> -       drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
> +       drm_crtc_vblank_put(&amdgpu_crtc->base);
>         schedule_work(&works->unpin_work);
>
>         return 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> index c11b600..6c51d9c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> @@ -3433,7 +3433,7 @@ static int dce_v11_0_pageflip_irq(struct amdgpu_device *adev,
>
>         spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
>
> -       drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
> +       drm_crtc_vblank_put(&amdgpu_crtc->base);
>         schedule_work(&works->unpin_work);
>
>         return 0;
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> index 3fb65e4..41d9bc5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> @@ -3376,7 +3376,7 @@ static int dce_v8_0_pageflip_irq(struct amdgpu_device *adev,
>
>         spin_unlock_irqrestore(&adev->ddev->event_lock, flags);
>
> -       drm_vblank_put(adev->ddev, amdgpu_crtc->crtc_id);
> +       drm_crtc_vblank_put(&amdgpu_crtc->base);
>         schedule_work(&works->unpin_work);
>
>         return 0;
> --
> 2.5.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

[toc] | [prev] | [next] | [standalone]


#1415226 — Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 17:40 +0200
SubjectRe: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()
Message-ID<rH4Nc-6KM-17@gated-at.bofh.it>
In reply to#1415222
2016-06-06 Alex Deucher <alexdeucher@gmail.com>:

> On Mon, Jun 6, 2016 at 10:41 AM, Gustavo Padovan <gustavo@padovan.org> wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> >
> > Replace the legacy drm_vblank_{get,put}() with the new helper functions.
> >
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> This and the radeon patch are:
> 
> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> 
> Should I pick this up, or are you planning to upstream this as a big batch?

I would like to upstream as a big batch via drm-misc. If I get acks on
everything it would be possible to remove drm_vblank_get,put for 4.8.

	Gustavo

[toc] | [prev] | [next] | [standalone]


#1415259 — Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-06-06 18:10 +0200
SubjectRe: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()
Message-ID<rH5ge-7ea-33@gated-at.bofh.it>
In reply to#1415226
On Mon, Jun 06, 2016 at 12:35:26PM -0300, Gustavo Padovan wrote:
> 2016-06-06 Alex Deucher <alexdeucher@gmail.com>:
> 
> > On Mon, Jun 6, 2016 at 10:41 AM, Gustavo Padovan <gustavo@padovan.org> wrote:
> > > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > >
> > > Replace the legacy drm_vblank_{get,put}() with the new helper functions.
> > >
> > > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > This and the radeon patch are:
> > 
> > Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
> > 
> > Should I pick this up, or are you planning to upstream this as a big batch?
> 
> I would like to upstream as a big batch via drm-misc. If I get acks on
> everything it would be possible to remove drm_vblank_get,put for 4.8.

Ok, I vacuumed them all up except for the 2 nouveau patches and the core
patch to remove drm_send_vblank_event. Btw drm_arm_vblank_event probably
deserves the same treatment (and would get rid of drm_crtc_index from
nouveau).
-Daniel

> 
> 	Gustavo
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [next] | [standalone]


#1415674 — Re: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()

FromMichel Dänzer <michel@daenzer.net>
Date2016-06-07 06:00 +0200
SubjectRe: [PATCH 08/14] drm/amdgpu: use drm_crtc_vblank_{get,put}()
Message-ID<rHglj-5QV-1@gated-at.bofh.it>
In reply to#1415168
On 06.06.2016 23:41, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Replace the legacy drm_vblank_{get,put}() with the new helper functions.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

[...]

> @@ -268,7 +268,7 @@ int amdgpu_crtc_page_flip(struct drm_crtc *crtc,
>  	return 0;
>  
>  vblank_cleanup:
> -	drm_vblank_put(crtc->dev, amdgpu_crtc->crtc_id);
> +	drm_crtc_vblank_put(&amdgpu_crtc->base);

Can just use crtc here instead of &amdgpu_crtc->base. Same for the
radeon patch.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

[toc] | [prev] | [next] | [standalone]


#1415169 — [PATCH RESEND 04/14] drm/qxl: use drm_crtc_send_vblank_event()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH RESEND 04/14] drm/qxl: use drm_crtc_send_vblank_event()
Message-ID<rH40P-6ct-43@gated-at.bofh.it>
In reply to#1415165
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Replace the legacy drm_send_vblank_event() with the new helper function.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/qxl/qxl_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 8b5d543..4c8cac98 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -256,7 +256,7 @@ static int qxl_crtc_page_flip(struct drm_crtc *crtc,
 
 	if (event) {
 		spin_lock_irqsave(&dev->event_lock, flags);
-		drm_send_vblank_event(dev, qcrtc->index, event);
+		drm_crtc_send_vblank_event(crtc, event);
 		spin_unlock_irqrestore(&dev->event_lock, flags);
 	}
 	drm_vblank_put(dev, qcrtc->index);
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1415171 — [PATCH RESEND 03/14] drm/atmel: use drm_crtc_send_vblank_event()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH RESEND 03/14] drm/atmel: use drm_crtc_send_vblank_event()
Message-ID<rH40P-6ct-45@gated-at.bofh.it>
In reply to#1415165
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Replace the legacy drm_send_vblank_event() with the new helper function.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
index cf23a75..6fca9c4 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
@@ -374,7 +374,7 @@ static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc)
 
 	spin_lock_irqsave(&dev->event_lock, flags);
 	if (crtc->event) {
-		drm_send_vblank_event(dev, crtc->id, crtc->event);
+		drm_crtc_send_vblank_event(&crtc->base, crtc->event);
 		drm_vblank_put(dev, crtc->id);
 		crtc->event = NULL;
 	}
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1415995 — Re: [PATCH RESEND 03/14] drm/atmel: use drm_crtc_send_vblank_event()

FromBoris Brezillon <boris.brezillon@free-electrons.com>
Date2016-06-07 13:10 +0200
SubjectRe: [PATCH RESEND 03/14] drm/atmel: use drm_crtc_send_vblank_event()
Message-ID<rHn3s-1Vt-35@gated-at.bofh.it>
In reply to#1415171
On Mon,  6 Jun 2016 11:41:34 -0300
Gustavo Padovan <gustavo@padovan.org> wrote:

> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Replace the legacy drm_send_vblank_event() with the new helper function.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> index cf23a75..6fca9c4 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c
> @@ -374,7 +374,7 @@ static void atmel_hlcdc_crtc_finish_page_flip(struct atmel_hlcdc_crtc *crtc)
>  
>  	spin_lock_irqsave(&dev->event_lock, flags);
>  	if (crtc->event) {
> -		drm_send_vblank_event(dev, crtc->id, crtc->event);
> +		drm_crtc_send_vblank_event(&crtc->base, crtc->event);
>  		drm_vblank_put(dev, crtc->id);
>  		crtc->event = NULL;
>  	}



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1415176 — [PATCH 09/14] drm/armada: use drm_crtc_vblank_{get,put}()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH 09/14] drm/armada: use drm_crtc_vblank_{get,put}()
Message-ID<rH40P-6ct-61@gated-at.bofh.it>
In reply to#1415165
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Replace the legacy drm_vblank_{get,put}() with the new helper functions.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/armada/armada_crtc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
index cdc4117..34405e4 100644
--- a/drivers/gpu/drm/armada/armada_crtc.c
+++ b/drivers/gpu/drm/armada/armada_crtc.c
@@ -199,7 +199,7 @@ static void armada_drm_plane_work_run(struct armada_crtc *dcrtc,
 	/* Handle any pending frame work. */
 	if (work) {
 		work->fn(dcrtc, plane, work);
-		drm_vblank_put(dcrtc->crtc.dev, dcrtc->num);
+		drm_crtc_vblank_put(&dcrtc->crtc);
 	}
 
 	wake_up(&plane->frame_wait);
@@ -210,7 +210,7 @@ int armada_drm_plane_work_queue(struct armada_crtc *dcrtc,
 {
 	int ret;
 
-	ret = drm_vblank_get(dcrtc->crtc.dev, dcrtc->num);
+	ret = drm_crtc_vblank_get(&dcrtc->crtc);
 	if (ret) {
 		DRM_ERROR("failed to acquire vblank counter\n");
 		return ret;
@@ -218,7 +218,7 @@ int armada_drm_plane_work_queue(struct armada_crtc *dcrtc,
 
 	ret = cmpxchg(&plane->work, NULL, work) ? -EBUSY : 0;
 	if (ret)
-		drm_vblank_put(dcrtc->crtc.dev, dcrtc->num);
+		drm_crtc_vblank_put(&dcrtc->crtc);
 
 	return ret;
 }
@@ -234,7 +234,7 @@ struct armada_plane_work *armada_drm_plane_work_cancel(
 	struct armada_plane_work *work = xchg(&plane->work, NULL);
 
 	if (work)
-		drm_vblank_put(dcrtc->crtc.dev, dcrtc->num);
+		drm_crtc_vblank_put(&dcrtc->crtc);
 
 	return work;
 }
@@ -592,9 +592,9 @@ static int armada_drm_crtc_mode_set(struct drm_crtc *crtc,
 
 	if (interlaced ^ dcrtc->interlaced) {
 		if (adj->flags & DRM_MODE_FLAG_INTERLACE)
-			drm_vblank_get(dcrtc->crtc.dev, dcrtc->num);
+			drm_crtc_vblank_get(&dcrtc->crtc);
 		else
-			drm_vblank_put(dcrtc->crtc.dev, dcrtc->num);
+			drm_crtc_vblank_put(&dcrtc->crtc);
 		dcrtc->interlaced = interlaced;
 	}
 
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1415178 — [PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event()
Message-ID<rH40P-6ct-57@gated-at.bofh.it>
In reply to#1415165
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Replace the legacy drm_send_vblank_event() with the new helper function.

Signed-off-by: Gustavo Padovan <gustavo.padovan@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

[toc] | [prev] | [next] | [standalone]


#1415865 — Re: [PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event()

FromGerd Hoffmann <kraxel@redhat.com>
Date2016-06-07 10:40 +0200
SubjectRe: [PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event()
Message-ID<rHkIi-nf-37@gated-at.bofh.it>
In reply to#1415178
On Mo, 2016-06-06 at 11:41 -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Replace the legacy drm_send_vblank_event() with the new helper function.
> 
> Signed-off-by: Gustavo Padovan <gustavo.padovan@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

[toc] | [prev] | [next] | [standalone]


#1415180 — [PATCH 07/14] drm: remove legacy drm_send_vblank_event()

FromGustavo Padovan <gustavo@padovan.org>
Date2016-06-06 16:50 +0200
Subject[PATCH 07/14] drm: remove legacy drm_send_vblank_event()
Message-ID<rH40P-6ct-59@gated-at.bofh.it>
In reply to#1415165
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

We don't have any user of this function anymore, let's remove it.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/gpu/drm/drm_irq.c | 31 ++++++-------------------------
 include/drm/drmP.h        |  2 --
 2 files changed, 6 insertions(+), 27 deletions(-)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 0fac801..2a347f0 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -1095,21 +1095,19 @@ void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
 EXPORT_SYMBOL(drm_crtc_arm_vblank_event);
 
 /**
- * drm_send_vblank_event - helper to send vblank event after pageflip
- * @dev: DRM device
- * @pipe: CRTC index
+ * drm_crtc_send_vblank_event - helper to send vblank event after pageflip
+ * @crtc: the source CRTC of the vblank event
  * @e: the event to send
  *
  * Updates sequence # and timestamp on event, and sends it to userspace.
  * Caller must hold event lock.
- *
- * This is the legacy version of drm_crtc_send_vblank_event().
  */
-void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe,
-			   struct drm_pending_vblank_event *e)
+void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
+				struct drm_pending_vblank_event *e)
 {
+	struct drm_device *dev = crtc->dev;
+	unsigned int seq, pipe = drm_crtc_index(crtc);
 	struct timeval now;
-	unsigned int seq;
 
 	if (dev->num_crtcs > 0) {
 		seq = drm_vblank_count_and_time(dev, pipe, &now);
@@ -1121,23 +1119,6 @@ void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe,
 	e->pipe = pipe;
 	send_vblank_event(dev, e, seq, &now);
 }
-EXPORT_SYMBOL(drm_send_vblank_event);
-
-/**
- * drm_crtc_send_vblank_event - helper to send vblank event after pageflip
- * @crtc: the source CRTC of the vblank event
- * @e: the event to send
- *
- * Updates sequence # and timestamp on event, and sends it to userspace.
- * Caller must hold event lock.
- *
- * This is the native KMS version of drm_send_vblank_event().
- */
-void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
-				struct drm_pending_vblank_event *e)
-{
-	drm_send_vblank_event(crtc->dev, drm_crtc_index(crtc), e);
-}
 EXPORT_SYMBOL(drm_crtc_send_vblank_event);
 
 /**
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 84f1a8e..16f7461 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -972,8 +972,6 @@ extern u32 drm_vblank_count_and_time(struct drm_device *dev, unsigned int pipe,
 				     struct timeval *vblanktime);
 extern u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
 					  struct timeval *vblanktime);
-extern void drm_send_vblank_event(struct drm_device *dev, unsigned int pipe,
-				  struct drm_pending_vblank_event *e);
 extern void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
 				       struct drm_pending_vblank_event *e);
 extern void drm_arm_vblank_event(struct drm_device *dev, unsigned int pipe,
-- 
2.5.5

[toc] | [prev] | [next] | [standalone]


#1415251

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-06-06 18:10 +0200
Message-ID<rH5ge-7ea-21@gated-at.bofh.it>
In reply to#1415165
On Mon, Jun 06, 2016 at 11:41:32AM -0300, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@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@gmail.com>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web