Skip to contentSkip to conversation

Add an editorconfig file for the basics of igt style.

PATCH In review Eric Anholt 2 participants 3 messages Jun 7, 2017 – Jun 8, 2017 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Add an editorconfig file for the basics of igt style.

This makes my emacs default to consistent indentation for the project.

---
 .editorconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 .editorconfig
.editorconfig new file +9 -0
new file mode 100644
index 000000000000..bdfebacaf4cd
@@ -0,0 +1,9 @@
+[*]
+tab_width = 8
+
+[{Makefile*,*.mk}]
+indent_style = tab
+
+[*.{c,h,cpp,hpp,cc,hh}]
+indent_style = tab
+indent_size = 8
Signature · 6 lines
2.11.0

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

PATCH 2/2 igt/vc4_tiling: Test vc4's new set/get_tiling ioctls.

This just checks that the appropriate errors get thrown, and that the modifier can be set/get successfully, and that the modifier doesn't leak to other BO allocations. Testing of scanout will be done with the writeback support that Boris is building. The modifier has no effect on V3D rendering, so no need to test that.

---
 lib/igt_vc4.c          |  21 ++++++++
 lib/igt_vc4.h          |   3 ++
 tests/Makefile.am      |   2 +
 tests/Makefile.sources |   1 +
 tests/vc4_tiling.c     | 137 +++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 164 insertions(+)
 create mode 100644 tests/vc4_tiling.c
lib/igt_vc4.c +21 -0
index c4682f5688f1..5347af8df400 100644
@@ -128,3 +128,24 @@ igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot)
 	else
 		return ptr;
 }
+
+void igt_vc4_set_tiling(int fd, uint32_t handle, uint64_t modifier)
+{
+	struct drm_vc4_set_tiling set = {
+		.handle = handle,
+		.modifier = modifier,
+	};
+
+	do_ioctl(fd, DRM_IOCTL_VC4_SET_TILING, &set);
+}
+
+uint64_t igt_vc4_get_tiling(int fd, uint32_t handle)
+{
+	struct drm_vc4_get_tiling get = {
+		.handle = handle,
+	};
+
+	do_ioctl(fd, DRM_IOCTL_VC4_GET_TILING, &get);
+
+	return get.modifier;
+}
lib/igt_vc4.h +3 -0
index e9252461c951..d1740b93f1fc 100644
@@ -28,4 +28,7 @@ uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval);
 int igt_vc4_create_bo(int fd, size_t size);
 void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
 
+void igt_vc4_set_tiling(int fd, uint32_t handle, uint64_t modifier);
+uint64_t igt_vc4_get_tiling(int fd, uint32_t handle);
+
 #endif /* IGT_VC4_H */
tests/Makefile.am +2 -0
index 12cc6dc48c12..0de12e204080 100644
@@ -126,6 +126,8 @@ vc4_lookup_fail_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS)
 vc4_lookup_fail_LDADD = $(LDADD) $(DRM_VC4_LIBS)
 vc4_dmabuf_poll_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS)
 vc4_dmabuf_poll_LDADD = $(LDADD) $(DRM_VC4_LIBS)
+vc4_tiling_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS)
+vc4_tiling_LDADD = $(LDADD) $(DRM_VC4_LIBS)
 vc4_wait_bo_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS)
 vc4_wait_bo_LDADD = $(LDADD) $(DRM_VC4_LIBS)
 vc4_wait_seqno_CFLAGS = $(AM_CFLAGS) $(DRM_VC4_CFLAGS)
tests/Makefile.sources +1 -0
index b3a680e9d75e..6d3c539b4041 100644
@@ -8,6 +8,7 @@ VC4_TESTS_M = \
 	vc4_create_bo \
 	vc4_dmabuf_poll \
 	vc4_lookup_fail \
+	vc4_tiling \
 	vc4_wait_bo \
 	vc4_wait_seqno \
 	$(NULL)
tests/vc4_tiling.c new file +137 -0

137 lines not on this page · raw message

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/2
#2 lore raw
In reply to Eric Anholt

Just when I was looking at the hell of writing a .dir-locals.el...

Editorconfig was new to me, thanks for this!

.editorconfig

Quoted 14 lines · Eric Anholt

This makes my emacs default to consistent indentation for the project.

---
 .editorconfig | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 .editorconfig
.editorconfig new file +0 -0
new file mode 100644
index 000000000000..bdfebacaf4cd
@@ -0,0 +1,9 @@

Add a header that links to the website like in Mesa's .editorconfig:

# To use this config on you editor, follow the instructions at:
# http://editorconfig.org

Also add

root = true

With those,

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