[PATCH v2] drm/xe: Do not include current dir for generated/xe_wa_oob.h

Jani Nikula jani.nikula at linux.intel.com
Mon Feb 26 15:43:15 UTC 2024


On Mon, 26 Feb 2024, Masahiro Yamada <masahiroy at kernel.org> wrote:
> On Mon, Feb 26, 2024 at 9:19 PM Jani Nikula <jani.nikula at linux.intel.com> wrote:
>>
>> On Wed, 21 Feb 2024, Dafna Hirschfeld <dhirschfeld at habana.ai> wrote:
>> > The generated file 'generated/xe_wa_oob.h' is included using:
>> > "generated/xe_wa_oob.h"
>> > which first look inside the source code. But the file resides
>> > in the build directory and should therefore be included using:
>> > <generated/xe_wa_oob.h>
>>
>> Is this documented anywhere?
>>
>> Is "generated" as a name special?
>
>
> No.
>
>
> It works because drivers/gpu/drm/xe/Makefile
> has this line:
>
>   subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)
>
>
>
>
> generated/xe_wa_oob.h is relative to the
> include path -I$(obj).
>
>
> Hence, #include <generated/xe_wa_oob.h> can
> include $(obj)/generated/xe_wa_oob.h

Thanks!

I guess the only real difference here would be if there was a
$(src)/generated/xe_wa_oob.h, which would be found first if double
quotes "" were used.

It's just that using angle brackets <> for something that isn't under
the top level include hierarchy feels wrong to me.

BR,
Jani.

>
>>
>> Cc: Masahiro.
>>
>>
>> BR,
>> Jani.
>>
>>
>> >
>> > Signed-off-by: Dafna Hirschfeld <dhirschfeld at habana.ai>
>> > Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>
>> >
>> > ---
>> > v2 changes: add newline, change patch title
>> >
>> >  drivers/gpu/drm/xe/xe_gsc.c            | 3 ++-
>> >  drivers/gpu/drm/xe/xe_guc.c            | 3 ++-
>> >  drivers/gpu/drm/xe/xe_migrate.c        | 3 ++-
>> >  drivers/gpu/drm/xe/xe_ring_ops.c       | 3 ++-
>> >  drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c | 3 ++-
>> >  drivers/gpu/drm/xe/xe_vm.c             | 3 ++-
>> >  drivers/gpu/drm/xe/xe_wa.c             | 3 ++-
>> >  7 files changed, 14 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/xe/xe_gsc.c b/drivers/gpu/drm/xe/xe_gsc.c
>> > index 0b90fd9ef63a..a61994292c43 100644
>> > --- a/drivers/gpu/drm/xe/xe_gsc.c
>> > +++ b/drivers/gpu/drm/xe/xe_gsc.c
>> > @@ -7,8 +7,9 @@
>> >
>> >  #include <drm/drm_managed.h>
>> >
>> > +#include <generated/xe_wa_oob.h>
>> > +
>> >  #include "abi/gsc_mkhi_commands_abi.h"
>> > -#include "generated/xe_wa_oob.h"
>> >  #include "xe_bb.h"
>> >  #include "xe_bo.h"
>> >  #include "xe_device.h"
>> > diff --git a/drivers/gpu/drm/xe/xe_guc.c b/drivers/gpu/drm/xe/xe_guc.c
>> > index 868208a39829..fa217f5a386e 100644
>> > --- a/drivers/gpu/drm/xe/xe_guc.c
>> > +++ b/drivers/gpu/drm/xe/xe_guc.c
>> > @@ -7,9 +7,10 @@
>> >
>> >  #include <drm/drm_managed.h>
>> >
>> > +#include <generated/xe_wa_oob.h>
>> > +
>> >  #include "abi/guc_actions_abi.h"
>> >  #include "abi/guc_errors_abi.h"
>> > -#include "generated/xe_wa_oob.h"
>> >  #include "regs/xe_gt_regs.h"
>> >  #include "regs/xe_guc_regs.h"
>> >  #include "xe_bo.h"
>> > diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
>> > index 3d2438dc86ee..a66fdf2d2991 100644
>> > --- a/drivers/gpu/drm/xe/xe_migrate.c
>> > +++ b/drivers/gpu/drm/xe/xe_migrate.c
>> > @@ -12,7 +12,8 @@
>> >  #include <drm/ttm/ttm_tt.h>
>> >  #include <drm/xe_drm.h>
>> >
>> > -#include "generated/xe_wa_oob.h"
>> > +#include <generated/xe_wa_oob.h>
>> > +
>> >  #include "instructions/xe_mi_commands.h"
>> >  #include "regs/xe_gpu_commands.h"
>> >  #include "tests/xe_test.h"
>> > diff --git a/drivers/gpu/drm/xe/xe_ring_ops.c b/drivers/gpu/drm/xe/xe_ring_ops.c
>> > index d5e9621428ef..c4edffcd4a32 100644
>> > --- a/drivers/gpu/drm/xe/xe_ring_ops.c
>> > +++ b/drivers/gpu/drm/xe/xe_ring_ops.c
>> > @@ -5,7 +5,8 @@
>> >
>> >  #include "xe_ring_ops.h"
>> >
>> > -#include "generated/xe_wa_oob.h"
>> > +#include <generated/xe_wa_oob.h>
>> > +
>> >  #include "instructions/xe_mi_commands.h"
>> >  #include "regs/xe_engine_regs.h"
>> >  #include "regs/xe_gpu_commands.h"
>> > diff --git a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>> > index 662f1e9bfc65..3107d2a12426 100644
>> > --- a/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>> > +++ b/drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
>> > @@ -11,7 +11,8 @@
>> >  #include <drm/ttm/ttm_placement.h>
>> >  #include <drm/ttm/ttm_range_manager.h>
>> >
>> > -#include "generated/xe_wa_oob.h"
>> > +#include <generated/xe_wa_oob.h>
>> > +
>> >  #include "regs/xe_gt_regs.h"
>> >  #include "regs/xe_regs.h"
>> >  #include "xe_bo.h"
>> > diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
>> > index 836a6e849cda..efe9a0d300c0 100644
>> > --- a/drivers/gpu/drm/xe/xe_vm.c
>> > +++ b/drivers/gpu/drm/xe/xe_vm.c
>> > @@ -18,6 +18,8 @@
>> >  #include <linux/mm.h>
>> >  #include <linux/swap.h>
>> >
>> > +#include <generated/xe_wa_oob.h>
>> > +
>> >  #include "xe_assert.h"
>> >  #include "xe_bo.h"
>> >  #include "xe_device.h"
>> > @@ -34,7 +36,6 @@
>> >  #include "xe_res_cursor.h"
>> >  #include "xe_sync.h"
>> >  #include "xe_trace.h"
>> > -#include "generated/xe_wa_oob.h"
>> >  #include "xe_wa.h"
>> >
>> >  static struct drm_gem_object *xe_vm_obj(struct xe_vm *vm)
>> > diff --git a/drivers/gpu/drm/xe/xe_wa.c b/drivers/gpu/drm/xe/xe_wa.c
>> > index 3299130ba10a..a0264eedd443 100644
>> > --- a/drivers/gpu/drm/xe/xe_wa.c
>> > +++ b/drivers/gpu/drm/xe/xe_wa.c
>> > @@ -9,7 +9,8 @@
>> >  #include <kunit/visibility.h>
>> >  #include <linux/compiler_types.h>
>> >
>> > -#include "generated/xe_wa_oob.h"
>> > +#include <generated/xe_wa_oob.h>
>> > +
>> >  #include "regs/xe_engine_regs.h"
>> >  #include "regs/xe_gt_regs.h"
>> >  #include "regs/xe_regs.h"
>>
>> --
>> Jani Nikula, Intel

-- 
Jani Nikula, Intel


More information about the Intel-xe mailing list