From 6496b4e5ab5db1306f06d0eabe28fe0be80f07cd Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 18 Nov 2016 11:28:42 +1000 Subject: [PATCH] drm/nouveau/bios/cstep: pointers are 32-bit Signed-off-by: Ben Skeggs --- .../nouveau/include/nvkm/subdev/bios/cstep.h | 12 ++++---- .../gpu/drm/nouveau/nvkm/subdev/bios/cstep.c | 30 +++++++++---------- .../gpu/drm/nouveau/nvkm/subdev/clk/base.c | 4 +-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h index 2f0e0c8e83be..76fe7d50a1ce 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/subdev/bios/cstep.h @@ -1,6 +1,6 @@ #ifndef __NVBIOS_CSTEP_H__ #define __NVBIOS_CSTEP_H__ -u16 nvbios_cstepTe(struct nvkm_bios *, +u32 nvbios_cstepTe(struct nvkm_bios *, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz); struct nvbios_cstepE { @@ -8,10 +8,10 @@ struct nvbios_cstepE { u8 index; }; -u16 nvbios_cstepEe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr); -u16 nvbios_cstepEp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr, +u32 nvbios_cstepEe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr); +u32 nvbios_cstepEp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr, struct nvbios_cstepE *); -u16 nvbios_cstepEm(struct nvkm_bios *, u8 pstate, u8 *ver, u8 *hdr, +u32 nvbios_cstepEm(struct nvkm_bios *, u8 pstate, u8 *ver, u8 *hdr, struct nvbios_cstepE *); struct nvbios_cstepX { @@ -20,7 +20,7 @@ struct nvbios_cstepX { u8 voltage; }; -u16 nvbios_cstepXe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr); -u16 nvbios_cstepXp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr, +u32 nvbios_cstepXe(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr); +u32 nvbios_cstepXp(struct nvkm_bios *, int idx, u8 *ver, u8 *hdr, struct nvbios_cstepX *); #endif diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/cstep.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/cstep.c index 32e01624a162..5063382d8a6c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/cstep.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/cstep.c @@ -25,16 +25,16 @@ #include #include -u16 +u32 nvbios_cstepTe(struct nvkm_bios *bios, u8 *ver, u8 *hdr, u8 *cnt, u8 *len, u8 *xnr, u8 *xsz) { struct bit_entry bit_P; - u16 cstep = 0x0000; + u32 cstep = 0; if (!bit_entry(bios, 'P', &bit_P)) { if (bit_P.version == 2) - cstep = nvbios_rd16(bios, bit_P.offset + 0x34); + cstep = nvbios_rd32(bios, bit_P.offset + 0x34); if (cstep) { *ver = nvbios_rd08(bios, cstep + 0); @@ -52,27 +52,27 @@ nvbios_cstepTe(struct nvkm_bios *bios, } } - return 0x0000; + return 0; } -u16 +u32 nvbios_cstepEe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr) { u8 cnt, len, xnr, xsz; - u16 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); + u32 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); if (data && idx < cnt) { data = data + *hdr + (idx * len); *hdr = len; return data; } - return 0x0000; + return 0; } -u16 +u32 nvbios_cstepEp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr, struct nvbios_cstepE *info) { - u16 data = nvbios_cstepEe(bios, idx, ver, hdr); + u32 data = nvbios_cstepEe(bios, idx, ver, hdr); memset(info, 0x00, sizeof(*info)); if (data) { info->pstate = (nvbios_rd16(bios, data + 0x00) & 0x01e0) >> 5; @@ -81,7 +81,7 @@ nvbios_cstepEp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr, return data; } -u16 +u32 nvbios_cstepEm(struct nvkm_bios *bios, u8 pstate, u8 *ver, u8 *hdr, struct nvbios_cstepE *info) { @@ -93,24 +93,24 @@ nvbios_cstepEm(struct nvkm_bios *bios, u8 pstate, u8 *ver, u8 *hdr, return data; } -u16 +u32 nvbios_cstepXe(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr) { u8 cnt, len, xnr, xsz; - u16 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); + u32 data = nvbios_cstepTe(bios, ver, hdr, &cnt, &len, &xnr, &xsz); if (data && idx < xnr) { data = data + *hdr + (cnt * len) + (idx * xsz); *hdr = xsz; return data; } - return 0x0000; + return 0; } -u16 +u32 nvbios_cstepXp(struct nvkm_bios *bios, int idx, u8 *ver, u8 *hdr, struct nvbios_cstepX *info) { - u16 data = nvbios_cstepXe(bios, idx, ver, hdr); + u32 data = nvbios_cstepXe(bios, idx, ver, hdr); memset(info, 0x00, sizeof(*info)); if (data) { info->freq = nvbios_rd16(bios, data + 0x00) * 1000; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c index f43970156558..e4c8d310d870 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/base.c @@ -229,7 +229,7 @@ nvkm_cstate_new(struct nvkm_clk *clk, int idx, struct nvkm_pstate *pstate) struct nvkm_cstate *cstate = NULL; struct nvbios_cstepX cstepX; u8 ver, hdr; - u16 data; + u32 data; data = nvbios_cstepXp(bios, idx, &ver, &hdr, &cstepX); if (!data) @@ -408,7 +408,7 @@ nvkm_pstate_new(struct nvkm_clk *clk, int idx) struct nvbios_cstepE cstepE; struct nvbios_perfE perfE; u8 ver, hdr, cnt, len; - u16 data; + u32 data; data = nvbios_perfEp(bios, idx, &ver, &hdr, &cnt, &len, &perfE); if (!data) -- 2.30.2