diff options
author | Jerome Glisse <glisse@freedesktop.org> | 2007-07-02 19:50:23 +0200 |
---|---|---|
committer | Jerome Glisse <glisse@freedesktop.org> | 2007-07-02 19:50:23 +0200 |
commit | 8a6fb613d6f18d33aef84460fac0fe59bc00f729 (patch) | |
tree | c445426b0a8dd2756d6b9d045d66cb5f9ca5c24c /xorg | |
parent | 214b9f80bf2b4935df8890cb9c6bb9aeb807ba80 (diff) |
avivo: code cleanup.
Diffstat (limited to 'xorg')
-rw-r--r-- | xorg/avivo.c | 19 | ||||
-rw-r--r-- | xorg/avivo_bios.c | 2 | ||||
-rw-r--r-- | xorg/avivo_common.c | 44 | ||||
-rw-r--r-- | xorg/avivo_output.c | 4 | ||||
-rw-r--r-- | xorg/avivo_state.c | 4 |
5 files changed, 35 insertions, 38 deletions
diff --git a/xorg/avivo.c b/xorg/avivo.c index 1514258..2127e9d 100644 --- a/xorg/avivo.c +++ b/xorg/avivo.c @@ -74,9 +74,6 @@ static void avivo_adjust_frame(int index, int x, int y, int flags); static void avivo_free_screen(int index, int flags); static void avivo_free_info(ScrnInfoPtr screen_info); -static void avivo_dpms(ScrnInfoPtr screen_info, int mode, int flags); - - /* * This contains the functions needed by the server after loading the * driver module. It must be supplied, and gets added the driver list by @@ -136,7 +133,6 @@ static int avivo_map_ctrl_mem(ScrnInfoPtr screen_info) { struct avivo_info *avivo = avivo_get_info(screen_info); - int i; if (avivo->ctrl_base) return 1; @@ -161,7 +157,6 @@ static int avivo_map_fb_mem(ScrnInfoPtr screen_info) { struct avivo_info *avivo = avivo_get_info(screen_info); - int i = 0; if (avivo->fb_base) return 0; @@ -285,7 +280,6 @@ avivo_pci_probe(DriverPtr drv, int entity_num, struct pci_device *dev, static Bool avivo_old_probe(DriverPtr drv, int flags) { - struct avivo_info avivo; ScrnInfoPtr screen_info = NULL; GDevPtr *sections; Bool found_screen = FALSE; @@ -344,12 +338,7 @@ avivo_free_info(ScrnInfoPtr screen_info) static Bool avivo_preinit(ScrnInfoPtr screen_info, int flags) { - xf86CrtcConfigPtr config; struct avivo_info *avivo; - DisplayModePtr mode; - ClockRangePtr clock_ranges; - xf86MonPtr monitor; - char *mod = NULL; int i; Gamma gzeros = { 0.0, 0.0, 0.0 }; rgb rzeros = { 0, 0, 0 }; @@ -521,7 +510,7 @@ avivo_screen_init(int index, ScreenPtr screen, int argc, char **argv) struct avivo_info *avivo = avivo_get_info(screen_info); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(screen_info); VisualPtr visual; - int flags, i; + int i; unsigned int mc_memory_map; unsigned int mc_memory_map_end; @@ -532,7 +521,7 @@ avivo_screen_init(int index, ScreenPtr screen, int argc, char **argv) mc_memory_map_end = ((avivo->fb_addr + avivo->fb_size) >> 16) - 1; mc_memory_map |= (mc_memory_map_end << AVIVO_MC_MEMORY_MAP_END_SHIFT) & AVIVO_MC_MEMORY_MAP_END_MASK; - radeon_set_mc(screen_info, AVIVO_MC_MEMORY_MAP, mc_memory_map); + avivo_set_mc(screen_info, AVIVO_MC_MEMORY_MAP, mc_memory_map); OUTREG(AVIVO_VGA_MEMORY_BASE, (avivo->fb_addr >> 16) & AVIVO_MC_MEMORY_MAP_BASE_MASK); OUTREG(AVIVO_VGA_FB_START, avivo->fb_addr); @@ -723,7 +712,9 @@ avivo_close_screen(int index, ScreenPtr screen) struct avivo_info *avivo = avivo_get_info(screen_info); avivo_restore_state(screen_info); - + avivo_unmap_ctrl_mem(screen_info); + avivo_unmap_fb_mem(screen_info); + screen->CloseScreen = avivo->close_screen; return screen->CloseScreen(index, screen); } diff --git a/xorg/avivo_bios.c b/xorg/avivo_bios.c index 5f979e9..3eaadf3 100644 --- a/xorg/avivo_bios.c +++ b/xorg/avivo_bios.c @@ -185,6 +185,8 @@ avivo_output_setup(ScrnInfoPtr screen_info) if (!avivo_output_exist(screen_info, type, number, ddc_reg)) avivo_output_init(screen_info, type, number, ddc_reg); break; + default: + break; } } } diff --git a/xorg/avivo_common.c b/xorg/avivo_common.c index 43ee6f0..3f6855c 100644 --- a/xorg/avivo_common.c +++ b/xorg/avivo_common.c @@ -32,11 +32,11 @@ #include "radeon_reg.h" void -radeon_set_indexed(ScrnInfoPtr screen_info, - unsigned int index_offset, - unsigned int data_offset, - unsigned int offset, - unsigned int value) +avivo_set_indexed(ScrnInfoPtr screen_info, + unsigned int index_offset, + unsigned int data_offset, + unsigned int offset, + unsigned int value) { struct avivo_info *avivo = avivo_get_info(screen_info); @@ -45,10 +45,10 @@ radeon_set_indexed(ScrnInfoPtr screen_info, } unsigned int -radeon_get_indexed(ScrnInfoPtr screen_info, - unsigned int index_offset, - unsigned int data_offset, - unsigned int offset) +avivo_get_indexed(ScrnInfoPtr screen_info, + unsigned int index_offset, + unsigned int data_offset, + unsigned int offset) { struct avivo_info *avivo = avivo_get_info(screen_info); @@ -57,24 +57,24 @@ radeon_get_indexed(ScrnInfoPtr screen_info, } unsigned int -radeon_get_mc(ScrnInfoPtr screen_info, unsigned int offset) +avivo_get_mc(ScrnInfoPtr screen_info, unsigned int offset) { - return radeon_get_indexed(screen_info, - AVIVO_MC_INDEX, - AVIVO_MC_DATA, - offset | 0x007f0000); + return avivo_get_indexed(screen_info, + AVIVO_MC_INDEX, + AVIVO_MC_DATA, + offset | 0x007f0000); } void -radeon_set_mc(ScrnInfoPtr screen_info, - unsigned int offset, - unsigned int value) +avivo_set_mc(ScrnInfoPtr screen_info, + unsigned int offset, + unsigned int value) { - radeon_set_indexed(screen_info, - AVIVO_MC_INDEX, - AVIVO_MC_DATA, - offset | 0x00ff0000, - value); + avivo_set_indexed(screen_info, + AVIVO_MC_INDEX, + AVIVO_MC_DATA, + offset | 0x00ff0000, + value); } struct avivo_info * diff --git a/xorg/avivo_output.c b/xorg/avivo_output.c index 7e697c1..c10b916 100644 --- a/xorg/avivo_output.c +++ b/xorg/avivo_output.c @@ -167,6 +167,8 @@ avivo_output_dpms(xf86OutputPtr output, int mode) OUTREG(AVIVO_TMDS1_CNTL + avivo_output->output_offset, value5); break; } + default: + break; } } @@ -344,6 +346,8 @@ avivo_output_init(ScrnInfoPtr screen_info, xf86ConnectorType type, case XF86ConnectorDVI_A: avivo_output->output_offset = AVIVO_TMDS2_CNTL - AVIVO_TMDS1_CNTL; break; + default: + break; } } if (avivo_output->type == XF86ConnectorLFP) { diff --git a/xorg/avivo_state.c b/xorg/avivo_state.c index 56bbf94..21f5541 100644 --- a/xorg/avivo_state.c +++ b/xorg/avivo_state.c @@ -73,7 +73,7 @@ avivo_restore_state(ScrnInfoPtr screen_info) struct avivo_info *avivo = avivo_get_info(screen_info); struct avivo_state *state = &avivo->saved_state; - radeon_set_mc(screen_info, AVIVO_MC_MEMORY_MAP, state->mc_memory_map); + avivo_set_mc(screen_info, AVIVO_MC_MEMORY_MAP, state->mc_memory_map); OUTREG(AVIVO_VGA_MEMORY_BASE, state->vga_memory_base); OUTREG(AVIVO_VGA_FB_START, state->vga_fb_start); OUTREG(AVIVO_VGA_MYSTERY0, state->vga_mystery0); @@ -198,7 +198,7 @@ avivo_save_state(ScrnInfoPtr screen_info) avivo_save_cursor(screen_info); - state->mc_memory_map = radeon_get_mc(screen_info, AVIVO_MC_MEMORY_MAP); + state->mc_memory_map = avivo_get_mc(screen_info, AVIVO_MC_MEMORY_MAP); state->vga_memory_base = INREG(AVIVO_VGA_MEMORY_BASE); state->vga_fb_start = INREG(AVIVO_VGA_FB_START); state->vga_mystery0 = INREG(AVIVO_VGA_MYSTERY0); |