[Intel-xe] [PATCH v2 02/11] drm/xe: Sort includes

Matthew Auld matthew.auld at intel.com
Fri Feb 17 11:20:50 UTC 2023


On 17/02/2023 00:52, Lucas De Marchi wrote:
> Sort includes and split them in blocks:
> 
> 1) .h corresponding to the .c. Example: xe_bb.c should have a "#include
>     "xe_bb.h" first.
> 2) #include <linux/...>
> 3) #include <drm/...>
> 4) local includes
> 5) i915 includes
> 
> This is accomplished by running
> `clang-format --style=file -i --sort-includes drivers/gpu/drm/xe/*.c`

Neat.

> and ignoring all the changes after the includes. There are also some
> manual tweaks to split the blocks.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

<snip>

>   
>   #include "gt/intel_gt_regs.h"
> diff --git a/drivers/gpu/drm/xe/xe_uc.c b/drivers/gpu/drm/xe/xe_uc.c
> index 7886c8b85397..a27e6c1a6aff 100644
> --- a/drivers/gpu/drm/xe/xe_uc.c
> +++ b/drivers/gpu/drm/xe/xe_uc.c
> @@ -3,13 +3,13 @@
>    * Copyright © 2022 Intel Corporation
>    */
>   
> +#include "xe_uc.h"

Needs new block here?

>   #include "xe_device.h"
> -#include "xe_huc.h"
>   #include "xe_gt.h"
>   #include "xe_guc.h"
>   #include "xe_guc_pc.h"
>   #include "xe_guc_submit.h"
> -#include "xe_uc.h"
> +#include "xe_huc.h"
>   #include "xe_uc_fw.h"
>   #include "xe_wopcm.h"
>   
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index 7276a375e2e0..a0e35627e45e 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -25,8 +25,8 @@
>   #include "xe_preempt_fence.h"
>   #include "xe_pt.h"
>   #include "xe_res_cursor.h"
> -#include "xe_trace.h"
>   #include "xe_sync.h"
> +#include "xe_trace.h"
>   
>   #define TEST_VM_ASYNC_OPS_ERROR
>   
> diff --git a/drivers/gpu/drm/xe/xe_vm_madvise.c b/drivers/gpu/drm/xe/xe_vm_madvise.c
> index 1e4e3a1b0631..29815852985a 100644
> --- a/drivers/gpu/drm/xe/xe_vm_madvise.c
> +++ b/drivers/gpu/drm/xe/xe_vm_madvise.c
> @@ -3,13 +3,15 @@
>    * Copyright © 2021 Intel Corporation
>    */
>   
> -#include <drm/xe_drm.h>
> -#include <drm/ttm/ttm_tt.h>
> +#include "xe_vm_madvise.h"
> +
>   #include <linux/nospec.h>
>   
> +#include <drm/ttm/ttm_tt.h>
> +#include <drm/xe_drm.h>
> +
>   #include "xe_bo.h"
>   #include "xe_vm.h"
> -#include "xe_vm_madvise.h"
>   
>   static int madvise_preferred_mem_class(struct xe_device *xe, struct xe_vm *vm,
>   				       struct xe_vma **vmas, int num_vmas,
> diff --git a/drivers/gpu/drm/xe/xe_wopcm.c b/drivers/gpu/drm/xe/xe_wopcm.c
> index 8fe182afa06c..e9ac560be57f 100644
> --- a/drivers/gpu/drm/xe/xe_wopcm.c
> +++ b/drivers/gpu/drm/xe/xe_wopcm.c
> @@ -3,13 +3,13 @@
>    * Copyright © 2022 Intel Corporation
>    */
>   
> +#include "xe_wopcm.h"

And here?

Reviewed-by: Matthew Auld <matthew.auld at intel.com>

>   #include "xe_device.h"
>   #include "xe_force_wake.h"
>   #include "xe_gt.h"
>   #include "xe_guc_reg.h"
>   #include "xe_mmio.h"
>   #include "xe_uc_fw.h"
> -#include "xe_wopcm.h"
>   
>   /**
>    * DOC: Write Once Protected Content Memory (WOPCM) Layout


More information about the Intel-xe mailing list