diff mbox

[1/2] lib/igt_kms: Let set_property return the result

Message ID 1428395344-12303-1-git-send-email-sonika.jindal@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

sonika.jindal@intel.com April 7, 2015, 8:29 a.m. UTC
Return the return value of the set_property ioctl and add check for
the failure.

Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
---
 lib/igt_kms.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Tvrtko Ursulin April 21, 2015, 10:40 a.m. UTC | #1
On 04/07/2015 09:29 AM, Sonika Jindal wrote:
> Return the return value of the set_property ioctl and add check for
> the failure.
>
> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
> ---
>   lib/igt_kms.c |    7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 6cb1f08..14abae8 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -927,13 +927,13 @@ get_plane_property(int drm_fd, uint32_t plane_id, const char *name,
>   				    name, prop_id, value, prop);
>   }
>
> -static void
> +static int
>   igt_plane_set_property(igt_plane_t *plane, uint32_t prop_id, uint64_t value)
>   {
>   	igt_pipe_t *pipe = plane->pipe;
>   	igt_display_t *display = pipe->display;
>
> -	drmModeObjectSetProperty(display->drm_fd, plane->drm_plane->plane_id,
> +	return drmModeObjectSetProperty(display->drm_fd, plane->drm_plane->plane_id,
>   				 DRM_MODE_OBJECT_PLANE, prop_id, value);
>   }
>
> @@ -1338,10 +1338,11 @@ static int igt_drm_plane_commit(igt_plane_t *plane,
>   	plane->position_changed = false;
>
>   	if (plane->rotation_changed) {
> -		igt_plane_set_property(plane, plane->rotation_property,
> +		ret = igt_plane_set_property(plane, plane->rotation_property,
>   				       plane->rotation);
>
>   		plane->rotation_changed = false;
> +		CHECK_RETURN(ret, fail_on_error);
>   	}
>
>   	return 0;
>

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
diff mbox

Patch

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 6cb1f08..14abae8 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -927,13 +927,13 @@  get_plane_property(int drm_fd, uint32_t plane_id, const char *name,
 				    name, prop_id, value, prop);
 }
 
-static void
+static int
 igt_plane_set_property(igt_plane_t *plane, uint32_t prop_id, uint64_t value)
 {
 	igt_pipe_t *pipe = plane->pipe;
 	igt_display_t *display = pipe->display;
 
-	drmModeObjectSetProperty(display->drm_fd, plane->drm_plane->plane_id,
+	return drmModeObjectSetProperty(display->drm_fd, plane->drm_plane->plane_id,
 				 DRM_MODE_OBJECT_PLANE, prop_id, value);
 }
 
@@ -1338,10 +1338,11 @@  static int igt_drm_plane_commit(igt_plane_t *plane,
 	plane->position_changed = false;
 
 	if (plane->rotation_changed) {
-		igt_plane_set_property(plane, plane->rotation_property,
+		ret = igt_plane_set_property(plane, plane->rotation_property,
 				       plane->rotation);
 
 		plane->rotation_changed = false;
+		CHECK_RETURN(ret, fail_on_error);
 	}
 
 	return 0;