Commit 1167c6bc authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: allocate device object for every client

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 80e60973
...@@ -198,7 +198,7 @@ nv04_update_arb(struct drm_device *dev, int VClk, int bpp, ...@@ -198,7 +198,7 @@ nv04_update_arb(struct drm_device *dev, int VClk, int bpp,
int *burst, int *lwm) int *burst, int *lwm)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
struct nv_fifo_info fifo_data; struct nv_fifo_info fifo_data;
struct nv_sim_state sim_data; struct nv_sim_state sim_data;
int MClk = nouveau_hw_get_clock(dev, PLL_MEMORY); int MClk = nouveau_hw_get_clock(dev, PLL_MEMORY);
...@@ -227,7 +227,7 @@ nv04_update_arb(struct drm_device *dev, int VClk, int bpp, ...@@ -227,7 +227,7 @@ nv04_update_arb(struct drm_device *dev, int VClk, int bpp,
sim_data.mem_page_miss = ((cfg1 >> 4) & 0xf) + ((cfg1 >> 31) & 0x1); sim_data.mem_page_miss = ((cfg1 >> 4) & 0xf) + ((cfg1 >> 31) & 0x1);
} }
if (drm->device.info.family == NV_DEVICE_INFO_V0_TNT) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_TNT)
nv04_calc_arb(&fifo_data, &sim_data); nv04_calc_arb(&fifo_data, &sim_data);
else else
nv10_calc_arb(&fifo_data, &sim_data); nv10_calc_arb(&fifo_data, &sim_data);
...@@ -254,7 +254,7 @@ nouveau_calc_arb(struct drm_device *dev, int vclk, int bpp, int *burst, int *lwm ...@@ -254,7 +254,7 @@ nouveau_calc_arb(struct drm_device *dev, int vclk, int bpp, int *burst, int *lwm
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->device.info.family < NV_DEVICE_INFO_V0_KELVIN) if (drm->client.device.info.family < NV_DEVICE_INFO_V0_KELVIN)
nv04_update_arb(dev, vclk, bpp, burst, lwm); nv04_update_arb(dev, vclk, bpp, burst, lwm);
else if ((dev->pdev->device & 0xfff0) == 0x0240 /*CHIPSET_C51*/ || else if ((dev->pdev->device & 0xfff0) == 0x0240 /*CHIPSET_C51*/ ||
(dev->pdev->device & 0xfff0) == 0x03d0 /*CHIPSET_C512*/) { (dev->pdev->device & 0xfff0) == 0x03d0 /*CHIPSET_C512*/) {
......
...@@ -113,8 +113,8 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod ...@@ -113,8 +113,8 @@ 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 nvkm_bios *bios = nvxx_bios(&drm->device); struct nvkm_bios *bios = nvxx_bios(&drm->client.device);
struct nvkm_clk *clk = nvxx_clk(&drm->device); struct nvkm_clk *clk = nvxx_clk(&drm->client.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];
...@@ -138,7 +138,7 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod ...@@ -138,7 +138,7 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod
* has yet been observed in allowing the use a single stage pll on all * has yet been observed in allowing the use a single stage pll on all
* nv43 however. the behaviour of single stage use is untested on nv40 * nv43 however. the behaviour of single stage use is untested on nv40
*/ */
if (drm->device.info.chipset > 0x40 && dot_clock <= (pll_lim.vco1.max_freq / 2)) if (drm->client.device.info.chipset > 0x40 && dot_clock <= (pll_lim.vco1.max_freq / 2))
memset(&pll_lim.vco2, 0, sizeof(pll_lim.vco2)); memset(&pll_lim.vco2, 0, sizeof(pll_lim.vco2));
...@@ -148,10 +148,10 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod ...@@ -148,10 +148,10 @@ static void nv_crtc_calc_state_ext(struct drm_crtc *crtc, struct drm_display_mod
state->pllsel &= PLLSEL_VPLL1_MASK | PLLSEL_VPLL2_MASK | PLLSEL_TV_MASK; state->pllsel &= PLLSEL_VPLL1_MASK | PLLSEL_VPLL2_MASK | PLLSEL_TV_MASK;
/* The blob uses this always, so let's do the same */ /* The blob uses this always, so let's do the same */
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
state->pllsel |= NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE; state->pllsel |= NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE;
/* again nv40 and some nv43 act more like nv3x as described above */ /* again nv40 and some nv43 act more like nv3x as described above */
if (drm->device.info.chipset < 0x41) if (drm->client.device.info.chipset < 0x41)
state->pllsel |= NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL | state->pllsel |= NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL |
NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL; NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL;
state->pllsel |= nv_crtc->index ? PLLSEL_VPLL2_MASK : PLLSEL_VPLL1_MASK; state->pllsel |= nv_crtc->index ? PLLSEL_VPLL2_MASK : PLLSEL_VPLL1_MASK;
...@@ -270,7 +270,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode) ...@@ -270,7 +270,7 @@ nv_crtc_mode_set_vga(struct drm_crtc *crtc, struct drm_display_mode *mode)
horizEnd = horizTotal - 2; horizEnd = horizTotal - 2;
horizBlankEnd = horizTotal + 4; horizBlankEnd = horizTotal + 4;
#if 0 #if 0
if (dev->overlayAdaptor && drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) if (dev->overlayAdaptor && drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS)
/* This reportedly works around some video overlay bandwidth problems */ /* This reportedly works around some video overlay bandwidth problems */
horizTotal += 2; horizTotal += 2;
#endif #endif
...@@ -505,7 +505,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) ...@@ -505,7 +505,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode)
regp->cursor_cfg = NV_PCRTC_CURSOR_CONFIG_CUR_LINES_64 | regp->cursor_cfg = NV_PCRTC_CURSOR_CONFIG_CUR_LINES_64 |
NV_PCRTC_CURSOR_CONFIG_CUR_PIXELS_64 | NV_PCRTC_CURSOR_CONFIG_CUR_PIXELS_64 |
NV_PCRTC_CURSOR_CONFIG_ADDRESS_SPACE_PNVM; NV_PCRTC_CURSOR_CONFIG_ADDRESS_SPACE_PNVM;
if (drm->device.info.chipset >= 0x11) if (drm->client.device.info.chipset >= 0x11)
regp->cursor_cfg |= NV_PCRTC_CURSOR_CONFIG_CUR_BPP_32; regp->cursor_cfg |= NV_PCRTC_CURSOR_CONFIG_CUR_BPP_32;
if (mode->flags & DRM_MODE_FLAG_DBLSCAN) if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
regp->cursor_cfg |= NV_PCRTC_CURSOR_CONFIG_DOUBLE_SCAN_ENABLE; regp->cursor_cfg |= NV_PCRTC_CURSOR_CONFIG_DOUBLE_SCAN_ENABLE;
...@@ -546,26 +546,26 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) ...@@ -546,26 +546,26 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode)
* 1 << 30 on 0x60.830), for no apparent reason */ * 1 << 30 on 0x60.830), for no apparent reason */
regp->CRTC[NV_CIO_CRE_59] = off_chip_digital; regp->CRTC[NV_CIO_CRE_59] = off_chip_digital;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_RANKINE)
regp->CRTC[0x9f] = off_chip_digital ? 0x11 : 0x1; regp->CRTC[0x9f] = off_chip_digital ? 0x11 : 0x1;
regp->crtc_830 = mode->crtc_vdisplay - 3; regp->crtc_830 = mode->crtc_vdisplay - 3;
regp->crtc_834 = mode->crtc_vdisplay - 1; regp->crtc_834 = mode->crtc_vdisplay - 1;
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
/* This is what the blob does */ /* This is what the blob does */
regp->crtc_850 = NVReadCRTC(dev, 0, NV_PCRTC_850); regp->crtc_850 = NVReadCRTC(dev, 0, NV_PCRTC_850);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_RANKINE)
regp->gpio_ext = NVReadCRTC(dev, 0, NV_PCRTC_GPIO_EXT); regp->gpio_ext = NVReadCRTC(dev, 0, NV_PCRTC_GPIO_EXT);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS)
regp->crtc_cfg = NV10_PCRTC_CONFIG_START_ADDRESS_HSYNC; regp->crtc_cfg = NV10_PCRTC_CONFIG_START_ADDRESS_HSYNC;
else else
regp->crtc_cfg = NV04_PCRTC_CONFIG_START_ADDRESS_HSYNC; regp->crtc_cfg = NV04_PCRTC_CONFIG_START_ADDRESS_HSYNC;
/* Some misc regs */ /* Some misc regs */
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) { if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE) {
regp->CRTC[NV_CIO_CRE_85] = 0xFF; regp->CRTC[NV_CIO_CRE_85] = 0xFF;
regp->CRTC[NV_CIO_CRE_86] = 0x1; regp->CRTC[NV_CIO_CRE_86] = 0x1;
} }
...@@ -577,7 +577,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) ...@@ -577,7 +577,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode)
/* Generic PRAMDAC regs */ /* Generic PRAMDAC regs */
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS)
/* Only bit that bios and blob set. */ /* Only bit that bios and blob set. */
regp->nv10_cursync = (1 << 25); regp->nv10_cursync = (1 << 25);
...@@ -586,7 +586,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode) ...@@ -586,7 +586,7 @@ nv_crtc_mode_set_regs(struct drm_crtc *crtc, struct drm_display_mode * mode)
NV_PRAMDAC_GENERAL_CONTROL_PIXMIX_ON; NV_PRAMDAC_GENERAL_CONTROL_PIXMIX_ON;
if (fb->format->depth == 16) if (fb->format->depth == 16)
regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL; regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL;
if (drm->device.info.chipset >= 0x11) if (drm->client.device.info.chipset >= 0x11)
regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_PIPE_LONG; regp->ramdac_gen_ctrl |= NV_PRAMDAC_GENERAL_CONTROL_PIPE_LONG;
regp->ramdac_630 = 0; /* turn off green mode (tv test pattern?) */ regp->ramdac_630 = 0; /* turn off green mode (tv test pattern?) */
...@@ -649,7 +649,7 @@ nv_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, ...@@ -649,7 +649,7 @@ nv_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
nv_crtc_mode_set_vga(crtc, adjusted_mode); nv_crtc_mode_set_vga(crtc, adjusted_mode);
/* calculated in nv04_dfp_prepare, nv40 needs it written before calculating PLLs */ /* calculated in nv04_dfp_prepare, nv40 needs it written before calculating PLLs */
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, nv04_display(dev)->mode_reg.sel_clk); NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, nv04_display(dev)->mode_reg.sel_clk);
nv_crtc_mode_set_regs(crtc, adjusted_mode); nv_crtc_mode_set_regs(crtc, adjusted_mode);
nv_crtc_calc_state_ext(crtc, mode, adjusted_mode->clock); nv_crtc_calc_state_ext(crtc, mode, adjusted_mode->clock);
...@@ -710,7 +710,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc) ...@@ -710,7 +710,7 @@ static void nv_crtc_prepare(struct drm_crtc *crtc)
/* Some more preparation. */ /* Some more preparation. */
NVWriteCRTC(dev, nv_crtc->index, NV_PCRTC_CONFIG, NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA); NVWriteCRTC(dev, nv_crtc->index, NV_PCRTC_CONFIG, NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) { if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE) {
uint32_t reg900 = NVReadRAMDAC(dev, nv_crtc->index, NV_PRAMDAC_900); uint32_t reg900 = NVReadRAMDAC(dev, nv_crtc->index, NV_PRAMDAC_900);
NVWriteRAMDAC(dev, nv_crtc->index, NV_PRAMDAC_900, reg900 & ~0x10000); NVWriteRAMDAC(dev, nv_crtc->index, NV_PRAMDAC_900, reg900 & ~0x10000);
} }
...@@ -886,7 +886,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc, ...@@ -886,7 +886,7 @@ nv04_crtc_do_mode_set_base(struct drm_crtc *crtc,
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FF_INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FF_INDEX);
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FFLWM__INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_FFLWM__INDEX);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_KELVIN) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_KELVIN) {
regp->CRTC[NV_CIO_CRE_47] = arb_lwm >> 8; regp->CRTC[NV_CIO_CRE_47] = arb_lwm >> 8;
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_47); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_47);
} }
...@@ -967,7 +967,7 @@ static void nv11_cursor_upload(struct drm_device *dev, struct nouveau_bo *src, ...@@ -967,7 +967,7 @@ static void nv11_cursor_upload(struct drm_device *dev, struct nouveau_bo *src,
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->device.info.chipset == 0x11) { if (drm->client.device.info.chipset == 0x11) {
pixel = ((pixel & 0x000000ff) << 24) | pixel = ((pixel & 0x000000ff) << 24) |
((pixel & 0x0000ff00) << 8) | ((pixel & 0x0000ff00) << 8) |
((pixel & 0x00ff0000) >> 8) | ((pixel & 0x00ff0000) >> 8) |
...@@ -1008,7 +1008,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv, ...@@ -1008,7 +1008,7 @@ nv04_crtc_cursor_set(struct drm_crtc *crtc, struct drm_file *file_priv,
if (ret) if (ret)
goto out; goto out;
if (drm->device.info.chipset >= 0x11) if (drm->client.device.info.chipset >= 0x11)
nv11_cursor_upload(dev, cursor, nv_crtc->cursor.nvbo); nv11_cursor_upload(dev, cursor, nv_crtc->cursor.nvbo);
else else
nv04_cursor_upload(dev, cursor, nv_crtc->cursor.nvbo); nv04_cursor_upload(dev, cursor, nv_crtc->cursor.nvbo);
......
...@@ -55,7 +55,7 @@ nv04_cursor_set_offset(struct nouveau_crtc *nv_crtc, uint32_t offset) ...@@ -55,7 +55,7 @@ nv04_cursor_set_offset(struct nouveau_crtc *nv_crtc, uint32_t offset)
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_HCUR_ADDR0_INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_HCUR_ADDR0_INDEX);
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_HCUR_ADDR1_INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_HCUR_ADDR1_INDEX);
crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_HCUR_ADDR2_INDEX); crtc_wr_cio_state(crtc, regp, NV_CIO_CRE_HCUR_ADDR2_INDEX);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
nv_fix_nv40_hw_cursor(dev, nv_crtc->index); nv_fix_nv40_hw_cursor(dev, nv_crtc->index);
} }
......
...@@ -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 nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
int i; int i;
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
...@@ -80,19 +80,19 @@ static int sample_load_twice(struct drm_device *dev, bool sense[2]) ...@@ -80,19 +80,19 @@ 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 (nvif_msec(&drm->device, 10, if (nvif_msec(&drm->client.device, 10,
if (!(nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 1)) if (!(nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 1))
break; break;
) < 0) ) < 0)
return -EBUSY; return -EBUSY;
if (nvif_msec(&drm->device, 10, if (nvif_msec(&drm->client.device, 10,
if ( (nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 1)) if ( (nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 1))
break; break;
) < 0) ) < 0)
return -EBUSY; return -EBUSY;
if (nvif_msec(&drm->device, 10, if (nvif_msec(&drm->client.device, 10,
if (!(nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 1)) if (!(nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 1))
break; break;
) < 0) ) < 0)
...@@ -133,7 +133,7 @@ static enum drm_connector_status nv04_dac_detect(struct drm_encoder *encoder, ...@@ -133,7 +133,7 @@ static enum drm_connector_status nv04_dac_detect(struct drm_encoder *encoder,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
uint8_t saved_seq1, saved_pi, saved_rpc1, saved_cr_mode; uint8_t saved_seq1, saved_pi, saved_rpc1, saved_cr_mode;
uint8_t saved_palette0[3], saved_palette_mask; uint8_t saved_palette0[3], saved_palette_mask;
...@@ -236,8 +236,8 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) ...@@ -236,8 +236,8 @@ 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_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
struct nvkm_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.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,
...@@ -288,7 +288,7 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder) ...@@ -288,7 +288,7 @@ uint32_t nv17_dac_sample_load(struct drm_encoder *encoder)
/* nv driver and nv31 use 0xfffffeee, nv34 and 6600 use 0xfffffece */ /* nv driver and nv31 use 0xfffffeee, nv34 and 6600 use 0xfffffece */
routput = (saved_routput & 0xfffffece) | head << 8; routput = (saved_routput & 0xfffffece) | head << 8;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CURIE) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CURIE) {
if (dcb->type == DCB_OUTPUT_TV) if (dcb->type == DCB_OUTPUT_TV)
routput |= 0x1a << 16; routput |= 0x1a << 16;
else else
...@@ -403,7 +403,7 @@ static void nv04_dac_mode_set(struct drm_encoder *encoder, ...@@ -403,7 +403,7 @@ static void nv04_dac_mode_set(struct drm_encoder *encoder,
} }
/* This could use refinement for flatpanels, but it should work this way */ /* This could use refinement for flatpanels, but it should work this way */
if (drm->device.info.chipset < 0x44) if (drm->client.device.info.chipset < 0x44)
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0xf0000000); NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0xf0000000);
else else
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000); NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000);
......
...@@ -281,7 +281,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder, ...@@ -281,7 +281,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(encoder->crtc);
struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index]; struct nv04_crtc_reg *regp = &nv04_display(dev)->mode_reg.crtc_reg[nv_crtc->index];
...@@ -417,7 +417,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder, ...@@ -417,7 +417,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder,
if ((nv_connector->dithering_mode == DITHERING_MODE_ON) || if ((nv_connector->dithering_mode == DITHERING_MODE_ON) ||
(nv_connector->dithering_mode == DITHERING_MODE_AUTO && (nv_connector->dithering_mode == DITHERING_MODE_AUTO &&
fb->format->depth > connector->display_info.bpc * 3)) { fb->format->depth > connector->display_info.bpc * 3)) {
if (drm->device.info.chipset == 0x11) if (drm->client.device.info.chipset == 0x11)
regp->dither = savep->dither | 0x00010000; regp->dither = savep->dither | 0x00010000;
else { else {
int i; int i;
...@@ -428,7 +428,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder, ...@@ -428,7 +428,7 @@ static void nv04_dfp_mode_set(struct drm_encoder *encoder,
} }
} }
} else { } else {
if (drm->device.info.chipset != 0x11) { if (drm->client.device.info.chipset != 0x11) {
/* reset them */ /* reset them */
int i; int i;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
...@@ -464,7 +464,7 @@ static void nv04_dfp_commit(struct drm_encoder *encoder) ...@@ -464,7 +464,7 @@ static void nv04_dfp_commit(struct drm_encoder *encoder)
NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_TG_CONTROL); NVReadRAMDAC(dev, head, NV_PRAMDAC_FP_TG_CONTROL);
/* This could use refinement for flatpanels, but it should work this way */ /* This could use refinement for flatpanels, but it should work this way */
if (drm->device.info.chipset < 0x44) if (drm->client.device.info.chipset < 0x44)
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0xf0000000); NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0xf0000000);
else else
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000); NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000);
...@@ -486,7 +486,7 @@ static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode) ...@@ -486,7 +486,7 @@ static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode)
{ {
#ifdef __powerpc__ #ifdef __powerpc__
struct drm_device *dev = encoder->dev; struct drm_device *dev = encoder->dev;
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
/* BIOS scripts usually take care of the backlight, thanks /* BIOS scripts usually take care of the backlight, thanks
* Apple for your consistency. * Apple for your consistency.
...@@ -624,7 +624,7 @@ static void nv04_tmds_slave_init(struct drm_encoder *encoder) ...@@ -624,7 +624,7 @@ 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 nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, NVKM_I2C_BUS_PRI); struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, NVKM_I2C_BUS_PRI);
struct nvkm_i2c_bus_probe info[] = { struct nvkm_i2c_bus_probe info[] = {
{ {
......
...@@ -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 nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.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;
...@@ -48,7 +48,7 @@ nv04_display_create(struct drm_device *dev) ...@@ -48,7 +48,7 @@ nv04_display_create(struct drm_device *dev)
if (!disp) if (!disp)
return -ENOMEM; return -ENOMEM;
nvif_object_map(&drm->device.object); nvif_object_map(&drm->client.device.object);
nouveau_display(dev)->priv = disp; nouveau_display(dev)->priv = disp;
nouveau_display(dev)->dtor = nv04_display_destroy; nouveau_display(dev)->dtor = nv04_display_destroy;
...@@ -139,7 +139,7 @@ nv04_display_destroy(struct drm_device *dev) ...@@ -139,7 +139,7 @@ nv04_display_destroy(struct drm_device *dev)
nouveau_display(dev)->priv = NULL; nouveau_display(dev)->priv = NULL;
kfree(disp); kfree(disp);
nvif_object_unmap(&drm->device.object); nvif_object_unmap(&drm->client.device.object);
} }
int int
......
...@@ -129,7 +129,7 @@ nv_two_heads(struct drm_device *dev) ...@@ -129,7 +129,7 @@ nv_two_heads(struct drm_device *dev)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
const int impl = dev->pdev->device & 0x0ff0; const int impl = dev->pdev->device & 0x0ff0;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS && impl != 0x0100 && if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS && impl != 0x0100 &&
impl != 0x0150 && impl != 0x01a0 && impl != 0x0200) impl != 0x0150 && impl != 0x01a0 && impl != 0x0200)
return true; return true;
...@@ -148,7 +148,7 @@ nv_two_reg_pll(struct drm_device *dev) ...@@ -148,7 +148,7 @@ nv_two_reg_pll(struct drm_device *dev)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
const int impl = dev->pdev->device & 0x0ff0; const int impl = dev->pdev->device & 0x0ff0;
if (impl == 0x0310 || impl == 0x0340 || drm->device.info.family >= NV_DEVICE_INFO_V0_CURIE) if (impl == 0x0310 || impl == 0x0340 || drm->client.device.info.family >= NV_DEVICE_INFO_V0_CURIE)
return true; return true;
return false; return false;
} }
...@@ -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 nvkm_bios *bios = nvxx_bios(&drm->device); struct nvkm_bios *bios = nvxx_bios(&drm->client.device);
struct nvbios_init init = { struct nvbios_init init = {
.subdev = &bios->subdev, .subdev = &bios->subdev,
.bios = bios, .bios = bios,
......
...@@ -89,7 +89,7 @@ NVSetOwner(struct drm_device *dev, int owner) ...@@ -89,7 +89,7 @@ NVSetOwner(struct drm_device *dev, int owner)
if (owner == 1) if (owner == 1)
owner *= 3; owner *= 3;
if (drm->device.info.chipset == 0x11) { if (drm->client.device.info.chipset == 0x11) {
/* This might seem stupid, but the blob does it and /* This might seem stupid, but the blob does it and
* omitting it often locks the system up. * omitting it often locks the system up.
*/ */
...@@ -100,7 +100,7 @@ NVSetOwner(struct drm_device *dev, int owner) ...@@ -100,7 +100,7 @@ NVSetOwner(struct drm_device *dev, int owner)
/* CR44 is always changed on CRTC0 */ /* CR44 is always changed on CRTC0 */
NVWriteVgaCrtc(dev, 0, NV_CIO_CRE_44, owner); NVWriteVgaCrtc(dev, 0, NV_CIO_CRE_44, owner);
if (drm->device.info.chipset == 0x11) { /* set me harder */ if (drm->client.device.info.chipset == 0x11) { /* set me harder */
NVWriteVgaCrtc(dev, 0, NV_CIO_CRE_2E, owner); NVWriteVgaCrtc(dev, 0, NV_CIO_CRE_2E, owner);
NVWriteVgaCrtc(dev, 0, NV_CIO_CRE_2E, owner); NVWriteVgaCrtc(dev, 0, NV_CIO_CRE_2E, owner);
} }
...@@ -149,7 +149,7 @@ nouveau_hw_decode_pll(struct drm_device *dev, uint32_t reg1, uint32_t pll1, ...@@ -149,7 +149,7 @@ nouveau_hw_decode_pll(struct drm_device *dev, uint32_t reg1, uint32_t pll1,
pllvals->NM1 = pll1 & 0xffff; pllvals->NM1 = pll1 & 0xffff;
if (nv_two_reg_pll(dev) && pll2 & NV31_RAMDAC_ENABLE_VCO2) if (nv_two_reg_pll(dev) && pll2 & NV31_RAMDAC_ENABLE_VCO2)
pllvals->NM2 = pll2 & 0xffff; pllvals->NM2 = pll2 & 0xffff;
else if (drm->device.info.chipset == 0x30 || drm->device.info.chipset == 0x35) { else if (drm->client.device.info.chipset == 0x30 || drm->client.device.info.chipset == 0x35) {
pllvals->M1 &= 0xf; /* only 4 bits */ pllvals->M1 &= 0xf; /* only 4 bits */
if (pll1 & NV30_RAMDAC_ENABLE_VCO2) { if (pll1 & NV30_RAMDAC_ENABLE_VCO2) {
pllvals->M2 = (pll1 >> 4) & 0x7; pllvals->M2 = (pll1 >> 4) & 0x7;
...@@ -165,8 +165,8 @@ nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype, ...@@ -165,8 +165,8 @@ nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype,
struct nvkm_pll_vals *pllvals) struct nvkm_pll_vals *pllvals)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
struct nvkm_bios *bios = nvxx_bios(&drm->device); struct nvkm_bios *bios = nvxx_bios(&drm->client.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;
...@@ -184,7 +184,7 @@ nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype, ...@@ -184,7 +184,7 @@ nouveau_hw_get_pllvals(struct drm_device *dev, enum nvbios_pll_type plltype,
pll2 = nvif_rd32(device, reg2); pll2 = nvif_rd32(device, reg2);
} }
if (drm->device.info.family == NV_DEVICE_INFO_V0_CELSIUS && reg1 >= NV_PRAMDAC_VPLL_COEFF) { if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CELSIUS && reg1 >= NV_PRAMDAC_VPLL_COEFF) {
uint32_t ramdac580 = NVReadRAMDAC(dev, 0, NV_PRAMDAC_580); uint32_t ramdac580 = NVReadRAMDAC(dev, 0, NV_PRAMDAC_580);
/* check whether vpll has been forced into single stage mode */ /* check whether vpll has been forced into single stage mode */
...@@ -252,7 +252,7 @@ nouveau_hw_fix_bad_vpll(struct drm_device *dev, int head) ...@@ -252,7 +252,7 @@ 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->client.device;
struct nvkm_clk *clk = nvxx_clk(device); struct nvkm_clk *clk = nvxx_clk(device);
struct nvkm_bios *bios = nvxx_bios(device); struct nvkm_bios *bios = nvxx_bios(device);
struct nvbios_pll pll_lim; struct nvbios_pll pll_lim;
...@@ -391,21 +391,21 @@ nv_save_state_ramdac(struct drm_device *dev, int head, ...@@ -391,21 +391,21 @@ nv_save_state_ramdac(struct drm_device *dev, int head,
struct nv04_crtc_reg *regp = &state->crtc_reg[head]; struct nv04_crtc_reg *regp = &state->crtc_reg[head];
int i; int i;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS)
regp->nv10_cursync = NVReadRAMDAC(dev, head, NV_RAMDAC_NV10_CURSYNC); regp->nv10_cursync = NVReadRAMDAC(dev, head, NV_RAMDAC_NV10_CURSYNC);
nouveau_hw_get_pllvals(dev, head ? PLL_VPLL1 : PLL_VPLL0, &regp->pllvals); nouveau_hw_get_pllvals(dev, head ? PLL_VPLL1 : PLL_VPLL0, &regp->pllvals);
state->pllsel = NVReadRAMDAC(dev, 0, NV_PRAMDAC_PLL_COEFF_SELECT); state->pllsel = NVReadRAMDAC(dev, 0, NV_PRAMDAC_PLL_COEFF_SELECT);
if (nv_two_heads(dev)) if (nv_two_heads(dev))
state->sel_clk = NVReadRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK); state->sel_clk = NVReadRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK);
if (drm->device.info.chipset == 0x11) if (drm->client.device.info.chipset == 0x11)
regp->dither = NVReadRAMDAC(dev, head, NV_RAMDAC_DITHER_NV11); regp->dither = NVReadRAMDAC(dev, head, NV_RAMDAC_DITHER_NV11);
regp->ramdac_gen_ctrl = NVReadRAMDAC(dev, head, NV_PRAMDAC_GENERAL_CONTROL); regp->ramdac_gen_ctrl = NVReadRAMDAC(dev, head, NV_PRAMDAC_GENERAL_CONTROL);
if (nv_gf4_disp_arch(dev)) if (nv_gf4_disp_arch(dev))
regp->ramdac_630 = NVReadRAMDAC(dev, head, NV_PRAMDAC_630); regp->ramdac_630 = NVReadRAMDAC(dev, head, NV_PRAMDAC_630);
if (drm->device.info.chipset >= 0x30) if (drm->client.device.info.chipset >= 0x30)
regp->ramdac_634 = NVReadRAMDAC(dev, head, NV_PRAMDAC_634); regp->ramdac_634 = NVReadRAMDAC(dev, head, NV_PRAMDAC_634);
regp->tv_setup = NVReadRAMDAC(dev, head, NV_PRAMDAC_TV_SETUP); regp->tv_setup = NVReadRAMDAC(dev, head, NV_PRAMDAC_TV_SETUP);
...@@ -447,7 +447,7 @@ nv_save_state_ramdac(struct drm_device *dev, int head, ...@@ -447,7 +447,7 @@ nv_save_state_ramdac(struct drm_device *dev, int head,
if (nv_gf4_disp_arch(dev)) if (nv_gf4_disp_arch(dev))
regp->ramdac_8c0 = NVReadRAMDAC(dev, head, NV_PRAMDAC_8C0); regp->ramdac_8c0 = NVReadRAMDAC(dev, head, NV_PRAMDAC_8C0);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) { if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE) {
regp->ramdac_a20 = NVReadRAMDAC(dev, head, NV_PRAMDAC_A20); regp->ramdac_a20 = NVReadRAMDAC(dev, head, NV_PRAMDAC_A20);
regp->ramdac_a24 = NVReadRAMDAC(dev, head, NV_PRAMDAC_A24); regp->ramdac_a24 = NVReadRAMDAC(dev, head, NV_PRAMDAC_A24);
regp->ramdac_a34 = NVReadRAMDAC(dev, head, NV_PRAMDAC_A34); regp->ramdac_a34 = NVReadRAMDAC(dev, head, NV_PRAMDAC_A34);
...@@ -463,26 +463,26 @@ nv_load_state_ramdac(struct drm_device *dev, int head, ...@@ -463,26 +463,26 @@ 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 nvkm_clk *clk = nvxx_clk(&drm->device); struct nvkm_clk *clk = nvxx_clk(&drm->client.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;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS)
NVWriteRAMDAC(dev, head, NV_RAMDAC_NV10_CURSYNC, regp->nv10_cursync); NVWriteRAMDAC(dev, head, NV_RAMDAC_NV10_CURSYNC, regp->nv10_cursync);
clk->pll_prog(clk, pllreg, &regp->pllvals); clk->pll_prog(clk, pllreg, &regp->pllvals);
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_PLL_COEFF_SELECT, state->pllsel); NVWriteRAMDAC(dev, 0, NV_PRAMDAC_PLL_COEFF_SELECT, state->pllsel);
if (nv_two_heads(dev)) if (nv_two_heads(dev))
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, state->sel_clk); NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, state->sel_clk);
if (drm->device.info.chipset == 0x11) if (drm->client.device.info.chipset == 0x11)
NVWriteRAMDAC(dev, head, NV_RAMDAC_DITHER_NV11, regp->dither); NVWriteRAMDAC(dev, head, NV_RAMDAC_DITHER_NV11, regp->dither);
NVWriteRAMDAC(dev, head, NV_PRAMDAC_GENERAL_CONTROL, regp->ramdac_gen_ctrl); NVWriteRAMDAC(dev, head, NV_PRAMDAC_GENERAL_CONTROL, regp->ramdac_gen_ctrl);
if (nv_gf4_disp_arch(dev)) if (nv_gf4_disp_arch(dev))
NVWriteRAMDAC(dev, head, NV_PRAMDAC_630, regp->ramdac_630); NVWriteRAMDAC(dev, head, NV_PRAMDAC_630, regp->ramdac_630);
if (drm->device.info.chipset >= 0x30) if (drm->client.device.info.chipset >= 0x30)
NVWriteRAMDAC(dev, head, NV_PRAMDAC_634, regp->ramdac_634); NVWriteRAMDAC(dev, head, NV_PRAMDAC_634, regp->ramdac_634);
NVWriteRAMDAC(dev, head, NV_PRAMDAC_TV_SETUP, regp->tv_setup); NVWriteRAMDAC(dev, head, NV_PRAMDAC_TV_SETUP, regp->tv_setup);
...@@ -519,7 +519,7 @@ nv_load_state_ramdac(struct drm_device *dev, int head, ...@@ -519,7 +519,7 @@ nv_load_state_ramdac(struct drm_device *dev, int head,
if (nv_gf4_disp_arch(dev)) if (nv_gf4_disp_arch(dev))
NVWriteRAMDAC(dev, head, NV_PRAMDAC_8C0, regp->ramdac_8c0); NVWriteRAMDAC(dev, head, NV_PRAMDAC_8C0, regp->ramdac_8c0);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) { if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE) {
NVWriteRAMDAC(dev, head, NV_PRAMDAC_A20, regp->ramdac_a20); NVWriteRAMDAC(dev, head, NV_PRAMDAC_A20, regp->ramdac_a20);
NVWriteRAMDAC(dev, head, NV_PRAMDAC_A24, regp->ramdac_a24); NVWriteRAMDAC(dev, head, NV_PRAMDAC_A24, regp->ramdac_a24);
NVWriteRAMDAC(dev, head, NV_PRAMDAC_A34, regp->ramdac_a34); NVWriteRAMDAC(dev, head, NV_PRAMDAC_A34, regp->ramdac_a34);
...@@ -600,10 +600,10 @@ nv_save_state_ext(struct drm_device *dev, int head, ...@@ -600,10 +600,10 @@ nv_save_state_ext(struct drm_device *dev, int head,
rd_cio_state(dev, head, regp, NV_CIO_CRE_FFLWM__INDEX); rd_cio_state(dev, head, regp, NV_CIO_CRE_FFLWM__INDEX);
rd_cio_state(dev, head, regp, NV_CIO_CRE_21); rd_cio_state(dev, head, regp, NV_CIO_CRE_21);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_KELVIN) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_KELVIN)
rd_cio_state(dev, head, regp, NV_CIO_CRE_47); rd_cio_state(dev, head, regp, NV_CIO_CRE_47);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_RANKINE)
rd_cio_state(dev, head, regp, 0x9f); rd_cio_state(dev, head, regp, 0x9f);
rd_cio_state(dev, head, regp, NV_CIO_CRE_49); rd_cio_state(dev, head, regp, NV_CIO_CRE_49);
...@@ -612,14 +612,14 @@ nv_save_state_ext(struct drm_device *dev, int head, ...@@ -612,14 +612,14 @@ nv_save_state_ext(struct drm_device *dev, int head,
rd_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR2_INDEX); rd_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR2_INDEX);
rd_cio_state(dev, head, regp, NV_CIO_CRE_ILACE__INDEX); rd_cio_state(dev, head, regp, NV_CIO_CRE_ILACE__INDEX);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) {
regp->crtc_830 = NVReadCRTC(dev, head, NV_PCRTC_830); regp->crtc_830 = NVReadCRTC(dev, head, NV_PCRTC_830);
regp->crtc_834 = NVReadCRTC(dev, head, NV_PCRTC_834); regp->crtc_834 = NVReadCRTC(dev, head, NV_PCRTC_834);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_RANKINE)
regp->gpio_ext = NVReadCRTC(dev, head, NV_PCRTC_GPIO_EXT); regp->gpio_ext = NVReadCRTC(dev, head, NV_PCRTC_GPIO_EXT);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
regp->crtc_850 = NVReadCRTC(dev, head, NV_PCRTC_850); regp->crtc_850 = NVReadCRTC(dev, head, NV_PCRTC_850);
if (nv_two_heads(dev)) if (nv_two_heads(dev))
...@@ -631,7 +631,7 @@ nv_save_state_ext(struct drm_device *dev, int head, ...@@ -631,7 +631,7 @@ nv_save_state_ext(struct drm_device *dev, int head,
rd_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH3__INDEX); rd_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH3__INDEX);
rd_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH4__INDEX); rd_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH4__INDEX);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) {
rd_cio_state(dev, head, regp, NV_CIO_CRE_EBR_INDEX); rd_cio_state(dev, head, regp, NV_CIO_CRE_EBR_INDEX);
rd_cio_state(dev, head, regp, NV_CIO_CRE_CSB); rd_cio_state(dev, head, regp, NV_CIO_CRE_CSB);
rd_cio_state(dev, head, regp, NV_CIO_CRE_4B); rd_cio_state(dev, head, regp, NV_CIO_CRE_4B);
...@@ -660,12 +660,12 @@ nv_load_state_ext(struct drm_device *dev, int head, ...@@ -660,12 +660,12 @@ nv_load_state_ext(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 nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
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;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) {
if (nv_two_heads(dev)) if (nv_two_heads(dev))
/* setting ENGINE_CTRL (EC) *must* come before /* setting ENGINE_CTRL (EC) *must* come before
* CIO_CRE_LCD, as writing CRE_LCD sets bits 16 & 17 in * CIO_CRE_LCD, as writing CRE_LCD sets bits 16 & 17 in
...@@ -677,20 +677,20 @@ nv_load_state_ext(struct drm_device *dev, int head, ...@@ -677,20 +677,20 @@ nv_load_state_ext(struct drm_device *dev, int head,
nvif_wr32(device, NV_PVIDEO_INTR_EN, 0); nvif_wr32(device, NV_PVIDEO_INTR_EN, 0);
nvif_wr32(device, NV_PVIDEO_OFFSET_BUFF(0), 0); nvif_wr32(device, NV_PVIDEO_OFFSET_BUFF(0), 0);
nvif_wr32(device, NV_PVIDEO_OFFSET_BUFF(1), 0); nvif_wr32(device, NV_PVIDEO_OFFSET_BUFF(1), 0);
nvif_wr32(device, NV_PVIDEO_LIMIT(0), drm->device.info.ram_size - 1); nvif_wr32(device, NV_PVIDEO_LIMIT(0), drm->client.device.info.ram_size - 1);
nvif_wr32(device, NV_PVIDEO_LIMIT(1), drm->device.info.ram_size - 1); nvif_wr32(device, NV_PVIDEO_LIMIT(1), drm->client.device.info.ram_size - 1);
nvif_wr32(device, NV_PVIDEO_UVPLANE_LIMIT(0), drm->device.info.ram_size - 1); nvif_wr32(device, NV_PVIDEO_UVPLANE_LIMIT(0), drm->client.device.info.ram_size - 1);
nvif_wr32(device, NV_PVIDEO_UVPLANE_LIMIT(1), drm->device.info.ram_size - 1); nvif_wr32(device, NV_PVIDEO_UVPLANE_LIMIT(1), drm->client.device.info.ram_size - 1);
nvif_wr32(device, NV_PBUS_POWERCTRL_2, 0); nvif_wr32(device, NV_PBUS_POWERCTRL_2, 0);
NVWriteCRTC(dev, head, NV_PCRTC_CURSOR_CONFIG, regp->cursor_cfg); NVWriteCRTC(dev, head, NV_PCRTC_CURSOR_CONFIG, regp->cursor_cfg);
NVWriteCRTC(dev, head, NV_PCRTC_830, regp->crtc_830); NVWriteCRTC(dev, head, NV_PCRTC_830, regp->crtc_830);
NVWriteCRTC(dev, head, NV_PCRTC_834, regp->crtc_834); NVWriteCRTC(dev, head, NV_PCRTC_834, regp->crtc_834);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_RANKINE)
NVWriteCRTC(dev, head, NV_PCRTC_GPIO_EXT, regp->gpio_ext); NVWriteCRTC(dev, head, NV_PCRTC_GPIO_EXT, regp->gpio_ext);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) { if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE) {
NVWriteCRTC(dev, head, NV_PCRTC_850, regp->crtc_850); NVWriteCRTC(dev, head, NV_PCRTC_850, regp->crtc_850);
reg900 = NVReadRAMDAC(dev, head, NV_PRAMDAC_900); reg900 = NVReadRAMDAC(dev, head, NV_PRAMDAC_900);
...@@ -713,23 +713,23 @@ nv_load_state_ext(struct drm_device *dev, int head, ...@@ -713,23 +713,23 @@ nv_load_state_ext(struct drm_device *dev, int head,
wr_cio_state(dev, head, regp, NV_CIO_CRE_FF_INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_FF_INDEX);
wr_cio_state(dev, head, regp, NV_CIO_CRE_FFLWM__INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_FFLWM__INDEX);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_KELVIN) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_KELVIN)
wr_cio_state(dev, head, regp, NV_CIO_CRE_47); wr_cio_state(dev, head, regp, NV_CIO_CRE_47);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_RANKINE)
wr_cio_state(dev, head, regp, 0x9f); wr_cio_state(dev, head, regp, 0x9f);
wr_cio_state(dev, head, regp, NV_CIO_CRE_49); wr_cio_state(dev, head, regp, NV_CIO_CRE_49);
wr_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR0_INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR0_INDEX);
wr_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR1_INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR1_INDEX);
wr_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR2_INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_HCUR_ADDR2_INDEX);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
nv_fix_nv40_hw_cursor(dev, head); nv_fix_nv40_hw_cursor(dev, head);
wr_cio_state(dev, head, regp, NV_CIO_CRE_ILACE__INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_ILACE__INDEX);
wr_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH3__INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH3__INDEX);
wr_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH4__INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_SCRATCH4__INDEX);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) {
wr_cio_state(dev, head, regp, NV_CIO_CRE_EBR_INDEX); wr_cio_state(dev, head, regp, NV_CIO_CRE_EBR_INDEX);
wr_cio_state(dev, head, regp, NV_CIO_CRE_CSB); wr_cio_state(dev, head, regp, NV_CIO_CRE_CSB);
wr_cio_state(dev, head, regp, NV_CIO_CRE_4B); wr_cio_state(dev, head, regp, NV_CIO_CRE_4B);
...@@ -737,14 +737,14 @@ nv_load_state_ext(struct drm_device *dev, int head, ...@@ -737,14 +737,14 @@ nv_load_state_ext(struct drm_device *dev, int head,
} }
/* NV11 and NV20 stop at 0x52. */ /* NV11 and NV20 stop at 0x52. */
if (nv_gf4_disp_arch(dev)) { if (nv_gf4_disp_arch(dev)) {
if (drm->device.info.family < NV_DEVICE_INFO_V0_KELVIN) { if (drm->client.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. */
nvif_msec(&drm->device, 650, nvif_msec(&drm->client.device, 650,
if ( (nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 8)) if ( (nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 8))
break; break;
); );
nvif_msec(&drm->device, 650, nvif_msec(&drm->client.device, 650,
if (!(nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 8)) if (!(nvif_rd32(device, NV_PRMCIO_INP0__COLOR) & 8))
break; break;
); );
...@@ -770,7 +770,7 @@ static void ...@@ -770,7 +770,7 @@ static void
nv_save_state_palette(struct drm_device *dev, int head, nv_save_state_palette(struct drm_device *dev, int head,
struct nv04_mode_state *state) struct nv04_mode_state *state)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
int head_offset = head * NV_PRMDIO_SIZE, i; int head_offset = head * NV_PRMDIO_SIZE, i;
nvif_wr08(device, NV_PRMDIO_PIXEL_MASK + head_offset, nvif_wr08(device, NV_PRMDIO_PIXEL_MASK + head_offset,
...@@ -789,7 +789,7 @@ void ...@@ -789,7 +789,7 @@ void
nouveau_hw_load_state_palette(struct drm_device *dev, int head, nouveau_hw_load_state_palette(struct drm_device *dev, int head,
struct nv04_mode_state *state) struct nv04_mode_state *state)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
int head_offset = head * NV_PRMDIO_SIZE, i; int head_offset = head * NV_PRMDIO_SIZE, i;
nvif_wr08(device, NV_PRMDIO_PIXEL_MASK + head_offset, nvif_wr08(device, NV_PRMDIO_PIXEL_MASK + head_offset,
...@@ -809,7 +809,7 @@ void nouveau_hw_save_state(struct drm_device *dev, int head, ...@@ -809,7 +809,7 @@ void nouveau_hw_save_state(struct drm_device *dev, int head,
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->device.info.chipset == 0x11) if (drm->client.device.info.chipset == 0x11)
/* NB: no attempt is made to restore the bad pll later on */ /* NB: no attempt is made to restore the bad pll later on */
nouveau_hw_fix_bad_vpll(dev, head); nouveau_hw_fix_bad_vpll(dev, head);
nv_save_state_ramdac(dev, head, state); nv_save_state_ramdac(dev, head, state);
......
...@@ -60,7 +60,7 @@ extern void nouveau_calc_arb(struct drm_device *, int vclk, int bpp, ...@@ -60,7 +60,7 @@ extern void nouveau_calc_arb(struct drm_device *, int vclk, int bpp,
static inline uint32_t NVReadCRTC(struct drm_device *dev, static inline uint32_t NVReadCRTC(struct drm_device *dev,
int head, uint32_t reg) int head, uint32_t reg)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
uint32_t val; uint32_t val;
if (head) if (head)
reg += NV_PCRTC0_SIZE; reg += NV_PCRTC0_SIZE;
...@@ -71,7 +71,7 @@ static inline uint32_t NVReadCRTC(struct drm_device *dev, ...@@ -71,7 +71,7 @@ static inline uint32_t NVReadCRTC(struct drm_device *dev,
static inline void NVWriteCRTC(struct drm_device *dev, static inline void NVWriteCRTC(struct drm_device *dev,
int head, uint32_t reg, uint32_t val) int head, uint32_t reg, uint32_t val)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
if (head) if (head)
reg += NV_PCRTC0_SIZE; reg += NV_PCRTC0_SIZE;
nvif_wr32(device, reg, val); nvif_wr32(device, reg, val);
...@@ -80,7 +80,7 @@ static inline void NVWriteCRTC(struct drm_device *dev, ...@@ -80,7 +80,7 @@ static inline void NVWriteCRTC(struct drm_device *dev,
static inline uint32_t NVReadRAMDAC(struct drm_device *dev, static inline uint32_t NVReadRAMDAC(struct drm_device *dev,
int head, uint32_t reg) int head, uint32_t reg)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
uint32_t val; uint32_t val;
if (head) if (head)
reg += NV_PRAMDAC0_SIZE; reg += NV_PRAMDAC0_SIZE;
...@@ -91,7 +91,7 @@ static inline uint32_t NVReadRAMDAC(struct drm_device *dev, ...@@ -91,7 +91,7 @@ static inline uint32_t NVReadRAMDAC(struct drm_device *dev,
static inline void NVWriteRAMDAC(struct drm_device *dev, static inline void NVWriteRAMDAC(struct drm_device *dev,
int head, uint32_t reg, uint32_t val) int head, uint32_t reg, uint32_t val)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
if (head) if (head)
reg += NV_PRAMDAC0_SIZE; reg += NV_PRAMDAC0_SIZE;
nvif_wr32(device, reg, val); nvif_wr32(device, reg, val);
...@@ -120,7 +120,7 @@ static inline void nv_write_tmds(struct drm_device *dev, ...@@ -120,7 +120,7 @@ static inline void nv_write_tmds(struct drm_device *dev,
static inline void NVWriteVgaCrtc(struct drm_device *dev, static inline void NVWriteVgaCrtc(struct drm_device *dev,
int head, uint8_t index, uint8_t value) int head, uint8_t index, uint8_t value)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
nvif_wr08(device, NV_PRMCIO_CRX__COLOR + head * NV_PRMCIO_SIZE, index); nvif_wr08(device, NV_PRMCIO_CRX__COLOR + head * NV_PRMCIO_SIZE, index);
nvif_wr08(device, NV_PRMCIO_CR__COLOR + head * NV_PRMCIO_SIZE, value); nvif_wr08(device, NV_PRMCIO_CR__COLOR + head * NV_PRMCIO_SIZE, value);
} }
...@@ -128,7 +128,7 @@ static inline void NVWriteVgaCrtc(struct drm_device *dev, ...@@ -128,7 +128,7 @@ static inline void NVWriteVgaCrtc(struct drm_device *dev,
static inline uint8_t NVReadVgaCrtc(struct drm_device *dev, static inline uint8_t NVReadVgaCrtc(struct drm_device *dev,
int head, uint8_t index) int head, uint8_t index)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
uint8_t val; uint8_t val;
nvif_wr08(device, NV_PRMCIO_CRX__COLOR + head * NV_PRMCIO_SIZE, index); nvif_wr08(device, NV_PRMCIO_CRX__COLOR + head * NV_PRMCIO_SIZE, index);
val = nvif_rd08(device, NV_PRMCIO_CR__COLOR + head * NV_PRMCIO_SIZE); val = nvif_rd08(device, NV_PRMCIO_CR__COLOR + head * NV_PRMCIO_SIZE);
...@@ -165,13 +165,13 @@ static inline uint8_t NVReadVgaCrtc5758(struct drm_device *dev, int head, uint8_ ...@@ -165,13 +165,13 @@ static inline uint8_t NVReadVgaCrtc5758(struct drm_device *dev, int head, uint8_
static inline uint8_t NVReadPRMVIO(struct drm_device *dev, static inline uint8_t NVReadPRMVIO(struct drm_device *dev,
int head, uint32_t reg) int head, uint32_t reg)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
uint8_t val; uint8_t val;
/* Only NV4x have two pvio ranges; other twoHeads cards MUST call /* Only NV4x have two pvio ranges; other twoHeads cards MUST call
* NVSetOwner for the relevant head to be programmed */ * NVSetOwner for the relevant head to be programmed */
if (head && drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (head && drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
reg += NV_PRMVIO_SIZE; reg += NV_PRMVIO_SIZE;
val = nvif_rd08(device, reg); val = nvif_rd08(device, reg);
...@@ -181,12 +181,12 @@ static inline uint8_t NVReadPRMVIO(struct drm_device *dev, ...@@ -181,12 +181,12 @@ static inline uint8_t NVReadPRMVIO(struct drm_device *dev,
static inline void NVWritePRMVIO(struct drm_device *dev, static inline void NVWritePRMVIO(struct drm_device *dev,
int head, uint32_t reg, uint8_t value) int head, uint32_t reg, uint8_t value)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
/* Only NV4x have two pvio ranges; other twoHeads cards MUST call /* Only NV4x have two pvio ranges; other twoHeads cards MUST call
* NVSetOwner for the relevant head to be programmed */ * NVSetOwner for the relevant head to be programmed */
if (head && drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (head && drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
reg += NV_PRMVIO_SIZE; reg += NV_PRMVIO_SIZE;
nvif_wr08(device, reg, value); nvif_wr08(device, reg, value);
...@@ -194,14 +194,14 @@ static inline void NVWritePRMVIO(struct drm_device *dev, ...@@ -194,14 +194,14 @@ static inline void NVWritePRMVIO(struct drm_device *dev,
static inline void NVSetEnablePalette(struct drm_device *dev, int head, bool enable) static inline void NVSetEnablePalette(struct drm_device *dev, int head, bool enable)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
nvif_rd08(device, NV_PRMCIO_INP0__COLOR + head * NV_PRMCIO_SIZE); nvif_rd08(device, NV_PRMCIO_INP0__COLOR + head * NV_PRMCIO_SIZE);
nvif_wr08(device, NV_PRMCIO_ARX + head * NV_PRMCIO_SIZE, enable ? 0 : 0x20); nvif_wr08(device, NV_PRMCIO_ARX + head * NV_PRMCIO_SIZE, enable ? 0 : 0x20);
} }
static inline bool NVGetEnablePalette(struct drm_device *dev, int head) static inline bool NVGetEnablePalette(struct drm_device *dev, int head)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
nvif_rd08(device, NV_PRMCIO_INP0__COLOR + head * NV_PRMCIO_SIZE); nvif_rd08(device, NV_PRMCIO_INP0__COLOR + head * NV_PRMCIO_SIZE);
return !(nvif_rd08(device, NV_PRMCIO_ARX + head * NV_PRMCIO_SIZE) & 0x20); return !(nvif_rd08(device, NV_PRMCIO_ARX + head * NV_PRMCIO_SIZE) & 0x20);
} }
...@@ -209,7 +209,7 @@ static inline bool NVGetEnablePalette(struct drm_device *dev, int head) ...@@ -209,7 +209,7 @@ static inline bool NVGetEnablePalette(struct drm_device *dev, int head)
static inline void NVWriteVgaAttr(struct drm_device *dev, static inline void NVWriteVgaAttr(struct drm_device *dev,
int head, uint8_t index, uint8_t value) int head, uint8_t index, uint8_t value)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
if (NVGetEnablePalette(dev, head)) if (NVGetEnablePalette(dev, head))
index &= ~0x20; index &= ~0x20;
else else
...@@ -223,7 +223,7 @@ static inline void NVWriteVgaAttr(struct drm_device *dev, ...@@ -223,7 +223,7 @@ static inline void NVWriteVgaAttr(struct drm_device *dev,
static inline uint8_t NVReadVgaAttr(struct drm_device *dev, static inline uint8_t NVReadVgaAttr(struct drm_device *dev,
int head, uint8_t index) int head, uint8_t index)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
uint8_t val; uint8_t val;
if (NVGetEnablePalette(dev, head)) if (NVGetEnablePalette(dev, head))
index &= ~0x20; index &= ~0x20;
...@@ -259,10 +259,10 @@ static inline void NVVgaProtect(struct drm_device *dev, int head, bool protect) ...@@ -259,10 +259,10 @@ static inline void NVVgaProtect(struct drm_device *dev, int head, bool protect)
static inline bool static inline bool
nv_heads_tied(struct drm_device *dev) nv_heads_tied(struct drm_device *dev)
{ {
struct nvif_object *device = &nouveau_drm(dev)->device.object; struct nvif_object *device = &nouveau_drm(dev)->client.device.object;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
if (drm->device.info.chipset == 0x11) if (drm->client.device.info.chipset == 0x11)
return !!(nvif_rd32(device, NV_PBUS_DEBUG_1) & (1 << 28)); return !!(nvif_rd32(device, NV_PBUS_DEBUG_1) & (1 << 28));
return NVReadVgaCrtc(dev, 0, NV_CIO_CRE_44) & 0x4; return NVReadVgaCrtc(dev, 0, NV_CIO_CRE_44) & 0x4;
...@@ -318,7 +318,7 @@ NVLockVgaCrtcs(struct drm_device *dev, bool lock) ...@@ -318,7 +318,7 @@ NVLockVgaCrtcs(struct drm_device *dev, bool lock)
NVWriteVgaCrtc(dev, 0, NV_CIO_SR_LOCK_INDEX, NVWriteVgaCrtc(dev, 0, NV_CIO_SR_LOCK_INDEX,
lock ? NV_CIO_SR_LOCK_VALUE : NV_CIO_SR_UNLOCK_RW_VALUE); lock ? NV_CIO_SR_LOCK_VALUE : NV_CIO_SR_UNLOCK_RW_VALUE);
/* NV11 has independently lockable extended crtcs, except when tied */ /* NV11 has independently lockable extended crtcs, except when tied */
if (drm->device.info.chipset == 0x11 && !nv_heads_tied(dev)) if (drm->client.device.info.chipset == 0x11 && !nv_heads_tied(dev))
NVWriteVgaCrtc(dev, 1, NV_CIO_SR_LOCK_INDEX, NVWriteVgaCrtc(dev, 1, NV_CIO_SR_LOCK_INDEX,
lock ? NV_CIO_SR_LOCK_VALUE : lock ? NV_CIO_SR_LOCK_VALUE :
NV_CIO_SR_UNLOCK_RW_VALUE); NV_CIO_SR_UNLOCK_RW_VALUE);
...@@ -335,7 +335,7 @@ static inline int nv_cursor_width(struct drm_device *dev) ...@@ -335,7 +335,7 @@ static inline int nv_cursor_width(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
return drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS ? NV10_CURSOR_SIZE : NV04_CURSOR_SIZE; return drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS ? NV10_CURSOR_SIZE : NV04_CURSOR_SIZE;
} }
static inline void static inline void
...@@ -357,7 +357,7 @@ nv_set_crtc_base(struct drm_device *dev, int head, uint32_t offset) ...@@ -357,7 +357,7 @@ nv_set_crtc_base(struct drm_device *dev, int head, uint32_t offset)
NVWriteCRTC(dev, head, NV_PCRTC_START, offset); NVWriteCRTC(dev, head, NV_PCRTC_START, offset);
if (drm->device.info.family == NV_DEVICE_INFO_V0_TNT) { if (drm->client.device.info.family == NV_DEVICE_INFO_V0_TNT) {
/* /*
* Hilarious, the 24th bit doesn't want to stick to * Hilarious, the 24th bit doesn't want to stick to
* PCRTC_START... * PCRTC_START...
...@@ -382,7 +382,7 @@ nv_show_cursor(struct drm_device *dev, int head, bool show) ...@@ -382,7 +382,7 @@ nv_show_cursor(struct drm_device *dev, int head, bool show)
*curctl1 &= ~MASK(NV_CIO_CRE_HCUR_ADDR1_ENABLE); *curctl1 &= ~MASK(NV_CIO_CRE_HCUR_ADDR1_ENABLE);
NVWriteVgaCrtc(dev, head, NV_CIO_CRE_HCUR_ADDR1_INDEX, *curctl1); NVWriteVgaCrtc(dev, head, NV_CIO_CRE_HCUR_ADDR1_INDEX, *curctl1);
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
nv_fix_nv40_hw_cursor(dev, head); nv_fix_nv40_hw_cursor(dev, head);
} }
...@@ -398,7 +398,7 @@ nv_pitch_align(struct drm_device *dev, uint32_t width, int bpp) ...@@ -398,7 +398,7 @@ nv_pitch_align(struct drm_device *dev, uint32_t width, int bpp)
bpp = 8; bpp = 8;
/* Alignment requirements taken from the Haiku driver */ /* Alignment requirements taken from the Haiku driver */
if (drm->device.info.family == NV_DEVICE_INFO_V0_TNT) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_TNT)
mask = 128 / bpp - 1; mask = 128 / bpp - 1;
else else
mask = 512 / bpp - 1; mask = 512 / bpp - 1;
......
...@@ -97,7 +97,7 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -97,7 +97,7 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
uint32_t src_w, uint32_t src_h) uint32_t src_w, uint32_t src_h)
{ {
struct nouveau_drm *drm = nouveau_drm(plane->dev); struct nouveau_drm *drm = nouveau_drm(plane->dev);
struct nvif_object *dev = &drm->device.object; struct nvif_object *dev = &drm->client.device.object;
struct nouveau_plane *nv_plane = struct nouveau_plane *nv_plane =
container_of(plane, struct nouveau_plane, base); container_of(plane, struct nouveau_plane, base);
struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb);
...@@ -119,7 +119,7 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -119,7 +119,7 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
if (format > 0xffff) if (format > 0xffff)
return -ERANGE; return -ERANGE;
if (drm->device.info.chipset >= 0x30) { if (drm->client.device.info.chipset >= 0x30) {
if (crtc_w < (src_w >> 1) || crtc_h < (src_h >> 1)) if (crtc_w < (src_w >> 1) || crtc_h < (src_h >> 1))
return -ERANGE; return -ERANGE;
} else { } else {
...@@ -174,7 +174,7 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -174,7 +174,7 @@ nv10_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
static int static int
nv10_disable_plane(struct drm_plane *plane) nv10_disable_plane(struct drm_plane *plane)
{ {
struct nvif_object *dev = &nouveau_drm(plane->dev)->device.object; struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
struct nouveau_plane *nv_plane = struct nouveau_plane *nv_plane =
container_of(plane, struct nouveau_plane, base); container_of(plane, struct nouveau_plane, base);
...@@ -198,7 +198,7 @@ nv_destroy_plane(struct drm_plane *plane) ...@@ -198,7 +198,7 @@ nv_destroy_plane(struct drm_plane *plane)
static void static void
nv10_set_params(struct nouveau_plane *plane) nv10_set_params(struct nouveau_plane *plane)
{ {
struct nvif_object *dev = &nouveau_drm(plane->base.dev)->device.object; struct nvif_object *dev = &nouveau_drm(plane->base.dev)->client.device.object;
u32 luma = (plane->brightness - 512) << 16 | plane->contrast; u32 luma = (plane->brightness - 512) << 16 | plane->contrast;
u32 chroma = ((sin_mul(plane->hue, plane->saturation) & 0xffff) << 16) | u32 chroma = ((sin_mul(plane->hue, plane->saturation) & 0xffff) << 16) |
(cos_mul(plane->hue, plane->saturation) & 0xffff); (cos_mul(plane->hue, plane->saturation) & 0xffff);
...@@ -268,7 +268,7 @@ nv10_overlay_init(struct drm_device *device) ...@@ -268,7 +268,7 @@ nv10_overlay_init(struct drm_device *device)
if (!plane) if (!plane)
return; return;
switch (drm->device.info.chipset) { switch (drm->client.device.info.chipset) {
case 0x10: case 0x10:
case 0x11: case 0x11:
case 0x15: case 0x15:
...@@ -347,7 +347,7 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -347,7 +347,7 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
uint32_t src_x, uint32_t src_y, uint32_t src_x, uint32_t src_y,
uint32_t src_w, uint32_t src_h) uint32_t src_w, uint32_t src_h)
{ {
struct nvif_object *dev = &nouveau_drm(plane->dev)->device.object; struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
struct nouveau_plane *nv_plane = struct nouveau_plane *nv_plane =
container_of(plane, struct nouveau_plane, base); container_of(plane, struct nouveau_plane, base);
struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb); struct nouveau_framebuffer *nv_fb = nouveau_framebuffer(fb);
...@@ -427,7 +427,7 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -427,7 +427,7 @@ nv04_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
static int static int
nv04_disable_plane(struct drm_plane *plane) nv04_disable_plane(struct drm_plane *plane)
{ {
struct nvif_object *dev = &nouveau_drm(plane->dev)->device.object; struct nvif_object *dev = &nouveau_drm(plane->dev)->client.device.object;
struct nouveau_plane *nv_plane = struct nouveau_plane *nv_plane =
container_of(plane, struct nouveau_plane, base); container_of(plane, struct nouveau_plane, base);
...@@ -495,7 +495,7 @@ nv04_overlay_init(struct drm_device *device) ...@@ -495,7 +495,7 @@ nv04_overlay_init(struct drm_device *device)
void void
nouveau_overlay_init(struct drm_device *device) nouveau_overlay_init(struct drm_device *device)
{ {
struct nvif_device *dev = &nouveau_drm(device)->device; struct nvif_device *dev = &nouveau_drm(device)->client.device;
if (dev->info.chipset < 0x10) if (dev->info.chipset < 0x10)
nv04_overlay_init(device); nv04_overlay_init(device);
else if (dev->info.chipset <= 0x40) else if (dev->info.chipset <= 0x40)
......
...@@ -54,7 +54,7 @@ static struct nvkm_i2c_bus_probe nv04_tv_encoder_info[] = { ...@@ -54,7 +54,7 @@ static struct nvkm_i2c_bus_probe 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 nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, i2c_index); struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, i2c_index);
if (bus) { if (bus) {
return nvkm_i2c_bus_probe(bus, "TV encoder", return nvkm_i2c_bus_probe(bus, "TV encoder",
...@@ -206,7 +206,7 @@ nv04_tv_create(struct drm_connector *connector, struct dcb_output *entry) ...@@ -206,7 +206,7 @@ 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 nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, entry->i2c_index); struct nvkm_i2c_bus *bus = nvkm_i2c_bus_find(i2c, entry->i2c_index);
int type, ret; int type, ret;
......
...@@ -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 nvkm_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.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;
...@@ -130,7 +130,7 @@ static bool ...@@ -130,7 +130,7 @@ static bool
get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
if (device->quirk && device->quirk->tv_pin_mask) { if (device->quirk && device->quirk->tv_pin_mask) {
*pin_mask = device->quirk->tv_pin_mask; *pin_mask = device->quirk->tv_pin_mask;
...@@ -154,8 +154,8 @@ nv17_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector) ...@@ -154,8 +154,8 @@ nv17_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector)
return connector_status_disconnected; return connector_status_disconnected;
if (reliable) { if (reliable) {
if (drm->device.info.chipset == 0x42 || if (drm->client.device.info.chipset == 0x42 ||
drm->device.info.chipset == 0x43) drm->client.device.info.chipset == 0x43)
tv_enc->pin_mask = tv_enc->pin_mask =
nv42_tv_sample_load(encoder) >> 28 & 0xe; nv42_tv_sample_load(encoder) >> 28 & 0xe;
else else
...@@ -362,7 +362,7 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int mode) ...@@ -362,7 +362,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 nvkm_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.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);
...@@ -435,7 +435,7 @@ static void nv17_tv_prepare(struct drm_encoder *encoder) ...@@ -435,7 +435,7 @@ static void nv17_tv_prepare(struct drm_encoder *encoder)
/* Set the DACCLK register */ /* Set the DACCLK register */
dacclk = (NVReadRAMDAC(dev, 0, dacclk_off) & ~0x30) | 0x1; dacclk = (NVReadRAMDAC(dev, 0, dacclk_off) & ~0x30) | 0x1;
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE) if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE)
dacclk |= 0x1a << 16; dacclk |= 0x1a << 16;
if (tv_norm->kind == CTV_ENC_MODE) { if (tv_norm->kind == CTV_ENC_MODE) {
...@@ -492,7 +492,7 @@ static void nv17_tv_mode_set(struct drm_encoder *encoder, ...@@ -492,7 +492,7 @@ static void nv17_tv_mode_set(struct drm_encoder *encoder,
tv_regs->ptv_614 = 0x13; tv_regs->ptv_614 = 0x13;
} }
if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_RANKINE) {
tv_regs->ptv_500 = 0xe8e0; tv_regs->ptv_500 = 0xe8e0;
tv_regs->ptv_504 = 0x1710; tv_regs->ptv_504 = 0x1710;
tv_regs->ptv_604 = 0x0; tv_regs->ptv_604 = 0x0;
...@@ -587,7 +587,7 @@ static void nv17_tv_commit(struct drm_encoder *encoder) ...@@ -587,7 +587,7 @@ static void nv17_tv_commit(struct drm_encoder *encoder)
nv17_tv_state_load(dev, &to_tv_enc(encoder)->state); nv17_tv_state_load(dev, &to_tv_enc(encoder)->state);
/* This could use refinement for flatpanels, but it should work */ /* This could use refinement for flatpanels, but it should work */
if (drm->device.info.chipset < 0x44) if (drm->client.device.info.chipset < 0x44)
NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL +
nv04_dac_output_offset(encoder), nv04_dac_output_offset(encoder),
0xf0000000); 0xf0000000);
......
...@@ -130,13 +130,13 @@ void nv17_ctv_update_rescaler(struct drm_encoder *encoder); ...@@ -130,13 +130,13 @@ void nv17_ctv_update_rescaler(struct drm_encoder *encoder);
static inline void nv_write_ptv(struct drm_device *dev, uint32_t reg, static inline void nv_write_ptv(struct drm_device *dev, uint32_t reg,
uint32_t val) uint32_t val)
{ {
struct nvif_device *device = &nouveau_drm(dev)->device; struct nvif_device *device = &nouveau_drm(dev)->client.device;
nvif_wr32(&device->object, reg, val); nvif_wr32(&device->object, reg, val);
} }
static inline uint32_t nv_read_ptv(struct drm_device *dev, uint32_t reg) static inline uint32_t nv_read_ptv(struct drm_device *dev, uint32_t reg)
{ {
struct nvif_device *device = &nouveau_drm(dev)->device; struct nvif_device *device = &nouveau_drm(dev)->client.device;
return nvif_rd32(&device->object, reg); return nvif_rd32(&device->object, reg);
} }
......
...@@ -87,7 +87,7 @@ nouveau_abi16_put(struct nouveau_abi16 *abi16, int ret) ...@@ -87,7 +87,7 @@ nouveau_abi16_put(struct nouveau_abi16 *abi16, int ret)
s32 s32
nouveau_abi16_swclass(struct nouveau_drm *drm) nouveau_abi16_swclass(struct nouveau_drm *drm)
{ {
switch (drm->device.info.family) { switch (drm->client.device.info.family) {
case NV_DEVICE_INFO_V0_TNT: case NV_DEVICE_INFO_V0_TNT:
return NVIF_CLASS_SW_NV04; return NVIF_CLASS_SW_NV04;
case NV_DEVICE_INFO_V0_CELSIUS: case NV_DEVICE_INFO_V0_CELSIUS:
...@@ -175,7 +175,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS) ...@@ -175,7 +175,7 @@ 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->client.device;
struct nvkm_gr *gr = nvxx_gr(device); struct nvkm_gr *gr = nvxx_gr(device);
struct drm_nouveau_getparam *getparam = data; struct drm_nouveau_getparam *getparam = data;
......
...@@ -65,7 +65,7 @@ static int ...@@ -65,7 +65,7 @@ static int
nv40_get_intensity(struct backlight_device *bd) nv40_get_intensity(struct backlight_device *bd)
{ {
struct nouveau_drm *drm = bl_get_data(bd); struct nouveau_drm *drm = bl_get_data(bd);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
int val = (nvif_rd32(device, NV40_PMC_BACKLIGHT) & int val = (nvif_rd32(device, NV40_PMC_BACKLIGHT) &
NV40_PMC_BACKLIGHT_MASK) >> 16; NV40_PMC_BACKLIGHT_MASK) >> 16;
...@@ -76,7 +76,7 @@ static int ...@@ -76,7 +76,7 @@ static int
nv40_set_intensity(struct backlight_device *bd) nv40_set_intensity(struct backlight_device *bd)
{ {
struct nouveau_drm *drm = bl_get_data(bd); struct nouveau_drm *drm = bl_get_data(bd);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
int val = bd->props.brightness; int val = bd->props.brightness;
int reg = nvif_rd32(device, NV40_PMC_BACKLIGHT); int reg = nvif_rd32(device, NV40_PMC_BACKLIGHT);
...@@ -96,7 +96,7 @@ static int ...@@ -96,7 +96,7 @@ static int
nv40_backlight_init(struct drm_connector *connector) nv40_backlight_init(struct drm_connector *connector)
{ {
struct nouveau_drm *drm = nouveau_drm(connector->dev); struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
struct backlight_properties props; struct backlight_properties props;
struct backlight_device *bd; struct backlight_device *bd;
struct backlight_connector bl_connector; struct backlight_connector bl_connector;
...@@ -133,7 +133,7 @@ nv50_get_intensity(struct backlight_device *bd) ...@@ -133,7 +133,7 @@ nv50_get_intensity(struct backlight_device *bd)
{ {
struct nouveau_encoder *nv_encoder = bl_get_data(bd); struct nouveau_encoder *nv_encoder = bl_get_data(bd);
struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
int or = nv_encoder->or; int or = nv_encoder->or;
u32 div = 1025; u32 div = 1025;
u32 val; u32 val;
...@@ -148,7 +148,7 @@ nv50_set_intensity(struct backlight_device *bd) ...@@ -148,7 +148,7 @@ nv50_set_intensity(struct backlight_device *bd)
{ {
struct nouveau_encoder *nv_encoder = bl_get_data(bd); struct nouveau_encoder *nv_encoder = bl_get_data(bd);
struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
int or = nv_encoder->or; int or = nv_encoder->or;
u32 div = 1025; u32 div = 1025;
u32 val = (bd->props.brightness * div) / 100; u32 val = (bd->props.brightness * div) / 100;
...@@ -169,7 +169,7 @@ nva3_get_intensity(struct backlight_device *bd) ...@@ -169,7 +169,7 @@ nva3_get_intensity(struct backlight_device *bd)
{ {
struct nouveau_encoder *nv_encoder = bl_get_data(bd); struct nouveau_encoder *nv_encoder = bl_get_data(bd);
struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
int or = nv_encoder->or; int or = nv_encoder->or;
u32 div, val; u32 div, val;
...@@ -187,7 +187,7 @@ nva3_set_intensity(struct backlight_device *bd) ...@@ -187,7 +187,7 @@ nva3_set_intensity(struct backlight_device *bd)
{ {
struct nouveau_encoder *nv_encoder = bl_get_data(bd); struct nouveau_encoder *nv_encoder = bl_get_data(bd);
struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev); struct nouveau_drm *drm = nouveau_drm(nv_encoder->base.base.dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
int or = nv_encoder->or; int or = nv_encoder->or;
u32 div, val; u32 div, val;
...@@ -213,7 +213,7 @@ static int ...@@ -213,7 +213,7 @@ static int
nv50_backlight_init(struct drm_connector *connector) nv50_backlight_init(struct drm_connector *connector)
{ {
struct nouveau_drm *drm = nouveau_drm(connector->dev); struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct backlight_properties props; struct backlight_properties props;
struct backlight_device *bd; struct backlight_device *bd;
...@@ -231,9 +231,9 @@ nv50_backlight_init(struct drm_connector *connector) ...@@ -231,9 +231,9 @@ nv50_backlight_init(struct drm_connector *connector)
if (!nvif_rd32(device, NV50_PDISP_SOR_PWM_CTL(nv_encoder->or))) if (!nvif_rd32(device, NV50_PDISP_SOR_PWM_CTL(nv_encoder->or)))
return 0; return 0;
if (drm->device.info.chipset <= 0xa0 || if (drm->client.device.info.chipset <= 0xa0 ||
drm->device.info.chipset == 0xaa || drm->client.device.info.chipset == 0xaa ||
drm->device.info.chipset == 0xac) drm->client.device.info.chipset == 0xac)
ops = &nv50_bl_ops; ops = &nv50_bl_ops;
else else
ops = &nva3_bl_ops; ops = &nva3_bl_ops;
...@@ -265,7 +265,7 @@ int ...@@ -265,7 +265,7 @@ int
nouveau_backlight_init(struct drm_device *dev) nouveau_backlight_init(struct drm_device *dev)
{ {
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->client.device;
struct drm_connector *connector; struct drm_connector *connector;
if (apple_gmux_present()) { if (apple_gmux_present()) {
......
...@@ -215,7 +215,7 @@ int call_lvds_script(struct drm_device *dev, struct dcb_output *dcbent, int head ...@@ -215,7 +215,7 @@ int call_lvds_script(struct drm_device *dev, struct dcb_output *dcbent, int head
*/ */
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
struct nvbios *bios = &drm->vbios; struct nvbios *bios = &drm->vbios;
uint8_t lvds_ver = bios->data[bios->fp.lvdsmanufacturerpointer]; uint8_t lvds_ver = bios->data[bios->fp.lvdsmanufacturerpointer];
uint32_t sel_clk_binding, sel_clk; uint32_t sel_clk_binding, sel_clk;
...@@ -319,7 +319,7 @@ static int ...@@ -319,7 +319,7 @@ static int
get_fp_strap(struct drm_device *dev, struct nvbios *bios) get_fp_strap(struct drm_device *dev, struct nvbios *bios)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
/* /*
* The fp strap is normally dictated by the "User Strap" in * The fp strap is normally dictated by the "User Strap" in
...@@ -333,10 +333,10 @@ get_fp_strap(struct drm_device *dev, struct nvbios *bios) ...@@ -333,10 +333,10 @@ get_fp_strap(struct drm_device *dev, struct nvbios *bios)
if (bios->major_version < 5 && bios->data[0x48] & 0x4) if (bios->major_version < 5 && bios->data[0x48] & 0x4)
return NVReadVgaCrtc5758(dev, 0, 0xf) & 0xf; return NVReadVgaCrtc5758(dev, 0, 0xf) & 0xf;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_MAXWELL) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_MAXWELL)
return nvif_rd32(device, 0x001800) & 0x0000000f; return nvif_rd32(device, 0x001800) & 0x0000000f;
else else
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA)
return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 24) & 0xf; return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 24) & 0xf;
else else
return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 16) & 0xf; return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 16) & 0xf;
...@@ -638,7 +638,7 @@ int run_tmds_table(struct drm_device *dev, struct dcb_output *dcbent, int head, ...@@ -638,7 +638,7 @@ int run_tmds_table(struct drm_device *dev, struct dcb_output *dcbent, int head,
*/ */
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
struct nvbios *bios = &drm->vbios; struct nvbios *bios = &drm->vbios;
int cv = bios->chip_version; int cv = bios->chip_version;
uint16_t clktable = 0, scriptptr; uint16_t clktable = 0, scriptptr;
...@@ -1255,7 +1255,7 @@ olddcb_table(struct drm_device *dev) ...@@ -1255,7 +1255,7 @@ olddcb_table(struct drm_device *dev)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
u8 *dcb = NULL; u8 *dcb = NULL;
if (drm->device.info.family > NV_DEVICE_INFO_V0_TNT) if (drm->client.device.info.family > NV_DEVICE_INFO_V0_TNT)
dcb = ROMPTR(dev, drm->vbios.data[0x36]); dcb = ROMPTR(dev, drm->vbios.data[0x36]);
if (!dcb) { if (!dcb) {
NV_WARN(drm, "No DCB data found in VBIOS\n"); NV_WARN(drm, "No DCB data found in VBIOS\n");
...@@ -1918,7 +1918,7 @@ static int load_nv17_hwsq_ucode_entry(struct drm_device *dev, struct nvbios *bio ...@@ -1918,7 +1918,7 @@ static int load_nv17_hwsq_ucode_entry(struct drm_device *dev, struct nvbios *bio
*/ */
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
uint8_t bytes_to_write; uint8_t bytes_to_write;
uint16_t hwsq_entry_offset; uint16_t hwsq_entry_offset;
int i; int i;
...@@ -2012,7 +2012,7 @@ uint8_t *nouveau_bios_embedded_edid(struct drm_device *dev) ...@@ -2012,7 +2012,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 nvkm_bios *bios = nvxx_bios(&drm->device); struct nvkm_bios *bios = nvxx_bios(&drm->client.device);
struct nvbios *legacy = &drm->vbios; struct nvbios *legacy = &drm->vbios;
memset(legacy, 0, sizeof(struct nvbios)); memset(legacy, 0, sizeof(struct nvbios));
...@@ -2064,7 +2064,7 @@ nouveau_bios_posted(struct drm_device *dev) ...@@ -2064,7 +2064,7 @@ nouveau_bios_posted(struct drm_device *dev)
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
unsigned htotal; unsigned htotal;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA)
return true; return true;
htotal = NVReadVgaCrtc(dev, 0, 0x06); htotal = NVReadVgaCrtc(dev, 0, 0x06);
......
...@@ -48,7 +48,7 @@ nv10_bo_update_tile_region(struct drm_device *dev, struct nouveau_drm_tile *reg, ...@@ -48,7 +48,7 @@ nv10_bo_update_tile_region(struct drm_device *dev, struct nouveau_drm_tile *reg,
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
int i = reg - drm->tile.reg; int i = reg - drm->tile.reg;
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
struct nvkm_fb *fb = device->fb; struct nvkm_fb *fb = device->fb;
struct nvkm_fb_tile *tile = &fb->tile.region[i]; struct nvkm_fb_tile *tile = &fb->tile.region[i];
...@@ -100,7 +100,7 @@ nv10_bo_set_tiling(struct drm_device *dev, u32 addr, ...@@ -100,7 +100,7 @@ nv10_bo_set_tiling(struct drm_device *dev, u32 addr,
u32 size, u32 pitch, u32 flags) u32 size, u32 pitch, u32 flags)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_fb *fb = nvxx_fb(&drm->device); struct nvkm_fb *fb = nvxx_fb(&drm->client.device);
struct nouveau_drm_tile *tile, *found = NULL; struct nouveau_drm_tile *tile, *found = NULL;
int i; int i;
...@@ -144,7 +144,7 @@ nouveau_bo_fixup_align(struct nouveau_bo *nvbo, u32 flags, ...@@ -144,7 +144,7 @@ nouveau_bo_fixup_align(struct nouveau_bo *nvbo, u32 flags,
int *align, int *size) int *align, int *size)
{ {
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->client.device;
if (device->info.family < NV_DEVICE_INFO_V0_TESLA) { if (device->info.family < NV_DEVICE_INFO_V0_TESLA) {
if (nvbo->tile_mode) { if (nvbo->tile_mode) {
...@@ -210,7 +210,7 @@ nouveau_bo_new(struct nouveau_cli *cli, int size, int align, ...@@ -210,7 +210,7 @@ nouveau_bo_new(struct nouveau_cli *cli, int size, int align,
nvbo->bo.bdev = &drm->ttm.bdev; nvbo->bo.bdev = &drm->ttm.bdev;
nvbo->cli = cli; nvbo->cli = cli;
if (!nvxx_device(&drm->device)->func->cpu_coherent) if (!nvxx_device(&drm->client.device)->func->cpu_coherent)
nvbo->force_coherent = flags & TTM_PL_FLAG_UNCACHED; nvbo->force_coherent = flags & TTM_PL_FLAG_UNCACHED;
nvbo->page_shift = 12; nvbo->page_shift = 12;
...@@ -256,10 +256,10 @@ static void ...@@ -256,10 +256,10 @@ static void
set_placement_range(struct nouveau_bo *nvbo, uint32_t type) set_placement_range(struct nouveau_bo *nvbo, uint32_t type)
{ {
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
u32 vram_pages = drm->device.info.ram_size >> PAGE_SHIFT; u32 vram_pages = drm->client.device.info.ram_size >> PAGE_SHIFT;
unsigned i, fpfn, lpfn; unsigned i, fpfn, lpfn;
if (drm->device.info.family == NV_DEVICE_INFO_V0_CELSIUS && if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CELSIUS &&
nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM) && nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM) &&
nvbo->bo.mem.num_pages < vram_pages / 4) { nvbo->bo.mem.num_pages < vram_pages / 4) {
/* /*
...@@ -317,7 +317,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype, bool contig) ...@@ -317,7 +317,7 @@ nouveau_bo_pin(struct nouveau_bo *nvbo, uint32_t memtype, bool contig)
if (ret) if (ret)
return ret; return ret;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA && if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA &&
memtype == TTM_PL_FLAG_VRAM && contig) { memtype == TTM_PL_FLAG_VRAM && contig) {
if (nvbo->tile_flags & NOUVEAU_GEM_TILE_NONCONTIG) { if (nvbo->tile_flags & NOUVEAU_GEM_TILE_NONCONTIG) {
if (bo->mem.mem_type == TTM_PL_VRAM) { if (bo->mem.mem_type == TTM_PL_VRAM) {
...@@ -444,7 +444,7 @@ void ...@@ -444,7 +444,7 @@ void
nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) nouveau_bo_sync_for_device(struct nouveau_bo *nvbo)
{ {
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm;
int i; int i;
...@@ -464,7 +464,7 @@ void ...@@ -464,7 +464,7 @@ void
nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo)
{ {
struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev);
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm;
int i; int i;
...@@ -580,9 +580,9 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, ...@@ -580,9 +580,9 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
TTM_PL_FLAG_WC; TTM_PL_FLAG_WC;
man->default_caching = TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
/* Some BARs do not support being ioremapped WC */ /* Some BARs do not support being ioremapped WC */
if (nvxx_bar(&drm->device)->iomap_uncached) { if (nvxx_bar(&drm->client.device)->iomap_uncached) {
man->available_caching = TTM_PL_FLAG_UNCACHED; man->available_caching = TTM_PL_FLAG_UNCACHED;
man->default_caching = TTM_PL_FLAG_UNCACHED; man->default_caching = TTM_PL_FLAG_UNCACHED;
} }
...@@ -595,7 +595,7 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, ...@@ -595,7 +595,7 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type,
} }
break; break;
case TTM_PL_TT: case TTM_PL_TT:
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA)
man->func = &nouveau_gart_manager; man->func = &nouveau_gart_manager;
else else
if (!drm->agp.bridge) if (!drm->agp.bridge)
...@@ -1034,7 +1034,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, ...@@ -1034,7 +1034,7 @@ nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr,
* old nvkm_mem node, these will get cleaned up after ttm has * old nvkm_mem node, these will get cleaned up after ttm has
* destroyed the ttm_mem_reg * destroyed the ttm_mem_reg
*/ */
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ret = nouveau_bo_move_prep(drm, bo, new_mem); ret = nouveau_bo_move_prep(drm, bo, new_mem);
if (ret) if (ret)
return ret; return ret;
...@@ -1230,7 +1230,7 @@ nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem, ...@@ -1230,7 +1230,7 @@ nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem,
if (new_mem->mem_type != TTM_PL_VRAM) if (new_mem->mem_type != TTM_PL_VRAM)
return 0; return 0;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_CELSIUS) {
*new_tile = nv10_bo_set_tiling(dev, offset, new_mem->size, *new_tile = nv10_bo_set_tiling(dev, offset, new_mem->size,
nvbo->tile_mode, nvbo->tile_mode,
nvbo->tile_flags); nvbo->tile_flags);
...@@ -1269,7 +1269,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr, ...@@ -1269,7 +1269,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr,
if (nvbo->pin_refcnt) if (nvbo->pin_refcnt)
NV_WARN(drm, "Moving pinned object %p!\n", nvbo); NV_WARN(drm, "Moving pinned object %p!\n", nvbo);
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) {
ret = nouveau_bo_vm_bind(bo, new_mem, &new_tile); ret = nouveau_bo_vm_bind(bo, new_mem, &new_tile);
if (ret) if (ret)
return ret; return ret;
...@@ -1304,7 +1304,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr, ...@@ -1304,7 +1304,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr,
ret = ttm_bo_move_memcpy(bo, intr, no_wait_gpu, new_mem); ret = ttm_bo_move_memcpy(bo, intr, no_wait_gpu, new_mem);
out: out:
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) {
if (ret) if (ret)
nouveau_bo_vm_cleanup(bo, NULL, &new_tile); nouveau_bo_vm_cleanup(bo, NULL, &new_tile);
else else
...@@ -1328,7 +1328,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) ...@@ -1328,7 +1328,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
{ {
struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type];
struct nouveau_drm *drm = nouveau_bdev(bdev); struct nouveau_drm *drm = nouveau_bdev(bdev);
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
struct nvkm_mem *node = mem->mm_node; struct nvkm_mem *node = mem->mm_node;
int ret; int ret;
...@@ -1351,7 +1351,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) ...@@ -1351,7 +1351,7 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
mem->bus.is_iomem = !drm->agp.cma; mem->bus.is_iomem = !drm->agp.cma;
} }
#endif #endif
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA || !node->memtype) if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA || !node->memtype)
/* untiled */ /* untiled */
break; break;
/* fallthrough, tiled memory */ /* fallthrough, tiled memory */
...@@ -1359,10 +1359,10 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) ...@@ -1359,10 +1359,10 @@ nouveau_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
mem->bus.offset = mem->start << PAGE_SHIFT; mem->bus.offset = mem->start << PAGE_SHIFT;
mem->bus.base = device->func->resource_addr(device, 1); mem->bus.base = device->func->resource_addr(device, 1);
mem->bus.is_iomem = true; mem->bus.is_iomem = true;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
struct nvkm_bar *bar = nvxx_bar(&drm->device); struct nvkm_bar *bar = nvxx_bar(&drm->client.device);
int page_shift = 12; int page_shift = 12;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_FERMI) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_FERMI)
page_shift = node->page_shift; page_shift = node->page_shift;
ret = nvkm_bar_umap(bar, node->size << 12, page_shift, ret = nvkm_bar_umap(bar, node->size << 12, page_shift,
...@@ -1397,7 +1397,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) ...@@ -1397,7 +1397,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
{ {
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 nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
u32 mappable = device->func->resource_size(device, 1) >> PAGE_SHIFT; u32 mappable = device->func->resource_size(device, 1) >> PAGE_SHIFT;
int i, ret; int i, ret;
...@@ -1405,7 +1405,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) ...@@ -1405,7 +1405,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
* nothing to do here. * nothing to do here.
*/ */
if (bo->mem.mem_type != TTM_PL_VRAM) { if (bo->mem.mem_type != TTM_PL_VRAM) {
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA || if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA ||
!nouveau_bo_tile_layout(nvbo)) !nouveau_bo_tile_layout(nvbo))
return 0; return 0;
...@@ -1420,7 +1420,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) ...@@ -1420,7 +1420,7 @@ nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo)
} }
/* make sure bo is in mappable vram */ /* make sure bo is in mappable vram */
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA || if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA ||
bo->mem.start + bo->mem.num_pages < mappable) bo->mem.start + bo->mem.num_pages < mappable)
return 0; return 0;
...@@ -1462,7 +1462,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm) ...@@ -1462,7 +1462,7 @@ nouveau_ttm_tt_populate(struct ttm_tt *ttm)
} }
drm = nouveau_bdev(ttm->bdev); drm = nouveau_bdev(ttm->bdev);
device = nvxx_device(&drm->device); device = nvxx_device(&drm->client.device);
dev = drm->dev; dev = drm->dev;
pdev = device->dev; pdev = device->dev;
...@@ -1519,7 +1519,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm) ...@@ -1519,7 +1519,7 @@ nouveau_ttm_tt_unpopulate(struct ttm_tt *ttm)
return; return;
drm = nouveau_bdev(ttm->bdev); drm = nouveau_bdev(ttm->bdev);
device = nvxx_device(&drm->device); device = nvxx_device(&drm->client.device);
dev = drm->dev; dev = drm->dev;
pdev = device->dev; pdev = device->dev;
......
...@@ -419,7 +419,7 @@ nouveau_connector_ddc_detect(struct drm_connector *connector) ...@@ -419,7 +419,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 nvkm_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.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;
...@@ -521,7 +521,7 @@ nouveau_connector_set_encoder(struct drm_connector *connector, ...@@ -521,7 +521,7 @@ nouveau_connector_set_encoder(struct drm_connector *connector,
return; return;
nv_connector->detected_encoder = nv_encoder; nv_connector->detected_encoder = nv_encoder;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
connector->interlace_allowed = true; connector->interlace_allowed = true;
connector->doublescan_allowed = true; connector->doublescan_allowed = true;
} else } else
...@@ -531,8 +531,8 @@ nouveau_connector_set_encoder(struct drm_connector *connector, ...@@ -531,8 +531,8 @@ nouveau_connector_set_encoder(struct drm_connector *connector,
connector->interlace_allowed = false; connector->interlace_allowed = false;
} else { } else {
connector->doublescan_allowed = true; connector->doublescan_allowed = true;
if (drm->device.info.family == NV_DEVICE_INFO_V0_KELVIN || if (drm->client.device.info.family == NV_DEVICE_INFO_V0_KELVIN ||
(drm->device.info.family == NV_DEVICE_INFO_V0_CELSIUS && (drm->client.device.info.family == NV_DEVICE_INFO_V0_CELSIUS &&
(dev->pdev->device & 0x0ff0) != 0x0100 && (dev->pdev->device & 0x0ff0) != 0x0100 &&
(dev->pdev->device & 0x0ff0) != 0x0150)) (dev->pdev->device & 0x0ff0) != 0x0150))
/* HW is broken */ /* HW is broken */
...@@ -984,17 +984,17 @@ get_tmds_link_bandwidth(struct drm_connector *connector, bool hdmi) ...@@ -984,17 +984,17 @@ get_tmds_link_bandwidth(struct drm_connector *connector, bool hdmi)
/* Note: these limits are conservative, some Fermi's /* Note: these limits are conservative, some Fermi's
* can do 297 MHz. Unclear how this can be determined. * can do 297 MHz. Unclear how this can be determined.
*/ */
if (drm->device.info.family >= NV_DEVICE_INFO_V0_KEPLER) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_KEPLER)
return 297000; return 297000;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_FERMI) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_FERMI)
return 225000; return 225000;
} }
if (dcb->location != DCB_LOC_ON_CHIP || if (dcb->location != DCB_LOC_ON_CHIP ||
drm->device.info.chipset >= 0x46) drm->client.device.info.chipset >= 0x46)
return 165000; return 165000;
else if (drm->device.info.chipset >= 0x40) else if (drm->client.device.info.chipset >= 0x40)
return 155000; return 155000;
else if (drm->device.info.chipset >= 0x18) else if (drm->client.device.info.chipset >= 0x18)
return 135000; return 135000;
else else
return 112000; return 112000;
......
...@@ -259,8 +259,9 @@ nouveau_debugfs_init(struct nouveau_drm *drm) ...@@ -259,8 +259,9 @@ nouveau_debugfs_init(struct nouveau_drm *drm)
if (!drm->debugfs) if (!drm->debugfs)
return -ENOMEM; return -ENOMEM;
ret = nvif_object_init(&drm->device.object, 0, NVIF_CLASS_CONTROL, ret = nvif_object_init(&drm->client.device.object, 0,
NULL, 0, &drm->debugfs->ctrl); NVIF_CLASS_CONTROL, NULL, 0,
&drm->debugfs->ctrl);
if (ret) if (ret)
return ret; return ret;
......
...@@ -495,7 +495,7 @@ int ...@@ -495,7 +495,7 @@ int
nouveau_display_create(struct drm_device *dev) nouveau_display_create(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
struct nouveau_display *disp; struct nouveau_display *disp;
int ret; int ret;
...@@ -512,15 +512,15 @@ nouveau_display_create(struct drm_device *dev) ...@@ -512,15 +512,15 @@ nouveau_display_create(struct drm_device *dev)
dev->mode_config.min_width = 0; dev->mode_config.min_width = 0;
dev->mode_config.min_height = 0; dev->mode_config.min_height = 0;
if (drm->device.info.family < NV_DEVICE_INFO_V0_CELSIUS) { if (drm->client.device.info.family < NV_DEVICE_INFO_V0_CELSIUS) {
dev->mode_config.max_width = 2048; dev->mode_config.max_width = 2048;
dev->mode_config.max_height = 2048; dev->mode_config.max_height = 2048;
} else } else
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) {
dev->mode_config.max_width = 4096; dev->mode_config.max_width = 4096;
dev->mode_config.max_height = 4096; dev->mode_config.max_height = 4096;
} else } else
if (drm->device.info.family < NV_DEVICE_INFO_V0_FERMI) { if (drm->client.device.info.family < NV_DEVICE_INFO_V0_FERMI) {
dev->mode_config.max_width = 8192; dev->mode_config.max_width = 8192;
dev->mode_config.max_height = 8192; dev->mode_config.max_height = 8192;
} else { } else {
...@@ -531,7 +531,7 @@ nouveau_display_create(struct drm_device *dev) ...@@ -531,7 +531,7 @@ nouveau_display_create(struct drm_device *dev)
dev->mode_config.preferred_depth = 24; dev->mode_config.preferred_depth = 24;
dev->mode_config.prefer_shadow = 1; dev->mode_config.prefer_shadow = 1;
if (drm->device.info.chipset < 0x11) if (drm->client.device.info.chipset < 0x11)
dev->mode_config.async_page_flip = false; dev->mode_config.async_page_flip = false;
else else
dev->mode_config.async_page_flip = true; dev->mode_config.async_page_flip = true;
...@@ -558,7 +558,7 @@ nouveau_display_create(struct drm_device *dev) ...@@ -558,7 +558,7 @@ nouveau_display_create(struct drm_device *dev)
int i; int i;
for (i = 0, ret = -ENODEV; ret && i < ARRAY_SIZE(oclass); i++) { for (i = 0, ret = -ENODEV; ret && i < ARRAY_SIZE(oclass); i++) {
ret = nvif_object_init(&drm->device.object, 0, ret = nvif_object_init(&drm->client.device.object, 0,
oclass[i], NULL, 0, &disp->disp); oclass[i], NULL, 0, &disp->disp);
} }
...@@ -1067,7 +1067,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev, ...@@ -1067,7 +1067,7 @@ nouveau_display_dumb_create(struct drm_file *file_priv, struct drm_device *dev,
args->size = roundup(args->size, PAGE_SIZE); args->size = roundup(args->size, PAGE_SIZE);
/* Use VRAM if there is any ; otherwise fallback to system memory */ /* Use VRAM if there is any ; otherwise fallback to system memory */
if (nouveau_drm(dev)->device.info.ram_size != 0) if (nouveau_drm(dev)->client.device.info.ram_size != 0)
domain = NOUVEAU_GEM_DOMAIN_VRAM; domain = NOUVEAU_GEM_DOMAIN_VRAM;
else else
domain = NOUVEAU_GEM_DOMAIN_GART; domain = NOUVEAU_GEM_DOMAIN_GART;
......
...@@ -116,6 +116,7 @@ nouveau_cli_fini(struct nouveau_cli *cli) ...@@ -116,6 +116,7 @@ nouveau_cli_fini(struct nouveau_cli *cli)
{ {
nvkm_vm_ref(NULL, &nvxx_client(&cli->base)->vm, NULL); nvkm_vm_ref(NULL, &nvxx_client(&cli->base)->vm, NULL);
usif_client_fini(cli); usif_client_fini(cli);
nvif_device_fini(&cli->device);
nvif_client_fini(&cli->base); nvif_client_fini(&cli->base);
} }
...@@ -143,6 +144,16 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname, ...@@ -143,6 +144,16 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
goto done; goto done;
} }
ret = nvif_device_init(&cli->base.object, 0, NV_DEVICE,
&(struct nv_device_v0) {
.device = ~0,
}, sizeof(struct nv_device_v0),
&cli->device);
if (ret) {
NV_ERROR(drm, "Device allocation failed: %d\n", ret);
goto done;
}
done: done:
if (ret) if (ret)
nouveau_cli_fini(cli); nouveau_cli_fini(cli);
...@@ -170,7 +181,7 @@ nouveau_accel_fini(struct nouveau_drm *drm) ...@@ -170,7 +181,7 @@ nouveau_accel_fini(struct nouveau_drm *drm)
static void static void
nouveau_accel_init(struct nouveau_drm *drm) nouveau_accel_init(struct nouveau_drm *drm)
{ {
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->client.device;
struct nvif_sclass *sclass; struct nvif_sclass *sclass;
u32 arg0, arg1; u32 arg0, arg1;
int ret, i, n; int ret, i, n;
...@@ -224,7 +235,7 @@ nouveau_accel_init(struct nouveau_drm *drm) ...@@ -224,7 +235,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
} }
if (device->info.family >= NV_DEVICE_INFO_V0_KEPLER) { if (device->info.family >= NV_DEVICE_INFO_V0_KEPLER) {
ret = nouveau_channel_new(drm, &drm->device, ret = nouveau_channel_new(drm, &drm->client.device,
NVA06F_V0_ENGINE_CE0 | NVA06F_V0_ENGINE_CE0 |
NVA06F_V0_ENGINE_CE1, NVA06F_V0_ENGINE_CE1,
0, &drm->cechan); 0, &drm->cechan);
...@@ -237,7 +248,7 @@ nouveau_accel_init(struct nouveau_drm *drm) ...@@ -237,7 +248,7 @@ nouveau_accel_init(struct nouveau_drm *drm)
if (device->info.chipset >= 0xa3 && if (device->info.chipset >= 0xa3 &&
device->info.chipset != 0xaa && device->info.chipset != 0xaa &&
device->info.chipset != 0xac) { device->info.chipset != 0xac) {
ret = nouveau_channel_new(drm, &drm->device, ret = nouveau_channel_new(drm, &drm->client.device,
NvDmaFB, NvDmaTT, &drm->cechan); NvDmaFB, NvDmaTT, &drm->cechan);
if (ret) if (ret)
NV_ERROR(drm, "failed to create ce channel, %d\n", ret); NV_ERROR(drm, "failed to create ce channel, %d\n", ret);
...@@ -249,7 +260,8 @@ nouveau_accel_init(struct nouveau_drm *drm) ...@@ -249,7 +260,8 @@ nouveau_accel_init(struct nouveau_drm *drm)
arg1 = NvDmaTT; arg1 = NvDmaTT;
} }
ret = nouveau_channel_new(drm, &drm->device, arg0, arg1, &drm->channel); ret = nouveau_channel_new(drm, &drm->client.device,
arg0, arg1, &drm->channel);
if (ret) { if (ret) {
NV_ERROR(drm, "failed to create kernel channel, %d\n", ret); NV_ERROR(drm, "failed to create kernel channel, %d\n", ret);
nouveau_accel_fini(drm); nouveau_accel_fini(drm);
...@@ -289,8 +301,8 @@ nouveau_accel_init(struct nouveau_drm *drm) ...@@ -289,8 +301,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 = nvkm_gpuobj_new(nvxx_device(&drm->device), 32, 0, false, ret = nvkm_gpuobj_new(nvxx_device(&drm->client.device), 32, 0,
NULL, &drm->notify); false, NULL, &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);
...@@ -425,6 +437,8 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -425,6 +437,8 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
if (ret) if (ret)
return ret; return ret;
dev->irq_enabled = true;
nvxx_client(&drm->client.base)->debug = nvxx_client(&drm->client.base)->debug =
nvkm_dbgopt(nouveau_debug, "DRM"); nvkm_dbgopt(nouveau_debug, "DRM");
...@@ -433,33 +447,24 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -433,33 +447,24 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
nouveau_get_hdmi_dev(drm); nouveau_get_hdmi_dev(drm);
ret = nvif_device_init(&drm->client.base.object, 0, NV_DEVICE,
&(struct nv_device_v0) {
.device = ~0,
}, sizeof(struct nv_device_v0),
&drm->device);
if (ret)
goto fail_device;
dev->irq_enabled = true;
/* workaround an odd issue on nvc1 by disabling the device's /* workaround an odd issue on nvc1 by disabling the device's
* nosnoop capability. hopefully won't cause issues until a * nosnoop capability. hopefully won't cause issues until a
* better fix is found - assuming there is one... * better fix is found - assuming there is one...
*/ */
if (drm->device.info.chipset == 0xc1) if (drm->client.device.info.chipset == 0xc1)
nvif_mask(&drm->device.object, 0x00088080, 0x00000800, 0x00000000); nvif_mask(&drm->client.device.object, 0x00088080, 0x00000800, 0x00000000);
nouveau_vga_init(drm); nouveau_vga_init(drm);
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
if (!nvxx_device(&drm->device)->mmu) { if (!nvxx_device(&drm->client.device)->mmu) {
ret = -ENOSYS; ret = -ENOSYS;
goto fail_device; goto fail_device;
} }
ret = nvkm_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40), ret = nvkm_vm_new(nvxx_device(&drm->client.device),
0x1000, NULL, &drm->client.vm); 0, (1ULL << 40), 0x1000, NULL,
&drm->client.vm);
if (ret) if (ret)
goto fail_device; goto fail_device;
...@@ -509,7 +514,6 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) ...@@ -509,7 +514,6 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags)
fail_ttm: fail_ttm:
nouveau_vga_fini(drm); nouveau_vga_fini(drm);
fail_device: fail_device:
nvif_device_fini(&drm->device);
nouveau_cli_fini(&drm->client); nouveau_cli_fini(&drm->client);
kfree(drm); kfree(drm);
return ret; return ret;
...@@ -540,7 +544,6 @@ nouveau_drm_unload(struct drm_device *dev) ...@@ -540,7 +544,6 @@ nouveau_drm_unload(struct drm_device *dev)
nouveau_ttm_fini(drm); nouveau_ttm_fini(drm);
nouveau_vga_fini(drm); nouveau_vga_fini(drm);
nvif_device_fini(&drm->device);
if (drm->hdmi_device) if (drm->hdmi_device)
pci_dev_put(drm->hdmi_device); pci_dev_put(drm->hdmi_device);
nouveau_cli_fini(&drm->client); nouveau_cli_fini(&drm->client);
...@@ -756,7 +759,7 @@ nouveau_pmops_runtime_resume(struct device *dev) ...@@ -756,7 +759,7 @@ nouveau_pmops_runtime_resume(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
struct nvif_device *device = &nouveau_drm(drm_dev)->device; struct nvif_device *device = &nouveau_drm(drm_dev)->client.device;
int ret; int ret;
if (nouveau_runtime_pm == 0) if (nouveau_runtime_pm == 0)
...@@ -848,9 +851,9 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv) ...@@ -848,9 +851,9 @@ 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->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA) {
ret = nvkm_vm_new(nvxx_device(&drm->device), 0, (1ULL << 40), ret = nvkm_vm_new(nvxx_device(&drm->client.device), 0,
0x1000, NULL, &cli->vm); (1ULL << 40), 0x1000, NULL, &cli->vm);
if (ret) if (ret)
goto done; goto done;
......
...@@ -89,6 +89,8 @@ struct nouveau_cli { ...@@ -89,6 +89,8 @@ struct nouveau_cli {
struct drm_device *dev; struct drm_device *dev;
struct mutex mutex; struct mutex mutex;
struct nvif_device device;
struct nvkm_vm *vm; /*XXX*/ struct nvkm_vm *vm; /*XXX*/
struct list_head head; struct list_head head;
void *abi16; void *abi16;
...@@ -112,7 +114,6 @@ struct nouveau_drm { ...@@ -112,7 +114,6 @@ struct nouveau_drm {
struct nouveau_cli client; struct nouveau_cli client;
struct drm_device *dev; struct drm_device *dev;
struct nvif_device device;
struct list_head clients; struct list_head clients;
struct { struct {
......
...@@ -60,7 +60,7 @@ nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -60,7 +60,7 @@ nouveau_fbcon_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{ {
struct nouveau_fbdev *fbcon = info->par; struct nouveau_fbdev *fbcon = info->par;
struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->client.device;
int ret; int ret;
if (info->state != FBINFO_STATE_RUNNING) if (info->state != FBINFO_STATE_RUNNING)
...@@ -92,7 +92,7 @@ nouveau_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *image) ...@@ -92,7 +92,7 @@ nouveau_fbcon_copyarea(struct fb_info *info, const struct fb_copyarea *image)
{ {
struct nouveau_fbdev *fbcon = info->par; struct nouveau_fbdev *fbcon = info->par;
struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->client.device;
int ret; int ret;
if (info->state != FBINFO_STATE_RUNNING) if (info->state != FBINFO_STATE_RUNNING)
...@@ -124,7 +124,7 @@ nouveau_fbcon_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -124,7 +124,7 @@ nouveau_fbcon_imageblit(struct fb_info *info, const struct fb_image *image)
{ {
struct nouveau_fbdev *fbcon = info->par; struct nouveau_fbdev *fbcon = info->par;
struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev); struct nouveau_drm *drm = nouveau_drm(fbcon->helper.dev);
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->client.device;
int ret; int ret;
if (info->state != FBINFO_STATE_RUNNING) if (info->state != FBINFO_STATE_RUNNING)
...@@ -266,10 +266,10 @@ nouveau_fbcon_accel_init(struct drm_device *dev) ...@@ -266,10 +266,10 @@ nouveau_fbcon_accel_init(struct drm_device *dev)
struct fb_info *info = fbcon->helper.fbdev; struct fb_info *info = fbcon->helper.fbdev;
int ret; int ret;
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA)
ret = nv04_fbcon_accel_init(info); ret = nv04_fbcon_accel_init(info);
else else
if (drm->device.info.family < NV_DEVICE_INFO_V0_FERMI) if (drm->client.device.info.family < NV_DEVICE_INFO_V0_FERMI)
ret = nv50_fbcon_accel_init(info); ret = nv50_fbcon_accel_init(info);
else else
ret = nvc0_fbcon_accel_init(info); ret = nvc0_fbcon_accel_init(info);
...@@ -324,7 +324,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, ...@@ -324,7 +324,7 @@ nouveau_fbcon_create(struct drm_fb_helper *helper,
container_of(helper, struct nouveau_fbdev, helper); container_of(helper, struct nouveau_fbdev, helper);
struct drm_device *dev = fbcon->helper.dev; struct drm_device *dev = fbcon->helper.dev;
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->client.device;
struct fb_info *info; struct fb_info *info;
struct nouveau_framebuffer *fb; struct nouveau_framebuffer *fb;
struct nouveau_channel *chan; struct nouveau_channel *chan;
...@@ -516,10 +516,10 @@ nouveau_fbcon_init(struct drm_device *dev) ...@@ -516,10 +516,10 @@ nouveau_fbcon_init(struct drm_device *dev)
if (ret) if (ret)
goto fini; goto fini;
if (drm->device.info.ram_size <= 32 * 1024 * 1024) if (drm->client.device.info.ram_size <= 32 * 1024 * 1024)
preferred_bpp = 8; preferred_bpp = 8;
else else
if (drm->device.info.ram_size <= 64 * 1024 * 1024) if (drm->client.device.info.ram_size <= 64 * 1024 * 1024)
preferred_bpp = 16; preferred_bpp = 16;
else else
preferred_bpp = 32; preferred_bpp = 32;
......
...@@ -206,7 +206,7 @@ nouveau_gem_new(struct nouveau_cli *cli, int size, int align, uint32_t domain, ...@@ -206,7 +206,7 @@ nouveau_gem_new(struct nouveau_cli *cli, int size, int align, uint32_t domain,
*/ */
nvbo->valid_domains = NOUVEAU_GEM_DOMAIN_VRAM | nvbo->valid_domains = NOUVEAU_GEM_DOMAIN_VRAM |
NOUVEAU_GEM_DOMAIN_GART; NOUVEAU_GEM_DOMAIN_GART;
if (drm->device.info.family >= NV_DEVICE_INFO_V0_TESLA) if (drm->client.device.info.family >= NV_DEVICE_INFO_V0_TESLA)
nvbo->valid_domains &= domain; nvbo->valid_domains &= domain;
/* Initialize the embedded gem-object. We return a single gem-reference /* Initialize the embedded gem-object. We return a single gem-reference
...@@ -257,7 +257,7 @@ nouveau_gem_ioctl_new(struct drm_device *dev, void *data, ...@@ -257,7 +257,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 nvkm_fb *fb = nvxx_fb(&drm->device); struct nvkm_fb *fb = nvxx_fb(&drm->client.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;
...@@ -496,7 +496,7 @@ validate_list(struct nouveau_channel *chan, struct nouveau_cli *cli, ...@@ -496,7 +496,7 @@ validate_list(struct nouveau_channel *chan, struct nouveau_cli *cli,
return ret; return ret;
} }
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) { if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA) {
if (nvbo->bo.offset == b->presumed.offset && if (nvbo->bo.offset == b->presumed.offset &&
((nvbo->bo.mem.mem_type == TTM_PL_VRAM && ((nvbo->bo.mem.mem_type == TTM_PL_VRAM &&
b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) || b->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) ||
...@@ -767,7 +767,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, ...@@ -767,7 +767,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
push[i].length); push[i].length);
} }
} else } else
if (drm->device.info.chipset >= 0x25) { if (drm->client.device.info.chipset >= 0x25) {
ret = RING_SPACE(chan, req->nr_push * 2); ret = RING_SPACE(chan, req->nr_push * 2);
if (ret) { if (ret) {
NV_PRINTK(err, cli, "cal_space: %d\n", ret); NV_PRINTK(err, cli, "cal_space: %d\n", ret);
...@@ -840,7 +840,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, ...@@ -840,7 +840,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
req->suffix0 = 0x00000000; req->suffix0 = 0x00000000;
req->suffix1 = 0x00000000; req->suffix1 = 0x00000000;
} else } else
if (drm->device.info.chipset >= 0x25) { if (drm->client.device.info.chipset >= 0x25) {
req->suffix0 = 0x00020000; req->suffix0 = 0x00020000;
req->suffix1 = 0x00000000; req->suffix1 = 0x00000000;
} else { } else {
......
...@@ -43,7 +43,7 @@ nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) ...@@ -43,7 +43,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
int temp = nvkm_therm_temp_get(therm); int temp = nvkm_therm_temp_get(therm);
if (temp < 0) if (temp < 0)
...@@ -69,7 +69,7 @@ nouveau_hwmon_temp1_auto_point1_temp(struct device *d, ...@@ -69,7 +69,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -81,7 +81,7 @@ nouveau_hwmon_set_temp1_auto_point1_temp(struct device *d, ...@@ -81,7 +81,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -102,7 +102,7 @@ nouveau_hwmon_temp1_auto_point1_temp_hyst(struct device *d, ...@@ -102,7 +102,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -114,7 +114,7 @@ nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d, ...@@ -114,7 +114,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -134,7 +134,7 @@ nouveau_hwmon_max_temp(struct device *d, struct device_attribute *a, char *buf) ...@@ -134,7 +134,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -145,7 +145,7 @@ nouveau_hwmon_set_max_temp(struct device *d, struct device_attribute *a, ...@@ -145,7 +145,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -165,7 +165,7 @@ nouveau_hwmon_max_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -165,7 +165,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -176,7 +176,7 @@ nouveau_hwmon_set_max_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -176,7 +176,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -197,7 +197,7 @@ nouveau_hwmon_critical_temp(struct device *d, struct device_attribute *a, ...@@ -197,7 +197,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -209,7 +209,7 @@ nouveau_hwmon_set_critical_temp(struct device *d, struct device_attribute *a, ...@@ -209,7 +209,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -230,7 +230,7 @@ nouveau_hwmon_critical_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -230,7 +230,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -243,7 +243,7 @@ nouveau_hwmon_set_critical_temp_hyst(struct device *d, ...@@ -243,7 +243,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -263,7 +263,7 @@ nouveau_hwmon_emergency_temp(struct device *d, struct device_attribute *a, ...@@ -263,7 +263,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -275,7 +275,7 @@ nouveau_hwmon_set_emergency_temp(struct device *d, struct device_attribute *a, ...@@ -275,7 +275,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -296,7 +296,7 @@ nouveau_hwmon_emergency_temp_hyst(struct device *d, struct device_attribute *a, ...@@ -296,7 +296,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -309,7 +309,7 @@ nouveau_hwmon_set_emergency_temp_hyst(struct device *d, ...@@ -309,7 +309,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
if (kstrtol(buf, 10, &value) == -EINVAL) if (kstrtol(buf, 10, &value) == -EINVAL)
...@@ -349,7 +349,7 @@ nouveau_hwmon_show_fan1_input(struct device *d, struct device_attribute *attr, ...@@ -349,7 +349,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
return snprintf(buf, PAGE_SIZE, "%d\n", nvkm_therm_fan_sense(therm)); return snprintf(buf, PAGE_SIZE, "%d\n", nvkm_therm_fan_sense(therm));
} }
...@@ -362,7 +362,7 @@ nouveau_hwmon_get_pwm1_enable(struct device *d, ...@@ -362,7 +362,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -378,7 +378,7 @@ nouveau_hwmon_set_pwm1_enable(struct device *d, struct device_attribute *a, ...@@ -378,7 +378,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
int ret; int ret;
...@@ -401,7 +401,7 @@ nouveau_hwmon_get_pwm1(struct device *d, struct device_attribute *a, char *buf) ...@@ -401,7 +401,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
int ret; int ret;
ret = therm->fan_get(therm); ret = therm->fan_get(therm);
...@@ -417,7 +417,7 @@ nouveau_hwmon_set_pwm1(struct device *d, struct device_attribute *a, ...@@ -417,7 +417,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
int ret = -ENODEV; int ret = -ENODEV;
long value; long value;
...@@ -441,7 +441,7 @@ nouveau_hwmon_get_pwm1_min(struct device *d, ...@@ -441,7 +441,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -457,7 +457,7 @@ nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a, ...@@ -457,7 +457,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
int ret; int ret;
...@@ -481,7 +481,7 @@ nouveau_hwmon_get_pwm1_max(struct device *d, ...@@ -481,7 +481,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.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);
...@@ -497,7 +497,7 @@ nouveau_hwmon_set_pwm1_max(struct device *d, struct device_attribute *a, ...@@ -497,7 +497,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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
long value; long value;
int ret; int ret;
...@@ -521,7 +521,7 @@ nouveau_hwmon_get_in0_input(struct device *d, ...@@ -521,7 +521,7 @@ nouveau_hwmon_get_in0_input(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 nvkm_volt *volt = nvxx_volt(&drm->device); struct nvkm_volt *volt = nvxx_volt(&drm->client.device);
int ret; int ret;
ret = nvkm_volt_get(volt); ret = nvkm_volt_get(volt);
...@@ -540,7 +540,7 @@ nouveau_hwmon_get_in0_min(struct device *d, ...@@ -540,7 +540,7 @@ nouveau_hwmon_get_in0_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 nvkm_volt *volt = nvxx_volt(&drm->device); struct nvkm_volt *volt = nvxx_volt(&drm->client.device);
if (!volt || !volt->min_uv) if (!volt || !volt->min_uv)
return -ENODEV; return -ENODEV;
...@@ -557,7 +557,7 @@ nouveau_hwmon_get_in0_max(struct device *d, ...@@ -557,7 +557,7 @@ nouveau_hwmon_get_in0_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 nvkm_volt *volt = nvxx_volt(&drm->device); struct nvkm_volt *volt = nvxx_volt(&drm->client.device);
if (!volt || !volt->max_uv) if (!volt || !volt->max_uv)
return -ENODEV; return -ENODEV;
...@@ -584,7 +584,7 @@ nouveau_hwmon_get_power1_input(struct device *d, struct device_attribute *a, ...@@ -584,7 +584,7 @@ nouveau_hwmon_get_power1_input(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 nvkm_iccsense *iccsense = nvxx_iccsense(&drm->device); struct nvkm_iccsense *iccsense = nvxx_iccsense(&drm->client.device);
int result = nvkm_iccsense_read_all(iccsense); int result = nvkm_iccsense_read_all(iccsense);
if (result < 0) if (result < 0)
...@@ -664,9 +664,9 @@ nouveau_hwmon_init(struct drm_device *dev) ...@@ -664,9 +664,9 @@ 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 nvkm_therm *therm = nvxx_therm(&drm->device); struct nvkm_therm *therm = nvxx_therm(&drm->client.device);
struct nvkm_volt *volt = nvxx_volt(&drm->device); struct nvkm_volt *volt = nvxx_volt(&drm->client.device);
struct nvkm_iccsense *iccsense = nvxx_iccsense(&drm->device); struct nvkm_iccsense *iccsense = nvxx_iccsense(&drm->client.device);
struct nouveau_hwmon *hwmon; struct nouveau_hwmon *hwmon;
struct device *hwmon_dev; struct device *hwmon_dev;
int ret = 0; int ret = 0;
......
...@@ -38,7 +38,7 @@ nouveau_led_get_brightness(struct led_classdev *led) ...@@ -38,7 +38,7 @@ nouveau_led_get_brightness(struct led_classdev *led)
{ {
struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev;
struct nouveau_drm *drm = nouveau_drm(drm_dev); struct nouveau_drm *drm = nouveau_drm(drm_dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
u32 div, duty; u32 div, duty;
div = nvif_rd32(device, 0x61c880) & 0x00ffffff; div = nvif_rd32(device, 0x61c880) & 0x00ffffff;
...@@ -55,7 +55,7 @@ nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value) ...@@ -55,7 +55,7 @@ nouveau_led_set_brightness(struct led_classdev *led, enum led_brightness value)
{ {
struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev; struct drm_device *drm_dev = container_of(led, struct nouveau_led, led)->dev;
struct nouveau_drm *drm = nouveau_drm(drm_dev); struct nouveau_drm *drm = nouveau_drm(drm_dev);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
u32 input_clk = 27e6; /* PDISPLAY.SOR[1].PWM is connected to the crystal */ u32 input_clk = 27e6; /* PDISPLAY.SOR[1].PWM is connected to the crystal */
u32 freq = 100; /* this is what nvidia uses and it should be good-enough */ u32 freq = 100; /* this is what nvidia uses and it should be good-enough */
...@@ -78,7 +78,7 @@ int ...@@ -78,7 +78,7 @@ int
nouveau_led_init(struct drm_device *dev) nouveau_led_init(struct drm_device *dev)
{ {
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nvkm_gpio *gpio = nvxx_gpio(&drm->device); struct nvkm_gpio *gpio = nvxx_gpio(&drm->client.device);
struct dcb_gpio_func logo_led; struct dcb_gpio_func logo_led;
int ret; int ret;
......
...@@ -100,7 +100,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, ...@@ -100,7 +100,7 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
if (!nvbe) if (!nvbe)
return NULL; return NULL;
if (drm->device.info.family < NV_DEVICE_INFO_V0_TESLA) if (drm->client.device.info.family < NV_DEVICE_INFO_V0_TESLA)
nvbe->ttm.ttm.func = &nv04_sgdma_backend; nvbe->ttm.ttm.func = &nv04_sgdma_backend;
else else
nvbe->ttm.ttm.func = &nv50_sgdma_backend; nvbe->ttm.ttm.func = &nv50_sgdma_backend;
......
...@@ -36,7 +36,7 @@ static int ...@@ -36,7 +36,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 nvkm_fb *fb = nvxx_fb(&drm->device); struct nvkm_fb *fb = nvxx_fb(&drm->client.device);
man->priv = fb; man->priv = fb;
return 0; return 0;
} }
...@@ -67,7 +67,7 @@ nouveau_vram_manager_del(struct ttm_mem_type_manager *man, ...@@ -67,7 +67,7 @@ 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 nvkm_ram *ram = nvxx_fb(&drm->device)->ram; struct nvkm_ram *ram = nvxx_fb(&drm->client.device)->ram;
nvkm_mem_node_cleanup(mem->mm_node); nvkm_mem_node_cleanup(mem->mm_node);
ram->func->put(ram, (struct nvkm_mem **)&mem->mm_node); ram->func->put(ram, (struct nvkm_mem **)&mem->mm_node);
} }
...@@ -79,13 +79,13 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, ...@@ -79,13 +79,13 @@ 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 nvkm_ram *ram = nvxx_fb(&drm->device)->ram; struct nvkm_ram *ram = nvxx_fb(&drm->client.device)->ram;
struct nouveau_bo *nvbo = nouveau_bo(bo); struct nouveau_bo *nvbo = nouveau_bo(bo);
struct nvkm_mem *node; struct nvkm_mem *node;
u32 size_nc = 0; u32 size_nc = 0;
int ret; int ret;
if (drm->device.info.ram_size == 0) if (drm->client.device.info.ram_size == 0)
return -ENOMEM; return -ENOMEM;
if (nvbo->tile_flags & NOUVEAU_GEM_TILE_NONCONTIG) if (nvbo->tile_flags & NOUVEAU_GEM_TILE_NONCONTIG)
...@@ -150,7 +150,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -150,7 +150,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
node->page_shift = 12; node->page_shift = 12;
switch (drm->device.info.family) { switch (drm->client.device.info.family) {
case NV_DEVICE_INFO_V0_TNT: case NV_DEVICE_INFO_V0_TNT:
case NV_DEVICE_INFO_V0_CELSIUS: case NV_DEVICE_INFO_V0_CELSIUS:
case NV_DEVICE_INFO_V0_KELVIN: case NV_DEVICE_INFO_V0_KELVIN:
...@@ -158,7 +158,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -158,7 +158,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
case NV_DEVICE_INFO_V0_CURIE: case NV_DEVICE_INFO_V0_CURIE:
break; break;
case NV_DEVICE_INFO_V0_TESLA: case NV_DEVICE_INFO_V0_TESLA:
if (drm->device.info.chipset != 0x50) if (drm->client.device.info.chipset != 0x50)
node->memtype = (nvbo->tile_flags & 0x7f00) >> 8; node->memtype = (nvbo->tile_flags & 0x7f00) >> 8;
break; break;
case NV_DEVICE_INFO_V0_FERMI: case NV_DEVICE_INFO_V0_FERMI:
...@@ -169,7 +169,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, ...@@ -169,7 +169,7 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man,
break; break;
default: default:
NV_WARN(drm, "%s: unhandled family type %x\n", __func__, NV_WARN(drm, "%s: unhandled family type %x\n", __func__,
drm->device.info.family); drm->client.device.info.family);
break; break;
} }
...@@ -197,7 +197,7 @@ static int ...@@ -197,7 +197,7 @@ 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 nvkm_mmu *mmu = nvxx_mmu(&drm->device); struct nvkm_mmu *mmu = nvxx_mmu(&drm->client.device);
struct nv04_mmu *priv = (void *)mmu; struct nv04_mmu *priv = (void *)mmu;
struct nvkm_vm *vm = NULL; struct nvkm_vm *vm = NULL;
nvkm_vm_ref(priv->vm, &vm, NULL); nvkm_vm_ref(priv->vm, &vm, NULL);
...@@ -339,7 +339,7 @@ nouveau_ttm_global_release(struct nouveau_drm *drm) ...@@ -339,7 +339,7 @@ nouveau_ttm_global_release(struct nouveau_drm *drm)
int int
nouveau_ttm_init(struct nouveau_drm *drm) nouveau_ttm_init(struct nouveau_drm *drm)
{ {
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
struct nvkm_pci *pci = device->pci; struct nvkm_pci *pci = device->pci;
struct drm_device *dev = drm->dev; struct drm_device *dev = drm->dev;
u8 bits; u8 bits;
...@@ -352,8 +352,8 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -352,8 +352,8 @@ nouveau_ttm_init(struct nouveau_drm *drm)
drm->agp.cma = pci->agp.cma; drm->agp.cma = pci->agp.cma;
} }
bits = nvxx_mmu(&drm->device)->dma_bits; bits = nvxx_mmu(&drm->client.device)->dma_bits;
if (nvxx_device(&drm->device)->func->pci) { if (nvxx_device(&drm->client.device)->func->pci) {
if (drm->agp.bridge) if (drm->agp.bridge)
bits = 32; bits = 32;
} else if (device->func->tegra) { } else if (device->func->tegra) {
...@@ -396,7 +396,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -396,7 +396,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
} }
/* VRAM init */ /* VRAM init */
drm->gem.vram_available = drm->device.info.ram_user; drm->gem.vram_available = drm->client.device.info.ram_user;
arch_io_reserve_memtype_wc(device->func->resource_addr(device, 1), arch_io_reserve_memtype_wc(device->func->resource_addr(device, 1),
device->func->resource_size(device, 1)); device->func->resource_size(device, 1));
...@@ -413,7 +413,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -413,7 +413,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
/* GART init */ /* GART init */
if (!drm->agp.bridge) { if (!drm->agp.bridge) {
drm->gem.gart_available = nvxx_mmu(&drm->device)->limit; drm->gem.gart_available = nvxx_mmu(&drm->client.device)->limit;
} else { } else {
drm->gem.gart_available = drm->agp.size; drm->gem.gart_available = drm->agp.size;
} }
...@@ -433,7 +433,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ...@@ -433,7 +433,7 @@ nouveau_ttm_init(struct nouveau_drm *drm)
void void
nouveau_ttm_fini(struct nouveau_drm *drm) nouveau_ttm_fini(struct nouveau_drm *drm)
{ {
struct nvkm_device *device = nvxx_device(&drm->device); struct nvkm_device *device = nvxx_device(&drm->client.device);
ttm_bo_clean_mm(&drm->ttm.bdev, TTM_PL_VRAM); ttm_bo_clean_mm(&drm->ttm.bdev, TTM_PL_VRAM);
ttm_bo_clean_mm(&drm->ttm.bdev, TTM_PL_TT); ttm_bo_clean_mm(&drm->ttm.bdev, TTM_PL_TT);
......
...@@ -13,13 +13,13 @@ static unsigned int ...@@ -13,13 +13,13 @@ static unsigned int
nouveau_vga_set_decode(void *priv, bool state) nouveau_vga_set_decode(void *priv, bool state)
{ {
struct nouveau_drm *drm = nouveau_drm(priv); struct nouveau_drm *drm = nouveau_drm(priv);
struct nvif_object *device = &drm->device.object; struct nvif_object *device = &drm->client.device.object;
if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE && if (drm->client.device.info.family == NV_DEVICE_INFO_V0_CURIE &&
drm->device.info.chipset >= 0x4c) drm->client.device.info.chipset >= 0x4c)
nvif_wr32(device, 0x088060, state); nvif_wr32(device, 0x088060, state);
else else
if (drm->device.info.chipset >= 0x40) if (drm->client.device.info.chipset >= 0x40)
nvif_wr32(device, 0x088054, state); nvif_wr32(device, 0x088054, state);
else else
nvif_wr32(device, 0x001854, state); nvif_wr32(device, 0x001854, state);
......
...@@ -136,7 +136,7 @@ nv04_fbcon_accel_init(struct fb_info *info) ...@@ -136,7 +136,7 @@ nv04_fbcon_accel_init(struct fb_info *info)
struct drm_device *dev = nfbdev->helper.dev; struct drm_device *dev = nfbdev->helper.dev;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_channel *chan = drm->channel; struct nouveau_channel *chan = drm->channel;
struct nvif_device *device = &drm->device; struct nvif_device *device = &drm->client.device;
int surface_fmt, pattern_fmt, rect_fmt; int surface_fmt, pattern_fmt, rect_fmt;
int ret; int ret;
......
...@@ -447,18 +447,18 @@ nv50_dmac_ctxdma_new(struct nv50_dmac *dmac, struct nouveau_framebuffer *fb) ...@@ -447,18 +447,18 @@ nv50_dmac_ctxdma_new(struct nv50_dmac *dmac, struct nouveau_framebuffer *fb)
args.base.target = NV_DMA_V0_TARGET_VRAM; args.base.target = NV_DMA_V0_TARGET_VRAM;
args.base.access = NV_DMA_V0_ACCESS_RDWR; args.base.access = NV_DMA_V0_ACCESS_RDWR;
args.base.start = 0; args.base.start = 0;
args.base.limit = drm->device.info.ram_user - 1; args.base.limit = drm->client.device.info.ram_user - 1;
if (drm->device.info.chipset < 0x80) { if (drm->client.device.info.chipset < 0x80) {
args.nv50.part = NV50_DMA_V0_PART_256; args.nv50.part = NV50_DMA_V0_PART_256;
argc += sizeof(args.nv50); argc += sizeof(args.nv50);
} else } else
if (drm->device.info.chipset < 0xc0) { if (drm->client.device.info.chipset < 0xc0) {
args.nv50.part = NV50_DMA_V0_PART_256; args.nv50.part = NV50_DMA_V0_PART_256;
args.nv50.kind = kind; args.nv50.kind = kind;
argc += sizeof(args.nv50); argc += sizeof(args.nv50);
} else } else
if (drm->device.info.chipset < 0xd0) { if (drm->client.device.info.chipset < 0xd0) {
args.gf100.kind = kind; args.gf100.kind = kind;
argc += sizeof(args.gf100); argc += sizeof(args.gf100);
} else { } else {
...@@ -848,7 +848,7 @@ nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw, ...@@ -848,7 +848,7 @@ nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw,
asyw->image.kind = (fb->nvbo->tile_flags & 0x0000ff00) >> 8; asyw->image.kind = (fb->nvbo->tile_flags & 0x0000ff00) >> 8;
if (asyw->image.kind) { if (asyw->image.kind) {
asyw->image.layout = 0; asyw->image.layout = 0;
if (drm->device.info.chipset >= 0xc0) if (drm->client.device.info.chipset >= 0xc0)
asyw->image.block = fb->nvbo->tile_mode >> 4; asyw->image.block = fb->nvbo->tile_mode >> 4;
else else
asyw->image.block = fb->nvbo->tile_mode; asyw->image.block = fb->nvbo->tile_mode;
...@@ -1397,7 +1397,7 @@ nv50_base_ntfy_wait_begun(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw) ...@@ -1397,7 +1397,7 @@ nv50_base_ntfy_wait_begun(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{ {
struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev); struct nouveau_drm *drm = nouveau_drm(wndw->plane.dev);
struct nv50_disp *disp = nv50_disp(wndw->plane.dev); struct nv50_disp *disp = nv50_disp(wndw->plane.dev);
if (nvif_msec(&drm->device, 2000ULL, if (nvif_msec(&drm->client.device, 2000ULL,
u32 data = nouveau_bo_rd32(disp->sync, asyw->ntfy.offset / 4); u32 data = nouveau_bo_rd32(disp->sync, asyw->ntfy.offset / 4);
if ((data & 0xc0000000) == 0x40000000) if ((data & 0xc0000000) == 0x40000000)
break; break;
...@@ -1522,7 +1522,7 @@ nv50_base_new(struct nouveau_drm *drm, struct nv50_head *head, ...@@ -1522,7 +1522,7 @@ nv50_base_new(struct nouveau_drm *drm, struct nv50_head *head,
return ret; return ret;
} }
ret = nv50_base_create(&drm->device, disp->disp, base->id, ret = nv50_base_create(&drm->client.device, disp->disp, base->id,
disp->sync->bo.offset, &base->chan); disp->sync->bo.offset, &base->chan);
if (ret) if (ret)
return ret; return ret;
...@@ -2394,7 +2394,7 @@ static int ...@@ -2394,7 +2394,7 @@ static int
nv50_head_create(struct drm_device *dev, int index) nv50_head_create(struct drm_device *dev, int index)
{ {
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->client.device;
struct nv50_disp *disp = nv50_disp(dev); struct nv50_disp *disp = nv50_disp(dev);
struct nv50_head *head; struct nv50_head *head;
struct nv50_base *base; struct nv50_base *base;
...@@ -2667,7 +2667,7 @@ static int ...@@ -2667,7 +2667,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 nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
struct nvkm_i2c_bus *bus; struct nvkm_i2c_bus *bus;
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -3657,7 +3657,7 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe) ...@@ -3657,7 +3657,7 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
{ {
struct nouveau_connector *nv_connector = nouveau_connector(connector); struct nouveau_connector *nv_connector = nouveau_connector(connector);
struct nouveau_drm *drm = nouveau_drm(connector->dev); struct nouveau_drm *drm = nouveau_drm(connector->dev);
struct nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
struct drm_encoder *encoder; struct drm_encoder *encoder;
int type, ret; int type, ret;
...@@ -3842,7 +3842,7 @@ static int ...@@ -3842,7 +3842,7 @@ 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 nvkm_i2c *i2c = nvxx_i2c(&drm->device); struct nvkm_i2c *i2c = nvxx_i2c(&drm->client.device);
struct nvkm_i2c_bus *bus = NULL; struct nvkm_i2c_bus *bus = NULL;
struct nvkm_i2c_aux *aux = NULL; struct nvkm_i2c_aux *aux = NULL;
struct i2c_adapter *ddc; struct i2c_adapter *ddc;
...@@ -3915,7 +3915,7 @@ nv50_disp_atomic_commit_core(struct nouveau_drm *drm, u32 interlock) ...@@ -3915,7 +3915,7 @@ nv50_disp_atomic_commit_core(struct nouveau_drm *drm, u32 interlock)
evo_data(push, 0x00000000); evo_data(push, 0x00000000);
nouveau_bo_wr32(disp->sync, 0, 0x00000000); nouveau_bo_wr32(disp->sync, 0, 0x00000000);
evo_kick(push, core); evo_kick(push, core);
if (nvif_msec(&drm->device, 2000ULL, if (nvif_msec(&drm->client.device, 2000ULL,
if (nouveau_bo_rd32(disp->sync, 0)) if (nouveau_bo_rd32(disp->sync, 0))
break; break;
usleep_range(1, 2); usleep_range(1, 2);
...@@ -4427,7 +4427,7 @@ module_param_named(atomic, nouveau_atomic, int, 0400); ...@@ -4427,7 +4427,7 @@ module_param_named(atomic, nouveau_atomic, int, 0400);
int int
nv50_display_create(struct drm_device *dev) nv50_display_create(struct drm_device *dev)
{ {
struct nvif_device *device = &nouveau_drm(dev)->device; struct nvif_device *device = &nouveau_drm(dev)->client.device;
struct nouveau_drm *drm = nouveau_drm(dev); struct nouveau_drm *drm = nouveau_drm(dev);
struct dcb_table *dcb = &drm->vbios.dcb; struct dcb_table *dcb = &drm->vbios.dcb;
struct drm_connector *connector, *tmp; struct drm_connector *connector, *tmp;
......
...@@ -193,7 +193,7 @@ nv84_fence_destroy(struct nouveau_drm *drm) ...@@ -193,7 +193,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 nvkm_fifo *fifo = nvxx_fifo(&drm->device); struct nvkm_fifo *fifo = nvxx_fifo(&drm->client.device);
struct nv84_fence_priv *priv; struct nv84_fence_priv *priv;
u32 domain; u32 domain;
int ret; int ret;
...@@ -213,7 +213,7 @@ nv84_fence_create(struct nouveau_drm *drm) ...@@ -213,7 +213,7 @@ nv84_fence_create(struct nouveau_drm *drm)
priv->base.uevent = true; priv->base.uevent = true;
/* Use VRAM if there is any ; otherwise fallback to system memory */ /* Use VRAM if there is any ; otherwise fallback to system memory */
domain = drm->device.info.ram_size != 0 ? TTM_PL_FLAG_VRAM : domain = drm->client.device.info.ram_size != 0 ? TTM_PL_FLAG_VRAM :
/* /*
* fences created in sysmem must be non-cached or we * fences created in sysmem must be non-cached or we
* will lose CPU/GPU coherency! * will lose CPU/GPU coherency!
......
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