mips & gfxterm kludge
PATCH 1/1 mips & gfxterm kludge
Possible approach to solving mips / gfxterm kludge.
Comments?
Signature · 1 line
Robert Millan
=== modified file 'term/gfxterm.c'
gfxterm.c +1 -1
@@ -27,7 +27,7 @@#include <grub/bitmap.h> #include <grub/command.h> -#define DEFAULT_VIDEO_MODE "1024x600" +#define DEFAULT_VIDEO_MODE "640x480,800x600,1024x768,0x0"#define DEFAULT_BORDER_WIDTH 10#define DEFAULT_STANDARD_COLOR 0x07
=== modified file 'video/sm712.c'
sm712.c +16 -8
@@ -55,7 +55,7 @@ grub_video_sm712_video_fini (void) {if (framebuffer.mapped)grub_pci_device_unmap_range (framebuffer.dev, framebuffer.ptr, -1024 *600 *2 ); + framebuffer.mode_info.width * framebuffer.mode_info.height * (framebuffer.mode_info.depth /8 ));return grub_video_fb_fini (); }
@@ -68,7 +68,7 @@ grub_video_sm712_setup (unsigned int widgrub_err_t err;int found =0 ; - int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__ ((unused))) + int NESTED_FUNC_ATTR find_card (grub_pci_device_t dev, grub_pci_id_t pciid) {grub_pci_address_t addr;grub_uint32_t class;
@@ -92,8 +92,16 @@ grub_video_sm712_setup (unsigned int wid depth = (mode_type &GRUB_VIDEO_MODE_TYPE_DEPTH_MASK ) >>GRUB_VIDEO_MODE_TYPE_DEPTH_POS ; -if ((width !=1024 && width !=0 ) || (height !=600 && height !=0 ) - || (depth !=16 && depth !=0 )) +if (width ==0 ) + width =1024 ; + +if (height ==0 ) + height =600 ; + +if (depth ==0 ) + depth =16 ; + +if (width !=1024 || height !=600 || depth !=16 )return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET ,"Only 1024x600x16 is supported" );
@@ -107,10 +115,10 @@ grub_video_sm712_setup (unsigned int wid }/* Fill mode info details. */ - framebuffer.mode_info.width =1024 ; - framebuffer.mode_info.height =600 ; + framebuffer.mode_info.width = width; + framebuffer.mode_info.height = height; framebuffer.mode_info.mode_type =GRUB_VIDEO_MODE_TYPE_RGB ; - framebuffer.mode_info.bpp =16 ; + framebuffer.mode_info.bpp = depth; framebuffer.mode_info.bytes_per_pixel =2 ; framebuffer.mode_info.pitch =1024 *2 ; framebuffer.mode_info.number_of_colors =256 ;
@@ -126,7 +134,7 @@ grub_video_sm712_setup (unsigned int wid/* We can safely discard volatile attribute. */ framebuffer.ptr = (void *)grub_pci_device_map_range (framebuffer.dev, framebuffer.base, -1024 *600 *2 ); + width * height * (depth /8 )); framebuffer.mapped =1 ; err =grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target, &framebuffer.mode_info, framebuffer.ptr);
Quoted 5 lines · Robert Millan
Possible approach to solving mips / gfxterm kludge.
Comments?
It's already done cleanly when using some changes from gfxmenu branch (look at how it was solved in experimental)
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 8 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 5 lines · Robert Millan
Possible approach to solving mips / gfxterm kludge.
Comments?
It's already done cleanly when using some changes from gfxmenu branch (look at how it was solved in experimental)
Oh, ok.
Signature · 1 line
Robert Millan