aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bios.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:11 -0400
commitdb2bec187dd68e79d512112df1f6e7a849e7f0ce (patch)
tree1a43c57fcea7915c837d5338d2bdf103259bc7be /drivers/gpu/drm/nouveau/nouveau_bios.c
parentfa2bade99a6fb24c3847d48ba3cad9a70dbb5364 (diff)
drm/nouveau: kill nouveau_dev() + wrap register macros
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 8268a4ccac15..676a03fc0b51 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -217,7 +217,7 @@ int call_lvds_script(struct drm_device *dev, struct dcb_output *dcbent, int head
217 */ 217 */
218 218
219 struct nouveau_drm *drm = nouveau_drm(dev); 219 struct nouveau_drm *drm = nouveau_drm(dev);
220 struct nouveau_device *device = nv_device(drm->device); 220 struct nouveau_object *device = drm->device;
221 struct nvbios *bios = &drm->vbios; 221 struct nvbios *bios = &drm->vbios;
222 uint8_t lvds_ver = bios->data[bios->fp.lvdsmanufacturerpointer]; 222 uint8_t lvds_ver = bios->data[bios->fp.lvdsmanufacturerpointer];
223 uint32_t sel_clk_binding, sel_clk; 223 uint32_t sel_clk_binding, sel_clk;
@@ -240,7 +240,7 @@ int call_lvds_script(struct drm_device *dev, struct dcb_output *dcbent, int head
240 NV_INFO(drm, "Calling LVDS script %d:\n", script); 240 NV_INFO(drm, "Calling LVDS script %d:\n", script);
241 241
242 /* don't let script change pll->head binding */ 242 /* don't let script change pll->head binding */
243 sel_clk_binding = nv_rd32(device, NV_PRAMDAC_SEL_CLK) & 0x50000; 243 sel_clk_binding = nvif_rd32(device, NV_PRAMDAC_SEL_CLK) & 0x50000;
244 244
245 if (lvds_ver < 0x30) 245 if (lvds_ver < 0x30)
246 ret = call_lvds_manufacturer_script(dev, dcbent, head, script); 246 ret = call_lvds_manufacturer_script(dev, dcbent, head, script);
@@ -252,7 +252,7 @@ int call_lvds_script(struct drm_device *dev, struct dcb_output *dcbent, int head
252 sel_clk = NVReadRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK) & ~0x50000; 252 sel_clk = NVReadRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK) & ~0x50000;
253 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, sel_clk | sel_clk_binding); 253 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, sel_clk | sel_clk_binding);
254 /* some scripts set a value in NV_PBUS_POWERCTRL_2 and break video overlay */ 254 /* some scripts set a value in NV_PBUS_POWERCTRL_2 and break video overlay */
255 nv_wr32(device, NV_PBUS_POWERCTRL_2, 0); 255 nvif_wr32(device, NV_PBUS_POWERCTRL_2, 0);
256 256
257 return ret; 257 return ret;
258} 258}
@@ -320,7 +320,7 @@ static int parse_lvds_manufacturer_table_header(struct drm_device *dev, struct n
320static int 320static int
321get_fp_strap(struct drm_device *dev, struct nvbios *bios) 321get_fp_strap(struct drm_device *dev, struct nvbios *bios)
322{ 322{
323 struct nouveau_device *device = nouveau_dev(dev); 323 struct nouveau_object *device = nouveau_drm(dev)->device;
324 324
325 /* 325 /*
326 * The fp strap is normally dictated by the "User Strap" in 326 * The fp strap is normally dictated by the "User Strap" in
@@ -334,10 +334,10 @@ get_fp_strap(struct drm_device *dev, struct nvbios *bios)
334 if (bios->major_version < 5 && bios->data[0x48] & 0x4) 334 if (bios->major_version < 5 && bios->data[0x48] & 0x4)
335 return NVReadVgaCrtc5758(dev, 0, 0xf) & 0xf; 335 return NVReadVgaCrtc5758(dev, 0, 0xf) & 0xf;
336 336
337 if (device->card_type >= NV_50) 337 if (nv_device(device)->card_type >= NV_50)
338 return (nv_rd32(device, NV_PEXTDEV_BOOT_0) >> 24) & 0xf; 338 return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 24) & 0xf;
339 else 339 else
340 return (nv_rd32(device, NV_PEXTDEV_BOOT_0) >> 16) & 0xf; 340 return (nvif_rd32(device, NV_PEXTDEV_BOOT_0) >> 16) & 0xf;
341} 341}
342 342
343static int parse_fp_mode_table(struct drm_device *dev, struct nvbios *bios) 343static int parse_fp_mode_table(struct drm_device *dev, struct nvbios *bios)
@@ -636,7 +636,7 @@ int run_tmds_table(struct drm_device *dev, struct dcb_output *dcbent, int head,
636 */ 636 */
637 637
638 struct nouveau_drm *drm = nouveau_drm(dev); 638 struct nouveau_drm *drm = nouveau_drm(dev);
639 struct nouveau_device *device = nv_device(drm->device); 639 struct nouveau_object *device = drm->device;
640 struct nvbios *bios = &drm->vbios; 640 struct nvbios *bios = &drm->vbios;
641 int cv = bios->chip_version; 641 int cv = bios->chip_version;
642 uint16_t clktable = 0, scriptptr; 642 uint16_t clktable = 0, scriptptr;
@@ -670,7 +670,7 @@ int run_tmds_table(struct drm_device *dev, struct dcb_output *dcbent, int head,
670 } 670 }
671 671
672 /* don't let script change pll->head binding */ 672 /* don't let script change pll->head binding */
673 sel_clk_binding = nv_rd32(device, NV_PRAMDAC_SEL_CLK) & 0x50000; 673 sel_clk_binding = nvif_rd32(device, NV_PRAMDAC_SEL_CLK) & 0x50000;
674 run_digital_op_script(dev, scriptptr, dcbent, head, pxclk >= 165000); 674 run_digital_op_script(dev, scriptptr, dcbent, head, pxclk >= 165000);
675 sel_clk = NVReadRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK) & ~0x50000; 675 sel_clk = NVReadRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK) & ~0x50000;
676 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, sel_clk | sel_clk_binding); 676 NVWriteRAMDAC(dev, 0, NV_PRAMDAC_SEL_CLK, sel_clk | sel_clk_binding);
@@ -1908,7 +1908,7 @@ static int load_nv17_hwsq_ucode_entry(struct drm_device *dev, struct nvbios *bio
1908 */ 1908 */
1909 1909
1910 struct nouveau_drm *drm = nouveau_drm(dev); 1910 struct nouveau_drm *drm = nouveau_drm(dev);
1911 struct nouveau_device *device = nv_device(drm->device); 1911 struct nouveau_object *device = drm->device;
1912 uint8_t bytes_to_write; 1912 uint8_t bytes_to_write;
1913 uint16_t hwsq_entry_offset; 1913 uint16_t hwsq_entry_offset;
1914 int i; 1914 int i;
@@ -1931,15 +1931,15 @@ static int load_nv17_hwsq_ucode_entry(struct drm_device *dev, struct nvbios *bio
1931 hwsq_entry_offset = hwsq_offset + 2 + entry * bytes_to_write; 1931 hwsq_entry_offset = hwsq_offset + 2 + entry * bytes_to_write;
1932 1932
1933 /* set sequencer control */ 1933 /* set sequencer control */
1934 nv_wr32(device, 0x00001304, ROM32(bios->data[hwsq_entry_offset])); 1934 nvif_wr32(device, 0x00001304, ROM32(bios->data[hwsq_entry_offset]));
1935 bytes_to_write -= 4; 1935 bytes_to_write -= 4;
1936 1936
1937 /* write ucode */ 1937 /* write ucode */
1938 for (i = 0; i < bytes_to_write; i += 4) 1938 for (i = 0; i < bytes_to_write; i += 4)
1939 nv_wr32(device, 0x00001400 + i, ROM32(bios->data[hwsq_entry_offset + i + 4])); 1939 nvif_wr32(device, 0x00001400 + i, ROM32(bios->data[hwsq_entry_offset + i + 4]));
1940 1940
1941 /* twiddle NV_PBUS_DEBUG_4 */ 1941 /* twiddle NV_PBUS_DEBUG_4 */
1942 nv_wr32(device, NV_PBUS_DEBUG_4, nv_rd32(device, NV_PBUS_DEBUG_4) | 0x18); 1942 nvif_wr32(device, NV_PBUS_DEBUG_4, nvif_rd32(device, NV_PBUS_DEBUG_4) | 0x18);
1943 1943
1944 return 0; 1944 return 0;
1945} 1945}