* [PATCH] mips & gfxterm kludge
@ 2009-12-13 21:01 Robert Millan
2009-12-13 22:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 3+ messages in thread
From: Robert Millan @ 2009-12-13 21:01 UTC (permalink / raw)
To: grub-devel; +Cc: Vladimir Serbinenko
[-- Attachment #1: Type: text/plain, Size: 83 bytes --]
Possible approach to solving mips / gfxterm kludge.
Comments?
--
Robert Millan
[-- Attachment #2: mips_gfxterm.diff --]
[-- Type: text/x-diff, Size: 2678 bytes --]
=== modified file 'term/gfxterm.c'
--- term/gfxterm.c 2009-10-24 19:01:27 +0000
+++ term/gfxterm.c 2009-12-13 20:37:57 +0000
@@ -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'
--- video/sm712.c 2009-12-02 10:48:10 +0000
+++ video/sm712.c 2009-12-13 20:33:44 +0000
@@ -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 wid
grub_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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mips & gfxterm kludge
2009-12-13 21:01 [PATCH] mips & gfxterm kludge Robert Millan
@ 2009-12-13 22:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-13 22:49 ` Robert Millan
0 siblings, 1 reply; 3+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2009-12-13 22:05 UTC (permalink / raw)
To: Robert Millan; +Cc: grub-devel
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
Robert Millan wrote:
> 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)
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mips & gfxterm kludge
2009-12-13 22:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2009-12-13 22:49 ` Robert Millan
0 siblings, 0 replies; 3+ messages in thread
From: Robert Millan @ 2009-12-13 22:49 UTC (permalink / raw)
To: Vladimir 'φ-coder/phcoder' Serbinenko; +Cc: grub-devel
On Sun, Dec 13, 2009 at 11:05:50PM +0100, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> Robert Millan wrote:
> > 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.
--
Robert Millan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-13 22:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-13 21:01 [PATCH] mips & gfxterm kludge Robert Millan
2009-12-13 22:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-13 22:49 ` Robert Millan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.