Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Move more GEM objects under gem/

Continuing the theme of separating out the GEM clutter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190528092956.14910-8-chris@chris-wilson.co.uk

+394 -753
+13 -13
drivers/gpu/drm/i915/Makefile
··· 87 87 # GEM (Graphics Execution Management) code 88 88 obj-y += gem/ 89 89 gem-y += \ 90 + gem/i915_gem_clflush.o \ 91 + gem/i915_gem_context.o \ 92 + gem/i915_gem_dmabuf.o \ 90 93 gem/i915_gem_domain.o \ 94 + gem/i915_gem_execbuffer.o \ 95 + gem/i915_gem_internal.o \ 91 96 gem/i915_gem_object.o \ 92 97 gem/i915_gem_mman.o \ 93 98 gem/i915_gem_pages.o \ 94 99 gem/i915_gem_phys.o \ 95 - gem/i915_gem_shmem.o 100 + gem/i915_gem_pm.o \ 101 + gem/i915_gem_shmem.o \ 102 + gem/i915_gem_shrinker.o \ 103 + gem/i915_gem_stolen.o \ 104 + gem/i915_gem_tiling.o \ 105 + gem/i915_gem_userptr.o \ 106 + gem/i915_gemfs.o 96 107 i915-y += \ 97 108 $(gem-y) \ 98 109 i915_active.o \ 99 110 i915_cmd_parser.o \ 100 111 i915_gem_batch_pool.o \ 101 - i915_gem_clflush.o \ 102 - i915_gem_context.o \ 103 - i915_gem_dmabuf.o \ 104 112 i915_gem_evict.o \ 105 - i915_gem_execbuffer.o \ 106 113 i915_gem_fence_reg.o \ 107 114 i915_gem_gtt.o \ 108 - i915_gem_internal.o \ 109 115 i915_gem.o \ 110 - i915_gem_pm.o \ 111 116 i915_gem_render_state.o \ 112 - i915_gem_shrinker.o \ 113 - i915_gem_stolen.o \ 114 - i915_gem_tiling.o \ 115 - i915_gem_userptr.o \ 116 - i915_gemfs.o \ 117 117 i915_globals.o \ 118 118 i915_query.o \ 119 119 i915_request.o \ ··· 199 199 # Post-mortem debug and GPU hang state capture 200 200 i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o 201 201 i915-$(CONFIG_DRM_I915_SELFTEST) += \ 202 + gem/selftests/igt_gem_utils.o \ 202 203 selftests/i915_random.o \ 203 204 selftests/i915_selftest.o \ 204 205 selftests/igt_flush_test.o \ 205 - selftests/igt_gem_utils.o \ 206 206 selftests/igt_live_test.o \ 207 207 selftests/igt_reset.o \ 208 208 selftests/igt_spinner.o
-2
drivers/gpu/drm/i915/Makefile.header-test
··· 6 6 i915_active_types.h \ 7 7 i915_debugfs.h \ 8 8 i915_drv.h \ 9 - i915_gem_context_types.h \ 10 - i915_gem_pm.h \ 11 9 i915_irq.h \ 12 10 i915_params.h \ 13 11 i915_priolist_types.h \
+20
drivers/gpu/drm/i915/gem/i915_gem_clflush.h
··· 1 + /* 2 + * SPDX-License-Identifier: MIT 3 + * 4 + * Copyright © 2016 Intel Corporation 5 + */ 6 + 7 + #ifndef __I915_GEM_CLFLUSH_H__ 8 + #define __I915_GEM_CLFLUSH_H__ 9 + 10 + #include <linux/types.h> 11 + 12 + struct drm_i915_private; 13 + struct drm_i915_gem_object; 14 + 15 + bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, 16 + unsigned int flags); 17 + #define I915_CLFLUSH_FORCE BIT(0) 18 + #define I915_CLFLUSH_SYNC BIT(1) 19 + 20 + #endif /* __I915_GEM_CLFLUSH_H__ */
+9 -1
drivers/gpu/drm/i915/gem/i915_gem_object.c
··· 23 23 */ 24 24 25 25 #include "i915_drv.h" 26 - #include "i915_gem_object.h" 27 26 #include "i915_gem_clflush.h" 27 + #include "i915_gem_context.h" 28 + #include "i915_gem_object.h" 28 29 #include "i915_globals.h" 29 30 #include "intel_frontbuffer.h" 30 31 ··· 443 442 i915_global_register(&global.base); 444 443 return 0; 445 444 } 445 + 446 + #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) 447 + #include "selftests/huge_gem_object.c" 448 + #include "selftests/huge_pages.c" 449 + #include "selftests/i915_gem_object.c" 450 + #include "selftests/i915_gem_coherency.c" 451 + #endif
+57
drivers/gpu/drm/i915/gem/i915_gemfs.c
··· 1 + /* 2 + * SPDX-License-Identifier: MIT 3 + * 4 + * Copyright © 2017 Intel Corporation 5 + */ 6 + 7 + #include <linux/fs.h> 8 + #include <linux/mount.h> 9 + #include <linux/pagemap.h> 10 + 11 + #include "i915_drv.h" 12 + #include "i915_gemfs.h" 13 + 14 + int i915_gemfs_init(struct drm_i915_private *i915) 15 + { 16 + struct file_system_type *type; 17 + struct vfsmount *gemfs; 18 + 19 + type = get_fs_type("tmpfs"); 20 + if (!type) 21 + return -ENODEV; 22 + 23 + gemfs = kern_mount(type); 24 + if (IS_ERR(gemfs)) 25 + return PTR_ERR(gemfs); 26 + 27 + /* 28 + * Enable huge-pages for objects that are at least HPAGE_PMD_SIZE, most 29 + * likely 2M. Note that within_size may overallocate huge-pages, if say 30 + * we allocate an object of size 2M + 4K, we may get 2M + 2M, but under 31 + * memory pressure shmem should split any huge-pages which can be 32 + * shrunk. 33 + */ 34 + 35 + if (has_transparent_hugepage()) { 36 + struct super_block *sb = gemfs->mnt_sb; 37 + /* FIXME: Disabled until we get W/A for read BW issue. */ 38 + char options[] = "huge=never"; 39 + int flags = 0; 40 + int err; 41 + 42 + err = sb->s_op->remount_fs(sb, &flags, options); 43 + if (err) { 44 + kern_unmount(gemfs); 45 + return err; 46 + } 47 + } 48 + 49 + i915->mm.gemfs = gemfs; 50 + 51 + return 0; 52 + } 53 + 54 + void i915_gemfs_fini(struct drm_i915_private *i915) 55 + { 56 + kern_unmount(i915->mm.gemfs); 57 + }
+16
drivers/gpu/drm/i915/gem/i915_gemfs.h
··· 1 + /* 2 + * SPDX-License-Identifier: MIT 3 + * 4 + * Copyright © 2017 Intel Corporation 5 + */ 6 + 7 + #ifndef __I915_GEMFS_H__ 8 + #define __I915_GEMFS_H__ 9 + 10 + struct drm_i915_private; 11 + 12 + int i915_gemfs_init(struct drm_i915_private *i915); 13 + 14 + void i915_gemfs_fini(struct drm_i915_private *i915); 15 + 16 + #endif
+27
drivers/gpu/drm/i915/gem/selftests/huge_gem_object.h
··· 1 + /* 2 + * SPDX-License-Identifier: MIT 3 + * 4 + * Copyright © 2016 Intel Corporation 5 + */ 6 + 7 + #ifndef __HUGE_GEM_OBJECT_H 8 + #define __HUGE_GEM_OBJECT_H 9 + 10 + struct drm_i915_gem_object * 11 + huge_gem_object(struct drm_i915_private *i915, 12 + phys_addr_t phys_size, 13 + dma_addr_t dma_size); 14 + 15 + static inline phys_addr_t 16 + huge_gem_object_phys_size(struct drm_i915_gem_object *obj) 17 + { 18 + return obj->scratch; 19 + } 20 + 21 + static inline dma_addr_t 22 + huge_gem_object_dma_size(struct drm_i915_gem_object *obj) 23 + { 24 + return obj->base.size; 25 + } 26 + 27 + #endif /* !__HUGE_GEM_OBJECT_H */
+1 -1
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
··· 7 7 #include <linux/prime_numbers.h> 8 8 9 9 #include "gt/intel_gt_pm.h" 10 + #include "huge_gem_object.h" 10 11 #include "i915_selftest.h" 11 - #include "selftests/huge_gem_object.h" 12 12 #include "selftests/igt_flush_test.h" 13 13 14 14 struct tile {
+24
drivers/gpu/drm/i915/gem/selftests/mock_context.h
··· 1 + /* 2 + * SPDX-License-Identifier: MIT 3 + * 4 + * Copyright © 2016 Intel Corporation 5 + */ 6 + 7 + #ifndef __MOCK_CONTEXT_H 8 + #define __MOCK_CONTEXT_H 9 + 10 + void mock_init_contexts(struct drm_i915_private *i915); 11 + 12 + struct i915_gem_context * 13 + mock_context(struct drm_i915_private *i915, 14 + const char *name); 15 + 16 + void mock_context_close(struct i915_gem_context *ctx); 17 + 18 + struct i915_gem_context * 19 + live_context(struct drm_i915_private *i915, struct drm_file *file); 20 + 21 + struct i915_gem_context *kernel_context(struct drm_i915_private *i915); 22 + void kernel_context_close(struct i915_gem_context *ctx); 23 + 24 + #endif /* !__MOCK_CONTEXT_H */
+22
drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.h
··· 1 + /* 2 + * SPDX-License-Identifier: MIT 3 + * 4 + * Copyright © 2016 Intel Corporation 5 + */ 6 + 7 + #ifndef __MOCK_DMABUF_H__ 8 + #define __MOCK_DMABUF_H__ 9 + 10 + #include <linux/dma-buf.h> 11 + 12 + struct mock_dmabuf { 13 + int npages; 14 + struct page *pages[]; 15 + }; 16 + 17 + static struct mock_dmabuf *to_mock(struct dma_buf *buf) 18 + { 19 + return buf->priv; 20 + } 21 + 22 + #endif /* !__MOCK_DMABUF_H__ */
+3 -1
drivers/gpu/drm/i915/gt/intel_context.c
··· 4 4 * Copyright © 2019 Intel Corporation 5 5 */ 6 6 7 + #include "gem/i915_gem_context.h" 8 + #include "gem/i915_gem_pm.h" 9 + 7 10 #include "i915_drv.h" 8 - #include "i915_gem_context.h" 9 11 #include "i915_globals.h" 10 12 11 13 #include "intel_context.h"
+3
drivers/gpu/drm/i915/gt/intel_engine_cs.c
··· 24 24 25 25 #include <drm/drm_print.h> 26 26 27 + #include "gem/i915_gem_context.h" 28 + 27 29 #include "i915_drv.h" 28 30 29 31 #include "intel_engine.h" 30 32 #include "intel_engine_pm.h" 33 + #include "intel_context.h" 31 34 #include "intel_lrc.h" 32 35 #include "intel_reset.h" 33 36
+2
drivers/gpu/drm/i915/gt/intel_lrc.c
··· 133 133 */ 134 134 #include <linux/interrupt.h> 135 135 136 + #include "gem/i915_gem_context.h" 137 + 136 138 #include "i915_drv.h" 137 139 #include "i915_gem_render_state.h" 138 140 #include "i915_vgpu.h"
+9 -5
drivers/gpu/drm/i915/gt/intel_lrc.h
··· 24 24 #ifndef _INTEL_LRC_H_ 25 25 #define _INTEL_LRC_H_ 26 26 27 - #include "intel_engine.h" 27 + #include <linux/types.h> 28 + 29 + struct drm_printer; 30 + 31 + struct drm_i915_private; 32 + struct i915_gem_context; 33 + struct i915_request; 34 + struct intel_context; 35 + struct intel_engine_cs; 28 36 29 37 /* Execlists regs */ 30 38 #define RING_ELSP(base) _MMIO((base) + 0x230) ··· 103 95 * the size of the header is synonymous with the start of the PPHWSP. 104 96 */ 105 97 #define LRC_HEADER_PAGES LRC_PPHWSP_PN 106 - 107 - struct drm_printer; 108 - 109 - struct drm_i915_private; 110 98 111 99 void intel_execlists_set_default_submission(struct intel_engine_cs *engine); 112 100
+2
drivers/gpu/drm/i915/gt/intel_reset.c
··· 7 7 #include <linux/sched/mm.h> 8 8 #include <linux/stop_machine.h> 9 9 10 + #include "gem/i915_gem_context.h" 11 + 10 12 #include "i915_drv.h" 11 13 #include "i915_gpu_error.h" 12 14 #include "i915_irq.h"
+3
drivers/gpu/drm/i915/gt/intel_ringbuffer.c
··· 31 31 32 32 #include <drm/i915_drm.h> 33 33 34 + #include "gem/i915_gem_context.h" 35 + 34 36 #include "i915_drv.h" 35 37 #include "i915_gem_render_state.h" 36 38 #include "i915_trace.h" 39 + #include "intel_context.h" 37 40 #include "intel_reset.h" 38 41 #include "intel_workarounds.h" 39 42
+1
drivers/gpu/drm/i915/gt/intel_workarounds.c
··· 5 5 */ 6 6 7 7 #include "i915_drv.h" 8 + #include "intel_context.h" 8 9 #include "intel_workarounds.h" 9 10 10 11 /**
+2 -1
drivers/gpu/drm/i915/gt/mock_engine.c
··· 22 22 * 23 23 */ 24 24 25 + #include "gem/i915_gem_context.h" 26 + 25 27 #include "i915_drv.h" 26 - #include "i915_gem_context.h" 27 28 #include "intel_context.h" 28 29 #include "intel_engine_pm.h" 29 30
+4 -2
drivers/gpu/drm/i915/gt/selftest_hangcheck.c
··· 24 24 25 25 #include <linux/kthread.h> 26 26 27 + #include "gem/i915_gem_context.h" 27 28 #include "intel_engine_pm.h" 28 29 29 30 #include "i915_selftest.h" 30 31 #include "selftests/i915_random.h" 31 32 #include "selftests/igt_flush_test.h" 32 - #include "selftests/igt_gem_utils.h" 33 33 #include "selftests/igt_reset.h" 34 34 #include "selftests/igt_wedge_me.h" 35 35 #include "selftests/igt_atomic.h" 36 36 37 - #include "selftests/mock_context.h" 38 37 #include "selftests/mock_drm.h" 38 + 39 + #include "gem/selftests/mock_context.h" 40 + #include "gem/selftests/igt_gem_utils.h" 39 41 40 42 #define IGT_IDLE_TIMEOUT 50 /* ms; time to wait after flushing between tests */ 41 43
+5 -2
drivers/gpu/drm/i915/gt/selftest_lrc.c
··· 6 6 7 7 #include <linux/prime_numbers.h> 8 8 9 + #include "gem/i915_gem_pm.h" 9 10 #include "gt/intel_reset.h" 11 + 10 12 #include "i915_selftest.h" 11 13 #include "selftests/i915_random.h" 12 14 #include "selftests/igt_flush_test.h" 13 - #include "selftests/igt_gem_utils.h" 14 15 #include "selftests/igt_live_test.h" 15 16 #include "selftests/igt_spinner.h" 16 17 #include "selftests/lib_sw_fence.h" 17 - #include "selftests/mock_context.h" 18 + 19 + #include "gem/selftests/igt_gem_utils.h" 20 + #include "gem/selftests/mock_context.h" 18 21 19 22 static int live_sanitycheck(void *arg) 20 23 {
+4 -2
drivers/gpu/drm/i915/gt/selftest_workarounds.c
··· 4 4 * Copyright © 2018 Intel Corporation 5 5 */ 6 6 7 + #include "gem/i915_gem_pm.h" 7 8 #include "i915_selftest.h" 8 9 #include "intel_reset.h" 9 10 10 11 #include "selftests/igt_flush_test.h" 11 - #include "selftests/igt_gem_utils.h" 12 12 #include "selftests/igt_reset.h" 13 13 #include "selftests/igt_spinner.h" 14 14 #include "selftests/igt_wedge_me.h" 15 - #include "selftests/mock_context.h" 16 15 #include "selftests/mock_drm.h" 16 + 17 + #include "gem/selftests/igt_gem_utils.h" 18 + #include "gem/selftests/mock_context.h" 17 19 18 20 static const struct wo_register { 19 21 enum intel_platform platform;
+1
drivers/gpu/drm/i915/gvt/mmio_context.c
··· 34 34 */ 35 35 36 36 #include "i915_drv.h" 37 + #include "gt/intel_context.h" 37 38 #include "gvt.h" 38 39 #include "trace.h" 39 40
+4 -1
drivers/gpu/drm/i915/gvt/scheduler.c
··· 35 35 36 36 #include <linux/kthread.h> 37 37 38 + #include "gem/i915_gem_context.h" 39 + #include "gem/i915_gem_pm.h" 40 + #include "gt/intel_context.h" 41 + 38 42 #include "i915_drv.h" 39 - #include "i915_gem_pm.h" 40 43 #include "gvt.h" 41 44 42 45 #define RING_CTX_OFF(x) \
+1 -1
drivers/gpu/drm/i915/i915_debugfs.c
··· 32 32 #include <drm/drm_debugfs.h> 33 33 #include <drm/drm_fourcc.h> 34 34 35 + #include "gem/i915_gem_context.h" 35 36 #include "gt/intel_reset.h" 36 37 37 38 #include "i915_debugfs.h" 38 - #include "i915_gem_context.h" 39 39 #include "i915_irq.h" 40 40 #include "intel_csr.h" 41 41 #include "intel_dp.h"
+1
drivers/gpu/drm/i915/i915_drv.c
··· 47 47 #include <drm/drm_probe_helper.h> 48 48 #include <drm/i915_drm.h> 49 49 50 + #include "gem/i915_gem_context.h" 50 51 #include "gem/i915_gem_ioctls.h" 51 52 #include "gt/intel_gt_pm.h" 52 53 #include "gt/intel_reset.h"
+1 -1
drivers/gpu/drm/i915/i915_drv.h
··· 80 80 #include "intel_wopcm.h" 81 81 82 82 #include "i915_gem.h" 83 - #include "i915_gem_context.h" 83 + #include "gem/i915_gem_context_types.h" 84 84 #include "i915_gem_fence_reg.h" 85 85 #include "i915_gem_gtt.h" 86 86 #include "i915_gpu_error.h"
+4 -7
drivers/gpu/drm/i915/i915_gem.c
··· 38 38 #include <linux/dma-buf.h> 39 39 #include <linux/mman.h> 40 40 41 + #include "gem/i915_gem_clflush.h" 42 + #include "gem/i915_gem_context.h" 41 43 #include "gem/i915_gem_ioctls.h" 44 + #include "gem/i915_gem_pm.h" 45 + #include "gem/i915_gemfs.h" 42 46 #include "gt/intel_engine_pm.h" 43 47 #include "gt/intel_gt_pm.h" 44 48 #include "gt/intel_mocs.h" ··· 50 46 #include "gt/intel_workarounds.h" 51 47 52 48 #include "i915_drv.h" 53 - #include "i915_gem_clflush.h" 54 - #include "i915_gemfs.h" 55 - #include "i915_gem_pm.h" 56 49 #include "i915_trace.h" 57 50 #include "i915_vgpu.h" 58 51 ··· 2372 2371 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST) 2373 2372 #include "selftests/scatterlist.c" 2374 2373 #include "selftests/mock_gem_device.c" 2375 - #include "selftests/huge_gem_object.c" 2376 - #include "selftests/huge_pages.c" 2377 - #include "selftests/i915_gem_object.c" 2378 - #include "selftests/i915_gem_coherency.c" 2379 2374 #include "selftests/i915_gem.c" 2380 2375 #endif
+3 -21
drivers/gpu/drm/i915/i915_gem_clflush.c drivers/gpu/drm/i915/gem/i915_gem_clflush.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include "i915_drv.h" 26 - #include "intel_frontbuffer.h" 27 8 #include "i915_gem_clflush.h" 9 + #include "intel_frontbuffer.h" 28 10 29 11 static DEFINE_SPINLOCK(clflush_lock); 30 12
-36
drivers/gpu/drm/i915/i915_gem_clflush.h
··· 1 - /* 2 - * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - */ 24 - 25 - #ifndef __I915_GEM_CLFLUSH_H__ 26 - #define __I915_GEM_CLFLUSH_H__ 27 - 28 - struct drm_i915_private; 29 - struct drm_i915_gem_object; 30 - 31 - bool i915_gem_clflush_object(struct drm_i915_gem_object *obj, 32 - unsigned int flags); 33 - #define I915_CLFLUSH_FORCE BIT(0) 34 - #define I915_CLFLUSH_SYNC BIT(1) 35 - 36 - #endif /* __I915_GEM_CLFLUSH_H__ */
+3 -24
drivers/gpu/drm/i915/i915_gem_context.c drivers/gpu/drm/i915/gem/i915_gem_context.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2011-2012 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - * Authors: 24 - * Ben Widawsky <ben@bwidawsk.net> 25 - * 26 5 */ 27 6 28 7 /* ··· 71 92 72 93 #include "gt/intel_lrc_reg.h" 73 94 74 - #include "i915_drv.h" 95 + #include "i915_gem_context.h" 75 96 #include "i915_globals.h" 76 97 #include "i915_trace.h" 77 98 #include "i915_user_extensions.h"
+2 -20
drivers/gpu/drm/i915/i915_gem_context.h drivers/gpu/drm/i915/gem/i915_gem_context.h
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #ifndef __I915_GEM_CONTEXT_H__
drivers/gpu/drm/i915/i915_gem_context_types.h drivers/gpu/drm/i915/gem/i915_gem_context_types.h
+4 -23
drivers/gpu/drm/i915/i915_gem_dmabuf.c drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright 2012 Red Hat Inc 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 - * DEALINGS IN THE SOFTWARE. 22 - * 23 - * Authors: 24 - * Dave Airlie <airlied@redhat.com> 25 5 */ 26 6 27 7 #include <linux/dma-buf.h> 8 + #include <linux/highmem.h> 28 9 #include <linux/reservation.h> 29 10 30 - 31 11 #include "i915_drv.h" 12 + #include "i915_gem_object.h" 32 13 33 14 static struct drm_i915_gem_object *dma_buf_to_obj(struct dma_buf *buf) 34 15 {
+2
drivers/gpu/drm/i915/i915_gem_evict.c
··· 28 28 29 29 #include <drm/i915_drm.h> 30 30 31 + #include "gem/i915_gem_context.h" 32 + 31 33 #include "i915_drv.h" 32 34 #include "intel_drv.h" 33 35 #include "i915_trace.h"
+5 -25
drivers/gpu/drm/i915/i915_gem_execbuffer.c drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2008,2010 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - * Authors: 24 - * Eric Anholt <eric@anholt.net> 25 - * Chris Wilson <chris@chris-wilson.co.uk> 26 - * 27 5 */ 28 6 29 7 #include <linux/intel-iommu.h> ··· 13 35 #include <drm/i915_drm.h> 14 36 15 37 #include "gem/i915_gem_ioctls.h" 38 + #include "gt/intel_context.h" 16 39 #include "gt/intel_gt_pm.h" 17 40 18 - #include "i915_drv.h" 41 + #include "i915_gem_ioctls.h" 19 42 #include "i915_gem_clflush.h" 43 + #include "i915_gem_context.h" 20 44 #include "i915_trace.h" 21 45 #include "intel_drv.h" 22 46 #include "intel_frontbuffer.h"
+10 -20
drivers/gpu/drm/i915/i915_gem_internal.c drivers/gpu/drm/i915/gem/i915_gem_internal.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2014-2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 7 + #include <linux/scatterlist.h> 8 + #include <linux/slab.h> 9 + #include <linux/swiotlb.h> 10 + 25 11 #include <drm/i915_drm.h> 12 + 26 13 #include "i915_drv.h" 14 + #include "i915_gem.h" 15 + #include "i915_gem_object.h" 16 + #include "i915_utils.h" 27 17 28 18 #define QUIET (__GFP_NORETRY | __GFP_NOWARN) 29 19 #define MAYFAIL (__GFP_RETRY_MAYFAIL | __GFP_NOWARN)
+1 -1
drivers/gpu/drm/i915/i915_gem_pm.c drivers/gpu/drm/i915/gem/i915_gem_pm.c
··· 4 4 * Copyright © 2019 Intel Corporation 5 5 */ 6 6 7 + #include "gem/i915_gem_pm.h" 7 8 #include "gt/intel_gt_pm.h" 8 9 9 10 #include "i915_drv.h" 10 - #include "i915_gem_pm.h" 11 11 #include "i915_globals.h" 12 12 13 13 static void i915_gem_park(struct drm_i915_private *i915)
drivers/gpu/drm/i915/i915_gem_pm.h drivers/gpu/drm/i915/gem/i915_gem_pm.h
+2 -21
drivers/gpu/drm/i915/i915_gem_shrinker.c drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2008-2015 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include <linux/oom.h> ··· 14 32 #include <linux/vmalloc.h> 15 33 #include <drm/i915_drm.h> 16 34 17 - #include "i915_drv.h" 18 35 #include "i915_trace.h" 19 36 20 37 static bool shrinker_lock(struct drm_i915_private *i915,
+7 -24
drivers/gpu/drm/i915/i915_gem_stolen.c drivers/gpu/drm/i915/gem/i915_gem_stolen.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2008-2012 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - * Authors: 24 - * Eric Anholt <eric@anholt.net> 25 - * Chris Wilson <chris@chris-wilson.co.uk> 26 - * 27 5 */ 28 6 7 + #include <linux/errno.h> 8 + #include <linux/mutex.h> 9 + 10 + #include <drm/drm_mm.h> 29 11 #include <drm/i915_drm.h> 12 + 30 13 #include "i915_drv.h" 31 14 32 15 /*
+5 -25
drivers/gpu/drm/i915/i915_gem_tiling.c drivers/gpu/drm/i915/gem/i915_gem_tiling.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2008 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - * Authors: 24 - * Eric Anholt <eric@anholt.net> 25 - * 26 5 */ 27 6 28 7 #include <linux/string.h> 29 8 #include <linux/bitops.h> 30 9 #include <drm/i915_drm.h> 31 10 32 - #include "gem/i915_gem_ioctls.h" 33 - 34 11 #include "i915_drv.h" 12 + #include "i915_gem.h" 13 + #include "i915_gem_ioctls.h" 14 + #include "i915_gem_object.h" 35 15 36 16 /** 37 17 * DOC: buffer object tiling
+4 -23
drivers/gpu/drm/i915/i915_gem_userptr.c drivers/gpu/drm/i915/gem/i915_gem_userptr.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2012-2014 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include <linux/mmu_context.h> ··· 12 30 13 31 #include <drm/i915_drm.h> 14 32 15 - #include "gem/i915_gem_ioctls.h" 16 - 17 - #include "i915_drv.h" 33 + #include "i915_gem_ioctls.h" 34 + #include "i915_gem_object.h" 18 35 #include "i915_trace.h" 19 36 #include "intel_drv.h" 20 37
-75
drivers/gpu/drm/i915/i915_gemfs.c
··· 1 - /* 2 - * Copyright © 2017 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - */ 24 - 25 - #include <linux/fs.h> 26 - #include <linux/mount.h> 27 - #include <linux/pagemap.h> 28 - 29 - #include "i915_drv.h" 30 - #include "i915_gemfs.h" 31 - 32 - int i915_gemfs_init(struct drm_i915_private *i915) 33 - { 34 - struct file_system_type *type; 35 - struct vfsmount *gemfs; 36 - 37 - type = get_fs_type("tmpfs"); 38 - if (!type) 39 - return -ENODEV; 40 - 41 - gemfs = kern_mount(type); 42 - if (IS_ERR(gemfs)) 43 - return PTR_ERR(gemfs); 44 - 45 - /* 46 - * Enable huge-pages for objects that are at least HPAGE_PMD_SIZE, most 47 - * likely 2M. Note that within_size may overallocate huge-pages, if say 48 - * we allocate an object of size 2M + 4K, we may get 2M + 2M, but under 49 - * memory pressure shmem should split any huge-pages which can be 50 - * shrunk. 51 - */ 52 - 53 - if (has_transparent_hugepage()) { 54 - struct super_block *sb = gemfs->mnt_sb; 55 - /* FIXME: Disabled until we get W/A for read BW issue. */ 56 - char options[] = "huge=never"; 57 - int flags = 0; 58 - int err; 59 - 60 - err = sb->s_op->remount_fs(sb, &flags, options); 61 - if (err) { 62 - kern_unmount(gemfs); 63 - return err; 64 - } 65 - } 66 - 67 - i915->mm.gemfs = gemfs; 68 - 69 - return 0; 70 - } 71 - 72 - void i915_gemfs_fini(struct drm_i915_private *i915) 73 - { 74 - kern_unmount(i915->mm.gemfs); 75 - }
-34
drivers/gpu/drm/i915/i915_gemfs.h
··· 1 - /* 2 - * Copyright © 2017 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - */ 24 - 25 - #ifndef __I915_GEMFS_H__ 26 - #define __I915_GEMFS_H__ 27 - 28 - struct drm_i915_private; 29 - 30 - int i915_gemfs_init(struct drm_i915_private *i915); 31 - 32 - void i915_gemfs_fini(struct drm_i915_private *i915); 33 - 34 - #endif
+1 -1
drivers/gpu/drm/i915/i915_globals.c
··· 8 8 #include <linux/workqueue.h> 9 9 10 10 #include "i915_active.h" 11 - #include "i915_gem_context.h" 11 + #include "gem/i915_gem_context.h" 12 12 #include "gem/i915_gem_object.h" 13 13 #include "i915_globals.h" 14 14 #include "i915_request.h"
+2
drivers/gpu/drm/i915/i915_gpu_error.c
··· 36 36 37 37 #include <drm/drm_print.h> 38 38 39 + #include "gem/i915_gem_context.h" 40 + 39 41 #include "i915_drv.h" 40 42 #include "i915_gpu_error.h" 41 43 #include "intel_atomic.h"
+2
drivers/gpu/drm/i915/i915_perf.c
··· 195 195 #include <linux/sizes.h> 196 196 #include <linux/uuid.h> 197 197 198 + #include "gem/i915_gem_context.h" 199 + #include "gem/i915_gem_pm.h" 198 200 #include "gt/intel_lrc_reg.h" 199 201 200 202 #include "i915_drv.h"
+3
drivers/gpu/drm/i915/i915_request.c
··· 29 29 #include <linux/sched/clock.h> 30 30 #include <linux/sched/signal.h> 31 31 32 + #include "gem/i915_gem_context.h" 33 + #include "gt/intel_context.h" 34 + 32 35 #include "i915_active.h" 33 36 #include "i915_drv.h" 34 37 #include "i915_globals.h"
-1
drivers/gpu/drm/i915/intel_display.c
··· 45 45 #include <drm/i915_drm.h> 46 46 47 47 #include "i915_drv.h" 48 - #include "i915_gem_clflush.h" 49 48 #include "i915_trace.h" 50 49 #include "intel_acpi.h" 51 50 #include "intel_atomic.h"
+2
drivers/gpu/drm/i915/intel_guc_submission.c
··· 26 26 27 27 #include "gt/intel_engine_pm.h" 28 28 #include "gt/intel_lrc_reg.h" 29 + #include "gt/intel_context.h" 30 + #include "gem/i915_gem_context.h" 29 31 30 32 #include "intel_guc_submission.h" 31 33 #include "i915_drv.h"
+2
drivers/gpu/drm/i915/intel_overlay.c
··· 29 29 #include <drm/drm_fourcc.h> 30 30 #include <drm/i915_drm.h> 31 31 32 + #include "gem/i915_gem_pm.h" 33 + 32 34 #include "i915_drv.h" 33 35 #include "i915_reg.h" 34 36 #include "intel_drv.h"
+2 -20
drivers/gpu/drm/i915/selftests/huge_gem_object.c drivers/gpu/drm/i915/gem/selftests/huge_gem_object.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include "huge_gem_object.h"
-45
drivers/gpu/drm/i915/selftests/huge_gem_object.h
··· 1 - /* 2 - * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - */ 24 - 25 - #ifndef __HUGE_GEM_OBJECT_H 26 - #define __HUGE_GEM_OBJECT_H 27 - 28 - struct drm_i915_gem_object * 29 - huge_gem_object(struct drm_i915_private *i915, 30 - phys_addr_t phys_size, 31 - dma_addr_t dma_size); 32 - 33 - static inline phys_addr_t 34 - huge_gem_object_phys_size(struct drm_i915_gem_object *obj) 35 - { 36 - return obj->scratch; 37 - } 38 - 39 - static inline dma_addr_t 40 - huge_gem_object_dma_size(struct drm_i915_gem_object *obj) 41 - { 42 - return obj->base.size; 43 - } 44 - 45 - #endif /* !__HUGE_GEM_OBJECT_H */
+11 -24
drivers/gpu/drm/i915/selftests/huge_pages.c drivers/gpu/drm/i915/gem/selftests/huge_pages.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2017 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 - 25 - #include "../i915_selftest.h" 26 6 27 7 #include <linux/prime_numbers.h> 28 8 9 + #include "i915_selftest.h" 10 + 11 + #include "gem/i915_gem_pm.h" 12 + 29 13 #include "igt_gem_utils.h" 30 - #include "mock_drm.h" 31 - #include "i915_random.h" 14 + #include "mock_context.h" 15 + 16 + #include "selftests/mock_drm.h" 17 + #include "selftests/mock_gem_device.h" 18 + #include "selftests/i915_random.h" 32 19 33 20 static const unsigned int page_sizes[] = { 34 21 I915_GTT_PAGE_SIZE_2M,
+3 -1
drivers/gpu/drm/i915/selftests/i915_active.c
··· 4 4 * Copyright © 2018 Intel Corporation 5 5 */ 6 6 7 - #include "../i915_selftest.h" 7 + #include "gem/i915_gem_pm.h" 8 + 9 + #include "i915_selftest.h" 8 10 9 11 #include "igt_flush_test.h" 10 12 #include "lib_sw_fence.h"
+5 -3
drivers/gpu/drm/i915/selftests/i915_gem.c
··· 6 6 7 7 #include <linux/random.h> 8 8 9 - #include "../i915_selftest.h" 9 + #include "gem/selftests/igt_gem_utils.h" 10 + #include "gem/selftests/mock_context.h" 10 11 11 - #include "igt_gem_utils.h" 12 + #include "i915_selftest.h" 13 + 12 14 #include "igt_flush_test.h" 13 - #include "mock_context.h" 15 + #include "mock_drm.h" 14 16 15 17 static int switch_to_context(struct drm_i915_private *i915, 16 18 struct i915_gem_context *ctx)
+4 -22
drivers/gpu/drm/i915/selftests/i915_gem_coherency.c drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2017 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include <linux/prime_numbers.h> 26 8 27 - #include "../i915_selftest.h" 28 - #include "i915_random.h" 9 + #include "i915_selftest.h" 10 + #include "selftests/i915_random.h" 29 11 30 12 static int cpu_set(struct drm_i915_gem_object *obj, 31 13 unsigned long offset,
+12 -28
drivers/gpu/drm/i915/selftests/i915_gem_context.c drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2017 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include <linux/prime_numbers.h> 26 8 9 + #include "gem/i915_gem_pm.h" 27 10 #include "gt/intel_reset.h" 28 11 #include "i915_selftest.h" 29 12 30 - #include "i915_random.h" 31 - #include "igt_flush_test.h" 32 - #include "igt_gem_utils.h" 33 - #include "igt_live_test.h" 34 - #include "igt_reset.h" 35 - #include "igt_spinner.h" 13 + #include "gem/selftests/igt_gem_utils.h" 14 + #include "selftests/i915_random.h" 15 + #include "selftests/igt_flush_test.h" 16 + #include "selftests/igt_live_test.h" 17 + #include "selftests/igt_reset.h" 18 + #include "selftests/igt_spinner.h" 19 + #include "selftests/mock_drm.h" 20 + #include "selftests/mock_gem_device.h" 36 21 37 - #include "mock_drm.h" 38 - #include "mock_gem_device.h" 39 22 #include "huge_gem_object.h" 23 + #include "igt_gem_utils.h" 40 24 41 25 #define DW_PER_PAGE (PAGE_SIZE / sizeof(u32)) 42 26
+4 -22
drivers/gpu/drm/i915/selftests/i915_gem_dmabuf.c drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 - #include "../i915_selftest.h" 7 + #include "i915_selftest.h" 26 8 27 - #include "mock_gem_device.h" 28 9 #include "mock_dmabuf.h" 10 + #include "selftests/mock_gem_device.h" 29 11 30 12 static int igt_dmabuf_export(void *arg) 31 13 {
+5 -3
drivers/gpu/drm/i915/selftests/i915_gem_evict.c
··· 22 22 * 23 23 */ 24 24 25 - #include "../i915_selftest.h" 25 + #include "gem/i915_gem_pm.h" 26 + #include "gem/selftests/igt_gem_utils.h" 27 + #include "gem/selftests/mock_context.h" 26 28 27 - #include "igt_gem_utils.h" 29 + #include "i915_selftest.h" 30 + 28 31 #include "lib_sw_fence.h" 29 - #include "mock_context.h" 30 32 #include "mock_drm.h" 31 33 #include "mock_gem_device.h" 32 34
+4 -3
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
··· 25 25 #include <linux/list_sort.h> 26 26 #include <linux/prime_numbers.h> 27 27 28 - #include "../i915_selftest.h" 29 - #include "i915_random.h" 28 + #include "gem/selftests/mock_context.h" 30 29 31 - #include "mock_context.h" 30 + #include "i915_random.h" 31 + #include "i915_selftest.h" 32 + 32 33 #include "mock_drm.h" 33 34 #include "mock_gem_device.h" 34 35
+5 -23
drivers/gpu/drm/i915/selftests/i915_gem_object.c drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 - #include "../i915_selftest.h" 7 + #include "i915_selftest.h" 26 8 27 - #include "igt_flush_test.h" 28 - #include "mock_gem_device.h" 29 9 #include "huge_gem_object.h" 10 + #include "selftests/igt_flush_test.h" 11 + #include "selftests/mock_gem_device.h" 30 12 31 13 static int igt_gem_object(void *arg) 32 14 {
+4 -2
drivers/gpu/drm/i915/selftests/i915_request.c
··· 24 24 25 25 #include <linux/prime_numbers.h> 26 26 27 - #include "../i915_selftest.h" 27 + #include "gem/i915_gem_pm.h" 28 + #include "gem/selftests/mock_context.h" 29 + 28 30 #include "i915_random.h" 31 + #include "i915_selftest.h" 29 32 #include "igt_live_test.h" 30 33 #include "lib_sw_fence.h" 31 34 32 - #include "mock_context.h" 33 35 #include "mock_drm.h" 34 36 #include "mock_gem_device.h" 35 37
+3 -1
drivers/gpu/drm/i915/selftests/i915_timeline.c
··· 6 6 7 7 #include <linux/prime_numbers.h> 8 8 9 - #include "../i915_selftest.h" 9 + #include "gem/i915_gem_pm.h" 10 + 10 11 #include "i915_random.h" 12 + #include "i915_selftest.h" 11 13 12 14 #include "igt_flush_test.h" 13 15 #include "mock_gem_device.h"
+3 -2
drivers/gpu/drm/i915/selftests/i915_vma.c
··· 24 24 25 25 #include <linux/prime_numbers.h> 26 26 27 - #include "../i915_selftest.h" 27 + #include "gem/selftests/mock_context.h" 28 + 29 + #include "i915_selftest.h" 28 30 29 31 #include "mock_gem_device.h" 30 - #include "mock_context.h" 31 32 #include "mock_gtt.h" 32 33 33 34 static bool assert_vma(struct i915_vma *vma,
+4 -2
drivers/gpu/drm/i915/selftests/igt_flush_test.c
··· 4 4 * Copyright © 2018 Intel Corporation 5 5 */ 6 6 7 - #include "../i915_drv.h" 7 + #include "gem/i915_gem_context.h" 8 8 9 - #include "../i915_selftest.h" 9 + #include "i915_drv.h" 10 + #include "i915_selftest.h" 11 + 10 12 #include "igt_flush_test.h" 11 13 12 14 int igt_flush_test(struct drm_i915_private *i915, unsigned int flags)
+3 -3
drivers/gpu/drm/i915/selftests/igt_gem_utils.c drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c
··· 6 6 7 7 #include "igt_gem_utils.h" 8 8 9 + #include "gem/i915_gem_context.h" 10 + #include "gem/i915_gem_pm.h" 9 11 #include "gt/intel_context.h" 10 12 11 - #include "../i915_gem_context.h" 12 - #include "../i915_gem_pm.h" 13 - #include "../i915_request.h" 13 + #include "i915_request.h" 14 14 15 15 struct i915_request * 16 16 igt_request_alloc(struct i915_gem_context *ctx, struct intel_engine_cs *engine)
drivers/gpu/drm/i915/selftests/igt_gem_utils.h drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.h
+2 -1
drivers/gpu/drm/i915/selftests/igt_spinner.c
··· 4 4 * Copyright © 2018 Intel Corporation 5 5 */ 6 6 7 - #include "igt_gem_utils.h" 7 + #include "gem/selftests/igt_gem_utils.h" 8 + 8 9 #include "igt_spinner.h" 9 10 10 11 int igt_spinner_init(struct igt_spinner *spin, struct drm_i915_private *i915)
+4 -5
drivers/gpu/drm/i915/selftests/igt_spinner.h
··· 7 7 #ifndef __I915_SELFTESTS_IGT_SPINNER_H__ 8 8 #define __I915_SELFTESTS_IGT_SPINNER_H__ 9 9 10 - #include "../i915_selftest.h" 11 - 10 + #include "gem/i915_gem_context.h" 12 11 #include "gt/intel_engine.h" 13 12 14 - #include "../i915_drv.h" 15 - #include "../i915_request.h" 16 - #include "../i915_gem_context.h" 13 + #include "i915_drv.h" 14 + #include "i915_request.h" 15 + #include "i915_selftest.h" 17 16 18 17 struct igt_spinner { 19 18 struct drm_i915_private *i915;
+2 -1
drivers/gpu/drm/i915/selftests/intel_guc.c
··· 22 22 * 23 23 */ 24 24 25 - #include "../i915_selftest.h" 25 + #include "i915_selftest.h" 26 + #include "gem/i915_gem_pm.h" 26 27 27 28 /* max doorbell number + negative test for each client type */ 28 29 #define ATTEMPTS (GUC_NUM_DOORBELLS + GUC_CLIENT_PRIORITY_NUM)
+3 -21
drivers/gpu/drm/i915/selftests/mock_context.c drivers/gpu/drm/i915/gem/selftests/mock_context.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include "mock_context.h" 26 - #include "mock_gtt.h" 8 + #include "selftests/mock_gtt.h" 27 9 28 10 struct i915_gem_context * 29 11 mock_context(struct drm_i915_private *i915,
-42
drivers/gpu/drm/i915/selftests/mock_context.h
··· 1 - /* 2 - * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 - */ 24 - 25 - #ifndef __MOCK_CONTEXT_H 26 - #define __MOCK_CONTEXT_H 27 - 28 - void mock_init_contexts(struct drm_i915_private *i915); 29 - 30 - struct i915_gem_context * 31 - mock_context(struct drm_i915_private *i915, 32 - const char *name); 33 - 34 - void mock_context_close(struct i915_gem_context *ctx); 35 - 36 - struct i915_gem_context * 37 - live_context(struct drm_i915_private *i915, struct drm_file *file); 38 - 39 - struct i915_gem_context *kernel_context(struct drm_i915_private *i915); 40 - void kernel_context_close(struct i915_gem_context *ctx); 41 - 42 - #endif /* !__MOCK_CONTEXT_H */
+2 -20
drivers/gpu/drm/i915/selftests/mock_dmabuf.c drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c
··· 1 1 /* 2 + * SPDX-License-Identifier: MIT 3 + * 2 4 * Copyright © 2016 Intel Corporation 3 - * 4 - * Permission is hereby granted, free of charge, to any person obtaining a 5 - * copy of this software and associated documentation files (the "Software"), 6 - * to deal in the Software without restriction, including without limitation 7 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 - * and/or sell copies of the Software, and to permit persons to whom the 9 - * Software is furnished to do so, subject to the following conditions: 10 - * 11 - * The above copyright notice and this permission notice (including the next 12 - * paragraph) shall be included in all copies or substantial portions of the 13 - * Software. 14 - * 15 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21 - * IN THE SOFTWARE. 22 - * 23 5 */ 24 6 25 7 #include "mock_dmabuf.h"
-41
drivers/gpu/drm/i915/selftests/mock_dmabuf.h
··· 1 - 2 - /* 3 - * Copyright © 2016 Intel Corporation 4 - * 5 - * Permission is hereby granted, free of charge, to any person obtaining a 6 - * copy of this software and associated documentation files (the "Software"), 7 - * to deal in the Software without restriction, including without limitation 8 - * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 - * and/or sell copies of the Software, and to permit persons to whom the 10 - * Software is furnished to do so, subject to the following conditions: 11 - * 12 - * The above copyright notice and this permission notice (including the next 13 - * paragraph) shall be included in all copies or substantial portions of the 14 - * Software. 15 - * 16 - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 - * IN THE SOFTWARE. 23 - * 24 - */ 25 - 26 - #ifndef __MOCK_DMABUF_H__ 27 - #define __MOCK_DMABUF_H__ 28 - 29 - #include <linux/dma-buf.h> 30 - 31 - struct mock_dmabuf { 32 - int npages; 33 - struct page *pages[]; 34 - }; 35 - 36 - static struct mock_dmabuf *to_mock(struct dma_buf *buf) 37 - { 38 - return buf->priv; 39 - } 40 - 41 - #endif /* !__MOCK_DMABUF_H__ */
+3 -2
drivers/gpu/drm/i915/selftests/mock_gem_device.c
··· 27 27 28 28 #include "gt/mock_engine.h" 29 29 30 - #include "mock_context.h" 31 30 #include "mock_request.h" 32 31 #include "mock_gem_device.h" 33 - #include "mock_gem_object.h" 34 32 #include "mock_gtt.h" 35 33 #include "mock_uncore.h" 34 + 35 + #include "gem/selftests/mock_context.h" 36 + #include "gem/selftests/mock_gem_object.h" 36 37 37 38 void mock_device_flush(struct drm_i915_private *i915) 38 39 {
+6 -1
drivers/gpu/drm/i915/selftests/mock_gem_object.h drivers/gpu/drm/i915/gem/selftests/mock_gem_object.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 1 + /* 2 + * SPDX-License-Identifier: MIT 3 + * 4 + * Copyright © 2016 Intel Corporation 5 + */ 6 + 2 7 #ifndef __MOCK_GEM_OBJECT_H__ 3 8 #define __MOCK_GEM_OBJECT_H__ 4 9
+1 -1
drivers/gpu/drm/i915/selftests/mock_request.c
··· 22 22 * 23 23 */ 24 24 25 + #include "gem/selftests/igt_gem_utils.h" 25 26 #include "gt/mock_engine.h" 26 27 27 - #include "igt_gem_utils.h" 28 28 #include "mock_request.h" 29 29 30 30 struct i915_request *