Commit be83cd4e authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: finalise nvkm namespace switch (no binary change)

The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 9719047b
...@@ -112,12 +112,12 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod ...@@ -112,12 +112,12 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_bios *bios = nvxx_bios(&drm->device); struct nvkm_bios *bios = nvxx_bios(&drm->device);
struct nouveau_clk *clk = nvxx_clk(&drm->device); struct nvkm_clk *clk = nvxx_clk(&drm->device);
struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(crtc);
struct nv04_mode_state *state = &nv04_display(dev)->mode_reg; struct nv04_mode_state *state = &nv04_display(dev)->mode_reg;
struct nv04_crtc_reg *regp = &state->crtc_reg[nv_crtc->index]; struct nv04_crtc_reg *regp = &state->crtc_reg[nv_crtc->index];
struct nouveau_pll_vals *pv = &regp->pllvals; struct nvkm_pll_vals *pv = &regp->pllvals;
struct nvbios_pll pll_lim; struct nvbios_pll pll_lim;
if (nvbios_pll_parse(bios, nv_crtc->index ? PLL_VPLL1 : PLL_VPLL0, if (nvbios_pll_parse(bios, nv_crtc->index ? PLL_VPLL1 : PLL_VPLL0,
......
...@@ -66,7 +66,7 @@ int nv04_dac_output_offset(struct drm_encoder *encoder) ...@@ -66,7 +66,7 @@ int nv04_dac_output_offset(struct drm_encoder *encoder)
static int sample_load_twice(struct drm_device *dev, bool sense[2]) static int sample_load_twice(struct drm_device *dev, bool sense[2])
{ {
struct nvif_device *device = &nouveau_drm(dev)->device; struct nvif_device *device = &nouveau_drm(dev)->device;
struct nouveau_timer *ptimer = nvxx_timer(device); struct nvkm_timer *ptimer = nvxx_timer(device);
int i; int i;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
...@@ -80,17 +80,17 @@ static int sample_load_twice(struct drm_device *dev, bool sense[2]) ...@@ -80,17 +80,17 @@ static int sample_load_twice(struct drm_device *dev, bool sense[2])
* use a 10ms timeout (guards against crtc being inactive, in * use a 10ms timeout (guards against crtc being inactive, in
* which case blank state would never change) * which case blank state would never change)
*/ */
if (!nouveau_timer_wait_eq(ptimer, 10000000, if (!nvkm_timer_wait_eq(ptimer, 10000000,
NV_PRMCIO_INP0__COLOR, NV_PRMCIO_INP0__COLOR,
0x00000001, 0x00000000)) 0x00000001, 0x00000000))
return -EBUSY; return -EBUSY;
if (!nouveau_timer_wait_eq(ptimer, 10000000, if (!nvkm_timer_wait_eq(ptimer, 10000000,
NV_PRMCIO_INP0__COLOR, NV_PRMCIO_INP0__COLOR,
0x00000001, 0x00000001)) 0x00000001, 0x00000001))
return -EBUSY; return -EBUSY;
if (!nouveau_timer_wait_eq(ptimer, 10000000, if (!nvkm_timer_wait_eq(ptimer, 10000000,
NV_PRMCIO_INP0__COLOR, NV_PRMCIO_INP0__COLOR,
0x00000001, 0x00000000)) 0x00000001, 0x00000000))
return -EBUSY; return -EBUSY;
udelay(100); udelay(100);
...@@ -232,7 +232,7 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) ...@@ -232,7 +232,7 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder)
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_device *device = &nouveau_drm(dev)->device; struct nvif_device *device = &nouveau_drm(dev)->device;
struct nouveau_gpio *gpio = nvxx_gpio(device); struct nvkm_gpio *gpio = nvxx_gpio(device);
struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; struct dcb_output *dcb = nouveau_encoder(encoder)->dcb;
uint32_t sample, testval, regoffset = nv04_dac_output_offset(encoder); uint32_t sample, testval, regoffset = nv04_dac_output_offset(encoder);
uint32_t saved_powerctrl_2 = 0, saved_powerctrl_4 = 0, saved_routput, uint32_t saved_powerctrl_2 = 0, saved_powerctrl_4 = 0, saved_routput,
......
...@@ -623,9 +623,9 @@ static void nv04_tmds_slave_init(struct drm_encoder *encoder) ...@@ -623,9 +623,9 @@ static void nv04_tmds_slave_init(struct drm_encoder *encoder)
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct dcb_output *dcb = nouveau_encoder(encoder)->dcb; struct dcb_output *dcb = nouveau_encoder(encoder)->dcb;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device);
struct nouveau_i2c_port *port = i2c->find(i2c, 2); struct nvkm_i2c_port *port = i2c->find(i2c, 2);
struct nouveau_i2c_board_info info[] = { struct nvkm_i2c_board_info info[] = {
{ {
{ {
.type = "sil164", .type = "sil164",
......
...@@ -35,7 +35,7 @@ int ...@@ -35,7 +35,7 @@ int
nv04_display_create(struct drm_device *dev) nv04_display_create(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device);
struct dcb_table *dcb = &drm->vbios.dcb; struct dcb_table *dcb = &drm->vbios.dcb;
struct drm_connector *connector, *ct; struct drm_connector *connector, *ct;
struct drm_encoder *encoder; struct drm_encoder *encoder;
......
...@@ -36,7 +36,7 @@ struct nv04_crtc_reg { ...@@ -36,7 +36,7 @@ struct nv04_crtc_reg {
/* PRAMDAC regs */ /* PRAMDAC regs */
uint32_t nv10_cursync; uint32_t nv10_cursync;
struct nouveau_pll_vals pllvals; struct nvkm_pll_vals pllvals;
uint32_t ramdac_gen_ctrl; uint32_t ramdac_gen_ctrl;
uint32_t ramdac_630; uint32_t ramdac_630;
uint32_t ramdac_634; uint32_t ramdac_634;
...@@ -170,7 +170,7 @@ nouveau_bios_run_init_table(struct drm_device *dev, u16 table, ...@@ -170,7 +170,7 @@ nouveau_bios_run_init_table(struct drm_device *dev, u16 table,
struct dcb_output *outp, int crtc) struct dcb_output *outp, int crtc)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_bios *bios = nvxx_bios(&drm->device); struct nvkm_bios *bios = nvxx_bios(&drm->device);
struct nvbios_init init = { struct nvbios_init init = {
.subdev = nv_subdev(bios), .subdev = nv_subdev(bios),
.bios = bios, .bios = bios,
......
...@@ -130,7 +130,7 @@ NVBlankScreen(struct drm_device *dev, int head, bool blank) ...@@ -130,7 +130,7 @@ NVBlankScreen(struct drm_device *dev, int head, bool blank)
static void static void
nouveau_hw_decode_pll(struct drm_device *dev, uint32_t reg1, uint32_t pll1, nouveau_hw_decode_pll(struct drm_device *dev, uint32_t reg1, uint32_t pll1,
uint32_t pll2, struct nouveau_pll_vals *pllvals) uint32_t pll2, struct nvkm_pll_vals *pllvals)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
...@@ -162,11 +162,11 @@ nouveau_hw_decode_pll(struct drm_device *dev, uint32_t reg1, uint32_t pll1, ...@@ -162,11 +162,11 @@ nouveau_hw_decode_pll(struct drm_device *dev, uint32_t reg1, uint32_t pll1,
int int
nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype, nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype,
struct nouveau_pll_vals *pllvals) struct nvkm_pll_vals *pllvals)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->device;
struct nouveau_bios *bios = nvxx_bios(device); struct nvkm_bios *bios = nvxx_bios(device);
uint32_t reg1, pll1, pll2 = 0; uint32_t reg1, pll1, pll2 = 0;
struct nvbios_pll pll_lim; struct nvbios_pll pll_lim;
int ret; int ret;
...@@ -202,7 +202,7 @@ nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype, ...@@ -202,7 +202,7 @@ nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype,
} }
int int
nouveau_hw_pllvals_to_clk(struct nouveau_pll_vals *pv) nouveau_hw_pllvals_to_clk(struct nvkm_pll_vals *pv)
{ {
/* Avoid divide by zero if called at an inappropriate time */ /* Avoid divide by zero if called at an inappropriate time */
if (!pv->M1 || !pv->M2) if (!pv->M1 || !pv->M2)
...@@ -214,7 +214,7 @@ nouveau_hw_pllvals_to_clk(struct nouveau_pll_vals *pv) ...@@ -214,7 +214,7 @@ nouveau_hw_pllvals_to_clk(struct nouveau_pll_vals *pv)
int int
nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype) nouveau_hw_get_clock(struct drm_device *dev, enum nvbios_pll_type plltype)
{ {
struct nouveau_pll_vals pllvals; struct nvkm_pll_vals pllvals;
int ret; int ret;
if (plltype == PLL_MEMORY && if (plltype == PLL_MEMORY &&
...@@ -253,10 +253,10 @@ nouveau_hw_fix_bad_vpll(struct drm_device *dev, int head) ...@@ -253,10 +253,10 @@ nouveau_hw_fix_bad_vpll(struct drm_device *dev, int head)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->device;
struct nouveau_clk *clk = nvxx_clk(device); struct nvkm_clk *clk = nvxx_clk(device);
struct nouveau_bios *bios = nvxx_bios(device); struct nvkm_bios *bios = nvxx_bios(device);
struct nvbios_pll pll_lim; struct nvbios_pll pll_lim;
struct nouveau_pll_vals pv; struct nvkm_pll_vals pv;
enum nvbios_pll_type pll = head ? PLL_VPLL1 : PLL_VPLL0; enum nvbios_pll_type pll = head ? PLL_VPLL1 : PLL_VPLL0;
if (nvbios_pll_parse(bios, pll, &pll_lim)) if (nvbios_pll_parse(bios, pll, &pll_lim))
...@@ -463,7 +463,7 @@ nv_load_state_ramdac(struct drm_device *dev, int head, ...@@ -463,7 +463,7 @@ nv_load_state_ramdac(struct drm_device *dev, int head,
struct nv04_mode_state *state) struct nv04_mode_state *state)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_clk *clk = nvxx_clk(&drm->device); struct nvkm_clk *clk = nvxx_clk(&drm->device);
struct nv04_crtc_reg *regp = &state->crtc_reg[head]; struct nv04_crtc_reg *regp = &state->crtc_reg[head];
uint32_t pllreg = head ? NV_RAMDAC_VPLL2 : NV_PRAMDAC_VPLL_COEFF; uint32_t pllreg = head ? NV_RAMDAC_VPLL2 : NV_PRAMDAC_VPLL_COEFF;
int i; int i;
...@@ -661,7 +661,7 @@ nv_load_state_ext(struct drm_device *dev, int head, ...@@ -661,7 +661,7 @@ nv_load_state_ext(struct drm_device *dev, int head,
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->device;
struct nouveau_timer *ptimer = nvxx_timer(device); struct nvkm_timer *ptimer = nvxx_timer(device);
struct nv04_crtc_reg *regp = &state->crtc_reg[head]; struct nv04_crtc_reg *regp = &state->crtc_reg[head];
uint32_t reg900; uint32_t reg900;
int i; int i;
...@@ -741,8 +741,8 @@ nv_load_state_ext(struct drm_device *dev, int head, ...@@ -741,8 +741,8 @@ nv_load_state_ext(struct drm_device *dev, int head,
if (drm->device.info.family < NV_DEVICE_INFO_V0_KELVIN) { if (drm->device.info.family < NV_DEVICE_INFO_V0_KELVIN) {
/* Not waiting for vertical retrace before modifying /* Not waiting for vertical retrace before modifying
CRE_53/CRE_54 causes lockups. */ CRE_53/CRE_54 causes lockups. */
nouveau_timer_wait_eq(ptimer, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x8); nvkm_timer_wait_eq(ptimer, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x8);
nouveau_timer_wait_eq(ptimer, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0); nvkm_timer_wait_eq(ptimer, 650000000, NV_PRMCIO_INP0__COLOR, 0x8, 0x0);
} }
wr_cio_state(dev, head, regp, NV_CIO_CRE_42); wr_cio_state(dev, head, regp, NV_CIO_CRE_42);
......
...@@ -42,8 +42,8 @@ uint8_t NVReadVgaGr(struct drm_device *, int head, uint8_t index); ...@@ -42,8 +42,8 @@ uint8_t NVReadVgaGr(struct drm_device *, int head, uint8_t index);
void NVSetOwner(struct drm_device *, int owner); void NVSetOwner(struct drm_device *, int owner);
void NVBlankScreen(struct drm_device *, int head, bool blank); void NVBlankScreen(struct drm_device *, int head, bool blank);
int nouveau_hw_get_pllvals(struct drm_device *, enum nvbios_pll_type plltype, int nouveau_hw_get_pllvals(struct drm_device *, enum nvbios_pll_type plltype,
struct nouveau_pll_vals *pllvals); struct nvkm_pll_vals *pllvals);
int nouveau_hw_pllvals_to_clk(struct nouveau_pll_vals *pllvals); int nouveau_hw_pllvals_to_clk(struct nvkm_pll_vals *pllvals);
int nouveau_hw_get_clock(struct drm_device *, enum nvbios_pll_type plltype); int nouveau_hw_get_clock(struct drm_device *, enum nvbios_pll_type plltype);
void nouveau_hw_save_vga_fonts(struct drm_device *, bool save); void nouveau_hw_save_vga_fonts(struct drm_device *, bool save);
void nouveau_hw_save_state(struct drm_device *, int head, void nouveau_hw_save_state(struct drm_device *, int head,
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include <drm/i2c/ch7006.h> #include <drm/i2c/ch7006.h>
static struct nouveau_i2c_board_info nv04_tv_encoder_info[] = { static struct nvkm_i2c_board_info nv04_tv_encoder_info[] = {
{ {
{ {
I2C_BOARD_INFO("ch7006", 0x75), I2C_BOARD_INFO("ch7006", 0x75),
...@@ -54,7 +54,7 @@ static struct nouveau_i2c_board_info nv04_tv_encoder_info[] = { ...@@ -54,7 +54,7 @@ static struct nouveau_i2c_board_info nv04_tv_encoder_info[] = {
int nv04_tv_identify(struct drm_device *dev, int i2c_index) int nv04_tv_identify(struct drm_device *dev, int i2c_index)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device);
return i2c->identify(i2c, i2c_index, "TV encoder", return i2c->identify(i2c, i2c_index, "TV encoder",
nv04_tv_encoder_info, NULL, NULL); nv04_tv_encoder_info, NULL, NULL);
...@@ -204,8 +204,8 @@ nv04_tv_create(struct drm_connector *connector, struct dcb_output *entry) ...@@ -204,8 +204,8 @@ nv04_tv_create(struct drm_connector *connector, struct dcb_output *entry)
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device);
struct nouveau_i2c_port *port = i2c->find(i2c, entry->i2c_index); struct nvkm_i2c_port *port = i2c->find(i2c, entry->i2c_index);
int type, ret; int type, ret;
/* Ensure that we can talk to this encoder */ /* Ensure that we can talk to this encoder */
......
...@@ -46,7 +46,7 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder) ...@@ -46,7 +46,7 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->device);
uint32_t testval, regoffset = nv04_dac_output_offset(encoder); uint32_t testval, regoffset = nv04_dac_output_offset(encoder);
uint32_t gpio0, gpio1, fp_htotal, fp_hsync_start, fp_hsync_end, uint32_t gpio0, gpio1, fp_htotal, fp_hsync_start, fp_hsync_end,
fp_control, test_ctrl, dacclk, ctv_14, ctv_1c, ctv_6c; fp_control, test_ctrl, dacclk, ctv_14, ctv_1c, ctv_6c;
...@@ -370,7 +370,7 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) ...@@ -370,7 +370,7 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->device);
struct nv17_tv_state *regs = &to_tv_enc(encoder)->state; struct nv17_tv_state *regs = &to_tv_enc(encoder)->state;
struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder);
......
...@@ -33,7 +33,7 @@ int nvif_client_resume(struct nvif_client *); ...@@ -33,7 +33,7 @@ int nvif_client_resume(struct nvif_client *);
#include <core/client.h> #include <core/client.h>
#define nvxx_client(a) ({ \ #define nvxx_client(a) ({ \
struct nvif_client *_client = nvif_client(nvif_object(a)); \ struct nvif_client *_client = nvif_client(nvif_object(a)); \
nouveau_client(_client->base.priv); \ nvkm_client(_client->base.priv); \
}) })
#endif #endif
...@@ -38,24 +38,24 @@ void nvif_device_ref(struct nvif_device *, struct nvif_device **); ...@@ -38,24 +38,24 @@ void nvif_device_ref(struct nvif_device *, struct nvif_device **);
#include <subdev/therm.h> #include <subdev/therm.h>
#define nvxx_device(a) nv_device(nvxx_object((a))) #define nvxx_device(a) nv_device(nvxx_object((a)))
#define nvxx_bios(a) nouveau_bios(nvxx_device(a)) #define nvxx_bios(a) nvkm_bios(nvxx_device(a))
#define nvxx_fb(a) nouveau_fb(nvxx_device(a)) #define nvxx_fb(a) nvkm_fb(nvxx_device(a))
#define nvxx_mmu(a) nouveau_mmu(nvxx_device(a)) #define nvxx_mmu(a) nvkm_mmu(nvxx_device(a))
#define nvxx_bar(a) nouveau_bar(nvxx_device(a)) #define nvxx_bar(a) nvkm_bar(nvxx_device(a))
#define nvxx_gpio(a) nouveau_gpio(nvxx_device(a)) #define nvxx_gpio(a) nvkm_gpio(nvxx_device(a))
#define nvxx_clk(a) nouveau_clk(nvxx_device(a)) #define nvxx_clk(a) nvkm_clk(nvxx_device(a))
#define nvxx_i2c(a) nouveau_i2c(nvxx_device(a)) #define nvxx_i2c(a) nvkm_i2c(nvxx_device(a))
#define nvxx_timer(a) nouveau_timer(nvxx_device(a)) #define nvxx_timer(a) nvkm_timer(nvxx_device(a))
#define nvxx_wait(a,b,c,d) nv_wait(nvxx_timer(a), (b), (c), (d)) #define nvxx_wait(a,b,c,d) nv_wait(nvxx_timer(a), (b), (c), (d))
#define nvxx_wait_cb(a,b,c) nv_wait_cb(nvxx_timer(a), (b), (c)) #define nvxx_wait_cb(a,b,c) nv_wait_cb(nvxx_timer(a), (b), (c))
#define nvxx_therm(a) nouveau_therm(nvxx_device(a)) #define nvxx_therm(a) nvkm_therm(nvxx_device(a))
#include <core/device.h> #include <core/device.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/gr.h> #include <engine/gr.h>
#include <engine/sw.h> #include <engine/sw.h>
#define nvxx_fifo(a) nouveau_fifo(nvxx_device(a)) #define nvxx_fifo(a) nvkm_fifo(nvxx_device(a))
#define nvxx_fifo_chan(a) ((struct nouveau_fifo_chan *)nvxx_object(a)) #define nvxx_fifo_chan(a) ((struct nvkm_fifo_chan *)nvxx_object(a))
#define nvxx_gr(a) ((struct nouveau_gr *)nouveau_engine(nvxx_object(a), NVDEV_ENGINE_GR)) #define nvxx_gr(a) ((struct nvkm_gr *)nvkm_engine(nvxx_object(a), NVDEV_ENGINE_GR))
#endif #endif
...@@ -70,6 +70,6 @@ void nvif_object_unmap(struct nvif_object *); ...@@ -70,6 +70,6 @@ void nvif_object_unmap(struct nvif_object *);
/*XXX*/ /*XXX*/
#include <core/object.h> #include <core/object.h>
#define nvxx_object(a) ((struct nouveau_object *)nvif_object(a)->priv) #define nvxx_object(a) ((struct nvkm_object *)nvif_object(a)->priv)
#endif #endif
#ifndef __NOUVEAU_MXM_H__ #ifndef __NVKM_MXM_H__
#define __NOUVEAU_MXM_H__ #define __NVKM_MXM_H__
#include <core/subdev.h> #include <core/subdev.h>
#include <core/device.h>
#define MXM_SANITISE_DCB 0x00000001 #define MXM_SANITISE_DCB 0x00000001
struct nouveau_mxm { struct nvkm_mxm {
struct nouveau_subdev base; struct nvkm_subdev base;
u32 action; u32 action;
u8 *mxms; u8 *mxms;
}; };
static inline struct nouveau_mxm * static inline struct nvkm_mxm *
nouveau_mxm(void *obj) nvkm_mxm(void *obj)
{ {
return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_MXM); return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_MXM);
} }
#define nouveau_mxm_create(p,e,o,d) \ #define nvkm_mxm_create(p,e,o,d) \
nouveau_mxm_create_((p), (e), (o), sizeof(**d), (void **)d) nvkm_mxm_create_((p), (e), (o), sizeof(**d), (void **)d)
#define nouveau_mxm_init(p) \ #define nvkm_mxm_init(p) \
nouveau_subdev_init(&(p)->base) nvkm_subdev_init(&(p)->base)
#define nouveau_mxm_fini(p,s) \ #define nvkm_mxm_fini(p,s) \
nouveau_subdev_fini(&(p)->base, (s)) nvkm_subdev_fini(&(p)->base, (s))
int nouveau_mxm_create_(struct nouveau_object *, struct nouveau_object *, int nvkm_mxm_create_(struct nvkm_object *, struct nvkm_object *,
struct nouveau_oclass *, int, void **); struct nvkm_oclass *, int, void **);
void nouveau_mxm_destroy(struct nouveau_mxm *); void nvkm_mxm_destroy(struct nvkm_mxm *);
#define _nouveau_mxm_dtor _nouveau_subdev_dtor #define _nvkm_mxm_dtor _nvkm_subdev_dtor
#define _nouveau_mxm_init _nouveau_subdev_init #define _nvkm_mxm_init _nvkm_subdev_init
#define _nouveau_mxm_fini _nouveau_subdev_fini #define _nvkm_mxm_fini _nvkm_subdev_fini
extern struct nouveau_oclass nv50_mxm_oclass; extern struct nvkm_oclass nv50_mxm_oclass;
#endif #endif
...@@ -100,7 +100,7 @@ static void ...@@ -100,7 +100,7 @@ static void
nouveau_abi16_ntfy_fini(struct nouveau_abi16_chan *chan, nouveau_abi16_ntfy_fini(struct nouveau_abi16_chan *chan,
struct nouveau_abi16_ntfy *ntfy) struct nouveau_abi16_ntfy *ntfy)
{ {
nouveau_mm_free(&chan->heap, &ntfy->node); nvkm_mm_free(&chan->heap, &ntfy->node);
list_del(&ntfy->head); list_del(&ntfy->head);
kfree(ntfy); kfree(ntfy);
} }
...@@ -128,7 +128,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16, ...@@ -128,7 +128,7 @@ nouveau_abi16_chan_fini(struct nouveau_abi16 *abi16,
} }
if (chan->heap.block_size) if (chan->heap.block_size)
nouveau_mm_fini(&chan->heap); nvkm_mm_fini(&chan->heap);
/* destroy channel object, all children will be killed too */ /* destroy channel object, all children will be killed too */
if (chan->chan) { if (chan->chan) {
...@@ -164,8 +164,8 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS) ...@@ -164,8 +164,8 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS)
struct nouveau_cli *cli = nouveau_cli(file_priv); struct nouveau_cli *cli = nouveau_cli(file_priv);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->device;
struct nouveau_timer *ptimer = nvxx_timer(device); struct nvkm_timer *ptimer = nvxx_timer(device);
struct nouveau_gr *gr = nvxx_gr(device); struct nvkm_gr *gr = nvxx_gr(device);
struct drm_nouveau_getparam *getparam = data; struct drm_nouveau_getparam *getparam = data;
switch (getparam->param) { switch (getparam->param) {
...@@ -324,7 +324,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS) ...@@ -324,7 +324,7 @@ nouveau_abi16_ioctl_channel_alloc(ABI16_IOCTL_ARGS)
if (ret) if (ret)
goto done; goto done;
ret = nouveau_mm_init(&chan->heap, 0, PAGE_SIZE, 1); ret = nvkm_mm_init(&chan->heap, 0, PAGE_SIZE, 1);
done: done:
if (ret) if (ret)
nouveau_abi16_chan_fini(abi16, chan); nouveau_abi16_chan_fini(abi16, chan);
...@@ -448,8 +448,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS) ...@@ -448,8 +448,8 @@ nouveau_abi16_ioctl_notifierobj_alloc(ABI16_IOCTL_ARGS)
list_add(&ntfy->head, &chan->notifiers); list_add(&ntfy->head, &chan->notifiers);
ntfy->handle = info->handle; ntfy->handle = info->handle;
ret = nouveau_mm_head(&chan->heap, 0, 1, info->size, info->size, 1, ret = nvkm_mm_head(&chan->heap, 0, 1, info->size, info->size, 1,
&ntfy->node); &ntfy->node);
if (ret) if (ret)
goto done; goto done;
...@@ -527,7 +527,7 @@ nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS) ...@@ -527,7 +527,7 @@ nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS)
/* cleanup extra state if this object was a notifier */ /* cleanup extra state if this object was a notifier */
list_for_each_entry(ntfy, &chan->notifiers, head) { list_for_each_entry(ntfy, &chan->notifiers, head) {
if (ntfy->handle == fini->handle) { if (ntfy->handle == fini->handle) {
nouveau_mm_free(&chan->heap, &ntfy->node); nvkm_mm_free(&chan->heap, &ntfy->node);
list_del(&ntfy->head); list_del(&ntfy->head);
break; break;
} }
......
...@@ -14,7 +14,7 @@ int nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS); ...@@ -14,7 +14,7 @@ int nouveau_abi16_ioctl_gpuobj_free(ABI16_IOCTL_ARGS);
struct nouveau_abi16_ntfy { struct nouveau_abi16_ntfy {
struct list_head head; struct list_head head;
struct nouveau_mm_node *node; struct nvkm_mm_node *node;
u32 handle; u32 handle;
}; };
...@@ -23,8 +23,8 @@ struct nouveau_abi16_chan { ...@@ -23,8 +23,8 @@ struct nouveau_abi16_chan {
struct nouveau_channel *chan; struct nouveau_channel *chan;
struct list_head notifiers; struct list_head notifiers;
struct nouveau_bo *ntfy; struct nouveau_bo *ntfy;
struct nouveau_vma ntfy_vma; struct nvkm_vma ntfy_vma;
struct nouveau_mm heap; struct nvkm_mm heap;
}; };
struct nouveau_abi16 { struct nouveau_abi16 {
......
...@@ -2009,7 +2009,7 @@ uint8_t *nouveau_bios_embedded_edid(struct drm_device *dev) ...@@ -2009,7 +2009,7 @@ uint8_t *nouveau_bios_embedded_edid(struct drm_device *dev)
static bool NVInitVBIOS(struct drm_device *dev) static bool NVInitVBIOS(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_bios *bios = nvxx_bios(&drm->device); struct nvkm_bios *bios = nvxx_bios(&drm->device);
struct nvbios *legacy = &drm->vbios; struct nvbios *legacy = &drm->vbios;
memset(legacy, 0, sizeof(struct nvbios)); memset(legacy, 0, sizeof(struct nvbios));
......
This diff is collapsed.
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
struct nouveau_channel; struct nouveau_channel;
struct nouveau_fence; struct nouveau_fence;
struct nouveau_vma; struct nvkm_vma;
struct nouveau_bo { struct nouveau_bo {
struct ttm_buffer_object bo; struct ttm_buffer_object bo;
...@@ -87,12 +87,12 @@ int nouveau_bo_validate(struct nouveau_bo *, bool interruptible, ...@@ -87,12 +87,12 @@ int nouveau_bo_validate(struct nouveau_bo *, bool interruptible,
void nouveau_bo_sync_for_device(struct nouveau_bo *nvbo); void nouveau_bo_sync_for_device(struct nouveau_bo *nvbo);
void nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo); void nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo);
struct nouveau_vma * struct nvkm_vma *
nouveau_bo_vma_find(struct nouveau_bo *, struct nouveau_vm *); nouveau_bo_vma_find(struct nouveau_bo *, struct nvkm_vm *);
int nouveau_bo_vma_add(struct nouveau_bo *, struct nouveau_vm *, int nouveau_bo_vma_add(struct nouveau_bo *, struct nvkm_vm *,
struct nouveau_vma *); struct nvkm_vma *);
void nouveau_bo_vma_del(struct nouveau_bo *, struct nouveau_vma *); void nouveau_bo_vma_del(struct nouveau_bo *, struct nvkm_vma *);
/* TODO: submit equivalent to TTM generic API upstream? */ /* TODO: submit equivalent to TTM generic API upstream? */
static inline void __iomem * static inline void __iomem *
......
...@@ -88,7 +88,7 @@ nouveau_channel_prep(struct nouveau_drm *drm, struct nvif_device *device, ...@@ -88,7 +88,7 @@ nouveau_channel_prep(struct nouveau_drm *drm, struct nvif_device *device,
u32 handle, u32 size, struct nouveau_channel **pchan) u32 handle, u32 size, struct nouveau_channel **pchan)
{ {
struct nouveau_cli *cli = (void *)nvif_client(&device->base); struct nouveau_cli *cli = (void *)nvif_client(&device->base);
struct nouveau_mmu *mmu = nvxx_mmu(device); struct nvkm_mmu *mmu = nvxx_mmu(device);
struct nv_dma_v0 args = {}; struct nv_dma_v0 args = {};
struct nouveau_channel *chan; struct nouveau_channel *chan;
u32 target; u32 target;
...@@ -281,8 +281,8 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart) ...@@ -281,8 +281,8 @@ nouveau_channel_init(struct nouveau_channel *chan, u32 vram, u32 gart)
{ {
struct nvif_device *device = chan->device; struct nvif_device *device = chan->device;
struct nouveau_cli *cli = (void *)nvif_client(&device->base); struct nouveau_cli *cli = (void *)nvif_client(&device->base);
struct nouveau_mmu *mmu = nvxx_mmu(device); struct nvkm_mmu *mmu = nvxx_mmu(device);
struct nouveau_sw_chan *swch; struct nvkm_sw_chan *swch;
struct nv_dma_v0 args = {}; struct nv_dma_v0 args = {};
int ret, i; int ret, i;
......
...@@ -16,7 +16,7 @@ struct nouveau_channel { ...@@ -16,7 +16,7 @@ struct nouveau_channel {
struct { struct {
struct nouveau_bo *buffer; struct nouveau_bo *buffer;
struct nouveau_vma vma; struct nvkm_vma vma;
struct nvif_object ctxdma; struct nvif_object ctxdma;
} push; } push;
......
...@@ -115,7 +115,7 @@ nouveau_connector_ddc_detect(struct drm_connector *connector) ...@@ -115,7 +115,7 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_connector *nv_connector = nouveau_connector(connector);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->device);
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
int i, panel = -ENODEV; int i, panel = -ENODEV;
...@@ -241,7 +241,7 @@ nouveau_connector_detect(struct drm_connector *connector, bool force) ...@@ -241,7 +241,7 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_connector *nv_connector = nouveau_connector(connector);
struct nouveau_encoder *nv_encoder = NULL; struct nouveau_encoder *nv_encoder = NULL;
struct nouveau_encoder *nv_partner; struct nouveau_encoder *nv_partner;
struct nouveau_i2c_port *i2c; struct nvkm_i2c_port *i2c;
int type; int type;
int ret; int ret;
enum drm_connector_status conn_status = connector_status_disconnected; enum drm_connector_status conn_status = connector_status_disconnected;
...@@ -985,7 +985,7 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) ...@@ -985,7 +985,7 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
struct nouveau_connector *nv_connector = struct nouveau_connector *nv_connector =
container_of(aux, typeof(*nv_connector), aux); container_of(aux, typeof(*nv_connector), aux);
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct nouveau_i2c_port *port; struct nvkm_i2c_port *port;
int ret; int ret;
nv_encoder = find_encoder(&nv_connector->base, DCB_OUTPUT_DP); nv_encoder = find_encoder(&nv_connector->base, DCB_OUTPUT_DP);
...@@ -996,13 +996,13 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) ...@@ -996,13 +996,13 @@ nouveau_connector_aux_xfer(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg)
if (msg->size == 0) if (msg->size == 0)
return msg->size; return msg->size;
ret = nouveau_i2c(port)->acquire(port, 0); ret = nvkm_i2c(port)->acquire(port, 0);
if (ret) if (ret)
return ret; return ret;
ret = port->func->aux(port, false, msg->request, msg->address, ret = port->func->aux(port, false, msg->request, msg->address,
msg->buffer, msg->size); msg->buffer, msg->size);
nouveau_i2c(port)->release(port); nvkm_i2c(port)->release(port);
if (ret >= 0) { if (ret >= 0) {
msg->reply = ret; msg->reply = ret;
return msg->size; return msg->size;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include <drm/drm_dp_helper.h> #include <drm/drm_dp_helper.h>
#include "nouveau_crtc.h" #include "nouveau_crtc.h"
struct nouveau_i2c_port; struct nvkm_i2c_port;
enum nouveau_underscan_type { enum nouveau_underscan_type {
UNDERSCAN_OFF, UNDERSCAN_OFF,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
struct nouveau_framebuffer { struct nouveau_framebuffer {
struct drm_framebuffer base; struct drm_framebuffer base;
struct nouveau_bo *nvbo; struct nouveau_bo *nvbo;
struct nouveau_vma vma; struct nvkm_vma vma;
u32 r_handle; u32 r_handle;
u32 r_format; u32 r_format;
u32 r_pitch; u32 r_pitch;
......
...@@ -84,7 +84,7 @@ nv50_dma_push(struct nouveau_channel *chan, struct nouveau_bo *bo, ...@@ -84,7 +84,7 @@ nv50_dma_push(struct nouveau_channel *chan, struct nouveau_bo *bo,
{ {
struct nouveau_cli *cli = (void *)nvif_client(&chan->device->base); struct nouveau_cli *cli = (void *)nvif_client(&chan->device->base);
struct nouveau_bo *pb = chan->push.buffer; struct nouveau_bo *pb = chan->push.buffer;
struct nouveau_vma *vma; struct nvkm_vma *vma;
int ip = (chan->dma.ib_put * 2) + chan->dma.ib_base; int ip = (chan->dma.ib_put * 2) + chan->dma.ib_base;
u64 offset; u64 offset;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "nouveau_crtc.h" #include "nouveau_crtc.h"
static void static void
nouveau_dp_probe_oui(struct drm_device *dev, struct nouveau_i2c_port *auxch, nouveau_dp_probe_oui(struct drm_device *dev, struct nvkm_i2c_port *auxch,
u8 *dpcd) u8 *dpcd)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
...@@ -55,7 +55,7 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder) ...@@ -55,7 +55,7 @@ nouveau_dp_detect(struct nouveau_encoder *nv_encoder)
{ {
struct drm_device *dev = nv_encoder->base.base.dev; struct drm_device *dev = nv_encoder->base.base.dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_i2c_port *auxch; struct nvkm_i2c_port *auxch;
u8 *dpcd = nv_encoder->dp.dpcd; u8 *dpcd = nv_encoder->dp.dpcd;
int ret; int ret;
......
...@@ -124,7 +124,7 @@ nouveau_cli_create(u64 name, const char *sname, ...@@ -124,7 +124,7 @@ nouveau_cli_create(u64 name, const char *sname,
static void static void
nouveau_cli_destroy(struct nouveau_cli *cli) nouveau_cli_destroy(struct nouveau_cli *cli)
{ {
nouveau_vm_ref(NULL, &nvxx_client(&cli->base)->vm, NULL); nvkm_vm_ref(NULL, &nvxx_client(&cli->base)->vm, NULL);
nvif_client_fini(&cli->base); nvif_client_fini(&cli->base);
usif_client_fini(cli); usif_client_fini(cli);
} }
...@@ -134,7 +134,7 @@ nouveau_accel_fini(struct nouveau_drm *drm) ...@@ -134,7 +134,7 @@ nouveau_accel_fini(struct nouveau_drm *drm)
{ {
nouveau_channel_del(&drm->channel); nouveau_channel_del(&drm->channel);
nvif_object_fini(&drm->ntfy); nvif_object_fini(&drm->ntfy);
nouveau_gpuobj_ref(NULL, &drm->notify); nvkm_gpuobj_ref(NULL, &drm->notify);
nvif_object_fini(&drm->nvsw); nvif_object_fini(&drm->nvsw);
nouveau_channel_del(&drm->cechan); nouveau_channel_del(&drm->cechan);
nvif_object_fini(&drm->ttm.copy); nvif_object_fini(&drm->ttm.copy);
...@@ -231,7 +231,7 @@ nouveau_accel_init(struct nouveau_drm *drm) ...@@ -231,7 +231,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
ret = nvif_object_init(drm->channel->object, NULL, NVDRM_NVSW, ret = nvif_object_init(drm->channel->object, NULL, NVDRM_NVSW,
nouveau_abi16_swclass(drm), NULL, 0, &drm->nvsw); nouveau_abi16_swclass(drm), NULL, 0, &drm->nvsw);
if (ret == 0) { if (ret == 0) {
struct nouveau_sw_chan *swch; struct nvkm_sw_chan *swch;
ret = RING_SPACE(drm->channel, 2); ret = RING_SPACE(drm->channel, 2);
if (ret == 0) { if (ret == 0) {
if (device->info.family < NV_DEVICE_INFO_V0_FERMI) { if (device->info.family < NV_DEVICE_INFO_V0_FERMI) {
...@@ -255,8 +255,8 @@ nouveau_accel_init(struct nouveau_drm *drm) ...@@ -255,8 +255,8 @@ nouveau_accel_init(struct nouveau_drm *drm)
} }
if (device->info.family < NV_DEVICE_INFO_V0_FERMI) { if (device->info.family < NV_DEVICE_INFO_V0_FERMI) {
ret = nouveau_gpuobj_new(nvxx_object(&drm->device), NULL, 32, ret = nvkm_gpuobj_new(nvxx_object(&drm->device), NULL, 32,
0, 0, &drm->notify); 0, 0, &drm->notify);
if (ret) { if (ret) {
NV_ERROR(drm, "failed to allocate notifier, %d\n", ret); NV_ERROR(drm, "failed to allocate notifier, %d\n", ret);
nouveau_accel_fini(drm); nouveau_accel_fini(drm);
...@@ -285,7 +285,7 @@ nouveau_accel_init(struct nouveau_drm *drm) ...@@ -285,7 +285,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
static int nouveau_drm_probe(struct pci_dev *pdev, static int nouveau_drm_probe(struct pci_dev *pdev,
const struct pci_device_id *pent) const struct pci_device_id *pent)
{ {
struct nouveau_device *device; struct nvkm_device *device;
struct apertures_struct *aper; struct apertures_struct *aper;
bool boot = false; bool boot = false;
int ret; int ret;
...@@ -318,9 +318,9 @@ static int nouveau_drm_probe(struct pci_dev *pdev, ...@@ -318,9 +318,9 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
remove_conflicting_framebuffers(aper, "nouveaufb", boot); remove_conflicting_framebuffers(aper, "nouveaufb", boot);
kfree(aper); kfree(aper);
ret = nouveau_device_create(pdev, NVKM_BUS_PCI, ret = nvkm_device_create(pdev, NVKM_BUS_PCI,
nouveau_pci_name(pdev), pci_name(pdev), nouveau_pci_name(pdev), pci_name(pdev),
nouveau_config, nouveau_debug, &device); nouveau_config, nouveau_debug, &device);
if (ret) if (ret)
return ret; return ret;
...@@ -328,7 +328,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev, ...@@ -328,7 +328,7 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
ret = drm_get_pci_dev(pdev, pent, &driver_pci); ret = drm_get_pci_dev(pdev, pent, &driver_pci);
if (ret) { if (ret) {
nouveau_object_ref(NULL, (struct nouveau_object **)&device); nvkm_object_ref(NULL, (struct nvkm_object **)&device);
return ret; return ret;
} }
...@@ -380,7 +380,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -380,7 +380,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
dev->dev_private = drm; dev->dev_private = drm;
drm->dev = dev; drm->dev = dev;
nvxx_client(&drm->client.base)->debug = nvxx_client(&drm->client.base)->debug =
nouveau_dbgopt(nouveau_debug, "DRM"); nvkm_dbgopt(nouveau_debug, "DRM");
INIT_LIST_HEAD(&drm->clients); INIT_LIST_HEAD(&drm->clients);
spin_lock_init(&drm->tile.lock); spin_lock_init(&drm->tile.lock);
...@@ -435,8 +435,8 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -435,8 +435,8 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
nouveau_agp_init(drm); nouveau_agp_init(drm);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ret = nouveau_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40), ret = nvkm_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40),
0x1000, &drm->client.vm); 0x1000, &drm->client.vm);
if (ret) if (ret)
goto fail_device; goto fail_device;
...@@ -523,16 +523,16 @@ void ...@@ -523,16 +523,16 @@ void
nouveau_drm_device_remove(struct drm_device *dev) nouveau_drm_device_remove(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_client *client; struct nvkm_client *client;
struct nouveau_object *device; struct nvkm_object *device;
dev->irq_enabled = false; dev->irq_enabled = false;
client = nvxx_client(&drm->client.base); client = nvxx_client(&drm->client.base);
device = client->device; device = client->device;
drm_put_dev(dev); drm_put_dev(dev);
nouveau_object_ref(NULL, &device); nvkm_object_ref(NULL, &device);
nouveau_object_debug(); nvkm_object_debug();
} }
static void static void
...@@ -831,8 +831,8 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv) ...@@ -831,8 +831,8 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv)
cli->base.super = false; cli->base.super = false;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ret = nouveau_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40), ret = nvkm_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40),
0x1000, &cli->vm); 0x1000, &cli->vm);
if (ret) { if (ret) {
nouveau_cli_destroy(cli); nouveau_cli_destroy(cli);
goto out_suspend; goto out_suspend;
...@@ -1056,10 +1056,10 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size, ...@@ -1056,10 +1056,10 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size,
struct drm_device *drm; struct drm_device *drm;
int err; int err;
err = nouveau_device_create_(pdev, NVKM_BUS_PLATFORM, err = nvkm_device_create_(pdev, NVKM_BUS_PLATFORM,
nouveau_platform_name(pdev), nouveau_platform_name(pdev),
dev_name(&pdev->dev), nouveau_config, dev_name(&pdev->dev), nouveau_config,
nouveau_debug, size, pobject); nouveau_debug, size, pobject);
if (err) if (err)
return ERR_PTR(err); return ERR_PTR(err);
...@@ -1079,7 +1079,7 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size, ...@@ -1079,7 +1079,7 @@ nouveau_platform_device_create_(struct platform_device *pdev, int size,
return drm; return drm;
err_free: err_free:
nouveau_object_ref(NULL, (struct nouveau_object **)pobject); nvkm_object_ref(NULL, (struct nvkm_object **)pobject);
return ERR_PTR(err); return ERR_PTR(err);
} }
......
...@@ -80,7 +80,7 @@ enum nouveau_drm_handle { ...@@ -80,7 +80,7 @@ enum nouveau_drm_handle {
struct nouveau_cli { struct nouveau_cli {
struct nvif_client base; struct nvif_client base;
struct nouveau_vm *vm; /*XXX*/ struct nvkm_vm *vm; /*XXX*/
struct list_head head; struct list_head head;
struct mutex mutex; struct mutex mutex;
void *abi16; void *abi16;
...@@ -142,7 +142,7 @@ struct nouveau_drm { ...@@ -142,7 +142,7 @@ struct nouveau_drm {
/* context for accelerated drm-internal operations */ /* context for accelerated drm-internal operations */
struct nouveau_channel *cechan; struct nouveau_channel *cechan;
struct nouveau_channel *channel; struct nouveau_channel *channel;
struct nouveau_gpuobj *notify; struct nvkm_gpuobj *notify;
struct nouveau_fbdev *fbcon; struct nouveau_fbdev *fbcon;
struct nvif_object nvsw; struct nvif_object nvsw;
struct nvif_object ntfy; struct nvif_object ntfy;
......
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
#define NV_DPMS_CLEARED 0x80 #define NV_DPMS_CLEARED 0x80
struct nouveau_i2c_port; struct nvkm_i2c_port;
struct nouveau_encoder { struct nouveau_encoder {
struct drm_encoder_slave base; struct drm_encoder_slave base;
struct dcb_output *dcb; struct dcb_output *dcb;
int or; int or;
struct nouveau_i2c_port *i2c; struct nvkm_i2c_port *i2c;
/* different to drm_encoder.crtc, this reflects what's /* different to drm_encoder.crtc, this reflects what's
* actually programmed on the hw, not the proposed crtc */ * actually programmed on the hw, not the proposed crtc */
......
...@@ -89,9 +89,9 @@ int nouveau_flip_complete(void *chan); ...@@ -89,9 +89,9 @@ int nouveau_flip_complete(void *chan);
struct nv84_fence_chan { struct nv84_fence_chan {
struct nouveau_fence_chan base; struct nouveau_fence_chan base;
struct nouveau_vma vma; struct nvkm_vma vma;
struct nouveau_vma vma_gart; struct nvkm_vma vma_gart;
struct nouveau_vma dispc_vma[4]; struct nvkm_vma dispc_vma[4];
}; };
struct nv84_fence_priv { struct nv84_fence_priv {
......
...@@ -64,7 +64,7 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv) ...@@ -64,7 +64,7 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
struct nouveau_cli *cli = nouveau_cli(file_priv); struct nouveau_cli *cli = nouveau_cli(file_priv);
struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct nouveau_bo *nvbo = nouveau_gem_object(gem);
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct nouveau_vma *vma; struct nvkm_vma *vma;
struct device *dev = drm->dev->dev; struct device *dev = drm->dev->dev;
int ret; int ret;
...@@ -105,14 +105,14 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv) ...@@ -105,14 +105,14 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
static void static void
nouveau_gem_object_delete(void *data) nouveau_gem_object_delete(void *data)
{ {
struct nouveau_vma *vma = data; struct nvkm_vma *vma = data;
nouveau_vm_unmap(vma); nvkm_vm_unmap(vma);
nouveau_vm_put(vma); nvkm_vm_put(vma);
kfree(vma); kfree(vma);
} }
static void static void
nouveau_gem_object_unmap(struct nouveau_bo *nvbo, struct nouveau_vma *vma) nouveau_gem_object_unmap(struct nouveau_bo *nvbo, struct nvkm_vma *vma)
{ {
const bool mapped = nvbo->bo.mem.mem_type != TTM_PL_SYSTEM; const bool mapped = nvbo->bo.mem.mem_type != TTM_PL_SYSTEM;
struct reservation_object *resv = nvbo->bo.resv; struct reservation_object *resv = nvbo->bo.resv;
...@@ -135,8 +135,8 @@ nouveau_gem_object_unmap(struct nouveau_bo *nvbo, struct nouveau_vma *vma) ...@@ -135,8 +135,8 @@ nouveau_gem_object_unmap(struct nouveau_bo *nvbo, struct nouveau_vma *vma)
nouveau_fence_work(fence, nouveau_gem_object_delete, vma); nouveau_fence_work(fence, nouveau_gem_object_delete, vma);
} else { } else {
if (mapped) if (mapped)
nouveau_vm_unmap(vma); nvkm_vm_unmap(vma);
nouveau_vm_put(vma); nvkm_vm_put(vma);
kfree(vma); kfree(vma);
} }
} }
...@@ -148,7 +148,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv) ...@@ -148,7 +148,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv)
struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct nouveau_bo *nvbo = nouveau_gem_object(gem);
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct device *dev = drm->dev->dev; struct device *dev = drm->dev->dev;
struct nouveau_vma *vma; struct nvkm_vma *vma;
int ret; int ret;
if (!cli->vm) if (!cli->vm)
...@@ -222,7 +222,7 @@ nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem, ...@@ -222,7 +222,7 @@ nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem,
{ {
struct nouveau_cli *cli = nouveau_cli(file_priv); struct nouveau_cli *cli = nouveau_cli(file_priv);
struct nouveau_bo *nvbo = nouveau_gem_object(gem); struct nouveau_bo *nvbo = nouveau_gem_object(gem);
struct nouveau_vma *vma; struct nvkm_vma *vma;
if (nvbo->bo.mem.mem_type == TTM_PL_TT) if (nvbo->bo.mem.mem_type == TTM_PL_TT)
rep->domain = NOUVEAU_GEM_DOMAIN_GART; rep->domain = NOUVEAU_GEM_DOMAIN_GART;
...@@ -251,7 +251,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, ...@@ -251,7 +251,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data,
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_cli *cli = nouveau_cli(file_priv); struct nouveau_cli *cli = nouveau_cli(file_priv);
struct nouveau_fb *pfb = nvxx_fb(&drm->device); struct nvkm_fb *pfb = nvxx_fb(&drm->device);
struct drm_nouveau_gem_new *req = data; struct drm_nouveau_gem_new *req = data;
struct nouveau_bo *nvbo = NULL; struct nouveau_bo *nvbo = NULL;
int ret = 0; int ret = 0;
......
...@@ -40,7 +40,7 @@ nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) ...@@ -40,7 +40,7 @@ nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf)
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
int temp = therm->temp_get(therm); int temp = therm->temp_get(therm);
if (temp < 0) if (temp < 0)
...@@ -66,7 +66,7 @@ nouveau_hwmon_temp1_auto_point1_temp(struct device *d, ...@@ -66,7 +66,7 @@ nouveau_hwmon_temp1_auto_point1_temp(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST) * 1000);
...@@ -78,7 +78,7 @@ nouveau_hwmon_set_temp1_auto_point1_temp(struct device *d, ...@@ -78,7 +78,7 @@ nouveau_hwmon_set_temp1_auto_point1_temp(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -99,7 +99,7 @@ nouveau_hwmon_temp1_auto_point1_temp_hyst(struct device *d, ...@@ -99,7 +99,7 @@ nouveau_hwmon_temp1_auto_point1_temp_hyst(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_FAN_BOOST_HYST) * 1000);
...@@ -111,7 +111,7 @@ nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d, ...@@ -111,7 +111,7 @@ nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -131,7 +131,7 @@ nouveau_hwmon_max_temp(struct device *d, struct device_attribute *a, char *buf) ...@@ -131,7 +131,7 @@ nouveau_hwmon_max_temp(struct device *d, struct device_attribute *a, char *buf)
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK) * 1000);
...@@ -142,7 +142,7 @@ nouveau_hwmon_set_max_temp(struct device *d, struct device_attribute *a, ...@@ -142,7 +142,7 @@ nouveau_hwmon_set_max_temp(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -162,7 +162,7 @@ nouveau_hwmon_max_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -162,7 +162,7 @@ nouveau_hwmon_max_temp_hyst(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK_HYST) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_DOWN_CLK_HYST) * 1000);
...@@ -173,7 +173,7 @@ nouveau_hwmon_set_max_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -173,7 +173,7 @@ nouveau_hwmon_set_max_temp_hyst(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -194,7 +194,7 @@ nouveau_hwmon_critical_temp(struct device *d, struct device_attribute *a, ...@@ -194,7 +194,7 @@ nouveau_hwmon_critical_temp(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_CRITICAL) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_CRITICAL) * 1000);
...@@ -206,7 +206,7 @@ nouveau_hwmon_set_critical_temp(struct device *d, struct device_attribute *a, ...@@ -206,7 +206,7 @@ nouveau_hwmon_set_critical_temp(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -227,7 +227,7 @@ nouveau_hwmon_critical_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -227,7 +227,7 @@ nouveau_hwmon_critical_temp_hyst(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_CRITICAL_HYST) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_CRITICAL_HYST) * 1000);
...@@ -240,7 +240,7 @@ nouveau_hwmon_set_critical_temp_hyst(struct device *d, ...@@ -240,7 +240,7 @@ nouveau_hwmon_set_critical_temp_hyst(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -260,7 +260,7 @@ nouveau_hwmon_emergency_temp(struct device *d, struct device_attribute *a, ...@@ -260,7 +260,7 @@ nouveau_hwmon_emergency_temp(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_SHUTDOWN) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_SHUTDOWN) * 1000);
...@@ -272,7 +272,7 @@ nouveau_hwmon_set_emergency_temp(struct device *d, struct device_attribute *a, ...@@ -272,7 +272,7 @@ nouveau_hwmon_set_emergency_temp(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -293,7 +293,7 @@ nouveau_hwmon_emergency_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -293,7 +293,7 @@ nouveau_hwmon_emergency_temp_hyst(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", return snprintf(buf, PAGE_SIZE, "%d\n",
therm->attr_get(therm, NVKM_THERM_ATTR_THRS_SHUTDOWN_HYST) * 1000); therm->attr_get(therm, NVKM_THERM_ATTR_THRS_SHUTDOWN_HYST) * 1000);
...@@ -306,7 +306,7 @@ nouveau_hwmon_set_emergency_temp_hyst(struct device *d, ...@@ -306,7 +306,7 @@ nouveau_hwmon_set_emergency_temp_hyst(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -346,7 +346,7 @@ nouveau_hwmon_show_fan1_input(struct device *d, struct device_attribute *attr, ...@@ -346,7 +346,7 @@ nouveau_hwmon_show_fan1_input(struct device *d, struct device_attribute *attr,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
return snprintf(buf, PAGE_SIZE, "%d\n", therm->fan_sense(therm)); return snprintf(buf, PAGE_SIZE, "%d\n", therm->fan_sense(therm));
} }
...@@ -359,7 +359,7 @@ nouveau_hwmon_get_pwm1_enable(struct device *d, ...@@ -359,7 +359,7 @@ nouveau_hwmon_get_pwm1_enable(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
int ret; int ret;
ret = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MODE); ret = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MODE);
...@@ -375,7 +375,7 @@ nouveau_hwmon_set_pwm1_enable(struct device *d, struct device_attribute *a, ...@@ -375,7 +375,7 @@ nouveau_hwmon_set_pwm1_enable(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
int ret; int ret;
...@@ -398,7 +398,7 @@ nouveau_hwmon_get_pwm1(struct device *d, struct device_attribute *a, char *buf) ...@@ -398,7 +398,7 @@ nouveau_hwmon_get_pwm1(struct device *d, struct device_attribute *a, char *buf)
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
int ret; int ret;
ret = therm->fan_get(therm); ret = therm->fan_get(therm);
...@@ -414,7 +414,7 @@ nouveau_hwmon_set_pwm1(struct device *d, struct device_attribute *a, ...@@ -414,7 +414,7 @@ nouveau_hwmon_set_pwm1(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
int ret = -ENODEV; int ret = -ENODEV;
long value; long value;
...@@ -438,7 +438,7 @@ nouveau_hwmon_get_pwm1_min(struct device *d, ...@@ -438,7 +438,7 @@ nouveau_hwmon_get_pwm1_min(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
int ret; int ret;
ret = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MIN_DUTY); ret = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MIN_DUTY);
...@@ -454,7 +454,7 @@ nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a, ...@@ -454,7 +454,7 @@ nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
int ret; int ret;
...@@ -478,7 +478,7 @@ nouveau_hwmon_get_pwm1_max(struct device *d, ...@@ -478,7 +478,7 @@ nouveau_hwmon_get_pwm1_max(struct device *d,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
int ret; int ret;
ret = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MAX_DUTY); ret = therm->attr_get(therm, NVKM_THERM_ATTR_FAN_MAX_DUTY);
...@@ -494,7 +494,7 @@ nouveau_hwmon_set_pwm1_max(struct device *d, struct device_attribute *a, ...@@ -494,7 +494,7 @@ nouveau_hwmon_set_pwm1_max(struct device *d, struct device_attribute *a,
{ {
struct drm_device *dev = dev_get_drvdata(d); struct drm_device *dev = dev_get_drvdata(d);
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
long value; long value;
int ret; int ret;
...@@ -561,7 +561,7 @@ nouveau_hwmon_init(struct drm_device *dev) ...@@ -561,7 +561,7 @@ nouveau_hwmon_init(struct drm_device *dev)
{ {
#if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE)) #if defined(CONFIG_HWMON) || (defined(MODULE) && defined(CONFIG_HWMON_MODULE))
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->device);
struct nouveau_hwmon *hwmon; struct nouveau_hwmon *hwmon;
struct device *hwmon_dev; struct device *hwmon_dev;
int ret = 0; int ret = 0;
......
...@@ -60,22 +60,22 @@ nvkm_client_ioctl(void *priv, bool super, void *data, u32 size, void **hack) ...@@ -60,22 +60,22 @@ nvkm_client_ioctl(void *priv, bool super, void *data, u32 size, void **hack)
static int static int
nvkm_client_resume(void *priv) nvkm_client_resume(void *priv)
{ {
return nouveau_client_init(priv); return nvkm_client_init(priv);
} }
static int static int
nvkm_client_suspend(void *priv) nvkm_client_suspend(void *priv)
{ {
return nouveau_client_fini(priv, true); return nvkm_client_fini(priv, true);
} }
static void static void
nvkm_client_driver_fini(void *priv) nvkm_client_driver_fini(void *priv)
{ {
struct nouveau_object *client = priv; struct nvkm_object *client = priv;
nouveau_client_fini(nv_client(client), false); nvkm_client_fini(nv_client(client), false);
atomic_set(&client->refcount, 1); atomic_set(&client->refcount, 1);
nouveau_object_ref(NULL, &client); nvkm_object_ref(NULL, &client);
} }
static int static int
...@@ -110,10 +110,10 @@ static int ...@@ -110,10 +110,10 @@ static int
nvkm_client_driver_init(const char *name, u64 device, const char *cfg, nvkm_client_driver_init(const char *name, u64 device, const char *cfg,
const char *dbg, void **ppriv) const char *dbg, void **ppriv)
{ {
struct nouveau_client *client; struct nvkm_client *client;
int ret; int ret;
ret = nouveau_client_create(name, device, cfg, dbg, &client); ret = nvkm_client_create(name, device, cfg, dbg, &client);
*ppriv = client; *ppriv = client;
if (ret) if (ret)
return ret; return ret;
......
...@@ -152,7 +152,7 @@ static int nouveau_platform_remove(struct platform_device *pdev) ...@@ -152,7 +152,7 @@ static int nouveau_platform_remove(struct platform_device *pdev)
{ {
struct drm_device *drm_dev = platform_get_drvdata(pdev); struct drm_device *drm_dev = platform_get_drvdata(pdev);
struct nouveau_drm *drm = nouveau_drm(drm_dev); struct nouveau_drm *drm = nouveau_drm(drm_dev);
struct nouveau_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->device);
struct nouveau_platform_gpu *gpu = nv_device_to_platform(device)->gpu; struct nouveau_platform_gpu *gpu = nv_device_to_platform(device)->gpu;
nouveau_drm_device_remove(drm_dev); nouveau_drm_device_remove(drm_dev);
......
...@@ -39,7 +39,7 @@ struct nouveau_platform_gpu { ...@@ -39,7 +39,7 @@ struct nouveau_platform_gpu {
}; };
struct nouveau_platform_device { struct nouveau_platform_device {
struct nouveau_device device; struct nvkm_device device;
struct nouveau_platform_gpu *gpu; struct nouveau_platform_gpu *gpu;
......
...@@ -9,7 +9,7 @@ struct nouveau_sgdma_be { ...@@ -9,7 +9,7 @@ struct nouveau_sgdma_be {
* nouve_bo.c works properly, otherwise have to move them here * nouve_bo.c works properly, otherwise have to move them here
*/ */
struct ttm_dma_tt ttm; struct ttm_dma_tt ttm;
struct nouveau_mem *node; struct nvkm_mem *node;
}; };
static void static void
...@@ -27,7 +27,7 @@ static int ...@@ -27,7 +27,7 @@ static int
nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem) nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem)
{ {
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm; struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
struct nouveau_mem *node = mem->mm_node; struct nvkm_mem *node = mem->mm_node;
if (ttm->sg) { if (ttm->sg) {
node->sg = ttm->sg; node->sg = ttm->sg;
...@@ -38,7 +38,7 @@ nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem) ...@@ -38,7 +38,7 @@ nv04_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem)
} }
node->size = (mem->num_pages << PAGE_SHIFT) >> 12; node->size = (mem->num_pages << PAGE_SHIFT) >> 12;
nouveau_vm_map(&node->vma[0], node); nvkm_vm_map(&node->vma[0], node);
nvbe->node = node; nvbe->node = node;
return 0; return 0;
} }
...@@ -47,7 +47,7 @@ static int ...@@ -47,7 +47,7 @@ static int
nv04_sgdma_unbind(struct ttm_tt *ttm) nv04_sgdma_unbind(struct ttm_tt *ttm)
{ {
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm; struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
nouveau_vm_unmap(&nvbe->node->vma[0]); nvkm_vm_unmap(&nvbe->node->vma[0]);
return 0; return 0;
} }
...@@ -61,7 +61,7 @@ static int ...@@ -61,7 +61,7 @@ static int
nv50_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem) nv50_sgdma_bind(struct ttm_tt *ttm, struct ttm_mem_reg *mem)
{ {
struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm; struct nouveau_sgdma_be *nvbe = (struct nouveau_sgdma_be *)ttm;
struct nouveau_mem *node = mem->mm_node; struct nvkm_mem *node = mem->mm_node;
/* noop: bound in move_notify() */ /* noop: bound in move_notify() */
if (ttm->sg) { if (ttm->sg) {
......
...@@ -33,7 +33,7 @@ static int ...@@ -33,7 +33,7 @@ static int
nouveau_vram_manager_init(struct ttm_mem_type_manager *man, unsigned long psize) nouveau_vram_manager_init(struct ttm_mem_type_manager *man, unsigned long psize)
{ {
struct nouveau_drm *drm = nouveau_bdev(man->bdev); struct nouveau_drm *drm = nouveau_bdev(man->bdev);
struct nouveau_fb *pfb = nvxx_fb(&drm->device); struct nvkm_fb *pfb = nvxx_fb(&drm->device);
man->priv = pfb; man->priv = pfb;
return 0; return 0;
} }
...@@ -46,16 +46,16 @@ nouveau_vram_manager_fini(struct ttm_mem_type_manager *man) ...@@ -46,16 +46,16 @@ nouveau_vram_manager_fini(struct ttm_mem_type_manager *man)
} }
static inline void static inline void
nouveau_mem_node_cleanup(struct nouveau_mem *node) nvkm_mem_node_cleanup(struct nvkm_mem *node)
{ {
if (node->vma[0].node) { if (node->vma[0].node) {
nouveau_vm_unmap(&node->vma[0]); nvkm_vm_unmap(&node->vma[0]);
nouveau_vm_put(&node->vma[0]); nvkm_vm_put(&node->vma[0]);
} }
if (node->vma[1].node) { if (node->vma[1].node) {
nouveau_vm_unmap(&node->vma[1]); nvkm_vm_unmap(&node->vma[1]);
nouveau_vm_put(&node->vma[1]); nvkm_vm_put(&node->vma[1]);
} }
} }
...@@ -64,9 +64,9 @@ nouveau_vram_manager_del(struct ttm_mem_type_manager *man, ...@@ -64,9 +64,9 @@ nouveau_vram_manager_del(struct ttm_mem_type_manager *man,
struct ttm_mem_reg *mem) struct ttm_mem_reg *mem)
{ {
struct nouveau_drm *drm = nouveau_bdev(man->bdev); struct nouveau_drm *drm = nouveau_bdev(man->bdev);
struct nouveau_fb *pfb = nvxx_fb(&drm->device); struct nvkm_fb *pfb = nvxx_fb(&drm->device);
nouveau_mem_node_cleanup(mem->mm_node); nvkm_mem_node_cleanup(mem->mm_node);
pfb->ram->put(pfb, (struct nouveau_mem **)&mem->mm_node); pfb->ram->put(pfb, (struct nvkm_mem **)&mem->mm_node);
} }
static int static int
...@@ -76,9 +76,9 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, ...@@ -76,9 +76,9 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
struct ttm_mem_reg *mem) struct ttm_mem_reg *mem)
{ {
struct nouveau_drm *drm = nouveau_bdev(man->bdev); struct nouveau_drm *drm = nouveau_bdev(man->bdev);
struct nouveau_fb *pfb = nvxx_fb(&drm->device); struct nvkm_fb *pfb = nvxx_fb(&drm->device);
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
struct nouveau_mem *node; struct nvkm_mem *node;
u32 size_nc = 0; u32 size_nc = 0;
int ret; int ret;
...@@ -103,9 +103,9 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, ...@@ -103,9 +103,9 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man,
static void static void
nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix) nouveau_vram_manager_debug(struct ttm_mem_type_manager *man, const char *prefix)
{ {
struct nouveau_fb *pfb = man->priv; struct nvkm_fb *pfb = man->priv;
struct nouveau_mm *mm = &pfb->vram; struct nvkm_mm *mm = &pfb->vram;
struct nouveau_mm_node *r; struct nvkm_mm_node *r;
u32 total = 0, free = 0; u32 total = 0, free = 0;
mutex_lock(&nv_subdev(pfb)->mutex); mutex_lock(&nv_subdev(pfb)->mutex);
...@@ -150,7 +150,7 @@ static void ...@@ -150,7 +150,7 @@ static void
nouveau_gart_manager_del(struct ttm_mem_type_manager *man, nouveau_gart_manager_del(struct ttm_mem_type_manager *man,
struct ttm_mem_reg *mem) struct ttm_mem_reg *mem)
{ {
nouveau_mem_node_cleanup(mem->mm_node); nvkm_mem_node_cleanup(mem->mm_node);
kfree(mem->mm_node); kfree(mem->mm_node);
mem->mm_node = NULL; mem->mm_node = NULL;
} }
...@@ -163,7 +163,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -163,7 +163,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
{ {
struct nouveau_drm *drm = nouveau_bdev(bo->bdev); struct nouveau_drm *drm = nouveau_bdev(bo->bdev);
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
struct nouveau_mem *node; struct nvkm_mem *node;
node = kzalloc(sizeof(*node), GFP_KERNEL); node = kzalloc(sizeof(*node), GFP_KERNEL);
if (!node) if (!node)
...@@ -208,10 +208,10 @@ static int ...@@ -208,10 +208,10 @@ static int
nv04_gart_manager_init(struct ttm_mem_type_manager *man, unsigned long psize) nv04_gart_manager_init(struct ttm_mem_type_manager *man, unsigned long psize)
{ {
struct nouveau_drm *drm = nouveau_bdev(man->bdev); struct nouveau_drm *drm = nouveau_bdev(man->bdev);
struct nouveau_mmu *mmu = nvxx_mmu(&drm->device); struct nvkm_mmu *mmu = nvxx_mmu(&drm->device);
struct nv04_mmu_priv *priv = (void *)mmu; struct nv04_mmu_priv *priv = (void *)mmu;
struct nouveau_vm *vm = NULL; struct nvkm_vm *vm = NULL;
nouveau_vm_ref(priv->vm, &vm, NULL); nvkm_vm_ref(priv->vm, &vm, NULL);
man->priv = vm; man->priv = vm;
return 0; return 0;
} }
...@@ -219,8 +219,8 @@ nv04_gart_manager_init(struct ttm_mem_type_manager *man, unsigned long psize) ...@@ -219,8 +219,8 @@ nv04_gart_manager_init(struct ttm_mem_type_manager *man, unsigned long psize)
static int static int
nv04_gart_manager_fini(struct ttm_mem_type_manager *man) nv04_gart_manager_fini(struct ttm_mem_type_manager *man)
{ {
struct nouveau_vm *vm = man->priv; struct nvkm_vm *vm = man->priv;
nouveau_vm_ref(NULL, &vm, NULL); nvkm_vm_ref(NULL, &vm, NULL);
man->priv = NULL; man->priv = NULL;
return 0; return 0;
} }
...@@ -228,9 +228,9 @@ nv04_gart_manager_fini(struct ttm_mem_type_manager *man) ...@@ -228,9 +228,9 @@ nv04_gart_manager_fini(struct ttm_mem_type_manager *man)
static void static void
nv04_gart_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem) nv04_gart_manager_del(struct ttm_mem_type_manager *man, struct ttm_mem_reg *mem)
{ {
struct nouveau_mem *node = mem->mm_node; struct nvkm_mem *node = mem->mm_node;
if (node->vma[0].node) if (node->vma[0].node)
nouveau_vm_put(&node->vma[0]); nvkm_vm_put(&node->vma[0]);
kfree(mem->mm_node); kfree(mem->mm_node);
mem->mm_node = NULL; mem->mm_node = NULL;
} }
...@@ -241,7 +241,7 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -241,7 +241,7 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man,
const struct ttm_place *place, const struct ttm_place *place,
struct ttm_mem_reg *mem) struct ttm_mem_reg *mem)
{ {
struct nouveau_mem *node; struct nvkm_mem *node;
int ret; int ret;
node = kzalloc(sizeof(*node), GFP_KERNEL); node = kzalloc(sizeof(*node), GFP_KERNEL);
...@@ -250,8 +250,8 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -250,8 +250,8 @@ nv04_gart_manager_new(struct ttm_mem_type_manager *man,
node->page_shift = 12; node->page_shift = 12;
ret = nouveau_vm_get(man->priv, mem->num_pages << 12, node->page_shift, ret = nvkm_vm_get(man->priv, mem->num_pages << 12, node->page_shift,
NV_MEM_ACCESS_RW, &node->vma[0]); NV_MEM_ACCESS_RW, &node->vma[0]);
if (ret) { if (ret) {
kfree(node); kfree(node);
return ret; return ret;
......
...@@ -57,7 +57,7 @@ nv04_fence_sync(struct nouveau_fence *fence, ...@@ -57,7 +57,7 @@ nv04_fence_sync(struct nouveau_fence *fence,
static u32 static u32
nv04_fence_read(struct nouveau_channel *chan) nv04_fence_read(struct nouveau_channel *chan)
{ {
struct nouveau_fifo_chan *fifo = nvxx_fifo_chan(chan);; struct nvkm_fifo_chan *fifo = nvxx_fifo_chan(chan);;
return atomic_read(&fifo->refcnt); return atomic_read(&fifo->refcnt);
} }
......
...@@ -1677,7 +1677,7 @@ static int ...@@ -1677,7 +1677,7 @@ static int
nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe) nv50_dac_create(struct drm_connector *connector, struct dcb_output *dcbe)
{ {
struct nouveau_drm *drm = nouveau_drm(connector->dev); struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct nouveau_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device);
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
int type = DRM_MODE_ENCODER_DAC; int type = DRM_MODE_ENCODER_DAC;
...@@ -2062,7 +2062,7 @@ static int ...@@ -2062,7 +2062,7 @@ static int
nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe) nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
{ {
struct nouveau_drm *drm = nouveau_drm(connector->dev); struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct nouveau_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device);
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
int type; int type;
...@@ -2233,8 +2233,8 @@ static int ...@@ -2233,8 +2233,8 @@ static int
nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe) nv50_pior_create(struct drm_connector *connector, struct dcb_output *dcbe)
{ {
struct nouveau_drm *drm = nouveau_drm(connector->dev); struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct nouveau_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->device);
struct nouveau_i2c_port *ddc = NULL; struct nvkm_i2c_port *ddc = NULL;
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
int type; int type;
......
...@@ -213,7 +213,7 @@ nv84_fence_destroy(struct nouveau_drm *drm) ...@@ -213,7 +213,7 @@ nv84_fence_destroy(struct nouveau_drm *drm)
int int
nv84_fence_create(struct nouveau_drm *drm) nv84_fence_create(struct nouveau_drm *drm)
{ {
struct nouveau_fifo *pfifo = nvxx_fifo(&drm->device); struct nvkm_fifo *pfifo = nvxx_fifo(&drm->device);
struct nv84_fence_priv *priv; struct nv84_fence_priv *priv;
int ret; int ret;
......
...@@ -21,18 +21,16 @@ ...@@ -21,18 +21,16 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "mxms.h"
#include <core/device.h>
#include <core/option.h> #include <core/option.h>
#include <subdev/i2c.h>
#include <subdev/mxm.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/mxm.h> #include <subdev/bios/mxm.h>
#include <subdev/i2c.h>
#include "mxms.h"
static bool static bool
mxm_shadow_rom_fetch(struct nouveau_i2c_port *i2c, u8 addr, mxm_shadow_rom_fetch(struct nvkm_i2c_port *i2c, u8 addr,
u8 offset, u8 size, u8 *data) u8 offset, u8 size, u8 *data)
{ {
struct i2c_msg msgs[] = { struct i2c_msg msgs[] = {
...@@ -44,11 +42,11 @@ mxm_shadow_rom_fetch(struct nouveau_i2c_port *i2c, u8 addr, ...@@ -44,11 +42,11 @@ mxm_shadow_rom_fetch(struct nouveau_i2c_port *i2c, u8 addr,
} }
static bool static bool
mxm_shadow_rom(struct nouveau_mxm *mxm, u8 version) mxm_shadow_rom(struct nvkm_mxm *mxm, u8 version)
{ {
struct nouveau_bios *bios = nouveau_bios(mxm); struct nvkm_bios *bios = nvkm_bios(mxm);
struct nouveau_i2c *i2c = nouveau_i2c(mxm); struct nvkm_i2c *i2c = nvkm_i2c(mxm);
struct nouveau_i2c_port *port = NULL; struct nvkm_i2c_port *port = NULL;
u8 i2cidx, mxms[6], addr, size; u8 i2cidx, mxms[6], addr, size;
i2cidx = mxm_ddc_map(bios, 1 /* LVDS_DDC */) & 0x0f; i2cidx = mxm_ddc_map(bios, 1 /* LVDS_DDC */) & 0x0f;
...@@ -79,9 +77,9 @@ mxm_shadow_rom(struct nouveau_mxm *mxm, u8 version) ...@@ -79,9 +77,9 @@ mxm_shadow_rom(struct nouveau_mxm *mxm, u8 version)
#if defined(CONFIG_ACPI) #if defined(CONFIG_ACPI)
static bool static bool
mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version) mxm_shadow_dsm(struct nvkm_mxm *mxm, u8 version)
{ {
struct nouveau_device *device = nv_device(mxm); struct nvkm_device *device = nv_device(mxm);
static char muid[] = { static char muid[] = {
0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C, 0x00, 0xA4, 0x04, 0x40, 0x7D, 0x91, 0xF2, 0x4C,
0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65 0xB8, 0x9C, 0x79, 0xB6, 0x2F, 0xD5, 0x56, 0x65
...@@ -129,7 +127,7 @@ mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version) ...@@ -129,7 +127,7 @@ mxm_shadow_dsm(struct nouveau_mxm *mxm, u8 version)
#define WMI_WMMX_GUID "F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0" #define WMI_WMMX_GUID "F6CB5C3C-9CAE-4EBD-B577-931EA32A2CC0"
static u8 static u8
wmi_wmmx_mxmi(struct nouveau_mxm *mxm, u8 version) wmi_wmmx_mxmi(struct nvkm_mxm *mxm, u8 version)
{ {
u32 mxmi_args[] = { 0x494D584D /* MXMI */, version, 0 }; u32 mxmi_args[] = { 0x494D584D /* MXMI */, version, 0 };
struct acpi_buffer args = { sizeof(mxmi_args), mxmi_args }; struct acpi_buffer args = { sizeof(mxmi_args), mxmi_args };
...@@ -158,7 +156,7 @@ wmi_wmmx_mxmi(struct nouveau_mxm *mxm, u8 version) ...@@ -158,7 +156,7 @@ wmi_wmmx_mxmi(struct nouveau_mxm *mxm, u8 version)
} }
static bool static bool
mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version) mxm_shadow_wmi(struct nvkm_mxm *mxm, u8 version)
{ {
u32 mxms_args[] = { 0x534D584D /* MXMS */, version, 0 }; u32 mxms_args[] = { 0x534D584D /* MXMS */, version, 0 };
struct acpi_buffer args = { sizeof(mxms_args), mxms_args }; struct acpi_buffer args = { sizeof(mxms_args), mxms_args };
...@@ -186,7 +184,7 @@ mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version) ...@@ -186,7 +184,7 @@ mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version)
obj = retn.pointer; obj = retn.pointer;
if (obj->type == ACPI_TYPE_BUFFER) { if (obj->type == ACPI_TYPE_BUFFER) {
mxm->mxms = kmemdup(obj->buffer.pointer, mxm->mxms = kmemdup(obj->buffer.pointer,
obj->buffer.length, GFP_KERNEL); obj->buffer.length, GFP_KERNEL);
} }
kfree(obj); kfree(obj);
...@@ -196,7 +194,7 @@ mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version) ...@@ -196,7 +194,7 @@ mxm_shadow_wmi(struct nouveau_mxm *mxm, u8 version)
static struct mxm_shadow_h { static struct mxm_shadow_h {
const char *name; const char *name;
bool (*exec)(struct nouveau_mxm *, u8 version); bool (*exec)(struct nvkm_mxm *, u8 version);
} _mxm_shadow[] = { } _mxm_shadow[] = {
{ "ROM", mxm_shadow_rom }, { "ROM", mxm_shadow_rom },
#if defined(CONFIG_ACPI) #if defined(CONFIG_ACPI)
...@@ -209,7 +207,7 @@ static struct mxm_shadow_h { ...@@ -209,7 +207,7 @@ static struct mxm_shadow_h {
}; };
static int static int
mxm_shadow(struct nouveau_mxm *mxm, u8 version) mxm_shadow(struct nvkm_mxm *mxm, u8 version)
{ {
struct mxm_shadow_h *shadow = _mxm_shadow; struct mxm_shadow_h *shadow = _mxm_shadow;
do { do {
...@@ -225,19 +223,18 @@ mxm_shadow(struct nouveau_mxm *mxm, u8 version) ...@@ -225,19 +223,18 @@ mxm_shadow(struct nouveau_mxm *mxm, u8 version)
} }
int int
nouveau_mxm_create_(struct nouveau_object *parent, nvkm_mxm_create_(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_object *engine, struct nvkm_oclass *oclass, int length, void **pobject)
struct nouveau_oclass *oclass, int length, void **pobject)
{ {
struct nouveau_device *device = nv_device(parent); struct nvkm_device *device = nv_device(parent);
struct nouveau_bios *bios = nouveau_bios(device); struct nvkm_bios *bios = nvkm_bios(device);
struct nouveau_mxm *mxm; struct nvkm_mxm *mxm;
u8 ver, len; u8 ver, len;
u16 data; u16 data;
int ret; int ret;
ret = nouveau_subdev_create_(parent, engine, oclass, 0, "MXM", "mxm", ret = nvkm_subdev_create_(parent, engine, oclass, 0, "MXM", "mxm",
length, pobject); length, pobject);
mxm = *pobject; mxm = *pobject;
if (ret) if (ret)
return ret; return ret;
...@@ -268,7 +265,7 @@ nouveau_mxm_create_(struct nouveau_object *parent, ...@@ -268,7 +265,7 @@ nouveau_mxm_create_(struct nouveau_object *parent,
mxms_version(mxm) >> 8, mxms_version(mxm) & 0xff); mxms_version(mxm) >> 8, mxms_version(mxm) & 0xff);
mxms_foreach(mxm, 0, NULL, NULL); mxms_foreach(mxm, 0, NULL, NULL);
if (nouveau_boolopt(device->cfgopt, "NvMXMDCB", true)) if (nvkm_boolopt(device->cfgopt, "NvMXMDCB", true))
mxm->action |= MXM_SANITISE_DCB; mxm->action |= MXM_SANITISE_DCB;
return 0; return 0;
} }
...@@ -21,22 +21,20 @@ ...@@ -21,22 +21,20 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <subdev/mxm.h>
#include "mxms.h" #include "mxms.h"
#define ROM16(x) le16_to_cpu(*(u16 *)&(x)) #define ROM16(x) le16_to_cpu(*(u16 *)&(x))
#define ROM32(x) le32_to_cpu(*(u32 *)&(x)) #define ROM32(x) le32_to_cpu(*(u32 *)&(x))
static u8 * static u8 *
mxms_data(struct nouveau_mxm *mxm) mxms_data(struct nvkm_mxm *mxm)
{ {
return mxm->mxms; return mxm->mxms;
} }
u16 u16
mxms_version(struct nouveau_mxm *mxm) mxms_version(struct nvkm_mxm *mxm)
{ {
u8 *mxms = mxms_data(mxm); u8 *mxms = mxms_data(mxm);
u16 version = (mxms[4] << 8) | mxms[5]; u16 version = (mxms[4] << 8) | mxms[5];
...@@ -54,19 +52,19 @@ mxms_version(struct nouveau_mxm *mxm) ...@@ -54,19 +52,19 @@ mxms_version(struct nouveau_mxm *mxm)
} }
u16 u16
mxms_headerlen(struct nouveau_mxm *mxm) mxms_headerlen(struct nvkm_mxm *mxm)
{ {
return 8; return 8;
} }
u16 u16
mxms_structlen(struct nouveau_mxm *mxm) mxms_structlen(struct nvkm_mxm *mxm)
{ {
return *(u16 *)&mxms_data(mxm)[6]; return *(u16 *)&mxms_data(mxm)[6];
} }
bool bool
mxms_checksum(struct nouveau_mxm *mxm) mxms_checksum(struct nvkm_mxm *mxm)
{ {
u16 size = mxms_headerlen(mxm) + mxms_structlen(mxm); u16 size = mxms_headerlen(mxm) + mxms_structlen(mxm);
u8 *mxms = mxms_data(mxm), sum = 0; u8 *mxms = mxms_data(mxm), sum = 0;
...@@ -80,7 +78,7 @@ mxms_checksum(struct nouveau_mxm *mxm) ...@@ -80,7 +78,7 @@ mxms_checksum(struct nouveau_mxm *mxm)
} }
bool bool
mxms_valid(struct nouveau_mxm *mxm) mxms_valid(struct nvkm_mxm *mxm)
{ {
u8 *mxms = mxms_data(mxm); u8 *mxms = mxms_data(mxm);
if (*(u32 *)mxms != 0x5f4d584d) { if (*(u32 *)mxms != 0x5f4d584d) {
...@@ -95,8 +93,8 @@ mxms_valid(struct nouveau_mxm *mxm) ...@@ -95,8 +93,8 @@ mxms_valid(struct nouveau_mxm *mxm)
} }
bool bool
mxms_foreach(struct nouveau_mxm *mxm, u8 types, mxms_foreach(struct nvkm_mxm *mxm, u8 types,
bool (*exec)(struct nouveau_mxm *, u8 *, void *), void *info) bool (*exec)(struct nvkm_mxm *, u8 *, void *), void *info)
{ {
u8 *mxms = mxms_data(mxm); u8 *mxms = mxms_data(mxm);
u8 *desc = mxms + mxms_headerlen(mxm); u8 *desc = mxms + mxms_headerlen(mxm);
...@@ -180,7 +178,7 @@ mxms_foreach(struct nouveau_mxm *mxm, u8 types, ...@@ -180,7 +178,7 @@ mxms_foreach(struct nouveau_mxm *mxm, u8 types,
} }
void void
mxms_output_device(struct nouveau_mxm *mxm, u8 *pdata, struct mxms_odev *desc) mxms_output_device(struct nvkm_mxm *mxm, u8 *pdata, struct mxms_odev *desc)
{ {
u64 data = ROM32(pdata[0]); u64 data = ROM32(pdata[0]);
if (mxms_version(mxm) >= 0x0300) if (mxms_version(mxm) >= 0x0300)
......
#ifndef __NVMXM_MXMS_H__ #ifndef __NVMXM_MXMS_H__
#define __NVMXM_MXMS_H__ #define __NVMXM_MXMS_H__
#include <subdev/mxm.h>
struct mxms_odev { struct mxms_odev {
u8 outp_type; u8 outp_type;
...@@ -8,15 +9,14 @@ struct mxms_odev { ...@@ -8,15 +9,14 @@ struct mxms_odev {
u8 dig_conn; u8 dig_conn;
}; };
void mxms_output_device(struct nouveau_mxm *, u8 *, struct mxms_odev *); void mxms_output_device(struct nvkm_mxm *, u8 *, struct mxms_odev *);
u16 mxms_version(struct nouveau_mxm *); u16 mxms_version(struct nvkm_mxm *);
u16 mxms_headerlen(struct nouveau_mxm *); u16 mxms_headerlen(struct nvkm_mxm *);
u16 mxms_structlen(struct nouveau_mxm *); u16 mxms_structlen(struct nvkm_mxm *);
bool mxms_checksum(struct nouveau_mxm *); bool mxms_checksum(struct nvkm_mxm *);
bool mxms_valid(struct nouveau_mxm *); bool mxms_valid(struct nvkm_mxm *);
bool mxms_foreach(struct nouveau_mxm *, u8,
bool (*)(struct nouveau_mxm *, u8 *, void *), void *);
bool mxms_foreach(struct nvkm_mxm *, u8,
bool (*)(struct nvkm_mxm *, u8 *, void *), void *);
#endif #endif
...@@ -21,17 +21,15 @@ ...@@ -21,17 +21,15 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "mxms.h"
#include <subdev/mxm.h>
#include <subdev/bios.h> #include <subdev/bios.h>
#include <subdev/bios/conn.h> #include <subdev/bios/conn.h>
#include <subdev/bios/dcb.h> #include <subdev/bios/dcb.h>
#include <subdev/bios/mxm.h> #include <subdev/bios/mxm.h>
#include "mxms.h"
struct nv50_mxm_priv { struct nv50_mxm_priv {
struct nouveau_mxm base; struct nvkm_mxm base;
}; };
struct context { struct context {
...@@ -40,7 +38,7 @@ struct context { ...@@ -40,7 +38,7 @@ struct context {
}; };
static bool static bool
mxm_match_tmds_partner(struct nouveau_mxm *mxm, u8 *data, void *info) mxm_match_tmds_partner(struct nvkm_mxm *mxm, u8 *data, void *info)
{ {
struct context *ctx = info; struct context *ctx = info;
struct mxms_odev desc; struct mxms_odev desc;
...@@ -53,9 +51,9 @@ mxm_match_tmds_partner(struct nouveau_mxm *mxm, u8 *data, void *info) ...@@ -53,9 +51,9 @@ mxm_match_tmds_partner(struct nouveau_mxm *mxm, u8 *data, void *info)
} }
static bool static bool
mxm_match_dcb(struct nouveau_mxm *mxm, u8 *data, void *info) mxm_match_dcb(struct nvkm_mxm *mxm, u8 *data, void *info)
{ {
struct nouveau_bios *bios = nouveau_bios(mxm); struct nvkm_bios *bios = nvkm_bios(mxm);
struct context *ctx = info; struct context *ctx = info;
u64 desc = *(u64 *)data; u64 desc = *(u64 *)data;
...@@ -98,9 +96,9 @@ mxm_match_dcb(struct nouveau_mxm *mxm, u8 *data, void *info) ...@@ -98,9 +96,9 @@ mxm_match_dcb(struct nouveau_mxm *mxm, u8 *data, void *info)
} }
static int static int
mxm_dcb_sanitise_entry(struct nouveau_bios *bios, void *data, int idx, u16 pdcb) mxm_dcb_sanitise_entry(struct nvkm_bios *bios, void *data, int idx, u16 pdcb)
{ {
struct nouveau_mxm *mxm = data; struct nvkm_mxm *mxm = data;
struct context ctx = { .outp = (u32 *)(bios->data + pdcb) }; struct context ctx = { .outp = (u32 *)(bios->data + pdcb) };
u8 type, i2cidx, link, ver, len; u8 type, i2cidx, link, ver, len;
u8 *conn; u8 *conn;
...@@ -180,7 +178,7 @@ mxm_dcb_sanitise_entry(struct nouveau_bios *bios, void *data, int idx, u16 pdcb) ...@@ -180,7 +178,7 @@ mxm_dcb_sanitise_entry(struct nouveau_bios *bios, void *data, int idx, u16 pdcb)
} }
static bool static bool
mxm_show_unmatched(struct nouveau_mxm *mxm, u8 *data, void *info) mxm_show_unmatched(struct nvkm_mxm *mxm, u8 *data, void *info)
{ {
u64 desc = *(u64 *)data; u64 desc = *(u64 *)data;
if ((desc & 0xf0) != 0xf0) if ((desc & 0xf0) != 0xf0)
...@@ -189,9 +187,9 @@ mxm_show_unmatched(struct nouveau_mxm *mxm, u8 *data, void *info) ...@@ -189,9 +187,9 @@ mxm_show_unmatched(struct nouveau_mxm *mxm, u8 *data, void *info)
} }
static void static void
mxm_dcb_sanitise(struct nouveau_mxm *mxm) mxm_dcb_sanitise(struct nvkm_mxm *mxm)
{ {
struct nouveau_bios *bios = nouveau_bios(mxm); struct nvkm_bios *bios = nvkm_bios(mxm);
u8 ver, hdr, cnt, len; u8 ver, hdr, cnt, len;
u16 dcb = dcb_table(bios, &ver, &hdr, &cnt, &len); u16 dcb = dcb_table(bios, &ver, &hdr, &cnt, &len);
if (dcb == 0x0000 || ver != 0x40) { if (dcb == 0x0000 || ver != 0x40) {
...@@ -204,14 +202,14 @@ mxm_dcb_sanitise(struct nouveau_mxm *mxm) ...@@ -204,14 +202,14 @@ mxm_dcb_sanitise(struct nouveau_mxm *mxm)
} }
static int static int
nv50_mxm_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv50_mxm_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv50_mxm_priv *priv; struct nv50_mxm_priv *priv;
int ret; int ret;
ret = nouveau_mxm_create(parent, engine, oclass, &priv); ret = nvkm_mxm_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -221,13 +219,13 @@ nv50_mxm_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -221,13 +219,13 @@ nv50_mxm_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv50_mxm_oclass = { nv50_mxm_oclass = {
.handle = NV_SUBDEV(MXM, 0x50), .handle = NV_SUBDEV(MXM, 0x50),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_mxm_ctor, .ctor = nv50_mxm_ctor,
.dtor = _nouveau_mxm_dtor, .dtor = _nvkm_mxm_dtor,
.init = _nouveau_mxm_init, .init = _nvkm_mxm_init,
.fini = _nouveau_mxm_fini, .fini = _nvkm_mxm_fini,
}, },
}; };
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment