All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH] mips & gfxterm kludge
Date: Sun, 13 Dec 2009 22:01:04 +0100	[thread overview]
Message-ID: <20091213210104.GA30191@thorin> (raw)

[-- 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);


             reply	other threads:[~2009-12-13 21:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-13 21:01 Robert Millan [this message]
2009-12-13 22:05 ` [PATCH] mips & gfxterm kludge Vladimir 'φ-coder/phcoder' Serbinenko
2009-12-13 22:49   ` Robert Millan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091213210104.GA30191@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    --cc=phcoder@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.