All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper
@ 2019-05-27  1:19 ` Rodrigo Siqueira
  0 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2019-05-27  1:19 UTC (permalink / raw)
  To: Petri Latvala, Arkadiusz Hiler, Chris Wilson, Simon Ser
  Cc: igt-dev, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 7443 bytes --]

The function __kms_addfb() and drmModeAddFB2WithModifiers() have a
similar code. Due to this similarity, this commit replaces all the
occurrences of  __kms_addfb() by drmModeAddFB2WithModifiers() and adds
the required adaptations.

V2: Simon Sir
 - Fix array data copy

V1: Arkadiusz Hiler
 - Fix array initialization
 - Drop __kms_addfb()

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
 lib/igt_aux.h                   |  3 +++
 lib/igt_fb.c                    | 14 +++++++++-----
 lib/ioctl_wrappers.c            | 33 ---------------------------------
 lib/ioctl_wrappers.h            | 11 -----------
 tests/kms_available_modes_crc.c | 14 +++++++++-----
 tests/kms_draw_crc.c            | 10 ++++++----
 tests/prime_vgem.c              | 14 ++++++++------
 7 files changed, 35 insertions(+), 64 deletions(-)

diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 04d22904..2b08a0d4 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -309,4 +309,7 @@ void igt_lsof(const char *dpath);
 
 uint64_t vfs_file_max(void);
 
+#define fill_memory(src, value, limit) \
+	for (int _i = 0; _i < limit; src[_i] = value, _i++)
+
 #endif /* IGT_AUX_H */
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index d4929019..5f55906b 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1235,6 +1235,9 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
 			   struct igt_fb *fb, uint64_t bo_size,
 			   unsigned bo_stride)
 {
+	uint32_t handles[4] = {};
+	uint64_t modifiers[4] = {};
+
 	/* FIXME allow the caller to pass these in */
 	enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
 	enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
@@ -1262,11 +1265,12 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
 	if (fb->modifier || igt_has_fb_modifiers(fd))
 		flags = LOCAL_DRM_MODE_FB_MODIFIERS;
 
-	do_or_die(__kms_addfb(fb->fd, fb->gem_handle,
-			      fb->width, fb->height,
-			      fb->drm_format, fb->modifier,
-			      fb->strides, fb->offsets, fb->num_planes, flags,
-			      &fb->fb_id));
+	fill_memory(handles, fb->gem_handle, fb->num_planes);
+	fill_memory(modifiers, modifier, fb->num_planes);
+	do_or_die(drmModeAddFB2WithModifiers(fb->fd, fb->width, fb->height,
+					     fb->drm_format, handles,
+					     fb->strides, fb->offsets,
+					     modifiers, &fb->fb_id, flags));
 
 	return fb->fb_id;
 }
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 280fdd62..0f00971d 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1453,36 +1453,3 @@ void igt_require_fb_modifiers(int fd)
 {
 	igt_require(igt_has_fb_modifiers(fd));
 }
-
-int __kms_addfb(int fd, uint32_t handle,
-		uint32_t width, uint32_t height,
-		uint32_t pixel_format, uint64_t modifier,
-		uint32_t strides[4], uint32_t offsets[4],
-		int num_planes, uint32_t flags, uint32_t *buf_id)
-{
-	struct drm_mode_fb_cmd2 f;
-	int ret, i;
-
-	if (flags & DRM_MODE_FB_MODIFIERS)
-		igt_require_fb_modifiers(fd);
-
-	memset(&f, 0, sizeof(f));
-
-	f.width  = width;
-	f.height = height;
-	f.pixel_format = pixel_format;
-	f.flags = flags;
-
-	for (i = 0; i < num_planes; i++) {
-		f.handles[i] = handle;
-		f.modifier[i] = modifier;
-		f.pitches[i] = strides[i];
-		f.offsets[i] = offsets[i];
-	}
-
-	ret = igt_ioctl(fd, DRM_IOCTL_MODE_ADDFB2, &f);
-
-	*buf_id = f.fb_id;
-
-	return ret < 0 ? -errno : ret;
-}
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 03211c97..4afc3e09 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -209,17 +209,6 @@ struct local_drm_mode_fb_cmd2 {
 bool igt_has_fb_modifiers(int fd);
 void igt_require_fb_modifiers(int fd);
 
-/**
- * __kms_addfb:
- *
- * Creates a framebuffer object.
- */
-int __kms_addfb(int fd, uint32_t handle,
-		uint32_t width, uint32_t height,
-		uint32_t pixel_format, uint64_t modifier,
-		uint32_t strides[4], uint32_t offsets[4],
-		int num_planes, uint32_t flags, uint32_t *buf_id);
-
 /**
  * to_user_pointer:
  *
diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index 50b5522a..275b4b6f 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -172,9 +172,10 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 {
 	drmModeModeInfo *mode;
 	uint64_t w, h;
+	uint32_t handles[4] = {};
+	uint64_t modifiers[4] = {};
 	signed ret, gemsize = 0;
 	unsigned tile_width, tile_height;
-	int num_planes = 1;
 	uint64_t tiling;
 	int bpp = 0;
 	int i;
@@ -225,10 +226,13 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 
 	igt_assert_eq(ret, 0);
 
-	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
-			  format, tiling, data->fb.strides, data->fb.offsets,
-			  num_planes, LOCAL_DRM_MODE_FB_MODIFIERS,
-			  &data->fb.fb_id);
+	fill_memory(handles, data->gem_handle, 1);
+	fill_memory(modifiers, tiling, 1);
+	ret = drmModeAddFB2WithModifiers(data->gfx_fd, w, h, format,
+					 handles, data->fb.strides,
+					 data->fb.offsets, modifiers,
+					 &data->fb.fb_id,
+					 LOCAL_DRM_MODE_FB_MODIFIERS);
 
 	if(ret < 0) {
 		igt_info("Creating fb for format %s failed, return code %d\n",
diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index ea14db9a..38f92ab9 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -155,17 +155,19 @@ static void get_method_crc(enum igt_draw_method method, uint32_t drm_format,
 
 static bool format_is_supported(uint32_t format, uint64_t modifier)
 {
-	uint32_t gem_handle, fb_id;
+	uint32_t gem_handle, fb_id, handles[4] = {};
 	unsigned int offsets[4] = {};
 	unsigned int strides[4] = {};
+	uint64_t modifiers[4] = {};
 	int ret;
 
 	gem_handle = igt_create_bo_with_dimensions(drm_fd, 64, 64,
 						   format, modifier,
 						   0, NULL, &strides[0], NULL);
-	ret =  __kms_addfb(drm_fd, gem_handle, 64, 64,
-			   format, modifier, strides, offsets, 1,
-			   LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id);
+	fill_memory(handles, gem_handle, 1);
+	ret = drmModeAddFB2WithModifiers(drm_fd, 64, 64, format, handles,
+					 strides, offsets, modifiers, &fb_id,
+					 LOCAL_DRM_MODE_FB_MODIFIERS);
 	drmModeRmFB(drm_fd, fb_id);
 	gem_close(drm_fd, gem_handle);
 
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 09e3373b..da15fd14 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -761,6 +761,7 @@ static void test_flip(int i915, int vgem, unsigned hang)
 	for (int i = 0; i < 2; i++) {
 		uint32_t strides[4] = {};
 		uint32_t offsets[4] = {};
+		uint32_t handles[4] = {};
 		int fd;
 
 		bo[i].width = mode->hdisplay;
@@ -776,12 +777,13 @@ static void test_flip(int i915, int vgem, unsigned hang)
 		strides[0] = bo[i].pitch;
 
 		/* May skip if i915 has no displays */
-		igt_require(__kms_addfb(i915, handle[i],
-					bo[i].width, bo[i].height,
-					DRM_FORMAT_XRGB8888, I915_TILING_NONE,
-					strides, offsets, 1,
-					LOCAL_DRM_MODE_FB_MODIFIERS,
-					&fb_id[i]) == 0);
+		fill_memory(handles, handle[i],1);
+		igt_require(drmModeAddFB2WithModifiers(i915, bo[i].width, bo[i].height,
+						       DRM_FORMAT_XRGB8888,
+						       handles, strides, offsets,
+						       I915_TILING_NONE, &fb_id[i],
+						       LOCAL_DRM_MODE_FB_MODIFIERS) == 0);
+
 		igt_assert(fb_id[i]);
 	}
 
-- 
2.21.0

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [igt-dev] [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper
@ 2019-05-27  1:19 ` Rodrigo Siqueira
  0 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2019-05-27  1:19 UTC (permalink / raw)
  To: Petri Latvala, Arkadiusz Hiler, Chris Wilson, Simon Ser
  Cc: igt-dev, intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 7443 bytes --]

The function __kms_addfb() and drmModeAddFB2WithModifiers() have a
similar code. Due to this similarity, this commit replaces all the
occurrences of  __kms_addfb() by drmModeAddFB2WithModifiers() and adds
the required adaptations.

V2: Simon Sir
 - Fix array data copy

V1: Arkadiusz Hiler
 - Fix array initialization
 - Drop __kms_addfb()

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
---
 lib/igt_aux.h                   |  3 +++
 lib/igt_fb.c                    | 14 +++++++++-----
 lib/ioctl_wrappers.c            | 33 ---------------------------------
 lib/ioctl_wrappers.h            | 11 -----------
 tests/kms_available_modes_crc.c | 14 +++++++++-----
 tests/kms_draw_crc.c            | 10 ++++++----
 tests/prime_vgem.c              | 14 ++++++++------
 7 files changed, 35 insertions(+), 64 deletions(-)

diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 04d22904..2b08a0d4 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -309,4 +309,7 @@ void igt_lsof(const char *dpath);
 
 uint64_t vfs_file_max(void);
 
+#define fill_memory(src, value, limit) \
+	for (int _i = 0; _i < limit; src[_i] = value, _i++)
+
 #endif /* IGT_AUX_H */
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index d4929019..5f55906b 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -1235,6 +1235,9 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
 			   struct igt_fb *fb, uint64_t bo_size,
 			   unsigned bo_stride)
 {
+	uint32_t handles[4] = {};
+	uint64_t modifiers[4] = {};
+
 	/* FIXME allow the caller to pass these in */
 	enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
 	enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
@@ -1262,11 +1265,12 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
 	if (fb->modifier || igt_has_fb_modifiers(fd))
 		flags = LOCAL_DRM_MODE_FB_MODIFIERS;
 
-	do_or_die(__kms_addfb(fb->fd, fb->gem_handle,
-			      fb->width, fb->height,
-			      fb->drm_format, fb->modifier,
-			      fb->strides, fb->offsets, fb->num_planes, flags,
-			      &fb->fb_id));
+	fill_memory(handles, fb->gem_handle, fb->num_planes);
+	fill_memory(modifiers, modifier, fb->num_planes);
+	do_or_die(drmModeAddFB2WithModifiers(fb->fd, fb->width, fb->height,
+					     fb->drm_format, handles,
+					     fb->strides, fb->offsets,
+					     modifiers, &fb->fb_id, flags));
 
 	return fb->fb_id;
 }
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 280fdd62..0f00971d 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1453,36 +1453,3 @@ void igt_require_fb_modifiers(int fd)
 {
 	igt_require(igt_has_fb_modifiers(fd));
 }
-
-int __kms_addfb(int fd, uint32_t handle,
-		uint32_t width, uint32_t height,
-		uint32_t pixel_format, uint64_t modifier,
-		uint32_t strides[4], uint32_t offsets[4],
-		int num_planes, uint32_t flags, uint32_t *buf_id)
-{
-	struct drm_mode_fb_cmd2 f;
-	int ret, i;
-
-	if (flags & DRM_MODE_FB_MODIFIERS)
-		igt_require_fb_modifiers(fd);
-
-	memset(&f, 0, sizeof(f));
-
-	f.width  = width;
-	f.height = height;
-	f.pixel_format = pixel_format;
-	f.flags = flags;
-
-	for (i = 0; i < num_planes; i++) {
-		f.handles[i] = handle;
-		f.modifier[i] = modifier;
-		f.pitches[i] = strides[i];
-		f.offsets[i] = offsets[i];
-	}
-
-	ret = igt_ioctl(fd, DRM_IOCTL_MODE_ADDFB2, &f);
-
-	*buf_id = f.fb_id;
-
-	return ret < 0 ? -errno : ret;
-}
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index 03211c97..4afc3e09 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -209,17 +209,6 @@ struct local_drm_mode_fb_cmd2 {
 bool igt_has_fb_modifiers(int fd);
 void igt_require_fb_modifiers(int fd);
 
-/**
- * __kms_addfb:
- *
- * Creates a framebuffer object.
- */
-int __kms_addfb(int fd, uint32_t handle,
-		uint32_t width, uint32_t height,
-		uint32_t pixel_format, uint64_t modifier,
-		uint32_t strides[4], uint32_t offsets[4],
-		int num_planes, uint32_t flags, uint32_t *buf_id);
-
 /**
  * to_user_pointer:
  *
diff --git a/tests/kms_available_modes_crc.c b/tests/kms_available_modes_crc.c
index 50b5522a..275b4b6f 100644
--- a/tests/kms_available_modes_crc.c
+++ b/tests/kms_available_modes_crc.c
@@ -172,9 +172,10 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 {
 	drmModeModeInfo *mode;
 	uint64_t w, h;
+	uint32_t handles[4] = {};
+	uint64_t modifiers[4] = {};
 	signed ret, gemsize = 0;
 	unsigned tile_width, tile_height;
-	int num_planes = 1;
 	uint64_t tiling;
 	int bpp = 0;
 	int i;
@@ -225,10 +226,13 @@ static bool setup_fb(data_t *data, igt_output_t *output, igt_plane_t *plane,
 
 	igt_assert_eq(ret, 0);
 
-	ret = __kms_addfb(data->gfx_fd, data->gem_handle, w, h,
-			  format, tiling, data->fb.strides, data->fb.offsets,
-			  num_planes, LOCAL_DRM_MODE_FB_MODIFIERS,
-			  &data->fb.fb_id);
+	fill_memory(handles, data->gem_handle, 1);
+	fill_memory(modifiers, tiling, 1);
+	ret = drmModeAddFB2WithModifiers(data->gfx_fd, w, h, format,
+					 handles, data->fb.strides,
+					 data->fb.offsets, modifiers,
+					 &data->fb.fb_id,
+					 LOCAL_DRM_MODE_FB_MODIFIERS);
 
 	if(ret < 0) {
 		igt_info("Creating fb for format %s failed, return code %d\n",
diff --git a/tests/kms_draw_crc.c b/tests/kms_draw_crc.c
index ea14db9a..38f92ab9 100644
--- a/tests/kms_draw_crc.c
+++ b/tests/kms_draw_crc.c
@@ -155,17 +155,19 @@ static void get_method_crc(enum igt_draw_method method, uint32_t drm_format,
 
 static bool format_is_supported(uint32_t format, uint64_t modifier)
 {
-	uint32_t gem_handle, fb_id;
+	uint32_t gem_handle, fb_id, handles[4] = {};
 	unsigned int offsets[4] = {};
 	unsigned int strides[4] = {};
+	uint64_t modifiers[4] = {};
 	int ret;
 
 	gem_handle = igt_create_bo_with_dimensions(drm_fd, 64, 64,
 						   format, modifier,
 						   0, NULL, &strides[0], NULL);
-	ret =  __kms_addfb(drm_fd, gem_handle, 64, 64,
-			   format, modifier, strides, offsets, 1,
-			   LOCAL_DRM_MODE_FB_MODIFIERS, &fb_id);
+	fill_memory(handles, gem_handle, 1);
+	ret = drmModeAddFB2WithModifiers(drm_fd, 64, 64, format, handles,
+					 strides, offsets, modifiers, &fb_id,
+					 LOCAL_DRM_MODE_FB_MODIFIERS);
 	drmModeRmFB(drm_fd, fb_id);
 	gem_close(drm_fd, gem_handle);
 
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 09e3373b..da15fd14 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -761,6 +761,7 @@ static void test_flip(int i915, int vgem, unsigned hang)
 	for (int i = 0; i < 2; i++) {
 		uint32_t strides[4] = {};
 		uint32_t offsets[4] = {};
+		uint32_t handles[4] = {};
 		int fd;
 
 		bo[i].width = mode->hdisplay;
@@ -776,12 +777,13 @@ static void test_flip(int i915, int vgem, unsigned hang)
 		strides[0] = bo[i].pitch;
 
 		/* May skip if i915 has no displays */
-		igt_require(__kms_addfb(i915, handle[i],
-					bo[i].width, bo[i].height,
-					DRM_FORMAT_XRGB8888, I915_TILING_NONE,
-					strides, offsets, 1,
-					LOCAL_DRM_MODE_FB_MODIFIERS,
-					&fb_id[i]) == 0);
+		fill_memory(handles, handle[i],1);
+		igt_require(drmModeAddFB2WithModifiers(i915, bo[i].width, bo[i].height,
+						       DRM_FORMAT_XRGB8888,
+						       handles, strides, offsets,
+						       I915_TILING_NONE, &fb_id[i],
+						       LOCAL_DRM_MODE_FB_MODIFIERS) == 0);
+
 		igt_assert(fb_id[i]);
 	}
 
-- 
2.21.0

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

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

* [igt-dev] ✗ Fi.CI.BAT: failure for lib: Drop __kms_addfb() wrapper (rev2)
  2019-05-27  1:19 ` [igt-dev] " Rodrigo Siqueira
  (?)
@ 2019-05-27  1:38 ` Patchwork
  -1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2019-05-27  1:38 UTC (permalink / raw)
  To: Rodrigo Siqueira; +Cc: igt-dev

== Series Details ==

Series: lib: Drop __kms_addfb() wrapper (rev2)
URL   : https://patchwork.freedesktop.org/series/60833/
State : failure

== Summary ==

IGT patchset build failed on latest successful build
cdd6b0a7630762cec14596b9863f418b48c32f46 tests/kms_chamelium: print audio sub-sub-test results

[44/703] Compiling C object 'lib/lib@@igt-igt_alsa_c@sta/igt_alsa.c.o'.
[45/703] Linking static target lib/libigt-igt_alsa_c.a.
[46/703] Linking static target lib/libigt-igt_chamelium_c.a.
[47/703] Linking static target lib/libigt-igt_chamelium_stream_c.a.
[48/703] Linking target lib/libigt.so.0.
[49/703] Generating symbol file 'lib/lib@@igt@sha/libigt.so.0.symbols'.
[50/703] Linking target tests/kms_pipe_crc_basic.
[51/703] Linking target lib/tests/igt_assert.
[52/703] Linking target lib/tests/igt_can_fail.
[53/703] Linking target lib/tests/igt_can_fail_simple.
[54/703] Linking target lib/tests/igt_exit_handler.
[55/703] Linking target lib/tests/igt_conflicting_args.
[56/703] Linking target lib/tests/igt_invalid_subtest_name.
[57/703] Linking target lib/tests/igt_fork.
[58/703] Linking target lib/tests/igt_hdmi_inject.
[59/703] Linking target lib/tests/igt_list_only.
[60/703] Linking target lib/tests/igt_fork_helper.
[61/703] Linking target lib/tests/igt_no_exit.
[62/703] Linking target lib/tests/igt_segfault.
[63/703] Linking target lib/tests/igt_stats.
[64/703] Linking target lib/tests/igt_subtest_group.
[65/703] Linking target lib/tests/igt_simulation.
[66/703] Linking target lib/tests/igt_simple_test_subtests.
[67/703] Linking target lib/tests/igt_no_subtest.
[68/703] Linking target tests/core_auth.
[69/703] Linking target lib/tests/igt_timeout.
[70/703] Linking target tests/core_getclient.
[71/703] Linking target tests/core_getversion.
[72/703] Linking target tests/core_setmaster_vs_auth.
[73/703] Linking target tests/core_getstats.
[74/703] Linking target tests/debugfs_test.
[75/703] Linking target tests/kms_atomic_transition.
[76/703] Linking target tests/drm_import_export.
[77/703] Linking target tests/drm_mm.
[78/703] Linking target tests/drm_read.
[79/703] Linking target tests/kms_3d.
[80/703] Linking target tests/kms_addfb_basic.
[81/703] Linking target tests/kms_atomic.
[82/703] Linking target tests/kms_atomic_interruptible.
[83/703] Linking target tests/kms_available_modes_crc.
[84/703] Compiling C object 'tests/tests@@kms_big_fb@exe/kms_big_fb.c.o'.
FAILED: tests/tests@@kms_big_fb@exe/kms_big_fb.c.o 
ccache cc -Itests/tests@@kms_big_fb@exe -Itests -I../tests -I../include/drm-uapi -Ilib -I../lib -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/igt/include -I/opt/igt/include/libdrm -I/usr/include/x86_64-linux-gnu -I/usr/include/alsa -I/usr/include -I/usr/include/libdrm -I/usr/include/libdrm/nouveau -I/home/cidrm/kernel_headers/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O2 -g -D_GNU_SOURCE -include config.h -D_FORTIFY_SOURCE=2 -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wimplicit-fallthrough=0 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -fno-builtin-malloc -fno-builtin-calloc -pthread  -MD -MQ 'tests/tests@@kms_big_fb@exe/kms_big_fb.c.o' -MF 'tests/tests@@kms_big_fb@exe/kms_big_fb.c.o.d' -o 'tests/tests@@kms_big_fb@exe/kms_big_fb.c.o' -c ../tests/kms_big_fb.c
../tests/kms_big_fb.c: In function ‘test_size_overflow’:
../tests/kms_big_fb.c:414:8: error: implicit declaration of function ‘__kms_addfb’ [-Werror=implicit-function-declaration]
  ret = __kms_addfb(data->drm_fd, bo,
        ^~~~~~~~~~~
../tests/kms_big_fb.c:414:8: warning: nested extern declaration of ‘__kms_addfb’ [-Wnested-externs]
cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.

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

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

* Re: [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper
  2019-05-27  1:19 ` [igt-dev] " Rodrigo Siqueira
@ 2019-05-27 10:13   ` Chris Wilson
  -1 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-05-27 10:13 UTC (permalink / raw)
  To: Arkadiusz Hiler, Petri Latvala, Rodrigo Siqueira, Simon Ser
  Cc: igt-dev, intel-gfx

Quoting Rodrigo Siqueira (2019-05-27 02:19:51)
> The function __kms_addfb() and drmModeAddFB2WithModifiers() have a
> similar code. Due to this similarity, this commit replaces all the
> occurrences of  __kms_addfb() by drmModeAddFB2WithModifiers() and adds
> the required adaptations.

No. There is a critical difference between the two: igt_ioctl. That
allows us to control the ioctl for error injection into the kernel.

If you want to test libdrm API and not the kernel, please add tests
to libdrm.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper
@ 2019-05-27 10:13   ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2019-05-27 10:13 UTC (permalink / raw)
  To: Arkadiusz Hiler, Petri Latvala, Rodrigo Siqueira, Simon Ser
  Cc: igt-dev, intel-gfx

Quoting Rodrigo Siqueira (2019-05-27 02:19:51)
> The function __kms_addfb() and drmModeAddFB2WithModifiers() have a
> similar code. Due to this similarity, this commit replaces all the
> occurrences of  __kms_addfb() by drmModeAddFB2WithModifiers() and adds
> the required adaptations.

No. There is a critical difference between the two: igt_ioctl. That
allows us to control the ioctl for error injection into the kernel.

If you want to test libdrm API and not the kernel, please add tests
to libdrm.
-Chris
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper
  2019-05-27 10:13   ` [igt-dev] " Chris Wilson
@ 2019-05-29 11:08     ` Rodrigo Siqueira
  -1 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2019-05-29 11:08 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Simon Ser, IGT GPU Tools, Intel GFX ML

Hi Chris,

Thank you for your feedback and the explanation about igt_ioctl, now
I've got it.

On Mon, May 27, 2019 at 7:13 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Quoting Rodrigo Siqueira (2019-05-27 02:19:51)
> > The function __kms_addfb() and drmModeAddFB2WithModifiers() have a
> > similar code. Due to this similarity, this commit replaces all the
> > occurrences of  __kms_addfb() by drmModeAddFB2WithModifiers() and adds
> > the required adaptations.
>
> No. There is a critical difference between the two: igt_ioctl. That
> allows us to control the ioctl for error injection into the kernel.
>
> If you want to test libdrm API and not the kernel, please add tests
> to libdrm.
> -Chris



-- 

Rodrigo Siqueira
https://siqueira.tech
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper
@ 2019-05-29 11:08     ` Rodrigo Siqueira
  0 siblings, 0 replies; 7+ messages in thread
From: Rodrigo Siqueira @ 2019-05-29 11:08 UTC (permalink / raw)
  To: Chris Wilson; +Cc: IGT GPU Tools, Intel GFX ML, Petri Latvala

Hi Chris,

Thank you for your feedback and the explanation about igt_ioctl, now
I've got it.

On Mon, May 27, 2019 at 7:13 AM Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> Quoting Rodrigo Siqueira (2019-05-27 02:19:51)
> > The function __kms_addfb() and drmModeAddFB2WithModifiers() have a
> > similar code. Due to this similarity, this commit replaces all the
> > occurrences of  __kms_addfb() by drmModeAddFB2WithModifiers() and adds
> > the required adaptations.
>
> No. There is a critical difference between the two: igt_ioctl. That
> allows us to control the ioctl for error injection into the kernel.
>
> If you want to test libdrm API and not the kernel, please add tests
> to libdrm.
> -Chris



-- 

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

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

end of thread, other threads:[~2019-05-29 11:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27  1:19 [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper Rodrigo Siqueira
2019-05-27  1:19 ` [igt-dev] " Rodrigo Siqueira
2019-05-27  1:38 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib: Drop __kms_addfb() wrapper (rev2) Patchwork
2019-05-27 10:13 ` [PATCH V3 i-g-t] lib: Drop __kms_addfb() wrapper Chris Wilson
2019-05-27 10:13   ` [igt-dev] " Chris Wilson
2019-05-29 11:08   ` Rodrigo Siqueira
2019-05-29 11:08     ` [igt-dev] " Rodrigo Siqueira

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.