diff options
Diffstat (limited to 'drivers/video/aty/radeon_base.c')
-rw-r--r-- | drivers/video/aty/radeon_base.c | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index 62867cb63fef..72cd0d2f14ec 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c | |||
@@ -52,11 +52,14 @@ | |||
52 | 52 | ||
53 | #define RADEON_VERSION "0.2.0" | 53 | #define RADEON_VERSION "0.2.0" |
54 | 54 | ||
55 | #include "radeonfb.h" | ||
56 | |||
55 | #include <linux/module.h> | 57 | #include <linux/module.h> |
56 | #include <linux/moduleparam.h> | 58 | #include <linux/moduleparam.h> |
57 | #include <linux/kernel.h> | 59 | #include <linux/kernel.h> |
58 | #include <linux/errno.h> | 60 | #include <linux/errno.h> |
59 | #include <linux/string.h> | 61 | #include <linux/string.h> |
62 | #include <linux/ctype.h> | ||
60 | #include <linux/mm.h> | 63 | #include <linux/mm.h> |
61 | #include <linux/slab.h> | 64 | #include <linux/slab.h> |
62 | #include <linux/delay.h> | 65 | #include <linux/delay.h> |
@@ -91,7 +94,6 @@ | |||
91 | 94 | ||
92 | #include "../edid.h" // MOVE THAT TO include/video | 95 | #include "../edid.h" // MOVE THAT TO include/video |
93 | #include "ati_ids.h" | 96 | #include "ati_ids.h" |
94 | #include "radeonfb.h" | ||
95 | 97 | ||
96 | #define MAX_MAPPED_VRAM (2048*2048*4) | 98 | #define MAX_MAPPED_VRAM (2048*2048*4) |
97 | #define MIN_MAPPED_VRAM (1024*768*1) | 99 | #define MIN_MAPPED_VRAM (1024*768*1) |
@@ -1488,7 +1490,7 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs | |||
1488 | freq = rinfo->pll.ppll_max; | 1490 | freq = rinfo->pll.ppll_max; |
1489 | if (freq*12 < rinfo->pll.ppll_min) | 1491 | if (freq*12 < rinfo->pll.ppll_min) |
1490 | freq = rinfo->pll.ppll_min / 12; | 1492 | freq = rinfo->pll.ppll_min / 12; |
1491 | RTRACE("freq = %lu, PLL min = %u, PLL max = %u\n", | 1493 | pr_debug("freq = %lu, PLL min = %u, PLL max = %u\n", |
1492 | freq, rinfo->pll.ppll_min, rinfo->pll.ppll_max); | 1494 | freq, rinfo->pll.ppll_min, rinfo->pll.ppll_max); |
1493 | 1495 | ||
1494 | for (post_div = &post_divs[0]; post_div->divider; ++post_div) { | 1496 | for (post_div = &post_divs[0]; post_div->divider; ++post_div) { |
@@ -1509,7 +1511,7 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs | |||
1509 | post_div = &post_divs[post_div->bitvalue]; | 1511 | post_div = &post_divs[post_div->bitvalue]; |
1510 | pll_output_freq = post_div->divider * freq; | 1512 | pll_output_freq = post_div->divider * freq; |
1511 | } | 1513 | } |
1512 | RTRACE("ref_div = %d, ref_clk = %d, output_freq = %d\n", | 1514 | pr_debug("ref_div = %d, ref_clk = %d, output_freq = %d\n", |
1513 | rinfo->pll.ref_div, rinfo->pll.ref_clk, | 1515 | rinfo->pll.ref_div, rinfo->pll.ref_clk, |
1514 | pll_output_freq); | 1516 | pll_output_freq); |
1515 | 1517 | ||
@@ -1519,7 +1521,7 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs | |||
1519 | post_div = &post_divs[post_div->bitvalue]; | 1521 | post_div = &post_divs[post_div->bitvalue]; |
1520 | pll_output_freq = post_div->divider * freq; | 1522 | pll_output_freq = post_div->divider * freq; |
1521 | } | 1523 | } |
1522 | RTRACE("ref_div = %d, ref_clk = %d, output_freq = %d\n", | 1524 | pr_debug("ref_div = %d, ref_clk = %d, output_freq = %d\n", |
1523 | rinfo->pll.ref_div, rinfo->pll.ref_clk, | 1525 | rinfo->pll.ref_div, rinfo->pll.ref_clk, |
1524 | pll_output_freq); | 1526 | pll_output_freq); |
1525 | 1527 | ||
@@ -1528,9 +1530,9 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs | |||
1528 | regs->ppll_ref_div = rinfo->pll.ref_div; | 1530 | regs->ppll_ref_div = rinfo->pll.ref_div; |
1529 | regs->ppll_div_3 = fb_div | (post_div->bitvalue << 16); | 1531 | regs->ppll_div_3 = fb_div | (post_div->bitvalue << 16); |
1530 | 1532 | ||
1531 | RTRACE("post div = 0x%x\n", post_div->bitvalue); | 1533 | pr_debug("post div = 0x%x\n", post_div->bitvalue); |
1532 | RTRACE("fb_div = 0x%x\n", fb_div); | 1534 | pr_debug("fb_div = 0x%x\n", fb_div); |
1533 | RTRACE("ppll_div_3 = 0x%x\n", regs->ppll_div_3); | 1535 | pr_debug("ppll_div_3 = 0x%x\n", regs->ppll_div_3); |
1534 | } | 1536 | } |
1535 | 1537 | ||
1536 | static int radeonfb_set_par(struct fb_info *info) | 1538 | static int radeonfb_set_par(struct fb_info *info) |
@@ -1602,9 +1604,9 @@ static int radeonfb_set_par(struct fb_info *info) | |||
1602 | dotClock = 1000000000 / pixClock; | 1604 | dotClock = 1000000000 / pixClock; |
1603 | freq = dotClock / 10; /* x100 */ | 1605 | freq = dotClock / 10; /* x100 */ |
1604 | 1606 | ||
1605 | RTRACE("hStart = %d, hEnd = %d, hTotal = %d\n", | 1607 | pr_debug("hStart = %d, hEnd = %d, hTotal = %d\n", |
1606 | hSyncStart, hSyncEnd, hTotal); | 1608 | hSyncStart, hSyncEnd, hTotal); |
1607 | RTRACE("vStart = %d, vEnd = %d, vTotal = %d\n", | 1609 | pr_debug("vStart = %d, vEnd = %d, vTotal = %d\n", |
1608 | vSyncStart, vSyncEnd, vTotal); | 1610 | vSyncStart, vSyncEnd, vTotal); |
1609 | 1611 | ||
1610 | hsync_wid = (hSyncEnd - hSyncStart) / 8; | 1612 | hsync_wid = (hSyncEnd - hSyncStart) / 8; |
@@ -1713,16 +1715,16 @@ static int radeonfb_set_par(struct fb_info *info) | |||
1713 | newmode->surf_info[i] = 0; | 1715 | newmode->surf_info[i] = 0; |
1714 | } | 1716 | } |
1715 | 1717 | ||
1716 | RTRACE("h_total_disp = 0x%x\t hsync_strt_wid = 0x%x\n", | 1718 | pr_debug("h_total_disp = 0x%x\t hsync_strt_wid = 0x%x\n", |
1717 | newmode->crtc_h_total_disp, newmode->crtc_h_sync_strt_wid); | 1719 | newmode->crtc_h_total_disp, newmode->crtc_h_sync_strt_wid); |
1718 | RTRACE("v_total_disp = 0x%x\t vsync_strt_wid = 0x%x\n", | 1720 | pr_debug("v_total_disp = 0x%x\t vsync_strt_wid = 0x%x\n", |
1719 | newmode->crtc_v_total_disp, newmode->crtc_v_sync_strt_wid); | 1721 | newmode->crtc_v_total_disp, newmode->crtc_v_sync_strt_wid); |
1720 | 1722 | ||
1721 | rinfo->bpp = mode->bits_per_pixel; | 1723 | rinfo->bpp = mode->bits_per_pixel; |
1722 | rinfo->depth = depth; | 1724 | rinfo->depth = depth; |
1723 | 1725 | ||
1724 | RTRACE("pixclock = %lu\n", (unsigned long)pixClock); | 1726 | pr_debug("pixclock = %lu\n", (unsigned long)pixClock); |
1725 | RTRACE("freq = %lu\n", (unsigned long)freq); | 1727 | pr_debug("freq = %lu\n", (unsigned long)freq); |
1726 | 1728 | ||
1727 | /* We use PPLL_DIV_3 */ | 1729 | /* We use PPLL_DIV_3 */ |
1728 | newmode->clk_cntl_index = 0x300; | 1730 | newmode->clk_cntl_index = 0x300; |
@@ -1986,7 +1988,7 @@ static void fixup_memory_mappings(struct radeonfb_info *rinfo) | |||
1986 | if (rinfo->has_CRTC2) | 1988 | if (rinfo->has_CRTC2) |
1987 | OUTREG(CRTC2_GEN_CNTL, save_crtc2_gen_cntl); | 1989 | OUTREG(CRTC2_GEN_CNTL, save_crtc2_gen_cntl); |
1988 | 1990 | ||
1989 | RTRACE("aper_base: %08x MC_FB_LOC to: %08x, MC_AGP_LOC to: %08x\n", | 1991 | pr_debug("aper_base: %08x MC_FB_LOC to: %08x, MC_AGP_LOC to: %08x\n", |
1990 | aper_base, | 1992 | aper_base, |
1991 | ((aper_base + aper_size - 1) & 0xffff0000) | (aper_base >> 16), | 1993 | ((aper_base + aper_size - 1) & 0xffff0000) | (aper_base >> 16), |
1992 | 0xffff0000 | (agp_base >> 16)); | 1994 | 0xffff0000 | (agp_base >> 16)); |
@@ -2083,7 +2085,7 @@ static void radeon_identify_vram(struct radeonfb_info *rinfo) | |||
2083 | * ToDo: identify these cases | 2085 | * ToDo: identify these cases |
2084 | */ | 2086 | */ |
2085 | 2087 | ||
2086 | RTRACE("radeonfb (%s): Found %ldk of %s %d bits wide videoram\n", | 2088 | pr_debug("radeonfb (%s): Found %ldk of %s %d bits wide videoram\n", |
2087 | pci_name(rinfo->pdev), | 2089 | pci_name(rinfo->pdev), |
2088 | rinfo->video_ram / 1024, | 2090 | rinfo->video_ram / 1024, |
2089 | rinfo->vram_ddr ? "DDR" : "SDRAM", | 2091 | rinfo->vram_ddr ? "DDR" : "SDRAM", |
@@ -2158,8 +2160,9 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, | |||
2158 | struct fb_info *info; | 2160 | struct fb_info *info; |
2159 | struct radeonfb_info *rinfo; | 2161 | struct radeonfb_info *rinfo; |
2160 | int ret; | 2162 | int ret; |
2163 | unsigned char c1, c2; | ||
2161 | 2164 | ||
2162 | RTRACE("radeonfb_pci_register BEGIN\n"); | 2165 | pr_debug("radeonfb_pci_register BEGIN\n"); |
2163 | 2166 | ||
2164 | /* Enable device in PCI config */ | 2167 | /* Enable device in PCI config */ |
2165 | ret = pci_enable_device(pdev); | 2168 | ret = pci_enable_device(pdev); |
@@ -2185,9 +2188,15 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, | |||
2185 | rinfo->lvds_timer.function = radeon_lvds_timer_func; | 2188 | rinfo->lvds_timer.function = radeon_lvds_timer_func; |
2186 | rinfo->lvds_timer.data = (unsigned long)rinfo; | 2189 | rinfo->lvds_timer.data = (unsigned long)rinfo; |
2187 | 2190 | ||
2188 | strcpy(rinfo->name, "ATI Radeon XX "); | 2191 | c1 = ent->device >> 8; |
2189 | rinfo->name[11] = ent->device >> 8; | 2192 | c2 = ent->device & 0xff; |
2190 | rinfo->name[12] = ent->device & 0xFF; | 2193 | if (isprint(c1) && isprint(c2)) |
2194 | snprintf(rinfo->name, sizeof(rinfo->name), | ||
2195 | "ATI Radeon %x \"%c%c\"", ent->device & 0xffff, c1, c2); | ||
2196 | else | ||
2197 | snprintf(rinfo->name, sizeof(rinfo->name), | ||
2198 | "ATI Radeon %x", ent->device & 0xffff); | ||
2199 | |||
2191 | rinfo->family = ent->driver_data & CHIP_FAMILY_MASK; | 2200 | rinfo->family = ent->driver_data & CHIP_FAMILY_MASK; |
2192 | rinfo->chipset = pdev->device; | 2201 | rinfo->chipset = pdev->device; |
2193 | rinfo->has_CRTC2 = (ent->driver_data & CHIP_HAS_CRTC2) != 0; | 2202 | rinfo->has_CRTC2 = (ent->driver_data & CHIP_HAS_CRTC2) != 0; |
@@ -2278,7 +2287,7 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, | |||
2278 | goto err_unmap_rom; | 2287 | goto err_unmap_rom; |
2279 | } | 2288 | } |
2280 | 2289 | ||
2281 | RTRACE("radeonfb (%s): mapped %ldk videoram\n", pci_name(rinfo->pdev), | 2290 | pr_debug("radeonfb (%s): mapped %ldk videoram\n", pci_name(rinfo->pdev), |
2282 | rinfo->mapped_vram/1024); | 2291 | rinfo->mapped_vram/1024); |
2283 | 2292 | ||
2284 | /* | 2293 | /* |
@@ -2373,7 +2382,7 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev, | |||
2373 | 2382 | ||
2374 | if (rinfo->bios_seg) | 2383 | if (rinfo->bios_seg) |
2375 | radeon_unmap_ROM(rinfo, pdev); | 2384 | radeon_unmap_ROM(rinfo, pdev); |
2376 | RTRACE("radeonfb_pci_register END\n"); | 2385 | pr_debug("radeonfb_pci_register END\n"); |
2377 | 2386 | ||
2378 | return 0; | 2387 | return 0; |
2379 | err_unmap_fb: | 2388 | err_unmap_fb: |