lib/i915: Move mmap IOCTLs wrappers into separate file
Subsystems (2)
PATCH v2 1/1 lib/i915: Move mmap IOCTLs wrappers into separate file
Move all mmap flavours and support function to separate file in i915 folder. This helps with moving i915 specific functions away from common libraries.
v2:
- Autotools still exists. (Petri)
- Include gem_mman.h directly. (Chris)
--- benchmarks/gem_busy.c | 7 +- benchmarks/gem_exec_reloc.c | 6 +- benchmarks/gem_mmap.c | 6 +- benchmarks/gem_wsim.c | 11 +- lib/Makefile.sources | 2 + lib/i915/gem_mman.c | 254 ++++++++++++++++++++++++++++++++++++ lib/i915/gem_mman.h | 55 ++++++++ lib/igt.h | 1 + lib/igt_draw.c | 1 + lib/igt_dummyload.c | 1 + lib/igt_fb.c | 1 + lib/ioctl_wrappers.c | 213 ------------------------------ lib/ioctl_wrappers.h | 22 ---- lib/meson.build | 1 + tests/i915/gem_exec_reloc.c | 1 - tests/i915/gem_stolen.c | 9 +- tests/prime_mmap.c | 6 +- 17 files changed, 327 insertions(+), 270 deletions(-) create mode 100644 lib/i915/gem_mman.c create mode 100644 lib/i915/gem_mman.h
benchmarks/gem_busy.c +1 -6
@@ -39,12 +39,7 @@#include <sys/time.h> #include <time.h> -#include "drm.h" -#include "ioctl_wrappers.h" -#include "drmtest.h" -#include "intel_chipset.h" -#include "intel_reg.h" -#include "igt_stats.h" +#include "igt.h" #define LOCAL_I915_EXEC_NO_RELOC (1<<11)#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
benchmarks/gem_exec_reloc.c +2 -4
@@ -36,10 +36,8 @@#include <sys/stat.h> #include <sys/time.h> #include "drm.h" -#include "intel_reg.h" -#include "ioctl_wrappers.h" -#include "igt_debugfs.h" -#include "drmtest.h" + +#include "igt.h" #define LOCAL_I915_EXEC_NO_RELOC (1<<11)#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
benchmarks/gem_mmap.c +2 -4
@@ -39,10 +39,8 @@#include <time.h> #include "drm.h" -#include "ioctl_wrappers.h" -#include "drmtest.h" -#include "igt_aux.h" -#include "igt_stats.h" + +#include "igt.h" #define OBJECT_SIZE (1<<23)
benchmarks/gem_wsim.c +3 -8
@@ -41,19 +41,14 @@#include <limits.h> #include <pthread.h> - -#include "intel_chipset.h" -#include "intel_reg.h" #include "drm.h" -#include "ioctl_wrappers.h" -#include "drmtest.h" - -#include "intel_io.h" -#include "igt_aux.h" #include "igt_rand.h" #include "igt_perf.h" #include "sw_sync.h" +#include "igt.h" +#include "intel_reg.h" +#include "ewma.h" #define LOCAL_I915_EXEC_FENCE_IN (1<<16)
lib/Makefile.sources +2 -0
@@ -11,6 +11,8 @@ lib_source_list = \ i915/gem_submission.h \ i915/gem_ring.h \ i915/gem_ring.c \ + i915/gem_mman.c \ + i915/gem_mman.h \ i915_3d.h \ i915_reg.h \ i915_pciids.h \
lib/i915/gem_mman.c new file +254 -0
254 lines not on this page · raw message
lib/i915/gem_mman.h new file +55 -0
55 lines not on this page · raw message
lib/igt.h +1 -0
@@ -52,5 +52,6 @@#include "media_fill.h" #include "media_spin.h" #include "rendercopy.h" +#include "i915/gem_mman.h" #endif /* IGT_H */
lib/igt_draw.c +1 -0
@@ -33,6 +33,7 @@#include "igt_fb.h" #include "ioctl_wrappers.h" #include "i830_reg.h" +#include "i915/gem_mman.h" #ifndef PAGE_ALIGN #ifndef PAGE_SIZE
lib/igt_dummyload.c +1 -0
@@ -39,6 +39,7 @@#include "ioctl_wrappers.h" #include "sw_sync.h" #include "igt_vgem.h" +#include "i915/gem_mman.h" /** * SECTION:igt_dummyload
lib/igt_fb.c +1 -0
@@ -41,6 +41,7 @@#include "ioctl_wrappers.h" #include "intel_batchbuffer.h" #include "intel_chipset.h" +#include "i915/gem_mman.h" /** * SECTION:igt_fb
lib/ioctl_wrappers.c +0 -213
219 lines not on this page · raw message
lib/ioctl_wrappers.h +0 -22
@@ -84,22 +84,10 @@ int __gem_execbuf_wr(int fd, struct drm_i915_gem_execbuffer2 *execbuf);void gem_execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf);int __gem_execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf); -void *gem_mmap__gtt (int fd,uint32_t handle,uint64_t size,unsigned prot); -void *gem_mmap__cpu (int fd,uint32_t handle,uint64_t offset,uint64_t size,unsigned prot); - -bool gem_mmap__has_wc (int fd); -void *gem_mmap__wc (int fd,uint32_t handle,uint64_t offset,uint64_t size,unsigned prot); -#ifndef I915_GEM_DOMAIN_WC #define I915_GEM_DOMAIN_WC 0x80#endif -void *__gem_mmap__gtt (int fd,uint32_t handle,uint64_t size,unsigned prot); -void *__gem_mmap__cpu (int fd,uint32_t handle,uint64_t offset,uint64_t size,unsigned prot); -void *__gem_mmap__wc (int fd,uint32_t handle,uint64_t offset,uint64_t size,unsigned prot); - -int gem_munmap (void *ptr,uint64_t size); -/** * gem_require_stolen_support: * @fd: open i915 drm file descriptor
@@ -111,16 +99,6 @@ int gem_munmap(void *ptr, uint64_t size);igt_require (gem_create__has_stolen_support (fd) && \ (gem_total_stolen_size(fd) > 0)) -/** -* gem_require_mmap_wc: -* @fd: open i915 drm file descriptor -* -* Feature test macro to query whether direct (i.e. cpu access path, bypassing -* the gtt) write-combine memory mappings are available. Automatically skips -* through igt_require() if not. - */ -#define gem_require_mmap_wc (fd) igt_require(gem_mmap__has_wc(fd)) -int gem_madvise (int fd,uint32_t handle,int state);#define LOCAL_I915_GEM_USERPTR 0x33
lib/meson.build +1 -0
@@ -4,6 +4,7 @@ lib_sources = [ 'i915/gem_scheduler.c', 'i915/gem_submission.c', 'i915/gem_ring.c', + 'i915/gem_mman.c', 'igt_color_encoding.c', 'igt_debugfs.c', 'igt_device.c',
tests/i915/gem_exec_reloc.c +0 -1
@@ -22,7 +22,6 @@*/ #include "igt.h" -#include "igt_dummyload.h" IGT_TEST_DESCRIPTION ("Basic sanity check of execbuf-ioctl relocations." );
tests/i915/gem_stolen.c +2 -7
@@ -47,16 +47,11 @@#include <drm.h> -#include "ioctl_wrappers.h" -#include "intel_bufmgr.h" -#include "intel_batchbuffer.h" -#include "intel_io.h" -#include "intel_chipset.h" -#include "igt_aux.h" -#include "drmtest.h" #include "drm.h" #include "i915_drm.h" +#include "igt.h" +IGT_TEST_DESCRIPTION ("This test verifies the exetended gem_create ioctl," " that includes allocation of obj from stolen region" );#define CLEAR (s) memset(&s, 0, sizeof(s))
tests/prime_mmap.c +1 -5
@@ -40,11 +40,7 @@#include <sys/ioctl.h> #include <pthread.h> -#include "drm.h" -#include "i915_drm.h" -#include "drmtest.h" -#include "igt_debugfs.h" -#include "ioctl_wrappers.h" +#include "igt.h" #define BO_SIZE (16*1024)
Signature · 6 lines
2.20.1 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Antonio Argenziano (2019-02-26 17:01:59)
Quoted 37 lines
Move all mmap flavours and support function to separate file in i915 folder. This helps with moving i915 specific functions away from common libraries.
v2:
- Autotools still exists. (Petri)
- Includegem_mman.hdirectly. (Chris)Signed-off-by Antonio Argenziano <[email protected]>Cc Chris Wilson <[email protected]>--- benchmarks/gem_busy.c | 7 +- benchmarks/gem_exec_reloc.c | 6 +- benchmarks/gem_mmap.c | 6 +- benchmarks/gem_wsim.c | 11 +- lib/Makefile.sources | 2 + lib/i915/gem_mman.c | 254 ++++++++++++++++++++++++++++++++++++ lib/i915/gem_mman.h | 55 ++++++++ lib/igt.h | 1 + lib/igt_draw.c | 1 + lib/igt_dummyload.c | 1 + lib/igt_fb.c | 1 + lib/ioctl_wrappers.c | 213 ------------------------------ lib/ioctl_wrappers.h | 22 ---- lib/meson.build | 1 + tests/i915/gem_exec_reloc.c | 1 - tests/i915/gem_stolen.c | 9 +- tests/prime_mmap.c | 6 +- 17 files changed, 327 insertions(+), 270 deletions(-) create mode 100644 lib/i915/gem_mman.c create mode 100644 lib/i915/gem_mman.hbenchmarks/gem_busy.c +0
-0
benchmarks/gem_busy.c line 42
Quoted 10 lines
benchmarks/gem_busy.c +1
-6@@ -39,12 +39,7 @@#include <sys/time.h> #include <time.h> -#include "drm.h" -#include "ioctl_wrappers.h" -#include "drmtest.h" -#include "intel_chipset.h" -#include "intel_reg.h" -#include "igt_stats.h" +#include "igt.h"
Nope. That should never have happened. Keep dependencies explicit and headers standalone.
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoted 41 lines · Chris Wilson
Quoting Antonio Argenziano (2019-02-26 17:01:59)
Quoted 40 lines
Move all mmap flavours and support function to separate file in i915 folder. This helps with moving i915 specific functions away from common libraries.
v2:
- Autotools still exists. (Petri)
- Includegem_mman.hdirectly. (Chris)Signed-off-by Antonio Argenziano <[email protected]>Cc Chris Wilson <[email protected]>--- benchmarks/gem_busy.c | 7 +- benchmarks/gem_exec_reloc.c | 6 +- benchmarks/gem_mmap.c | 6 +- benchmarks/gem_wsim.c | 11 +- lib/Makefile.sources | 2 + lib/i915/gem_mman.c | 254 ++++++++++++++++++++++++++++++++++++ lib/i915/gem_mman.h | 55 ++++++++ lib/igt.h | 1 + lib/igt_draw.c | 1 + lib/igt_dummyload.c | 1 + lib/igt_fb.c | 1 + lib/ioctl_wrappers.c | 213 ------------------------------ lib/ioctl_wrappers.h | 22 ---- lib/meson.build | 1 + tests/i915/gem_exec_reloc.c | 1 - tests/i915/gem_stolen.c | 9 +- tests/prime_mmap.c | 6 +- 17 files changed, 327 insertions(+), 270 deletions(-)create mode 100644
lib/i915/gem_mman.c
create mode 100644lib/i915/gem_mman.hbenchmarks/gem_busy.c +0
-0@@ -39,12 +39,7 @@#include <sys/time.h> #include <time.h>
Quoted 10 lines
benchmarks/gem_busy.c line 42
Quoted 7 lines
benchmarks/gem_busy.c +1
-6-#include "drm.h" -#include "ioctl_wrappers.h" -#include "drmtest.h" -#include "intel_chipset.h" -#include "intel_reg.h" -#include "igt_stats.h" +#include "igt.h" Nope. That should never have happened. Keep dependencies explicit and headers standalone.
Everywhere or just in benchmark/?
Antonio
Quoted 2 lines
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Antonio Argenziano (2019-02-26 17:13:47)
Quoted 55 lines · Chris Wilson
Quoted 41 lines
Quoting Antonio Argenziano (2019-02-26 17:01:59)
Quoted 40 lines
Move all mmap flavours and support function to separate file in i915 folder. This helps with moving i915 specific functions away from common libraries.
v2:
- Autotools still exists. (Petri)
- Includegem_mman.hdirectly. (Chris)Signed-off-by Antonio Argenziano <[email protected]>Cc Chris Wilson <[email protected]>--- benchmarks/gem_busy.c | 7 +- benchmarks/gem_exec_reloc.c | 6 +- benchmarks/gem_mmap.c | 6 +- benchmarks/gem_wsim.c | 11 +- lib/Makefile.sources | 2 + lib/i915/gem_mman.c | 254 ++++++++++++++++++++++++++++++++++++ lib/i915/gem_mman.h | 55 ++++++++ lib/igt.h | 1 + lib/igt_draw.c | 1 + lib/igt_dummyload.c | 1 + lib/igt_fb.c | 1 + lib/ioctl_wrappers.c | 213 ------------------------------ lib/ioctl_wrappers.h | 22 ---- lib/meson.build | 1 + tests/i915/gem_exec_reloc.c | 1 - tests/i915/gem_stolen.c | 9 +- tests/prime_mmap.c | 6 +- 17 files changed, 327 insertions(+), 270 deletions(-)create mode 100644
lib/i915/gem_mman.c
create mode 100644lib/i915/gem_mman.hbenchmarks/gem_busy.c +0
-0@@ -39,12 +39,7 @@#include <sys/time.h> #include <time.h> Quoted 10 lines
benchmarks/gem_busy.c line 42
Quoted 7 lines
benchmarks/gem_busy.c +1
-6-#include "drm.h" -#include "ioctl_wrappers.h" -#include "drmtest.h" -#include "intel_chipset.h" -#include "intel_reg.h" -#include "igt_stats.h" +#include "igt.h" Nope. That should never have happened. Keep dependencies explicit and headers standalone.
Quoted 1 line
Everywhere or just in benchmark/?
I'm denying igt.h even exists because I'm too lazy to git rm. So everywhere...
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev