All of lore.kernel.org
 help / color / mirror / Atom feed
* scrolling bug
@ 2010-02-14 12:26 Michal Suchanek
  2010-02-16 23:25 ` Michal Suchanek
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Suchanek @ 2010-02-14 12:26 UTC (permalink / raw)
  To: The development of GRUB 2

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

Hello

while trying to merge the recent changes with the framebuffer rotation
patches I found that terminal without a background picture does not
work for me in non-default directions.

I have not found the major issue which causes the part which is
scrolled to not get redrawn but I noticed that scrolling does not work
as expected - there is some off-by-one error in determining the
scrolled area which will likely cause memory adjacent to the render
target's framebuffer to be overwritten if the whole render target is
scrolled.

So far I have tracked this to r2112

Attaching a small patch which includes a crude visual scroll test in
the videotest command.

Before r2112 the area to the left is solid blue after (second)
scrolling but after the change the area is striped and right part of
the red frame is overwritten.

Thanks

Michal

[-- Attachment #2: scrolltest.patch --]
[-- Type: text/x-diff, Size: 1565 bytes --]

=== modified file 'commands/videotest.c'
--- commands/videotest.c	2010-02-03 00:24:07 +0000
+++ commands/videotest.c	2010-02-13 23:12:14 +0000
@@ -60,6 +60,45 @@
 
   grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY);
 
+#define BORDER 32
+#define INC1 2
+#define INC2 4
+  x += BORDER;
+  y += BORDER;
+  width -= 2* BORDER;
+  height -= 2* BORDER;
+  color = grub_video_map_rgb (255, 0, 0);
+  grub_video_fill_rect (color, x -1, y -1, width +2, height +2);
+  grub_video_set_viewport (x, y, width, height);
+
+  color = grub_video_map_rgb (0, 0, 0);
+  grub_video_fill_rect (color, 0, 0, width, height);
+
+  color = grub_video_map_rgb (0, 255, 0);
+  grub_video_fill_rect (color, BORDER, BORDER, width - 2* BORDER, height - 2* BORDER);
+  color = grub_video_map_rgb (0, 0, 0);
+  grub_video_fill_rect (color, BORDER + 1, BORDER + 1, width - 2* BORDER -2 , height - 2* BORDER -2);
+  color = grub_video_map_rgb (0, 255, 0);
+  grub_video_fill_rect (color, BORDER + 2, BORDER + 2, width - 2* BORDER -4 , height - 2* BORDER -4);
+
+  color = grub_video_map_rgb (0, 0, 255);
+
+  for(i=0; i<BORDER; i+= INC1)
+    grub_video_scroll(color, -INC1, 0);
+  grub_getkey();
+
+  for(i=0; i<BORDER; i+= INC2)
+    grub_video_scroll(color, INC2, 0);
+  grub_getkey();
+
+  for(i=0; i<BORDER; i+= INC1)
+    grub_video_scroll(color, 0, -INC1);
+  grub_getkey();
+
+  for(i=0; i<BORDER; i+= INC2)
+    grub_video_scroll(color, 0, INC2);
+  grub_getkey();
+
   color = grub_video_map_rgb (0, 0, 0);
   grub_video_fill_rect (color, 0, 0, width, height);
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-20 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-14 12:26 scrolling bug Michal Suchanek
2010-02-16 23:25 ` Michal Suchanek
2010-02-16 23:46   ` [patch] " Michal Suchanek
2010-02-20 10:16     ` Vladimir 'φ-coder/phcoder' Serbinenko

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.