All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [RFC] Framebuffer rotation patch
Date: Thu, 11 Feb 2010 03:46:26 +0100	[thread overview]
Message-ID: <4B736F82.7010005@gmail.com> (raw)
In-Reply-To: <a5d587fb0908280103s1aa2dc21gf0f6363d3bbdec6d@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3404 bytes --]

Michal Suchanek wrote:
> Hello
>
> Sending a preliminary framebuffer rotation patch.
>
> You can use videotest to see 4 tiles rotated from the same bitmap data.
>
>   
+char leaf_data[] = { 0x00, 0x0f, 0xe0, 0x00,
+                     0x00, 0x7f, 0xfc, 0x00,
+                     0x01, 0xff, 0xff, 0x00,
+                     0x03, 0xff, 0xff, 0x80,
This is a blob. Could it be generated automatically at build time?
+
+  sans = grub_font_get ("Helvetica Bold 14");
Please use free font rather than Helvetica
Could you split addition of videotests from the rest of the patch?
-    unsigned int x;
-    unsigned int y;
-    unsigned int width;
-    unsigned int height;
+    int x;
+    int y;
+    int width;
+    int height;
Why do you need negative values?
+/* Supported operations are simple and easy to understand.
+ * MIRROR  |  swap image across (around) the vertical axis
+ * FLIP    -  swap image across the horizontal axis - upside down
+ * SWAP    /  swap image across the x=y axis - swap the x and y coordinates
It's just a D_8 group. Could you add a comment to functions what they do
in group theoretical sense? It would make the code easier to follow and
compute transformations for mathematicians. Perhaps another
representation of D_8 would result in more efficient code?
+static inline void grub_swap_int(int *a, int *b) { int tmp = *a; *a =
*b; *b = tmp; }
+static inline void grub_swap_unsigned(unsigned *a, unsigned *b) {
unsigned tmp = *a; *a = *b; *b = tmp; }
+
With typeof macro this can be made type-neutral avoiding potential mistakes.
+static inline long
+grub_min (long x, long y)
+{
+  if (x > y)
+    return y;
+  else
+    return x;
+}
+
Same here
+
+  int transform;
I would prefer an enum
Skipping term/gfxterm.c since it has to be adjusted for gfxmenu-related
gfxterm.c updates.
-         set_pixel (dst, x + i, y + j, dst_color);
-       }
+          if (transform & FB_TRAN_SWAP)
+            set_pixel (dst, x + j*dy, y + i*dx, dst_color);
+          else
+            set_pixel (dst, x + i*dx, y + j*dy, dst_color);
+        }
Could you split it into 4 functions? I understand it's the slow fallback
function but still it should be kept as fast as possible. Perhaps you
could consider compiling same file with different #define's to obtain
function variants
 grub_err_t
-grub_video_fb_set_viewport (unsigned int x, unsigned int y,
-                           unsigned int width, unsigned int height)
+grub_video_fb_set_viewport (int x, int y, int width, int height)
 {
You don't check for x < 0 and y < 0
> Known issues:
>
> - font glyphs and terminal do not rotate properly
> - no accelerated blitters for rotated modes, at least the 1bit blitter
> should work
>
>   
> To be done
>
> - split out signed rectangle patch that changes graphics coordinates
> from unsigned to signed
> - make up some naming scheme and rename functions and macros accordingly
> - make up some acceptable way to specify framebnuffer rotation in the
> environment like gfxmode
>
> Thanks
>
> Michal
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel


-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 293 bytes --]

  parent reply	other threads:[~2010-02-11  2:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28  8:03 [RFC] Framebuffer rotation patch Michal Suchanek
2009-08-29 10:24 ` Michal Suchanek
2010-02-11  2:46 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2010-02-11 10:19   ` Michal Suchanek
2010-02-11 10:52     ` Michal Suchanek
2010-02-11 16:11       ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-11 16:08     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-13 17:29       ` Michal Suchanek
2010-02-15 17:05         ` [RFC] Framebuffer rotation patch, or why 'unsigned' fails us Colin D Bennett
2010-02-15 18:14           ` Michal Suchanek
2010-02-15 18:35             ` Colin D Bennett
2010-02-16 12:35             ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 20:53               ` Michal Suchanek
2010-02-16 12:32         ` [RFC] Framebuffer rotation patch Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 15:52           ` Michal Suchanek
2010-02-16 18:03             ` Isaac Dupree
2010-02-16 18:15               ` richardvoigt
2010-02-16 18:47                 ` [Off-topic] C++ enums Isaac Dupree
2010-02-16 16:08   ` [RFC] Framebuffer rotation patch Michal Suchanek
2010-02-16 16:21     ` Vladimir 'φ-coder/phcoder' Serbinenko
2010-02-16 21:05       ` Michal Suchanek
2010-02-16 21:14         ` richardvoigt
2010-02-16 23:19           ` Michal Suchanek
2010-02-16 21:53         ` Michal Suchanek

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=4B736F82.7010005@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /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.