diff mbox

drm: Fix error path in drm_mode_page_flip_ioctl()

Message ID 1473269025-16148-1-git-send-email-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Imre Deak Sept. 7, 2016, 5:23 p.m. UTC
This fixes the error path for platforms that don't define the new
page_flip_target() hook.

Fixes: c229bfbbd04 ("drm: Add page_flip_target CRTC hook v2")
Testcase: igt/kms_flip/basic-flip-vs-dpms
CC: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/drm_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michel Dänzer Sept. 8, 2016, 3:39 a.m. UTC | #1
On 08/09/16 02:23 AM, Imre Deak wrote:
> This fixes the error path for platforms that don't define the new
> page_flip_target() hook.
> 
> Fixes: c229bfbbd04 ("drm: Add page_flip_target CRTC hook v2")
> Testcase: igt/kms_flip/basic-flip-vs-dpms
> CC: Michel Dänzer <michel.daenzer@amd.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/drm_crtc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 0f797ee..d84a0ea 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -2047,7 +2047,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
>  	}
>  
>  out:
> -	if (ret)
> +	if (ret && crtc->funcs->page_flip_target)
>  		drm_crtc_vblank_put(crtc);
>  	if (fb)
>  		drm_framebuffer_unreference(fb);
> 

Nice catch, thanks!

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Jani Nikula Sept. 8, 2016, 9:15 a.m. UTC | #2
On Thu, 08 Sep 2016, Michel Dänzer <michel@daenzer.net> wrote:
> On 08/09/16 02:23 AM, Imre Deak wrote:
>> This fixes the error path for platforms that don't define the new
>> page_flip_target() hook.
>> 
>> Fixes: c229bfbbd04 ("drm: Add page_flip_target CRTC hook v2")
>> Testcase: igt/kms_flip/basic-flip-vs-dpms
>> CC: Michel Dänzer <michel.daenzer@amd.com>
>> Signed-off-by: Imre Deak <imre.deak@intel.com>
>> ---
>>  drivers/gpu/drm/drm_crtc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
>> index 0f797ee..d84a0ea 100644
>> --- a/drivers/gpu/drm/drm_crtc.c
>> +++ b/drivers/gpu/drm/drm_crtc.c
>> @@ -2047,7 +2047,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
>>  	}
>>  
>>  out:
>> -	if (ret)
>> +	if (ret && crtc->funcs->page_flip_target)
>>  		drm_crtc_vblank_put(crtc);
>>  	if (fb)
>>  		drm_framebuffer_unreference(fb);
>> 
>
> Nice catch, thanks!
>
> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>

Picked up to drm-misc, thanks for the patch and review.

BR,
Jani.
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 0f797ee..d84a0ea 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2047,7 +2047,7 @@  int drm_mode_page_flip_ioctl(struct drm_device *dev,
 	}
 
 out:
-	if (ret)
+	if (ret && crtc->funcs->page_flip_target)
 		drm_crtc_vblank_put(crtc);
 	if (fb)
 		drm_framebuffer_unreference(fb);