Skip to contentSkip to conversation

lib/igt_gt: Define HANG_ALLOW_* as bit flags

PATCH In review Michel Thierry 3 participants 5 messages Feb 8, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/igt_gt: Define HANG_ALLOW_* as bit flags

As that is what they are meant to be. It will prevent any confusion if we have to add other flags in the future.

---
 lib/igt_gt.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/igt_gt.h +2 -2
index e44b6db1..d83e23a1 100644
@@ -45,8 +45,8 @@ igt_hang_t igt_hang_ctx(int fd,
 			int ring,
 			unsigned flags,
 			uint64_t *offset);
-#define HANG_ALLOW_BAN 1
-#define HANG_ALLOW_CAPTURE 2
+#define HANG_ALLOW_BAN		(1<<0)
+#define HANG_ALLOW_CAPTURE	(1<<1)
 
 igt_hang_t igt_hang_ring(int fd, int ring);
 void igt_post_hang_ring(int fd, igt_hang_t arg);
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Michel Thierry

As that is what they are meant to be. It will prevent any confusion if we have to add other flags in the future.

<SNIP>

lib/igt_gt.h igt_hang_t igt_hang_ctx(int fd, · line 49

Quoted 4 lines
lib/igt_gt.h +2 -2
-#define HANG_ALLOW_BAN 1
-#define HANG_ALLOW_CAPTURE 2
+#define HANG_ALLOW_BAN		(1<<0)
+#define HANG_ALLOW_CAPTURE	(1<<1)

Make them BIT(0) and BIT(1), and this is;

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 6 lines · Joonas Lahtinen
Quoted 4 lines · Michel Thierry

As that is what they are meant to be. It will prevent any confusion if we have to add other flags in the future.

Quoted 8 lines

<SNIP>

lib/igt_gt.h igt_hang_t igt_hang_ctx(int fd, · line 49

Quoted 4 lines
lib/igt_gt.h +2 -2
-#define HANG_ALLOW_BAN 1
-#define HANG_ALLOW_CAPTURE 2
+#define HANG_ALLOW_BAN		(1<<0)
+#define HANG_ALLOW_CAPTURE	(1<<1)

Make them BIT(0) and BIT(1), and this is;

This is igt and BIT() is already a hodge-podge of different macros. -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 9 lines · Chris Wilson
Quoted 8 lines · Joonas Lahtinen
Quoted 4 lines · Michel Thierry

As that is what they are meant to be. It will prevent any confusion if we have to add other flags in the future.

<SNIP>

Quoted 8 lines
Quoted 6 lines

lib/igt_gt.h igt_hang_t igt_hang_ctx(int fd, · line 49

Quoted 4 lines
lib/igt_gt.h +2 -2
-#define HANG_ALLOW_BAN 1
-#define HANG_ALLOW_CAPTURE 2
+#define HANG_ALLOW_BAN		(1<<0)
+#define HANG_ALLOW_CAPTURE	(1<<1)

Make them BIT(0) and BIT(1), and this is;

This is igt and BIT() is already a hodge-podge of different macros.

I see at least 3 different BIT macros already (Chris added the one we want in lib/intel_device_info.c)

I can volunteer to move it to one of the header files, replace all the 1<<x with BIT and rename the ones in igt_draw/intel_audio_dump... thoughts?

-Michel

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 19 lines · Michel Thierry
Quoted 16 lines · Chris Wilson
Quoted 14 lines · Joonas Lahtinen
Quoted 4 lines · Michel Thierry

As that is what they are meant to be. It will prevent any confusion if we have to add other flags in the future.

<SNIP>

lib/igt_gt.h igt_hang_t igt_hang_ctx(int fd, · line 49

Quoted 4 lines
lib/igt_gt.h +2 -2
-#define HANG_ALLOW_BAN 1
-#define HANG_ALLOW_CAPTURE 2
+#define HANG_ALLOW_BAN		(1<<0)
+#define HANG_ALLOW_CAPTURE	(1<<1)

Make them BIT(0) and BIT(1), and this is;

Quoted 8 lines
Quoted 1 line

This is igt and BIT() is already a hodge-podge of different macros.

I see at least 3 different BIT macros already (Chris added the one we want in lib/intel_device_info.c)

I can volunteer to move it to one of the header files, replace all the 1<<x with BIT and rename the ones in igt_draw/intel_audio_dump... thoughts?

BIT(), test_bit, set_bit, clear_bit...

If you are willing to write them, please do! Make us feel at home :) -Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx