Skip to contentSkip to conversation

tests/intel/kms_pm_dc: Fix compilation on arm64

PATCH In review Kamil Konieczny 4 participants 4 messages Jul 20 – Jul 21

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/intel/kms_pm_dc: Fix compilation on arm64

Fix compilation on arm64, where following error occurs:

../tests/intel/kms_pm_dc.c:428:16: error: implicit declaration of function ‘poll’; did you mean ‘powl’? [-Werror=implicit-function-declaration]
428 | igt_assert_f(poll(&pfd, 1, timeout_ms) > 0,
| ^~~~

Also while at this add a newline to separate system includes from igt ones and a compilation warning in other place:

../tests/intel/kms_pm_dc.c:322:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

  322 |         color_t red_green_blue[] = {
      |         ^~~~~~~
Fixes e4a428ca3a46 ("tests/intel/kms_pm_dc: Detect frame drops via page-flip events")
Cc Jeevan B <[email protected]>
Cc Dibin Moolakadan Subrahmanian <[email protected]>
Cc "Zbigniew Kempczyński" <[email protected]>
---
 tests/intel/kms_pm_dc.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
tests/intel/kms_pm_dc.c +9 -8
index 37c795ca8..29cfa847e 100644
@@ -32,9 +32,11 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <poll.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
+
 #include "igt.h"
 #include "igt_kmod.h"
 #include "igt_psr.h"
@@ -309,14 +311,6 @@ static void assert_dc_counter_negative(data_t *data, int dc_flag, uint32_t prev_
 static void setup_videoplayback(data_t *data)
 {
 	igt_plane_t *primary;
-
-	primary = igt_output_get_plane_type(data->output,
-					    DRM_PLANE_TYPE_PRIMARY);
-	igt_require_f(igt_plane_has_format_mod(primary, data->dc3co_fb_format,
-					       DRM_FORMAT_MOD_LINEAR),
-					       "Primary plane does not support format %s\n",
-					       igt_format_str(data->dc3co_fb_format));
-
 	color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
@@ -328,6 +322,13 @@ static void setup_videoplayback(data_t *data)
 		{ 1.0, 0.0, 0.0 },
 	};
 
+	primary = igt_output_get_plane_type(data->output,
+					    DRM_PLANE_TYPE_PRIMARY);
+	igt_require_f(igt_plane_has_format_mod(primary, data->dc3co_fb_format,
+					       DRM_FORMAT_MOD_LINEAR),
+					       "Primary plane does not support format %s\n",
+					       igt_format_str(data->dc3co_fb_format));
+
 	create_color_fb(data, &data->fb_rgb, red_green_blue);
 	create_color_fb(data, &data->fb_rgr, red_green_red);
 }
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Kamil Konieczny

Fix compilation on arm64, where following error occurs:

../tests/intel/kms_pm_dc.c:428:16: error: implicit declaration of function ‘poll’; did you mean ‘powl’? [-Werror=implicit-function-declaration]
428 | igt_assert_f(poll(&pfd, 1, timeout_ms) > 0,
| ^~~~

Also while at this add a newline to separate system includes from igt ones and a compilation warning in other place:

../tests/intel/kms_pm_dc.c:322:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

Quoted 8 lines
  322 |         color_t red_green_blue[] = {
      |         ^~~~~~~
Fixes e4a428ca3a46 ("tests/intel/kms_pm_dc: Detect frame drops via page-flip events")
Cc Jeevan B <[email protected]>
Cc Dibin Moolakadan Subrahmanian <[email protected]>
Cc "Zbigniew Kempczyński" <[email protected]>

LGTM,

--
Zbigniew

Quoted 52 lines
---
 tests/intel/kms_pm_dc.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
tests/intel/kms_pm_dc.c +9 -8
index 37c795ca8..29cfa847e 100644
@@ -32,9 +32,11 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <poll.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
+
 #include "igt.h"
 #include "igt_kmod.h"
 #include "igt_psr.h"
@@ -309,14 +311,6 @@ static void assert_dc_counter_negative(data_t *data, int dc_flag, uint32_t prev_
 static void setup_videoplayback(data_t *data)
 {
 	igt_plane_t *primary;
-
-	primary = igt_output_get_plane_type(data->output,
-					    DRM_PLANE_TYPE_PRIMARY);
-	igt_require_f(igt_plane_has_format_mod(primary, data->dc3co_fb_format,
-					       DRM_FORMAT_MOD_LINEAR),
-					       "Primary plane does not support format %s\n",
-					       igt_format_str(data->dc3co_fb_format));
-
 	color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
@@ -328,6 +322,13 @@ static void setup_videoplayback(data_t *data)
 		{ 1.0, 0.0, 0.0 },
 	};
 
+	primary = igt_output_get_plane_type(data->output,
+					    DRM_PLANE_TYPE_PRIMARY);
+	igt_require_f(igt_plane_has_format_mod(primary, data->dc3co_fb_format,
+					       DRM_FORMAT_MOD_LINEAR),
+					       "Primary plane does not support format %s\n",
+					       igt_format_str(data->dc3co_fb_format));
+
 	create_color_fb(data, &data->fb_rgb, red_green_blue);
 	create_color_fb(data, &data->fb_rgr, red_green_red);
 }
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#2 lore raw
In reply to Kamil Konieczny

LGTM.

Quoted 87 lines

-----Original Message-----
From: Kamil Konieczny <[email protected]>
Sent: Monday, July 20, 2026 5:19 PM
To: [email protected]
Cc: Kamil Konieczny <[email protected]>; B, Jeevan <[email protected]>; Dibin Moolakadan Subrahmanian <[email protected]>; Kempczynski, Zbigniew <[email protected]>
Subject: [PATCH i-g-t] tests/intel/kms_pm_dc: Fix compilation on arm64

Fix compilation on arm64, where following error occurs:

../tests/intel/kms_pm_dc.c:428:16: error: implicit declaration of function ‘poll’; did you mean ‘powl’? [-Werror=implicit-function-declaration]
428 | igt_assert_f(poll(&pfd, 1, timeout_ms) > 0,
| ^~~~

Also while at this add a newline to separate system includes from igt ones and a compilation warning in other place:

../tests/intel/kms_pm_dc.c:322:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

  322 |         color_t red_green_blue[] = {
      |         ^~~~~~~
Fixes e4a428ca3a46 ("tests/intel/kms_pm_dc: Detect frame drops via page-flip

events")
Cc: Jeevan B <[email protected]>
Cc: Dibin Moolakadan Subrahmanian
<[email protected]>

Cc "Zbigniew Kempczyński" <[email protected]>
---
 tests/intel/kms_pm_dc.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
tests/intel/kms_pm_dc.c index renamed from tests/intel/kms_pm_dc.c +0 -0

37c795ca8..29cfa847e 100644

tests/intel/kms_pm_dc.c +2 -8
@@ -32,9 +32,11 @@
 
 #include <errno.h>
 #include <fcntl.h>
+#include <poll.h>
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
+
 #include "igt.h"
 #include "igt_kmod.h"
 #include "igt_psr.h"
@@ -309,14 +311,6 @@ static void assert_dc_counter_negative(data_t *data,
 int dc_flag, uint32_t prev_  static void setup_videoplayback(data_t *data)  {
 	igt_plane_t *primary;
-
-	primary = igt_output_get_plane_type(data->output,
-					    DRM_PLANE_TYPE_PRIMARY);
-	igt_require_f(igt_plane_has_format_mod(primary, data-
 >dc3co_fb_format,
-					       DRM_FORMAT_MOD_LINEAR),
-					       "Primary plane does not support
 format %s\n",
-					       igt_format_str(data-
 >dc3co_fb_format));
-
 	color_t red_green_blue[] = {
tests/intel/kms_pm_dc.c +7 -0
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
@@ -328,6 +322,13 @@ static void setup_videoplayback(data_t *data)
 		{ 1.0, 0.0, 0.0 },
 	};
 
+	primary = igt_output_get_plane_type(data->output,
+					    DRM_PLANE_TYPE_PRIMARY);
+	igt_require_f(igt_plane_has_format_mod(primary, data-
 >dc3co_fb_format,
+					       DRM_FORMAT_MOD_LINEAR),
+					       "Primary plane does not support
 format %s\n",
+					       igt_format_str(data-
 >dc3co_fb_format));
+
tests/intel/kms_pm_dc.c +0 -1
 	create_color_fb(data, &data->fb_rgb, red_green_blue);
 	create_color_fb(data, &data->fb_rgr, red_green_red);  }
--

2.54.0