[3/3] drm/amdgpu: Switch to drm_vblank_on/off
diff mbox

Message ID 1453370938-5464-3-git-send-email-daniel.vetter@ffwll.ch
State New
Headers show

Commit Message

Daniel Vetter Jan. 21, 2016, 10:08 a.m. UTC
Equivalent change to the radeon driver.

Note that with radeon this caught a bug in the dri3 DDX
implementation, which asked for vblank interrupts when the pipe is
off. That bug needs to be fixed before we can merge this patch (if
amdgpu is affected too). Michel discovered this one.

Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 4 ++--
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Michel Dänzer Jan. 22, 2016, 3:23 a.m. UTC | #1
On 21.01.2016 19:08, Daniel Vetter wrote:
> Equivalent change to the radeon driver.
> 
> Note that with radeon this caught a bug in the dri3 DDX
> implementation, which asked for vblank interrupts when the pipe is
> off. That bug needs to be fixed before we can merge this patch (if
> amdgpu is affected too). Michel discovered this one.

This is fixed in xf86-video-amdgpu as well.


> Cc: Michel Dänzer <michel.daenzer@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 4 ++--
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> index 093599aba64b..d3926d193018 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> @@ -2701,13 +2701,13 @@ static void dce_v10_0_crtc_dpms(struct drm_crtc *crtc, int mode)
>  		type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
>  		amdgpu_irq_update(adev, &adev->crtc_irq, type);
>  		amdgpu_irq_update(adev, &adev->pageflip_irq, type);
> -		drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
> +		drm_vblank_on(dev, amdgpu_crtc->crtc_id);
>  		dce_v10_0_crtc_load_lut(crtc);
>  		break;
>  	case DRM_MODE_DPMS_STANDBY:
>  	case DRM_MODE_DPMS_SUSPEND:
>  	case DRM_MODE_DPMS_OFF:
> -		drm_vblank_pre_modeset(dev, amdgpu_crtc->crtc_id);
> +		drm_vblank_off(dev, amdgpu_crtc->crtc_id);
>  		if (amdgpu_crtc->enabled) {
>  			dce_v10_0_vga_enable(crtc, true);
>  			amdgpu_atombios_crtc_blank(crtc, ATOM_ENABLE);
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> index 8e67249d4367..789c7f9f623a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> @@ -2692,13 +2692,13 @@ static void dce_v11_0_crtc_dpms(struct drm_crtc *crtc, int mode)
>  		type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
>  		amdgpu_irq_update(adev, &adev->crtc_irq, type);
>  		amdgpu_irq_update(adev, &adev->pageflip_irq, type);
> -		drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
> +		drm_vblank_on(dev, amdgpu_crtc->crtc_id);
>  		dce_v11_0_crtc_load_lut(crtc);
>  		break;
>  	case DRM_MODE_DPMS_STANDBY:
>  	case DRM_MODE_DPMS_SUSPEND:
>  	case DRM_MODE_DPMS_OFF:
> -		drm_vblank_pre_modeset(dev, amdgpu_crtc->crtc_id);
> +		drm_vblank_off(dev, amdgpu_crtc->crtc_id);
>  		if (amdgpu_crtc->enabled) {
>  			dce_v11_0_vga_enable(crtc, true);
>  			amdgpu_atombios_crtc_blank(crtc, ATOM_ENABLE);
> 

You missed dce_v8_0.c. With that fixed,

Acked-by: Michel Dänzer <michel.daenzer@amd.com>

Patch
diff mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index 093599aba64b..d3926d193018 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -2701,13 +2701,13 @@  static void dce_v10_0_crtc_dpms(struct drm_crtc *crtc, int mode)
 		type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
 		amdgpu_irq_update(adev, &adev->crtc_irq, type);
 		amdgpu_irq_update(adev, &adev->pageflip_irq, type);
-		drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
+		drm_vblank_on(dev, amdgpu_crtc->crtc_id);
 		dce_v10_0_crtc_load_lut(crtc);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		drm_vblank_pre_modeset(dev, amdgpu_crtc->crtc_id);
+		drm_vblank_off(dev, amdgpu_crtc->crtc_id);
 		if (amdgpu_crtc->enabled) {
 			dce_v10_0_vga_enable(crtc, true);
 			amdgpu_atombios_crtc_blank(crtc, ATOM_ENABLE);
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index 8e67249d4367..789c7f9f623a 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -2692,13 +2692,13 @@  static void dce_v11_0_crtc_dpms(struct drm_crtc *crtc, int mode)
 		type = amdgpu_crtc_idx_to_irq_type(adev, amdgpu_crtc->crtc_id);
 		amdgpu_irq_update(adev, &adev->crtc_irq, type);
 		amdgpu_irq_update(adev, &adev->pageflip_irq, type);
-		drm_vblank_post_modeset(dev, amdgpu_crtc->crtc_id);
+		drm_vblank_on(dev, amdgpu_crtc->crtc_id);
 		dce_v11_0_crtc_load_lut(crtc);
 		break;
 	case DRM_MODE_DPMS_STANDBY:
 	case DRM_MODE_DPMS_SUSPEND:
 	case DRM_MODE_DPMS_OFF:
-		drm_vblank_pre_modeset(dev, amdgpu_crtc->crtc_id);
+		drm_vblank_off(dev, amdgpu_crtc->crtc_id);
 		if (amdgpu_crtc->enabled) {
 			dce_v11_0_vga_enable(crtc, true);
 			amdgpu_atombios_crtc_blank(crtc, ATOM_ENABLE);