Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib: fix igt_reset_connectors
@ 2014-11-24 14:16 Thomas Wood
  2014-11-25  8:35 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Wood @ 2014-11-24 14:16 UTC (permalink / raw)
  To: intel-gfx

Use igt_debugfs_open to open the connector file, since the
forced_connectors array now only stores the connector path relative to
the debugfs path. Also add some extra error checking to ensure a test
failure if the reset fails.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85829
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
---
 lib/igt_kms.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5edd5ec..cba0c27 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1773,8 +1773,8 @@ void igt_reset_connectors(void)
 	 * functions that are not safe to call in signal handlers */
 
 	for (tmp = forced_connectors; *tmp; tmp++) {
-		int fd = open(*tmp, O_WRONLY | O_TRUNC);
-		write(fd, "unspecified", 11);
+		int fd = igt_debugfs_open(*tmp, O_WRONLY | O_TRUNC);
+		igt_assert(write(fd, "unspecified", 11) == 11);
 		close(fd);
 	}
 }
-- 
2.1.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH i-g-t] lib: fix igt_reset_connectors
  2014-11-24 14:16 [PATCH i-g-t] lib: fix igt_reset_connectors Thomas Wood
@ 2014-11-25  8:35 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2014-11-25  8:35 UTC (permalink / raw)
  To: Thomas Wood; +Cc: intel-gfx

On Mon, Nov 24, 2014 at 02:16:25PM +0000, Thomas Wood wrote:
> Use igt_debugfs_open to open the connector file, since the
> forced_connectors array now only stores the connector path relative to
> the debugfs path. Also add some extra error checking to ensure a test
> failure if the reset fails.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85829
> Signed-off-by: Thomas Wood <thomas.wood@intel.com>

Tested-by: lu hua <huax.lu@intel.com>

And I went right ahead and committed it, thanks.
-Daniel

> ---
>  lib/igt_kms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 5edd5ec..cba0c27 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1773,8 +1773,8 @@ void igt_reset_connectors(void)
>  	 * functions that are not safe to call in signal handlers */
>  
>  	for (tmp = forced_connectors; *tmp; tmp++) {
> -		int fd = open(*tmp, O_WRONLY | O_TRUNC);
> -		write(fd, "unspecified", 11);
> +		int fd = igt_debugfs_open(*tmp, O_WRONLY | O_TRUNC);
> +		igt_assert(write(fd, "unspecified", 11) == 11);
>  		close(fd);
>  	}
>  }
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-25  8:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-24 14:16 [PATCH i-g-t] lib: fix igt_reset_connectors Thomas Wood
2014-11-25  8:35 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox