[PATCH i-g-t] tests/intel/kms_pm_dc: Fix compilation on arm64
Kamil Konieczny <[email protected]>
| Newsgroups | org.freedesktop.lists.igt-dev |
|---|---|
| Message-ID | <[email protected]> |
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]>
Signed-off-by: Kamil Konieczny <[email protected]>
---
tests/intel/kms_pm_dc.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/tests/intel/kms_pm_dc.c b/tests/intel/kms_pm_dc.c
index 37c795ca8..29cfa847e 100644
--- a/tests/intel/kms_pm_dc.c
+++ b/tests/intel/kms_pm_dc.c
@@ -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);
}
--
2.54.0