aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-08-09 14:10:22 -0400
committerBen Skeggs <bskeggs@redhat.com>2014-08-09 15:13:13 -0400
commit967e7bde8739fe3b215f7537e8f1f39c044902af (patch)
tree5d96683b3b139da0b681ae038a8cd5f25ca32ef8 /drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
parentdb2bec187dd68e79d512112df1f6e7a849e7f0ce (diff)
drm/nouveau: initial pass at moving to struct nvif_device
This is an attempt at isolating some of the changes necessary to port to NVIF in a separate commit. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/dispnv04/tvnv17.c')
-rw-r--r--drivers/gpu/drm/nouveau/dispnv04/tvnv17.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
index 195bd8e86c6a..28975b732c6a 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
@@ -51,7 +51,7 @@ static uint32_t nv42_tv_sample_load(struct drm_encoder *encoder)
51{ 51{
52 struct drm_device *dev = encoder->dev; 52 struct drm_device *dev = encoder->dev;
53 struct nouveau_drm *drm = nouveau_drm(dev); 53 struct nouveau_drm *drm = nouveau_drm(dev);
54 struct nouveau_gpio *gpio = nouveau_gpio(drm->device); 54 struct nouveau_gpio *gpio = nvkm_gpio(&drm->device);
55 uint32_t testval, regoffset = nv04_dac_output_offset(encoder); 55 uint32_t testval, regoffset = nv04_dac_output_offset(encoder);
56 uint32_t gpio0, gpio1, fp_htotal, fp_hsync_start, fp_hsync_end, 56 uint32_t gpio0, gpio1, fp_htotal, fp_hsync_start, fp_hsync_end,
57 fp_control, test_ctrl, dacclk, ctv_14, ctv_1c, ctv_6c; 57 fp_control, test_ctrl, dacclk, ctv_14, ctv_1c, ctv_6c;
@@ -135,17 +135,17 @@ static bool
135get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) 135get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask)
136{ 136{
137 struct nouveau_drm *drm = nouveau_drm(dev); 137 struct nouveau_drm *drm = nouveau_drm(dev);
138 struct nouveau_object *device = drm->device; 138 struct nvif_device *device = &drm->device;
139 139
140 /* Zotac FX5200 */ 140 /* Zotac FX5200 */
141 if (nv_device_match(device, 0x0322, 0x19da, 0x1035) || 141 if (nv_device_match(nvkm_object(device), 0x0322, 0x19da, 0x1035) ||
142 nv_device_match(device, 0x0322, 0x19da, 0x2035)) { 142 nv_device_match(nvkm_object(device), 0x0322, 0x19da, 0x2035)) {
143 *pin_mask = 0xc; 143 *pin_mask = 0xc;
144 return false; 144 return false;
145 } 145 }
146 146
147 /* MSI nForce2 IGP */ 147 /* MSI nForce2 IGP */
148 if (nv_device_match(device, 0x01f0, 0x1462, 0x5710)) { 148 if (nv_device_match(nvkm_object(device), 0x01f0, 0x1462, 0x5710)) {
149 *pin_mask = 0xc; 149 *pin_mask = 0xc;
150 return false; 150 return false;
151 } 151 }
@@ -167,8 +167,8 @@ nv17_tv_detect(struct drm_encoder *encoder, struct drm_connector *connector)
167 return connector_status_disconnected; 167 return connector_status_disconnected;
168 168
169 if (reliable) { 169 if (reliable) {
170 if (nv_device(drm->device)->chipset == 0x42 || 170 if (drm->device.info.chipset == 0x42 ||
171 nv_device(drm->device)->chipset == 0x43) 171 drm->device.info.chipset == 0x43)
172 tv_enc->pin_mask = 172 tv_enc->pin_mask =
173 nv42_tv_sample_load(encoder) >> 28 & 0xe; 173 nv42_tv_sample_load(encoder) >> 28 & 0xe;
174 else 174 else
@@ -375,7 +375,7 @@ static void nv17_tv_dpms(struct drm_encoder *encoder, int mode)
375{ 375{
376 struct drm_device *dev = encoder->dev; 376 struct drm_device *dev = encoder->dev;
377 struct nouveau_drm *drm = nouveau_drm(dev); 377 struct nouveau_drm *drm = nouveau_drm(dev);
378 struct nouveau_gpio *gpio = nouveau_gpio(drm->device); 378 struct nouveau_gpio *gpio = nvkm_gpio(&drm->device);
379 struct nv17_tv_state *regs = &to_tv_enc(encoder)->state; 379 struct nv17_tv_state *regs = &to_tv_enc(encoder)->state;
380 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder); 380 struct nv17_tv_norm_params *tv_norm = get_tv_norm(encoder);
381 381
@@ -448,7 +448,7 @@ static void nv17_tv_prepare(struct drm_encoder *encoder)
448 /* Set the DACCLK register */ 448 /* Set the DACCLK register */
449 dacclk = (NVReadRAMDAC(dev, 0, dacclk_off) & ~0x30) | 0x1; 449 dacclk = (NVReadRAMDAC(dev, 0, dacclk_off) & ~0x30) | 0x1;
450 450
451 if (nv_device(drm->device)->card_type == NV_40) 451 if (drm->device.info.family == NV_DEVICE_INFO_V0_CURIE)
452 dacclk |= 0x1a << 16; 452 dacclk |= 0x1a << 16;
453 453
454 if (tv_norm->kind == CTV_ENC_MODE) { 454 if (tv_norm->kind == CTV_ENC_MODE) {
@@ -505,7 +505,7 @@ static void nv17_tv_mode_set(struct drm_encoder *encoder,
505 tv_regs->ptv_614 = 0x13; 505 tv_regs->ptv_614 = 0x13;
506 } 506 }
507 507
508 if (nv_device(drm->device)->card_type >= NV_30) { 508 if (drm->device.info.family >= NV_DEVICE_INFO_V0_RANKINE) {
509 tv_regs->ptv_500 = 0xe8e0; 509 tv_regs->ptv_500 = 0xe8e0;
510 tv_regs->ptv_504 = 0x1710; 510 tv_regs->ptv_504 = 0x1710;
511 tv_regs->ptv_604 = 0x0; 511 tv_regs->ptv_604 = 0x0;
@@ -600,7 +600,7 @@ static void nv17_tv_commit(struct drm_encoder *encoder)
600 nv17_tv_state_load(dev, &to_tv_enc(encoder)->state); 600 nv17_tv_state_load(dev, &to_tv_enc(encoder)->state);
601 601
602 /* This could use refinement for flatpanels, but it should work */ 602 /* This could use refinement for flatpanels, but it should work */
603 if (nv_device(drm->device)->chipset < 0x44) 603 if (drm->device.info.chipset < 0x44)
604 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + 604 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL +
605 nv04_dac_output_offset(encoder), 605 nv04_dac_output_offset(encoder),
606 0xf0000000); 606 0xf0000000);