2 years agoallow for out-of-tree builds 58/48858/2 factory-4128.B factory-4290.B factory-4455.B factory-pit-4280.B factory-pit-4390.B factory-pit-4471.B factory-spring-4131.B factory-spring-4262.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-pit-4482.B firmware-wolf-4389.24.B master release-R28-4100.B release-R29-4319.B release-R30-4537.B stabilize-4068.0.B stabilize-4100.38.B stabilize-4255.B stabilize-4287.B stabilize-4443.B stabilize-4512.B stabilize-spring-4100.53.B toolchainB
Mike Frysinger [Tue, 23 Apr 2013 00:50:08 +0000 (20:50 -0400)]
allow for out-of-tree builds

This adds a few missing build vars to the compile and makes it
so the code can be compiled out-of-tree.

TEST=`emerge-x86-alex ply-image` still works

Change-Id: Ifbec0b8706523c6ec61751f20d8fc874f76c97bb
Reviewed-by: Daniel Erat <>
Commit-Queue: Mike Frysinger <>
Tested-by: Mike Frysinger <>
2 years agopull in stddef.h for NULL 57/48857/2
Mike Frysinger [Tue, 23 Apr 2013 00:27:50 +0000 (20:27 -0400)]
pull in stddef.h for NULL

This file uses NULL, but doesn't include headers for it.  It works
currently as the headers it does pull in happen to pull in the right
headers eventually.  Make it explicit to fix building with newer
kernel headers.

TEST=`emerge-x86-alex ply-image` still works

Change-Id: I7c1f7096370085956cd9e5f7a2cf9b7de72e5247
Reviewed-by: Daniel Erat <>
Commit-Queue: Mike Frysinger <>
Tested-by: Mike Frysinger <>
2 years agoUse visible size when filling frame buffer 55/38655/3 factory-3536.B factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B release-R25-3428.B release-R26-3701.B release-R27-3912.B stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-3881.0.B stabilize-3912.79.B stabilize-4008.0.B stabilize-4035.0.B stabilize-bluetooth-smart stabilize2 toolchain-3428.65.B toolchain-3701.42.B toolchainA
Simon Que [Mon, 26 Nov 2012 19:57:13 +0000 (11:57 -0800)]
Use visible size when filling frame buffer

The buffer pixel area is based on nominal framebuffer size rather than
visible area.  On systems like Link, the internal panel size is greater
than the external display size, but the nominal framebuffer size is the
latter.  This means the amount of memory mapping covers a smaller area
than what is actually needed to fill the internal panel.

This patch updates the fill frame buffer code to use the visible area,
which correctly reflects the size of the internal panel.

TEST=Boot link and daisy with external monitor attached. make sure the
splash screen is fully white.

Change-Id: I6cacef64dfc4542fab7c87ae6613d78929f497a9
Signed-off-by: Simon Que <>
Reviewed-by: Stéphane Marchesin <>
2 years agoGet true visible area when querying frame buffer device 00/38500/5
Simon Que [Thu, 22 Nov 2012 00:14:37 +0000 (16:14 -0800)]
Get true visible area when querying frame buffer device

The visible area is obtained by calling ply_monitor_setup().  This is
the area that represents the actual screen size.

TEST=Plug in external HDMI monitor on Daisy, boot up, splash screen
should be centered.

Change-Id: Ia71c6f49050bdbe6c3e5c51c6b79bf8b33bb9298
Signed-off-by: Simon Que <>
Reviewed-by: Stéphane Marchesin <>
2 years agoply-image: Attempt to improve animation consistency. 33/38433/3
Daniel Erat [Wed, 21 Nov 2012 00:10:39 +0000 (16:10 -0800)]
ply-image: Attempt to improve animation consistency.

When displaying an animation, ply-image previously slept
before loading and displaying each image.  The code was
written such that intervals between frames would be
reasonably consistent when faced with consistent load times
for each image, but less so for inconsistent load times.

This change makes ply-image load the next image before
sleeping the required amount and displaying the image.

In my testing, this leads to very consistent frame intervals
during boot on Lumpy -- out of 18 frames, all but one or two
are shown 25 ms after the previous frame and the others are
all 26 ms.  Doing the same testing with the old code, I see
intervals ranging between 22 and 29 ms.

TEST=update /etc/init/boot-splash.conf to pass --debug to
     ply-image and to redirect stderr to a file in /tmp;
     after booting, grep it for "showing" and check

Change-Id: Ibb82f8d38d8a19dce555028f9288b70789362edb
Commit-Ready: Daniel Erat <>
Reviewed-by: Daniel Erat <>
Tested-by: Daniel Erat <>
2 years agoply-image: Separate image loading and displaying. 95/38395/3
Daniel Erat [Tue, 20 Nov 2012 18:20:31 +0000 (10:20 -0800)]
ply-image: Separate image loading and displaying.

This renames ply_frame_buffer_show_file() to
ply_frame_buffer_show_image() and makes process_images()
make a separate call to load each image that it wants to
display.  No functional changes intended apart from a debug
logging message; I'm just doing this to enable more
fine-grained benchmarking and make it possible to
preemptively load the next image.

TEST=boot animation still works on lumpy

Change-Id: I53fbe9b2a01ce54377061400829f7c77aea11f46
Reviewed-by: Simon Que <>
Reviewed-by: Stéphane Marchesin <>
Commit-Ready: Daniel Erat <>
Tested-by: Daniel Erat <>
2 years agoOnly display the splash screen on the main monitor.
Stéphane Marchesin [Mon, 22 Oct 2012 22:07:06 +0000 (15:07 -0700)]
Only display the splash screen on the main monitor.

Before this change, we always displayed the splash screen on all
connected monitors. When their resolutions mismatch, this looks ugly.

As per bug chromium-os:34066, we now want the splash screen to only
display on one monitor. To do that, we call into the KMS API to probe
the monitor state, pick a main monitor (LVDS, eDP, or the first
connected one we find), and disable all non-main monitors.

This behaviour is the default, and can be disabled with the new
--no-set-monitors flag.

TEST=by hand, the splash screen only happens on the main monitor.

Change-Id: I63803311f41a64f3ab26c54a4d72bfe0dd2b374d
Reviewed-by: Stéphane Marchesin <>
Tested-by: Stéphane Marchesin <>
Commit-Ready: Stéphane Marchesin <>

2 years agoRemove printf warning.
Stéphane Marchesin [Tue, 23 Oct 2012 00:24:19 +0000 (17:24 -0700)]
Remove printf warning.

TEST=compiles, runs.

Change-Id: I6c96c30b5f48893413803032e2ba0c707f783053
Commit-Ready: Stéphane Marchesin <>
Reviewed-by: Stéphane Marchesin <>
Tested-by: Stéphane Marchesin <>
2 years agoRemove unused variables.
Stéphane Marchesin [Sat, 20 Oct 2012 01:13:59 +0000 (18:13 -0700)]
Remove unused variables.

TEST=compiles, runs

Change-Id: I828edb745b182df49a7a8093047caca7ba5203ca
Tested-by: Stéphane Marchesin <>
Reviewed-by: Daniel Erat <>
Commit-Ready: Stéphane Marchesin <>

2 years agoply-image: Add --print-resolution flag. factory-2717.B factory-2723.14.B factory-2846.B factory-2848.B factory-2914.B factory-2985.B factory-2993.B factory-3004.B firmware-butterfly-2788.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B firmware-stout-2817.B release-R22-2723.B release-R23-2913.B stabilize stabilize-daisy stabilize-link stabilize-link-2913.278
Daniel Erat [Tue, 10 Jul 2012 20:03:29 +0000 (13:03 -0700)]
ply-image: Add --print-resolution flag.

This adds a new flag that instructs ply-image to print the
space-separated framebuffer width and height to stdout.

I'm also updating the usage method to list all flags.

TEST=manual: --print-resolution works; previous behavior still works too

Change-Id: I52a3c0570384026247b95c4ab2b642fe26f2edd4
Reviewed-by: Daniel Erat <>
Tested-by: Daniel Erat <>
Commit-Ready: Daniel Erat <>

3 years agoAdd a --debug option to ply-image. factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B factory-2569.B firmware-link-2348.B release-R19-2046.B release-R20-2268.B release-R21-2465.B
J. Richard Barnette [Sat, 24 Mar 2012 00:07:13 +0000 (17:07 -0700)]
Add a --debug option to ply-image.

The new option is meant to make it easy to confirm placement of
images and to confirm the frame rate of animations.  It's primarily
meant to be used for debugging any scripts that display PNG assets,
although it could be useful in debugging ply-image as well.

TEST=run manually from shell prompt

Change-Id: I596aaeb6ab7082f1408a98e1f6fa3b48b2b8b58c
Commit-Ready: Richard Barnette <>
Tested-by: Richard Barnette <>
Reviewed-by: Luigi Semenzato <>
3 years agoAdd --offset <x,y> for playing animation on specified location factory-1235.B factory-1284.B factory-1412.B factory-1987.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B release-R16-1193.B release-R17-1412.B release-R18-1660.B
Hung-Te Lin [Wed, 5 Oct 2011 15:42:27 +0000 (23:42 +0800)]
Add --offset <x,y> for playing animation on specified location

When displaying messages, we need to play animation on top of prepared large
background image.  Since these images are centered in screen, --location does
not work (frame buffer size is unknown to caller) and --offset will be easier
for startup scripts to use.

TEST=display_boot_message enter_dev1 en  # image centering still works
     ply-image --offset -300,0 /usr/share/chromeos-assets/images/*frame*
     # seeing animation played in -300 pixels from center

Change-Id: I2906d1406ee113ee3cfabfb700017ab7314f480f
Reviewed-by: Richard Barnette <>
Reviewed-by: Daniel Erat <>
Tested-by: Hung-Te Lin <>
3 years agoAdd support for dynamically specified frame rate.
J. Richard Barnette [Mon, 10 Oct 2011 17:55:58 +0000 (10:55 -0700)]
Add support for dynamically specified frame rate.

This adds a new --frame-interval option to specify the frame rate
in milliseconds per frame.

TEST=for T in 5 10 50 100 1000; do time ./ply-image --frame-interval $T /usr/share/chromeos-assets/images/boot_splash*; done

Change-Id: I95b3a9012f55fedcab713f315e686e3a8daf259a
Tested-by: Richard Barnette <>
Commit-Ready: Richard Barnette <>
Reviewed-by: Luigi Semenzato <>
3 years agoAdd clear color support to ply-image.
Stéphane Marchesin [Wed, 28 Sep 2011 20:01:47 +0000 (13:01 -0700)]
Add clear color support to ply-image.

Change-Id: Icf3d7db319313a1a5eb5aa4b18beaba781dfd110
Reviewed-by: Stéphane Marchesin <>
Tested-by: Stéphane Marchesin <>
3 years agoFix centering when an image exceeds display boundaries. 0.14.811.B 0.15.877.B 780.B factory-1020.B factory-980.B firmware-881-u-boot-v1 firmware-u-boot-v1 release-1011.B test-982.B
J. Richard Barnette [Tue, 21 Jun 2011 01:17:02 +0000 (18:17 -0700)]
Fix centering when an image exceeds display boundaries.

ply_frame_buffer_fill_centered() incorrectly used unsigned
arithmetic to calculate centering offsets.  If the image was
larger than the frame buffer, the calculated x and/or y offset
would be wrong, causing the image not to be displayed.

TEST=manually display a 1366x800 image on a 1280x800 display

Change-Id: Ibcdd5cd27e6aee4d7ec0a0d6054867cabbc48a82
Tested-by: Richard Barnette <>
Reviewed-by: Luigi Semenzato <>
3 years agoRespect PKG_CONFIG variable if set in the environment.
David James [Tue, 7 Jun 2011 00:17:09 +0000 (17:17 -0700)]
Respect PKG_CONFIG variable if set in the environment.

This is required for the new cross-compilation support using pkg-config
wrappers instead of changing the pkg-config files themselves.

TEST=emerge-arm-generic with and without pkg-config wrappers

Change-Id: I6bb5bc15bb7402c06cc3b9cada660bcc8163f61d
Reviewed-by: Anush Elangovan <>
Tested-by: David James <>
3 years agoAdd an option to allow specifying the location for images.
J. Richard Barnette [Fri, 27 May 2011 18:06:42 +0000 (11:06 -0700)]
Add an option to allow specifying the location for images.

This deletes the command line arguments that previously were used to
specify the location of animation frames, as well as fixes bugs that
prevented any location but (0, 0) from being useful.

TEST=Boot and observe the splash screen

Change-Id: I9ca7e0ef0d1b03a4675cd5bde0f0c7f4f70afa91
Reviewed-by: Luigi Semenzato <>
Tested-by: Abhishek Shroff <>
Tested-by: Richard Barnette <>
3 years agoClean up ply-frame-buffer.h
J. Richard Barnette [Thu, 2 Jun 2011 23:37:43 +0000 (16:37 -0700)]
Clean up ply-frame-buffer.h

  + Remove declarations of non-existent functions.
  + Re-order to put related function declarations together.
  + Adjust style conformance.

TEST=Manual test on VT2

Change-Id: I820c2ee83792ae4a7a81b97f29f24669192e581a
Tested-by: Richard Barnette <>
Reviewed-by: Daniel Erat <>
3 years agoStyle conformance fixes to ply-frame-buffer.c
J. Richard Barnette [Wed, 1 Jun 2011 23:51:32 +0000 (16:51 -0700)]
Style conformance fixes to ply-frame-buffer.c

TEST=Manual test on VT2

Change-Id: Ie0a3d2650f89524ac78cd190f9688f11cf4545a4
Reviewed-by: Daniel Erat <>
Tested-by: Richard Barnette <>
3 years agoMake the contents of ply-image.c private.
J. Richard Barnette [Wed, 1 Jun 2011 21:52:54 +0000 (14:52 -0700)]
Make the contents of ply-image.c private.

Added 'static' to everything in ply-image.c except for main().
Also deleted ply-image.h, as its sole purpose was to export the
private definitions.

TEST=Manual test on VT2

Change-Id: Icb4094acda497ec214ea96211f38303e5daa8fbd
Tested-by: Richard Barnette <>
Reviewed-by: Daniel Erat <>
3 years agoStyle fixes for ply-image.c
J. Richard Barnette [Wed, 1 Jun 2011 20:45:49 +0000 (13:45 -0700)]
Style fixes for ply-image.c

The changes are whitespace only, and are targeted at matching the
style in ply-gamma.c and with Google's C++ style conventions.

TEST=Manual test on VT2

Change-Id: I93d2bd204fd09606d17f0c1f144837507a01a1c9
Reviewed-by: Daniel Erat <>
Tested-by: Richard Barnette <>
3 years agoRemove dead code and unneeded #include's from ply-image
J. Richard Barnette [Wed, 1 Jun 2011 17:40:30 +0000 (10:40 -0700)]
Remove dead code and unneeded #include's from ply-image

TEST=Manual test on VT2

Change-Id: Ib518b6001f5fbadb8d9f6f3cbeb637a7becb89c4
Tested-by: Richard Barnette <>
Reviewed-by: Daniel Erat <>
Reviewed-by: Luigi Semenzato <>
3 years agoDon't require a Chromium copyright header on ply-image files. 0.13.587.B
J. Richard Barnette [Fri, 27 May 2011 18:49:03 +0000 (11:49 -0700)]
Don't require a Chromium copyright header on ply-image files.

ply-image is derived from third party code subject to the GPL.
We can't (or at least shouldn't always) have Chromium copyright
headers on files here.

TEST=Upload a new change to any file

Change-Id: I5be5a735720a92de590000493a23c3d1b8590184
Tested-by: Richard Barnette <>
Reviewed-by: Stéphane Marchesin <>
Reviewed-by: Luigi Semenzato <>
4 years agoFix argument parsing regression (allow "ply-image <image>" again) 0.13.509.B 0.13.558.B
Luigi Semenzato [Mon, 9 May 2011 16:34:14 +0000 (09:34 -0700)]
Fix argument parsing regression (allow "ply-image <image>" again)

TEST=run the program with one argument

Change-Id: Ibb171e23e920ecb9323fce87bc7fb4abc9dc9526
Reviewed-by: Luigi Semenzato <>
Tested-by: Luigi Semenzato <>
4 years agoAdd gamma support to ply-image. 0.12.433.B 0.12.433.B109 0.12.433.B62 0.13.434.B
Stéphane Marchesin [Tue, 19 Apr 2011 21:48:45 +0000 (14:48 -0700)]
Add gamma support to ply-image.

TEST=Run chrome os with a color profile, check that it gets loaded (I use a profile with one of the components zeroed for testing so changes are obvious).

Review URL:

Change-Id: I328c32c30e7e73080895b0344bdcc354a6ad7053

4 years agoMake animation loop more understandable. 0.11.241.B 0.11.257.B 0.11.257.B90 0.12.362.B 0.12.369.B 0.12.392.B 11.1.241.B
Luigi Semenzato [Fri, 17 Dec 2010 20:40:55 +0000 (12:40 -0800)]
Make animation loop more understandable.

Change-Id: I71215e8f36abe82e591ec35880962628827a4b6f

TEST=ran the program

Review URL:

4 years agoAdd frame-by-frame animation.
Luigi Semenzato [Tue, 14 Dec 2010 23:12:41 +0000 (15:12 -0800)]
Add frame-by-frame animation.

Change-Id: Ia4c409a75e923c7f4e549a2ce6d9d8e95835e84b

TEST=ran on CR-48

Review URL:

4 years agoAdded math library to ply-image -l list so that it is explicitly passed to the linker.
Raymes Khoury [Fri, 24 Sep 2010 20:27:42 +0000 (13:27 -0700)]
Added math library to ply-image -l list so that it is explicitly passed to the linker.
Without this, the package won't link with the gold linker. This is not a gold bug.

Change-Id: I9b28df107f7d3c1124a4d94e4d3a9e49c1552fa7


Review URL:

4 years agoply-image: Add --clear flag.
Daniel Erat [Tue, 31 Aug 2010 23:48:38 +0000 (16:48 -0700)]
ply-image: Add --clear flag.

If this is specified, we just clear the entire framebuffer
to black instead of copying an image onto it.  I'm going to
use this to clear the framebuffer once it's been copied into
X's root window; otherwise, the boot splash screen is
briefly visible after X exits due to logout or shutdown.

This change also deletes the old dpkg-based build scripts.

TEST=ran both with image files and with --clear

Review URL:

Change-Id: I3213769a26a7e8fc5a3b879e202630809cb262f9

4 years agoSetup code review inheritance
Anush Elangovan [Sat, 5 Jun 2010 20:12:30 +0000 (13:12 -0700)]
Setup code review inheritance

Change-Id: I445808a66fea00c2f48558dbee581749acb2b978

4 years agoSupport ply-image splash screen display for ST1q
Krishna Konda [Tue, 1 Jun 2010 18:00:27 +0000 (11:00 -0700)]
Support ply-image splash screen display for ST1q

Change-Id: Ib452052603331a8f76c285cc248e25ef2d0cc1fe

Review URL:
Patch from Krishna Konda <>.

5 years agoFix ply-image cross compile on ARM. Remove explicit strip command since emerged does...
Anush Elangovan [Thu, 13 May 2010 18:13:13 +0000 (11:13 -0700)]
Fix ply-image cross compile on ARM. Remove explicit strip command since emerged does the right thing

TEST=emerge-voguet20 ply-image and emerge-x86-generic ply-image

Review URL:

5 years agoply-image: Switch to new cross-friendly packaging style
Colin Watson [Thu, 7 Jan 2010 17:54:49 +0000 (17:54 +0000)]
ply-image: Switch to new cross-friendly packaging style

Use dh(1).
Build-depend on libpng12-dev.
Make the top-level Makefile useful.
Pass toolchain parameters correctly for cross-compilation.
Remove; debian/rules takes care of calling make now.

Review URL:

5 years agoLet ply-image pull in CFLAGS when cross compiling. [Tue, 27 Oct 2009 02:32:49 +0000 (02:32 +0000)]
Let ply-image pull in CFLAGS when cross compiling.
Eventually we'll want to get rid of the -O2, but
I'm leaving it in place for now.

Review URL:

git-svn-id: svn://chrome-svn/chromeos/trunk@98 06c00378-0e64-4dae-be16-12b19f9950a1

5 years agoChanges to be able to cross-compile chromeos-wm. [Mon, 26 Oct 2009 23:11:52 +0000 (23:11 +0000)]
Changes to be able to cross-compile chromeos-wm.

Review URL:

git-svn-id: svn://chrome-svn/chromeos/trunk@94 06c00378-0e64-4dae-be16-12b19f9950a1

5 years agoFix bug in ply-image for the (unlikely) case when [Mon, 12 Oct 2009 22:58:27 +0000 (22:58 +0000)]
Fix bug in ply-image for the (unlikely) case when
buffer->area.width != buffer->row_stride.
This particular case remains untested.  However, I
verified there is no regression.

Review URL:

git-svn-id: svn://chrome-svn/chromeos/trunk@40 06c00378-0e64-4dae-be16-12b19f9950a1

5 years agoCenter the boot splash image. [Mon, 12 Oct 2009 20:52:29 +0000 (20:52 +0000)]
Center the boot splash image.

This makes ply-image center the image, clipping it as necessary,
and leaving untouched the parts of the frame buffer not covered
by the centered image.

Review URL:

git-svn-id: svn://chrome-svn/chromeos/trunk@37 06c00378-0e64-4dae-be16-12b19f9950a1

5 years agoAdd ply-image [Fri, 9 Oct 2009 23:30:34 +0000 (23:30 +0000)]
Add ply-image

git-svn-id: svn://chrome-svn/chromeos/trunk@18 06c00378-0e64-4dae-be16-12b19f9950a1