Skip to contentSkip to conversation

menu_entry: Disable cursor during update_screen()

PATCH Applied Thomas Huth 2 participants 7 messages Jan 29, 2016 – Feb 22, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 menu_entry: Disable cursor during update_screen()

When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen().

---
 grub-core/normal/menu_entry.c | 4 ++++
 1 file changed, 4 insertions(+)
grub-core/normal/menu_entry.c +4 -0
index 62c7e16..68359eb 100644
@@ -250,6 +250,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
       mode = ALL_LINES;
     }
 
+  grub_term_setcursor (term_screen->term, 0);
+
   if (mode != NO_LINE)
     {
       /* Draw lines. This code is tricky, because this must calculate logical
@@ -357,6 +359,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
 
     }
 
+  grub_term_setcursor (term_screen->term, 1);
+
   grub_term_refresh (term_screen->term);
 }
 
Signature · 1 line
1.8.3.1
#1 lore raw

29.01.2016 17:26, Thomas Huth пишет:

Quoted 9 lines

When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen().

While it looks OK - any reason it is not present in Fedora grub2 GIT?

Quoted 28 lines
---
 grub-core/normal/menu_entry.c | 4 ++++
 1 file changed, 4 insertions(+)
grub-core/normal/menu_entry.c +4 -0
index 62c7e16..68359eb 100644
@@ -250,6 +250,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
       mode = ALL_LINES;
     }
 
+  grub_term_setcursor (term_screen->term, 0);
+
   if (mode != NO_LINE)
     {
       /* Draw lines. This code is tricky, because this must calculate logical
@@ -357,6 +359,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
 
     }
 
+  grub_term_setcursor (term_screen->term, 1);
+
   grub_term_refresh (term_screen->term);
 }
 
#2 lore raw

Hi,

Quoted 11 lines · Andrei Borzenkov

29.01.2016 17:26, Thomas Huth пишет:

Quoted 9 lines

When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen().

Quoted 1 line

While it looks OK - any reason it is not present in Fedora grub2 GIT?

Sorry, I didn't quite got your question ... do you mean the problem can not be seen with the version from Fedora? If so, how did you start QEMU to run the guest?

Thomas

#3 lore raw

31.01.2016 18:02, Thomas Huth пишет:

Quoted 14 lines

Hi,

Quoted 11 lines · Andrei Borzenkov

29.01.2016 17:26, Thomas Huth пишет:

Quoted 9 lines

When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen().

Quoted 6 lines
Quoted 1 line

While it looks OK - any reason it is not present in Fedora grub2 GIT?

Sorry, I didn't quite got your question ... do you mean the problem can not be seen with the version from Fedora? If so, how did you start QEMU to run the guest?

I usually expect that patches from distributions initially appear in distribution packages, so I was surprised that I could not see it in Fedora package.

#4 lore raw

Hi Andrei,

Quoted 15 lines · Andrei Borzenkov

31.01.2016 18:02, Thomas Huth пишет:

Quoted 14 lines · Andrei Borzenkov
Quoted 11 lines

29.01.2016 17:26, Thomas Huth пишет:

Quoted 8 lines

When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen().

While it looks OK - any reason it is not present in Fedora grub2 GIT?

Quoted 7 lines
Quoted 3 lines

Sorry, I didn't quite got your question ... do you mean the problem can not be seen with the version from Fedora? If so, how did you start QEMU to run the guest?

I usually expect that patches from distributions initially appear in distribution packages, so I was surprised that I could not see it in Fedora package.

Ah, ok, simple answer: Although I'm working for Red Hat, I am not involved in the Fedora project (yet). And the problem with the cursor during update_screen() has been found while testing RHEL, not Fedora, so discussing this issue directly upstream here seems to make more sense for me (and if the patch is fine for you and it gets included, Fedora will automatically benefit from this, too, once they update to a new version of grub).

Regards,
Thomas

#5 lore raw
In reply to Andrei Borzenkov
Quoted 29 lines · Thomas Huth
Quoted 29 lines

When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen().

---
 grub-core/normal/menu_entry.c | 4 ++++
 1 file changed, 4 insertions(+)
grub-core/normal/menu_entry.c +2 -0
index 62c7e16..68359eb 100644
@@ -250,6 +250,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
       mode = ALL_LINES;
     }
 
+  grub_term_setcursor (term_screen->term, 0);
+
   if (mode != NO_LINE)
     {
       /* Draw lines. This code is tricky, because this must calculate logical
@@ -357,6 +359,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
 
Quoted 6 lines

grub-core/normal/menu_entry.c update_screen (struct screen *screen, struct per_term_screen *term_screen, · line 365

Quoted 6 lines
grub-core/normal/menu_entry.c +2 -0
     }
 
+  grub_term_setcursor (term_screen->term, 1);
+
   grub_term_refresh (term_screen->term);
 }

Ping?

#6 lore raw
In reply to Thomas Huth

29.01.2016 17:26, Thomas Huth пишет:

Quoted 9 lines

When running grub in a VGA console of a KVM pseries guest on PowerPC, you can see the cursor sweeping over the whole line when entering a character in editor mode. This is visible because grub always refreshes the whole line when entering a character in editor mode, and drawing characters is quite a slow operation with the firmware used for the powerpc pseries guests (SLOF).
To avoid this ugliness, the cursor should be disabled when refreshing the screen contents during update_screen().

Applied, thanks!

Quoted 28 lines
---
 grub-core/normal/menu_entry.c | 4 ++++
 1 file changed, 4 insertions(+)
grub-core/normal/menu_entry.c +4 -0
index 62c7e16..68359eb 100644
@@ -250,6 +250,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
       mode = ALL_LINES;
     }
 
+  grub_term_setcursor (term_screen->term, 0);
+
   if (mode != NO_LINE)
     {
       /* Draw lines. This code is tricky, because this must calculate logical
@@ -357,6 +359,8 @@ update_screen (struct screen *screen, struct per_term_screen *term_screen,
 
     }
 
+  grub_term_setcursor (term_screen->term, 1);
+
   grub_term_refresh (term_screen->term);
 }