On Fri, 26 Jul 2024 14:38:07 +1000 Ben Skeggs <bskeggs@xxxxxxxxxx> wrote: > This hasn't been used in a while. > > Moves io accessors from nvkm/core/os.h to nvif/os.h at the same time > to fix a compile issue that results from <nvkm/core/object.h> no > longer being included. > Better split the patches. One for the removal of nxxx_object and one for fixing the compiling issues. Regarding to the compiling issues, what causes the compiling issue? And why it can't be solved by including <core/object.h>? I am not sure if it is a good idea to move io{read,write}{*}_native() to nvif/os.h as nvkm_{rd,wr}*() are using them. IMO, architecturally, nvif sits on top of nvkm, it would be better to keep nvkm self-sufficient. > Signed-off-by: Ben Skeggs <bskeggs@xxxxxxxxxx> > --- > drivers/gpu/drm/nouveau/include/nvif/object.h | 7 ------- > drivers/gpu/drm/nouveau/include/nvif/os.h | 19 > +++++++++++++++++++ .../gpu/drm/nouveau/include/nvkm/core/os.h | > 19 ------------------- 3 files changed, 19 insertions(+), 26 > deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/include/nvif/object.h > b/drivers/gpu/drm/nouveau/include/nvif/object.h index > f52399caee82..478cbb8f2dfe 100644 --- > a/drivers/gpu/drm/nouveau/include/nvif/object.h +++ > b/drivers/gpu/drm/nouveau/include/nvif/object.h @@ -134,11 +134,4 @@ > struct nvif_mclass { #define NVIF_MR32(p,A...) DRF_MR(NVIF_RD32_, > NVIF_WR32_, u32, (p), 0, ##A) #define NVIF_MV32(p,A...) > DRF_MV(NVIF_RD32_, NVIF_WR32_, u32, (p), 0, ##A) #define > NVIF_MD32(p,A...) DRF_MD(NVIF_RD32_, NVIF_WR32_, u32, (p), 0, ##A) - > -/*XXX*/ > -#include <core/object.h> > -#define nvxx_object(a) ({ > \ > - struct nvif_object *_object = (a); > \ > - (struct nvkm_object *)_object->priv; > \ -}) > #endif > diff --git a/drivers/gpu/drm/nouveau/include/nvif/os.h > b/drivers/gpu/drm/nouveau/include/nvif/os.h index > 429d0106c123..a2eaf3929ac3 100644 --- > a/drivers/gpu/drm/nouveau/include/nvif/os.h +++ > b/drivers/gpu/drm/nouveau/include/nvif/os.h @@ -34,4 +34,23 @@ > > #include <soc/tegra/fuse.h> > #include <soc/tegra/pmc.h> > + > +#ifdef __BIG_ENDIAN > +#define ioread16_native ioread16be > +#define iowrite16_native iowrite16be > +#define ioread32_native ioread32be > +#define iowrite32_native iowrite32be > +#else > +#define ioread16_native ioread16 > +#define iowrite16_native iowrite16 > +#define ioread32_native ioread32 > +#define iowrite32_native iowrite32 > +#endif > + > +#define iowrite64_native(v,p) do { > \ > + u32 __iomem *_p = (u32 __iomem *)(p); > \ > + u64 _v = (v); > \ > + iowrite32_native(lower_32_bits(_v), &_p[0]); > \ > + iowrite32_native(upper_32_bits(_v), &_p[1]); > \ +} while(0) > #endif > diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h > b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h index > 3fd5c007a663..9b05612e6490 100644 --- > a/drivers/gpu/drm/nouveau/include/nvkm/core/os.h +++ > b/drivers/gpu/drm/nouveau/include/nvkm/core/os.h @@ -3,25 +3,6 @@ > #define __NVKM_OS_H__ > #include <nvif/os.h> > > -#ifdef __BIG_ENDIAN > -#define ioread16_native ioread16be > -#define iowrite16_native iowrite16be > -#define ioread32_native ioread32be > -#define iowrite32_native iowrite32be > -#else > -#define ioread16_native ioread16 > -#define iowrite16_native iowrite16 > -#define ioread32_native ioread32 > -#define iowrite32_native iowrite32 > -#endif > - > -#define iowrite64_native(v,p) do { > \ > - u32 __iomem *_p = (u32 __iomem *)(p); > \ > - u64 _v = (v); > \ > - iowrite32_native(lower_32_bits(_v), &_p[0]); > \ > - iowrite32_native(upper_32_bits(_v), &_p[1]); > \ -} while(0) > - > struct nvkm_blob { > void *data; > u32 size;