[4/5] testdisplay: use first available option values

Submitted by Lucas De Marchi on May 29, 2019, 11:27 p.m.

Details

Message ID 20190529232737.31515-4-lucas.demarchi@intel.com
State Accepted
Commit 6cf57293a390beddd21985580efa28beec5fc798
Headers show
Series "Series without cover letter" ( rev: 1 ) in IGT (deprecated)

Not browsing as part of any series.

Commit Message

Lucas De Marchi May 29, 2019, 11:27 p.m.
Now that core options are set to 500 and above, start from the lowest
values without causing problems with conflicts. This also rename the
constants to follow the names from the core.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 tests/testdisplay.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/testdisplay.c b/tests/testdisplay.c
index b4f0d45f..32590547 100644
--- a/tests/testdisplay.c
+++ b/tests/testdisplay.c
@@ -69,8 +69,10 @@ 
 #include <stdlib.h>
 #include <signal.h>
 
-#define Yb_OPT		 5
-#define Yf_OPT		 6
+enum {
+	OPT_YB,
+	OPT_YF,
+};
 
 static int tio_fd;
 struct termios saved_tio;
@@ -573,8 +575,8 @@  static void set_termio_mode(void)
 
 static char optstr[] = "3iaf:s:d:p:mrto:j:y";
 static struct option long_opts[] = {
-	{"yb", 0, 0, Yb_OPT},
-	{"yf", 0, 0, Yf_OPT},
+	{"yb", 0, 0, OPT_YB},
+	{"yf", 0, 0, OPT_YF},
 	{ 0, 0, 0, 0 }
 };
 
@@ -648,10 +650,10 @@  static int opt_handler(int opt, int opt_index, void *data)
 		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
 		break;
 	case 'y':
-	case Yb_OPT:
+	case OPT_YB:
 		tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
 		break;
-	case Yf_OPT:
+	case OPT_YF:
 		tiling = LOCAL_I915_FORMAT_MOD_Yf_TILED;
 		break;
 	case 'r':

Comments

On 29/05/19 16:27, Lucas De Marchi wrote:
> Now that core options are set to 500 and above, start from the lowest
> values without causing problems with conflicts. This also rename the
> constants to follow the names from the core.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>

> ---
>   tests/testdisplay.c | 14 ++++++++------
>   1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/testdisplay.c b/tests/testdisplay.c
> index b4f0d45f..32590547 100644
> --- a/tests/testdisplay.c
> +++ b/tests/testdisplay.c
> @@ -69,8 +69,10 @@
>   #include <stdlib.h>
>   #include <signal.h>
>   
> -#define Yb_OPT		 5
> -#define Yf_OPT		 6
> +enum {
> +	OPT_YB,
> +	OPT_YF,
> +};
>   
>   static int tio_fd;
>   struct termios saved_tio;
> @@ -573,8 +575,8 @@ static void set_termio_mode(void)
>   
>   static char optstr[] = "3iaf:s:d:p:mrto:j:y";
>   static struct option long_opts[] = {
> -	{"yb", 0, 0, Yb_OPT},
> -	{"yf", 0, 0, Yf_OPT},
> +	{"yb", 0, 0, OPT_YB},
> +	{"yf", 0, 0, OPT_YF},
>   	{ 0, 0, 0, 0 }
>   };
>   
> @@ -648,10 +650,10 @@ static int opt_handler(int opt, int opt_index, void *data)
>   		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
>   		break;
>   	case 'y':
> -	case Yb_OPT:
> +	case OPT_YB:
>   		tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
>   		break;
> -	case Yf_OPT:
> +	case OPT_YF:
>   		tiling = LOCAL_I915_FORMAT_MOD_Yf_TILED;
>   		break;
>   	case 'r':
>
On Wed, May 29, 2019 at 04:27:36PM -0700, Lucas De Marchi wrote:
> Now that core options are set to 500 and above, start from the lowest
> values without causing problems with conflicts. This also rename the
> constants to follow the names from the core.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Petri Latvala <petri.latvala@intel.com>

> ---
>  tests/testdisplay.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/testdisplay.c b/tests/testdisplay.c
> index b4f0d45f..32590547 100644
> --- a/tests/testdisplay.c
> +++ b/tests/testdisplay.c
> @@ -69,8 +69,10 @@
>  #include <stdlib.h>
>  #include <signal.h>
>  
> -#define Yb_OPT		 5
> -#define Yf_OPT		 6
> +enum {
> +	OPT_YB,
> +	OPT_YF,
> +};
>  
>  static int tio_fd;
>  struct termios saved_tio;
> @@ -573,8 +575,8 @@ static void set_termio_mode(void)
>  
>  static char optstr[] = "3iaf:s:d:p:mrto:j:y";
>  static struct option long_opts[] = {
> -	{"yb", 0, 0, Yb_OPT},
> -	{"yf", 0, 0, Yf_OPT},
> +	{"yb", 0, 0, OPT_YB},
> +	{"yf", 0, 0, OPT_YF},
>  	{ 0, 0, 0, 0 }
>  };
>  
> @@ -648,10 +650,10 @@ static int opt_handler(int opt, int opt_index, void *data)
>  		tiling = LOCAL_I915_FORMAT_MOD_X_TILED;
>  		break;
>  	case 'y':
> -	case Yb_OPT:
> +	case OPT_YB:
>  		tiling = LOCAL_I915_FORMAT_MOD_Y_TILED;
>  		break;
> -	case Yf_OPT:
> +	case OPT_YF:
>  		tiling = LOCAL_I915_FORMAT_MOD_Yf_TILED;
>  		break;
>  	case 'r':
> -- 
> 2.21.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx