diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/subdev')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv05.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/i2c/nv04.c | 20 |
7 files changed, 36 insertions, 33 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c index 95b6468d5f27..8b175d8cec66 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c @@ -214,7 +214,7 @@ static u8 init_rdport(struct nvbios_init *init, u16 port) { if (init_exec(init)) - return nv_rdport(init->subdev, init->crtc, port); + return nvkm_rdport(init->subdev->device, init->crtc, port); return 0x00; } @@ -222,7 +222,7 @@ static void init_wrport(struct nvbios_init *init, u16 port, u8 value) { if (init_exec(init)) - nv_wrport(init->subdev, init->crtc, port, value); + nvkm_wrport(init->subdev->device, init->crtc, port, value); } static u8 @@ -231,7 +231,7 @@ init_rdvgai(struct nvbios_init *init, u16 port, u8 index) struct nvkm_subdev *subdev = init->subdev; if (init_exec(init)) { int head = init->crtc < 0 ? 0 : init->crtc; - return nv_rdvgai(subdev, head, port, index); + return nvkm_rdvgai(subdev->device, head, port, index); } return 0x00; } @@ -239,19 +239,21 @@ init_rdvgai(struct nvbios_init *init, u16 port, u8 index) static void init_wrvgai(struct nvbios_init *init, u16 port, u8 index, u8 value) { + struct nvkm_device *device = init->subdev->device; + /* force head 0 for updates to cr44, it only exists on first head */ - if (nv_device(init->subdev)->card_type < NV_50) { + if (device->card_type < NV_50) { if (port == 0x03d4 && index == 0x44) init->crtc = 0; } if (init_exec(init)) { int head = init->crtc < 0 ? 0 : init->crtc; - nv_wrvgai(init->subdev, head, port, index, value); + nvkm_wrvgai(device, head, port, index, value); } /* select head 1 if cr44 write selected it */ - if (nv_device(init->subdev)->card_type < NV_50) { + if (device->card_type < NV_50) { if (port == 0x03d4 && index == 0x44 && value == 3) init->crtc = 1; } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c index c9c66f8dda2e..1f5c1332bf25 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/pll.c @@ -367,7 +367,7 @@ nvbios_pll_parse(struct nvkm_bios *bios, u32 type, struct nvbios_pll *info) u32 sel_clk = nvkm_rd32(device, 0x680524); if ((info->reg == 0x680508 && sel_clk & 0x20) || (info->reg == 0x680520 && sel_clk & 0x80)) { - if (nv_rdvgac(bios, 0, 0x27) < 0xa3) + if (nvkm_rdvgac(device, 0, 0x27) < 0xa3) info->refclk = 200000; else info->refclk = 25000; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c index 4338e437bcc3..989513fae7d5 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/base.c @@ -36,7 +36,7 @@ _nvkm_devinit_fini(struct nvkm_object *object, bool suspend) init->post = true; /* unlock the extended vga crtc regs */ - nv_lockvgac(init, false); + nvkm_lockvgac(init->subdev.device, false); return nvkm_subdev_fini(&init->subdev, suspend); } @@ -67,7 +67,7 @@ _nvkm_devinit_dtor(struct nvkm_object *object) struct nvkm_devinit *init = (void *)object; /* lock crtc regs */ - nv_lockvgac(init, true); + nvkm_lockvgac(init->subdev.device, true); nvkm_subdev_destroy(&init->subdev); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c index 5158ea62f65a..41d9dbb075a4 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv04.c @@ -49,7 +49,7 @@ nv04_devinit_meminit(struct nvkm_devinit *init) } /* Sequencer and refresh off */ - nv_wrvgas(init, 0, 1, nv_rdvgas(init, 0, 1) | 0x20); + nvkm_wrvgas(device, 0, 1, nvkm_rdvgas(device, 0, 1) | 0x20); nvkm_mask(device, NV04_PFB_DEBUG_0, 0, NV04_PFB_DEBUG_0_REFRESH_OFF); nvkm_mask(device, NV04_PFB_BOOT_0, ~0, @@ -105,7 +105,7 @@ nv04_devinit_meminit(struct nvkm_devinit *init) /* Refresh on, sequencer on */ nvkm_mask(device, NV04_PFB_DEBUG_0, NV04_PFB_DEBUG_0_REFRESH_OFF, 0); - nv_wrvgas(init, 0, 1, nv_rdvgas(init, 0, 1) & ~0x20); + nvkm_wrvgas(device, 0, 1, nvkm_rdvgas(device, 0, 1) & ~0x20); fbmem_fini(fb); } @@ -406,8 +406,8 @@ nv04_devinit_fini(struct nvkm_object *object, bool suspend) /* unslave crtcs */ if (init->owner < 0) - init->owner = nv_rdvgaowner(init); - nv_wrvgaowner(init, 0); + init->owner = nvkm_rdvgaowner(device); + nvkm_wrvgaowner(device, 0); return 0; } @@ -416,13 +416,14 @@ nv04_devinit_init(struct nvkm_object *object) { struct nv04_devinit *init = (void *)object; struct nvkm_subdev *subdev = &init->base.subdev; + struct nvkm_device *device = subdev->device; if (!init->base.post) { - u32 htotal = nv_rdvgac(init, 0, 0x06); - htotal |= (nv_rdvgac(init, 0, 0x07) & 0x01) << 8; - htotal |= (nv_rdvgac(init, 0, 0x07) & 0x20) << 4; - htotal |= (nv_rdvgac(init, 0, 0x25) & 0x01) << 10; - htotal |= (nv_rdvgac(init, 0, 0x41) & 0x01) << 11; + u32 htotal = nvkm_rdvgac(device, 0, 0x06); + htotal |= (nvkm_rdvgac(device, 0, 0x07) & 0x01) << 8; + htotal |= (nvkm_rdvgac(device, 0, 0x07) & 0x20) << 4; + htotal |= (nvkm_rdvgac(device, 0, 0x25) & 0x01) << 10; + htotal |= (nvkm_rdvgac(device, 0, 0x41) & 0x01) << 11; if (!htotal) { nvkm_debug(subdev, "adaptor not initialised\n"); init->base.post = true; @@ -438,7 +439,7 @@ nv04_devinit_dtor(struct nvkm_object *object) struct nv04_devinit *init = (void *)object; /* restore vga owner saved at first init */ - nv_wrvgaowner(init, init->owner); + nvkm_wrvgaowner(init->base.subdev.device, init->owner); nvkm_devinit_destroy(&init->base); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv05.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv05.c index 54de25eea98a..32be8852e0bc 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv05.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv05.c @@ -70,7 +70,7 @@ nv05_devinit_meminit(struct nvkm_devinit *init) } /* Sequencer off */ - nv_wrvgas(init, 0, 1, nv_rdvgas(init, 0, 1) | 0x20); + nvkm_wrvgas(device, 0, 1, nvkm_rdvgas(device, 0, 1) | 0x20); if (nvkm_rd32(device, NV04_PFB_BOOT_0) & NV04_PFB_BOOT_0_UMA_ENABLE) goto out; @@ -122,7 +122,7 @@ nv05_devinit_meminit(struct nvkm_devinit *init) out: /* Sequencer on */ - nv_wrvgas(init, 0, 1, nv_rdvgas(init, 0, 1) & ~0x20); + nvkm_wrvgas(device, 0, 1, nvkm_rdvgas(device, 0, 1) & ~0x20); fbmem_fini(fb); } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c index 548b3fe09cbf..bbcc3080a478 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c @@ -105,8 +105,8 @@ nv50_devinit_init(struct nvkm_object *object) int ret, i = 0; if (!init->base.post) { - if (!nv_rdvgac(init, 0, 0x00) && - !nv_rdvgac(init, 0, 0x1a)) { + if (!nvkm_rdvgac(device, 0, 0x00) && + !nvkm_rdvgac(device, 0, 0x1a)) { nvkm_debug(subdev, "adaptor not initialised\n"); init->base.post = true; } diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/nv04.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/nv04.c index 230727847c68..e76c555d4d0e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/nv04.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/nv04.c @@ -34,39 +34,39 @@ struct nv04_i2c_port { static void nv04_i2c_drive_scl(struct nvkm_i2c_port *base, int state) { - struct nvkm_i2c *i2c = (void *)nvkm_i2c(base); + struct nvkm_device *device = nvkm_i2c(base)->subdev.device; struct nv04_i2c_port *port = (void *)base; - u8 val = nv_rdvgac(i2c, 0, port->drive); + u8 val = nvkm_rdvgac(device, 0, port->drive); if (state) val |= 0x20; else val &= 0xdf; - nv_wrvgac(i2c, 0, port->drive, val | 0x01); + nvkm_wrvgac(device, 0, port->drive, val | 0x01); } static void nv04_i2c_drive_sda(struct nvkm_i2c_port *base, int state) { - struct nvkm_i2c *i2c = (void *)nvkm_i2c(base); + struct nvkm_device *device = nvkm_i2c(base)->subdev.device; struct nv04_i2c_port *port = (void *)base; - u8 val = nv_rdvgac(i2c, 0, port->drive); + u8 val = nvkm_rdvgac(device, 0, port->drive); if (state) val |= 0x10; else val &= 0xef; - nv_wrvgac(i2c, 0, port->drive, val | 0x01); + nvkm_wrvgac(device, 0, port->drive, val | 0x01); } static int nv04_i2c_sense_scl(struct nvkm_i2c_port *base) { - struct nvkm_i2c *i2c = (void *)nvkm_i2c(base); + struct nvkm_device *device = nvkm_i2c(base)->subdev.device; struct nv04_i2c_port *port = (void *)base; - return !!(nv_rdvgac(i2c, 0, port->sense) & 0x04); + return !!(nvkm_rdvgac(device, 0, port->sense) & 0x04); } static int nv04_i2c_sense_sda(struct nvkm_i2c_port *base) { - struct nvkm_i2c *i2c = (void *)nvkm_i2c(base); + struct nvkm_device *device = nvkm_i2c(base)->subdev.device; struct nv04_i2c_port *port = (void *)base; - return !!(nv_rdvgac(i2c, 0, port->sense) & 0x08); + return !!(nvkm_rdvgac(device, 0, port->sense) & 0x08); } static const struct nvkm_i2c_func |