Skip to content

Commit

Permalink
drm/ttm: merge ttm_bo_api.h and ttm_bo_driver.h
Browse files Browse the repository at this point in the history
Merge and cleanup the two headers into a single description of the
object API. Also move all the documentation to the implementation and
drop unecessary includes from the header.

No functional change.

Signed-off-by: Christian König <christian.koenig@amd.com>
  • Loading branch information
Christian König authored and intel-lab-lkp committed Nov 25, 2022
1 parent 3b575b9 commit a212742
Show file tree
Hide file tree
Showing 55 changed files with 410 additions and 557 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu.h
Expand Up @@ -52,8 +52,7 @@
#include <linux/pci.h>
#include <linux/aer.h>

#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_execbuf_util.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
Expand Up @@ -25,6 +25,7 @@
#include <linux/pagemap.h>
#include <linux/sched/mm.h>
#include <linux/sched/task.h>
#include <drm/ttm/ttm_tt.h>

#include "amdgpu_object.h"
#include "amdgpu_gem.h"
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.h
Expand Up @@ -28,6 +28,8 @@

struct hmm_range;

struct drm_file;

struct amdgpu_device;
struct amdgpu_bo;
struct amdgpu_bo_va;
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
Expand Up @@ -32,6 +32,8 @@

#include <drm/amdgpu_drm.h>
#include <drm/drm_syncobj.h>
#include <drm/ttm/ttm_tt.h>

#include "amdgpu_cs.h"
#include "amdgpu.h"
#include "amdgpu_trace.h"
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_cs.h
Expand Up @@ -23,6 +23,8 @@
#ifndef __AMDGPU_CS_H__
#define __AMDGPU_CS_H__

#include <linux/ww_mutex.h>

#include "amdgpu_job.h"
#include "amdgpu_bo_list.h"
#include "amdgpu_ring.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
Expand Up @@ -37,6 +37,7 @@
#include "amdgpu_dma_buf.h"
#include "amdgpu_xgmi.h"
#include <drm/amdgpu_drm.h>
#include <drm/ttm/ttm_tt.h>
#include <linux/dma-buf.h>
#include <linux/dma-fence-array.h>
#include <linux/pci-p2pdma.h>
Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.h
Expand Up @@ -30,7 +30,6 @@
#include <linux/rbtree.h>
#include <drm/gpu_scheduler.h>
#include <drm/drm_file.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <linux/sched/mm.h>

#include "amdgpu_sync.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
Expand Up @@ -34,6 +34,7 @@
#include <drm/amdgpu_drm.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem_ttm_helper.h>
#include <drm/ttm/ttm_tt.h>

#include "amdgpu.h"
#include "amdgpu_display.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
Expand Up @@ -35,6 +35,7 @@
#include "amdgpu_xgmi.h"

#include <drm/drm_drv.h>
#include <drm/ttm/ttm_tt.h>

/**
* amdgpu_gmc_pdb0_alloc - allocate vram for pdb0
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Expand Up @@ -44,10 +44,10 @@
#include <linux/module.h>

#include <drm/drm_drv.h>
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_range_manager.h>
#include <drm/ttm/ttm_tt.h>

#include <drm/amdgpu_drm.h>
#include <drm/drm_drv.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
Expand Up @@ -33,6 +33,7 @@

#include <drm/amdgpu_drm.h>
#include <drm/drm_drv.h>
#include <drm/ttm/ttm_tt.h>
#include "amdgpu.h"
#include "amdgpu_trace.h"
#include "amdgpu_amdkfd.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
Expand Up @@ -29,7 +29,7 @@
#include <linux/rbtree.h>
#include <drm/gpu_scheduler.h>
#include <drm/drm_file.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <linux/sched/mm.h>

#include "amdgpu_sync.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdkfd/kfd_svm.c
Expand Up @@ -23,6 +23,7 @@

#include <linux/types.h>
#include <linux/sched/task.h>
#include <drm/ttm/ttm_tt.h>
#include "amdgpu_sync.h"
#include "amdgpu_object.h"
#include "amdgpu_vm.h"
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/drm_gem_ttm_helper.c
Expand Up @@ -3,6 +3,8 @@
#include <linux/module.h>

#include <drm/drm_gem_ttm_helper.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_tt.h>

/**
* DOC: overview
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/drm_gem_vram_helper.c
Expand Up @@ -19,6 +19,7 @@
#include <drm/drm_simple_kms_helper.h>

#include <drm/ttm/ttm_range_manager.h>
#include <drm/ttm/ttm_tt.h>

static const struct drm_gem_object_funcs drm_gem_vram_object_funcs;

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_object_types.h
Expand Up @@ -10,7 +10,7 @@
#include <linux/mmu_notifier.h>

#include <drm/drm_gem.h>
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo.h>
#include <uapi/drm/i915_drm.h>

#include "i915_active.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_ttm.c
Expand Up @@ -5,8 +5,8 @@

#include <linux/shmem_fs.h>

#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_tt.h>
#include <drm/drm_buddy.h>

#include "i915_drv.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
Expand Up @@ -3,7 +3,7 @@
* Copyright © 2021 Intel Corporation
*/

#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_tt.h>

#include "i915_deps.h"
#include "i915_drv.h"
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_deps.c
Expand Up @@ -6,7 +6,7 @@
#include <linux/dma-fence.h>
#include <linux/slab.h>

#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo.h>

#include "i915_deps.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
Expand Up @@ -5,8 +5,8 @@

#include <linux/slab.h>

#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_bo.h>

#include <drm/drm_buddy.h>

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/intel_region_ttm.c
Expand Up @@ -2,7 +2,6 @@
/*
* Copyright © 2021 Intel Corporation
*/
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_device.h>
#include <drm/ttm/ttm_range_manager.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nouveau_bo.c
Expand Up @@ -28,6 +28,7 @@
*/

#include <linux/dma-mapping.h>
#include <drm/ttm/ttm_tt.h>

#include "nouveau_drv.h"
#include "nouveau_chan.h"
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_bo.h
@@ -1,8 +1,9 @@
/* SPDX-License-Identifier: MIT */
#ifndef __NOUVEAU_BO_H__
#define __NOUVEAU_BO_H__
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/drm_gem.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>

struct nouveau_channel;
struct nouveau_cli;
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/nouveau/nouveau_drv.h
Expand Up @@ -51,8 +51,7 @@
#include <drm/drm_drv.h>
#include <drm/drm_file.h>

#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>

#include <drm/drm_audio_component.h>
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/nouveau/nouveau_mem.c
Expand Up @@ -19,11 +19,12 @@
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include <drm/ttm/ttm_tt.h>

#include "nouveau_mem.h"
#include "nouveau_drv.h"
#include "nouveau_bo.h"

#include <drm/ttm/ttm_bo_driver.h>

#include <nvif/class.h>
#include <nvif/if000a.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_mem.h
@@ -1,6 +1,6 @@
#ifndef __NOUVEAU_MEM_H__
#define __NOUVEAU_MEM_H__
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo.h>
struct ttm_tt;

#include <nvif/mem.h>
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nouveau_prime.c
Expand Up @@ -23,6 +23,7 @@
*/

#include <linux/dma-buf.h>
#include <drm/ttm/ttm_tt.h>

#include "nouveau_drv.h"
#include "nouveau_gem.h"
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/nouveau/nouveau_sgdma.c
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: MIT
#include <linux/pagemap.h>
#include <linux/slab.h>
#include <drm/ttm/ttm_tt.h>

#include "nouveau_drv.h"
#include "nouveau_mem.h"
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/qxl/qxl_drv.h
Expand Up @@ -42,8 +42,7 @@
#include <drm/drm_ioctl.h>
#include <drm/drm_gem.h>
#include <drm/qxl_drm.h>
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_execbuf_util.h>
#include <drm/ttm/ttm_placement.h>

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/qxl/qxl_ttm.c
Expand Up @@ -29,10 +29,10 @@
#include <drm/drm_file.h>
#include <drm/drm_debugfs.h>
#include <drm/qxl_drm.h>
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_range_manager.h>
#include <drm/ttm/ttm_tt.h>

#include "qxl_drv.h"
#include "qxl_object.h"
Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/radeon/radeon.h
Expand Up @@ -73,8 +73,7 @@
#include <linux/mmu_notifier.h>
#endif

#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_execbuf_util.h>

Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/radeon/radeon_prime.c
Expand Up @@ -29,6 +29,8 @@
#include <drm/drm_prime.h>
#include <drm/radeon_drm.h>

#include <drm/ttm/ttm_tt.h>

#include "radeon.h"
#include "radeon_prime.h"

Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/radeon/radeon_ttm.c
Expand Up @@ -42,10 +42,10 @@
#include <drm/drm_file.h>
#include <drm/drm_prime.h>
#include <drm/radeon_drm.h>
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_bo.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_range_manager.h>
#include <drm/ttm/ttm_tt.h>

#include "radeon_reg.h"
#include "radeon.h"
Expand Down

0 comments on commit a212742

Please sign in to comment.