New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 602793 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Apr 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

verified boot invokes screen refreshes unnecessarily

Project Member Reported by vbendeb@chromium.org, Apr 12 2016

Issue description


When a device sits in recovery mode waiting for boot media to be plugged in, it periodically polls USB/SD/etc ports to see if a new storage device was plugged in.

In every poll cycle it invokes the vbDisplayScreen() function, which re-draws the screen. This is unnecessary, could cause flickering on some slow devices.


the below patch is one way of fixing the problem:


diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index c336278..b8e0830 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -499,6 +499,7 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
 {
        VbSharedDataHeader *shared =
                (VbSharedDataHeader *)cparams->shared_data_blob;
+       uint32_t previous_retval = VBERROR_SUCCESS;
        uint32_t retval;
        uint32_t key;
        int i;
@@ -552,10 +553,14 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
                if (VBERROR_SUCCESS == retval)
                        break; /* Found a recovery kernel */
 
-               VbDisplayScreen(cparams, VBERROR_NO_DISK_FOUND == retval ?
-                               VB_SCREEN_RECOVERY_INSERT :
-                               VB_SCREEN_RECOVERY_NO_GOOD,
-                               0, &vnc);
+               if (retval != previous_retval) {
+                       previous_retval = retval;
+                       VbDisplayScreen(cparams,
+                                       VBERROR_NO_DISK_FOUND == retval ?
+                                       VB_SCREEN_RECOVERY_INSERT :
+                                       VB_SCREEN_RECOVERY_NO_GOOD,
+                                       0, &vnc);
+               }
 
                /*
                 * Scan keyboard more frequently than media, since x86



it was considered not comprehensive enough.

 
 
Status: Assigned (was: Unconfirmed)
Originally, VbDisplayScreen had a check to prevent redisplaying the current screen, and a force parameter which overrides the check.

When we refactored that to VbDisplayScreenLegacy(), the new VbDisplayScreen() wrapper did not maintain that check.

The check should move out of VbDisplayScreenLegacy() to VbDisplayScreen().

(Alternately, if we want to use the suggestion above, then we should simplify VbDisplayScreen() to get rid of the force parameter, since it's meaningless if VbDisplayScreen() always redisplays.)
ah, I missed the part about the extra parameter. Not a big deal either way, just annoying when you look at the console or at a half working display :)
Cc: rspangler@chromium.org
Owner: dnojiri@chromium.org
It often happens after Deep Resetting the Chromebook.
Project Member

Comment 5 by bugdroid1@chromium.org, Apr 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/ff9c2b2e8b49a948ecc6ca640a0400450fd16f4f

commit ff9c2b2e8b49a948ecc6ca640a0400450fd16f4f
Author: Daisuke Nojiri <dnojiri@chromium.org>
Date: Thu Apr 21 21:54:45 2016

vboot: Save last screen ID

This patch makes VbDisplayScreen remember the last successfully displayed
screen and skip rendering if the same screen is requested.

When locale is changed, VbCheckDisplayKey calls VbDisplayScreen with force=1,
which makes VbDisplayScreen render the requested screen regardless of the
saved screen ID.

BUG= chromium:602793 
BRANCH=tot
TEST=emerge-veyron_jerry vboot_reference chromeos-bootimage

Change-Id: I31c4dde4ff060081f14224a93d57e9b76fcac1db
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/340264
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>

[modify] https://crrev.com/ff9c2b2e8b49a948ecc6ca640a0400450fd16f4f/firmware/lib/vboot_display.c

Status: Fixed (was: Assigned)
Labels: VerifyIn-52
Labels: VerifyIn-53
Labels: VerifyIn-54

Comment 10 by ka...@chromium.org, Aug 31 2016

Labels: Bulk-Verified
Status: Verified (was: Fixed)

Sign in to add a comment