All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t 1/2] lib/kms: Constify some string arrays
@ 2018-03-16 18:16 Ville Syrjala
  2018-03-16 18:16 ` [igt-dev] [PATCH i-g-t 2/2] lib/kms: Use named initializers for prop name arrays Ville Syrjala
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ville Syrjala @ 2018-03-16 18:16 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Make a bunch of string arrays const.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c | 18 ++++++++++--------
 lib/igt_kms.h |  6 +++---
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index cf6389f2474c..59f97cb4c5a0 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -158,7 +158,7 @@ const unsigned char* igt_kms_get_base_edid(void)
 #define EDID_NAME alt_edid
 #include "igt_edid_template.h"
 
-const char *igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
+const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
 	"SRC_X",
 	"SRC_Y",
 	"SRC_W",
@@ -175,7 +175,7 @@ const char *igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
 	"IN_FORMATS",
 };
 
-const char *igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
+const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
 	"background_color",
 	"CTM",
 	"GAMMA_LUT",
@@ -187,7 +187,7 @@ const char *igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
 	"OUT_FENCE_PTR"
 };
 
-const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
+const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
 	"scaling mode",
 	"CRTC_ID",
 	"DPMS",
@@ -200,7 +200,7 @@ const char *igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
  */
 static void
 igt_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
-		     int num_props, const char **prop_names)
+		     int num_props, const char * const prop_names[])
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -234,7 +234,7 @@ igt_fill_plane_props(igt_display_t *display, igt_plane_t *plane,
  */
 static void
 igt_atomic_fill_connector_props(igt_display_t *display, igt_output_t *output,
-			int num_connector_props, const char **conn_prop_names)
+			int num_connector_props, const char * const conn_prop_names[])
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -264,7 +264,7 @@ igt_atomic_fill_connector_props(igt_display_t *display, igt_output_t *output,
 
 static void
 igt_fill_pipe_props(igt_display_t *display, igt_pipe_t *pipe,
-		    int num_crtc_props, const char **crtc_prop_names)
+		    int num_crtc_props, const char * const crtc_prop_names[])
 {
 	drmModeObjectPropertiesPtr props;
 	int i, j, fd;
@@ -324,7 +324,9 @@ const unsigned char* igt_kms_get_alt_edid(void)
  */
 const char *kmstest_pipe_name(enum pipe pipe)
 {
-	const char *str[] = { "A", "B", "C", "D", "E", "F"};
+	static const char * const str[] = {
+		"A", "B", "C", "D", "E", "F",
+	};
 
 	if (pipe == PIPE_NONE)
 		return "None";
@@ -367,7 +369,7 @@ int kmstest_pipe_to_index(char pipe)
  */
 const char *kmstest_plane_type_name(int plane_type)
 {
-	static const char *names[] = {
+	static const char * const names[] = {
 		[DRM_PLANE_TYPE_OVERLAY] = "overlay",
 		[DRM_PLANE_TYPE_PRIMARY] = "primary",
 		[DRM_PLANE_TYPE_CURSOR] = "cursor",
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 1ea3be991509..194f62fa8347 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -113,7 +113,7 @@ enum igt_atomic_crtc_properties {
  * igt_crtc_prop_names contains a list of crtc property names,
  * as indexed by the igt_atomic_crtc_properties enum.
  */
-extern const char *igt_crtc_prop_names[];
+extern const char * const igt_crtc_prop_names[];
 
 enum igt_atomic_connector_properties {
        IGT_CONNECTOR_SCALING_MODE = 0,
@@ -129,7 +129,7 @@ enum igt_atomic_connector_properties {
  * igt_connector_prop_names contains a list of crtc property names,
  * as indexed by the igt_atomic_connector_properties enum.
  */
-extern const char *igt_connector_prop_names[];
+extern const char * const igt_connector_prop_names[];
 
 struct kmstest_connector_config {
 	drmModeCrtc *crtc;
@@ -272,7 +272,7 @@ enum igt_atomic_plane_properties {
  * igt_plane_prop_names contains a list of crtc property names,
  * as indexed by the igt_atomic_plane_properties enum.
  */
-extern const char *igt_plane_prop_names[];
+extern const char * const igt_plane_prop_names[];
 
 typedef struct igt_display igt_display_t;
 typedef struct igt_pipe igt_pipe_t;
-- 
2.16.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH i-g-t 2/2] lib/kms: Use named initializers for prop name arrays
  2018-03-16 18:16 [igt-dev] [PATCH i-g-t 1/2] lib/kms: Constify some string arrays Ville Syrjala
@ 2018-03-16 18:16 ` Ville Syrjala
  2018-03-16 19:58 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/kms: Constify some string arrays Patchwork
  2018-03-17  1:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Ville Syrjala @ 2018-03-16 18:16 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Decouple the prop name arrays from the actual enum values
by using named initializers. Should make it less likely that we
end up with the wrong property on account of getting the order
wrong.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c | 54 +++++++++++++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 59f97cb4c5a0..9c0470b0288f 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -159,39 +159,39 @@ const unsigned char* igt_kms_get_base_edid(void)
 #include "igt_edid_template.h"
 
 const char * const igt_plane_prop_names[IGT_NUM_PLANE_PROPS] = {
-	"SRC_X",
-	"SRC_Y",
-	"SRC_W",
-	"SRC_H",
-	"CRTC_X",
-	"CRTC_Y",
-	"CRTC_W",
-	"CRTC_H",
-	"FB_ID",
-	"CRTC_ID",
-	"IN_FENCE_FD",
-	"type",
-	"rotation",
-	"IN_FORMATS",
+	[IGT_PLANE_SRC_X] = "SRC_X",
+	[IGT_PLANE_SRC_Y] = "SRC_Y",
+	[IGT_PLANE_SRC_W] = "SRC_W",
+	[IGT_PLANE_SRC_H] = "SRC_H",
+	[IGT_PLANE_CRTC_X] = "CRTC_X",
+	[IGT_PLANE_CRTC_Y] = "CRTC_Y",
+	[IGT_PLANE_CRTC_W] = "CRTC_W",
+	[IGT_PLANE_CRTC_H] = "CRTC_H",
+	[IGT_PLANE_FB_ID] = "FB_ID",
+	[IGT_PLANE_CRTC_ID] = "CRTC_ID",
+	[IGT_PLANE_IN_FENCE_FD] = "IN_FENCE_FD",
+	[IGT_PLANE_TYPE] = "type",
+	[IGT_PLANE_ROTATION] = "rotation",
+	[IGT_PLANE_IN_FORMATS] = "IN_FORMATS",
 };
 
 const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
-	"background_color",
-	"CTM",
-	"GAMMA_LUT",
-	"GAMMA_LUT_SIZE",
-	"DEGAMMA_LUT",
-	"DEGAMMA_LUT_SIZE",
-	"MODE_ID",
-	"ACTIVE",
-	"OUT_FENCE_PTR"
+	[IGT_CRTC_BACKGROUND] = "background_color",
+	[IGT_CRTC_CTM] = "CTM",
+	[IGT_CRTC_GAMMA_LUT] = "GAMMA_LUT",
+	[IGT_CRTC_GAMMA_LUT_SIZE] = "GAMMA_LUT_SIZE",
+	[IGT_CRTC_DEGAMMA_LUT] = "DEGAMMA_LUT",
+	[IGT_CRTC_DEGAMMA_LUT_SIZE] = "DEGAMMA_LUT_SIZE",
+	[IGT_CRTC_MODE_ID] = "MODE_ID",
+	[IGT_CRTC_ACTIVE] = "ACTIVE",
+	[IGT_CRTC_OUT_FENCE_PTR] = "OUT_FENCE_PTR",
 };
 
 const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
-	"scaling mode",
-	"CRTC_ID",
-	"DPMS",
-	"Broadcast RGB"
+	[IGT_CONNECTOR_SCALING_MODE] = "scaling mode",
+	[IGT_CONNECTOR_CRTC_ID] = "CRTC_ID",
+	[IGT_CONNECTOR_DPMS] = "DPMS",
+	[IGT_CONNECTOR_BROADCAST_RGB] = "Broadcast RGB",
 };
 
 /*
-- 
2.16.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/kms: Constify some string arrays
  2018-03-16 18:16 [igt-dev] [PATCH i-g-t 1/2] lib/kms: Constify some string arrays Ville Syrjala
  2018-03-16 18:16 ` [igt-dev] [PATCH i-g-t 2/2] lib/kms: Use named initializers for prop name arrays Ville Syrjala
@ 2018-03-16 19:58 ` Patchwork
  2018-03-17  1:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-03-16 19:58 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] lib/kms: Constify some string arrays
URL   : https://patchwork.freedesktop.org/series/40117/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
98f7614bd725afaae48f7b70d18329149075661b lib: Parse plane IN_FORMATS blobifiers into a nicer form

with latest DRM-Tip kernel build CI_DRM_3942
66a3be2efe09 drm-tip: 2018y-03m-16d-16h-32m-51s UTC integration manifest

No testlist changes.

---- Known issues:

Test gem_exec_suspend:
        Subgroup basic-s4-devices:
                pass       -> DMESG-WARN (fi-kbl-7500u) fdo#105128

fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:432s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:443s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:383s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:538s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:300s
fi-bxt-j4205     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:513s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:517s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:506s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:410s
fi-cfl-s2        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:579s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:511s
fi-cnl-drrs      total:285  pass:254  dwarn:3   dfail:0   fail:0   skip:28  time:521s
fi-cnl-y3        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:595s
fi-elk-e7500     total:285  pass:225  dwarn:1   dfail:0   fail:0   skip:59  time:428s
fi-gdg-551       total:285  pass:177  dwarn:0   dfail:0   fail:0   skip:108 time:323s
fi-glk-1         total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:539s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:403s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:423s
fi-ivb-3520m     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:479s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:427s
fi-kbl-7500u     total:285  pass:259  dwarn:2   dfail:0   fail:0   skip:24  time:476s
fi-kbl-7567u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:467s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:516s
fi-pnv-d510      total:285  pass:219  dwarn:1   dfail:0   fail:0   skip:65  time:656s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:440s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:532s
fi-skl-6700hq    total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:540s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:498s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:507s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:428s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:447s
fi-snb-2520m     total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:583s
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:399s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1155/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] lib/kms: Constify some string arrays
  2018-03-16 18:16 [igt-dev] [PATCH i-g-t 1/2] lib/kms: Constify some string arrays Ville Syrjala
  2018-03-16 18:16 ` [igt-dev] [PATCH i-g-t 2/2] lib/kms: Use named initializers for prop name arrays Ville Syrjala
  2018-03-16 19:58 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/kms: Constify some string arrays Patchwork
@ 2018-03-17  1:33 ` Patchwork
  2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2018-03-17  1:33 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] lib/kms: Constify some string arrays
URL   : https://patchwork.freedesktop.org/series/40117/
State : failure

== Summary ==

---- Possible new issues:

Test kms_cursor_crc:
        Subgroup cursor-128x128-suspend:
                skip       -> PASS       (shard-snb)
        Subgroup cursor-64x64-suspend:
                pass       -> SKIP       (shard-snb)
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-indfb-fliptrack:
                pass       -> FAIL       (shard-apl)
        Subgroup fbc-1p-offscren-pri-indfb-draw-mmap-cpu:
                pass       -> FAIL       (shard-apl)
Test pm_rc6_residency:
        Subgroup rc6-accuracy:
                pass       -> SKIP       (shard-snb)

---- Known issues:

Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-pwrite:
                pass       -> DMESG-FAIL (shard-apl) fdo#101623
Test kms_rotation_crc:
        Subgroup primary-rotation-180:
                pass       -> FAIL       (shard-snb) fdo#103925
        Subgroup sprite-rotation-180:
                pass       -> FAIL       (shard-snb) fdo#105185 +1
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test perf:
        Subgroup blocking:
                fail       -> PASS       (shard-hsw) fdo#102252 +1

fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252

shard-apl        total:3442 pass:1810 dwarn:1   dfail:1   fail:10  skip:1619 time:13026s
shard-hsw        total:3442 pass:1767 dwarn:1   dfail:0   fail:2   skip:1671 time:11860s
shard-snb        total:3442 pass:1355 dwarn:1   dfail:0   fail:4   skip:2082 time:7149s
Blacklisted hosts:
shard-kbl        total:3442 pass:1939 dwarn:1   dfail:1   fail:9   skip:1492 time:9892s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1155/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-03-17  1:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-16 18:16 [igt-dev] [PATCH i-g-t 1/2] lib/kms: Constify some string arrays Ville Syrjala
2018-03-16 18:16 ` [igt-dev] [PATCH i-g-t 2/2] lib/kms: Use named initializers for prop name arrays Ville Syrjala
2018-03-16 19:58 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/kms: Constify some string arrays Patchwork
2018-03-17  1:33 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.