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

2016-06-06 Thread Gustavo Padovan
From: Gustavo Padovan 

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

Signed-off-by: Gustavo Padovan 
---
 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



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

2016-06-06 Thread Alex Deucher
On Mon, Jun 6, 2016 at 10:41 AM, Gustavo Padovan  wrote:
> From: Gustavo Padovan 
>
> Replace the legacy drm_vblank_{get,put}() with the new helper functions.
>
> Signed-off-by: Gustavo Padovan 

This and the radeon patch are:

Reviewed-by: Alex Deucher 

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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


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

2016-06-06 Thread Gustavo Padovan
2016-06-06 Alex Deucher :

> On Mon, Jun 6, 2016 at 10:41 AM, Gustavo Padovan  
> wrote:
> > From: Gustavo Padovan 
> >
> > Replace the legacy drm_vblank_{get,put}() with the new helper functions.
> >
> > Signed-off-by: Gustavo Padovan 
> 
> This and the radeon patch are:
> 
> Reviewed-by: Alex Deucher 
> 
> 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


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

2016-06-06 Thread Daniel Vetter
On Mon, Jun 06, 2016 at 12:35:26PM -0300, Gustavo Padovan wrote:
> 2016-06-06 Alex Deucher :
> 
> > On Mon, Jun 6, 2016 at 10:41 AM, Gustavo Padovan  
> > wrote:
> > > From: Gustavo Padovan 
> > >
> > > Replace the legacy drm_vblank_{get,put}() with the new helper functions.
> > >
> > > Signed-off-by: Gustavo Padovan 
> > 
> > This and the radeon patch are:
> > 
> > Reviewed-by: Alex Deucher 
> > 
> > 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

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


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

2016-06-07 Thread Michel Dänzer
On 06.06.2016 23:41, Gustavo Padovan wrote:
> From: Gustavo Padovan 
> 
> Replace the legacy drm_vblank_{get,put}() with the new helper functions.
> 
> Signed-off-by: Gustavo Padovan 

[...]

> @@ -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