Author: mcayland Date: Sat Jul 27 12:15:01 2013 New Revision: 1187 URL: http://tracker.coreboot.org/trac/openbios/changeset/1187
Log: video_common.c: remove init_video() function
Finally we now have a set of common video routines in video_common.c with per bus initialisers for SBus and PCI. Hence we can remove the now obsolete init_video() function.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/arch/sparc32/openbios.c trunk/openbios-devel/drivers/vga_vbe.c trunk/openbios-devel/include/libopenbios/video.h trunk/openbios-devel/libopenbios/video_common.c
Modified: trunk/openbios-devel/arch/sparc32/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc32/openbios.c Sat Jul 27 12:14:56 2013 (r1186) +++ trunk/openbios-devel/arch/sparc32/openbios.c Sat Jul 27 12:15:01 2013 (r1187) @@ -876,7 +876,6 @@ #ifdef CONFIG_DRIVER_SBUS #ifdef CONFIG_DEBUG_CONSOLE_VIDEO setup_video(hwdef->tcx_base + 0x00800000ULL, (unsigned long)vmem); - init_video(); #endif ob_sbus_init(hwdef->iommu_base + 0x1000ULL, qemu_machine_type); #endif
Modified: trunk/openbios-devel/drivers/vga_vbe.c ============================================================================== --- trunk/openbios-devel/drivers/vga_vbe.c Sat Jul 27 12:14:56 2013 (r1186) +++ trunk/openbios-devel/drivers/vga_vbe.c Sat Jul 27 12:15:01 2013 (r1187) @@ -27,6 +27,7 @@ #include "drivers/vga.h" #include "libopenbios/video.h" #include "libopenbios/ofmem.h" +#include "packages/video.h"
/* VGA init. We use the Bochs VESA VBE extensions */ #define VBE_DISPI_INDEX_ID 0x0 @@ -125,6 +126,7 @@ phys_addr_t phys; phandle_t ph, chosen, aliases, options; char buf[6]; + int size;
phys = fb;
@@ -152,6 +154,8 @@ set_int_property(ph, "linebytes", VIDEO_DICT_VALUE(video.rb)); set_int_property(ph, "address", (u32)(fb & ~0x0000000F));
+ molvideo_init(); + chosen = find_dev("/chosen"); push_str(path); fword("open-dev"); @@ -168,7 +172,6 @@
if (rom_size >= 8) { const char *p; - int size;
p = (const char *)rom; if (p[0] == 'N' && p[1] == 'D' && p[2] == 'R' && p[3] == 'V') { @@ -178,5 +181,11 @@ } }
- init_video(); +#if defined(CONFIG_OFMEM) && defined(CONFIG_DRIVER_PCI) + size = ((VIDEO_DICT_VALUE(video.h) * VIDEO_DICT_VALUE(video.rb)) + 0xfff) & ~0xfff; + + ofmem_claim_phys( video.mphys, size, 0 ); + ofmem_claim_virt( VIDEO_DICT_VALUE(video.mvirt), size, 0 ); + ofmem_map( video.mphys, VIDEO_DICT_VALUE(video.mvirt), size, ofmem_arch_io_translation_mode(video.mphys) ); +#endif }
Modified: trunk/openbios-devel/include/libopenbios/video.h ============================================================================== --- trunk/openbios-devel/include/libopenbios/video.h Sat Jul 27 12:14:56 2013 (r1186) +++ trunk/openbios-devel/include/libopenbios/video.h Sat Jul 27 12:15:01 2013 (r1187) @@ -20,7 +20,6 @@ #define VGA_DEFAULT_LINEBYTES (VGA_DEFAULT_WIDTH*((VGA_DEFAULT_DEPTH+7)/8))
void setup_video(phys_addr_t phys, ucell virt); -void init_video(void); unsigned long video_get_color(int col_ind); void video_set_color(int ind, unsigned long color); void video_mask_blit(void); @@ -28,8 +27,6 @@ void video_fill_rect(void);
extern struct video_info { - int has_video; - volatile ihandle_t *ih; volatile phys_addr_t mphys; volatile ucell *mvirt;
Modified: trunk/openbios-devel/libopenbios/video_common.c ============================================================================== --- trunk/openbios-devel/libopenbios/video_common.c Sat Jul 27 12:14:56 2013 (r1186) +++ trunk/openbios-devel/libopenbios/video_common.c Sat Jul 27 12:15:01 2013 (r1187) @@ -31,7 +31,7 @@ video_get_color( int col_ind ) { unsigned long col; - if( !video.has_video || col_ind < 0 || col_ind > 255 ) + if( !VIDEO_DICT_VALUE(video.ih) || col_ind < 0 || col_ind > 255 ) return 0; if( VIDEO_DICT_VALUE(video.depth) == 8 ) return col_ind; @@ -48,7 +48,7 @@ { xt_t hw_xt = 0;
- if( !video.has_video || ind < 0 || ind > 255 ) + if( !VIDEO_DICT_VALUE(video.ih) || ind < 0 || ind > 255 ) return; video.pal[ind] = color;
@@ -138,7 +138,7 @@ bgcolor = video_get_color(bgcolor); fgcolor = video_get_color(fgcolor);
- if (!video.has_video || x < 0 || y < 0 || w <= 0 || h <= 0 || + if (!VIDEO_DICT_VALUE(video.ih) || x < 0 || y < 0 || w <= 0 || h <= 0 || x + w > VIDEO_DICT_VALUE(video.w) || y + h > VIDEO_DICT_VALUE(video.h)) return;
@@ -190,7 +190,7 @@ char *pp; unsigned long col = video_get_color(col_ind);
- if (!video.has_video || x < 0 || y < 0 || w <= 0 || h <= 0 || + if (!VIDEO_DICT_VALUE(video.ih) || x < 0 || y < 0 || w <= 0 || h <= 0 || x + w > VIDEO_DICT_VALUE(video.w) || y + h > VIDEO_DICT_VALUE(video.h)) return;
@@ -279,36 +279,3 @@ } #endif } - -void -init_video(void) -{ -#if defined(CONFIG_OFMEM) && defined(CONFIG_DRIVER_PCI) - int size; -#endif - phandle_t ph=0, saved_ph=0; - - saved_ph = get_cur_dev(); - while( (ph=dt_iterate_type(ph, "display")) ) { - video.has_video = 1; - - set_int_property( ph, "width", VIDEO_DICT_VALUE(video.w) ); - set_int_property( ph, "height", VIDEO_DICT_VALUE(video.h) ); - set_int_property( ph, "depth", VIDEO_DICT_VALUE(video.depth) ); - set_int_property( ph, "linebytes", VIDEO_DICT_VALUE(video.rb) ); - set_int_property( ph, "address", VIDEO_DICT_VALUE(video.mvirt) ); - - activate_dev(ph); - - molvideo_init(); - } - activate_dev(saved_ph); - -#if defined(CONFIG_OFMEM) && defined(CONFIG_DRIVER_PCI) - size = ((VIDEO_DICT_VALUE(video.h) * VIDEO_DICT_VALUE(video.rb)) + 0xfff) & ~0xfff; - - ofmem_claim_phys( video.mphys, size, 0 ); - ofmem_claim_virt( VIDEO_DICT_VALUE(video.mvirt), size, 0 ); - ofmem_map( video.mphys, VIDEO_DICT_VALUE(video.mvirt), size, ofmem_arch_io_translation_mode(video.mphys) ); -#endif -}