egl:fbdev: lazily allocate buffers.

No point in reallocating the buffers 3-4 times before we start drawing.
Instead, delay creating them until the first dequeu.

This incidientally fixes an issue where we fail to allocate a third
buffer beceause setBufferCount gets called after queueBuffer().
Because one buffer is locked by the fb device (due to the post())
we end up with only being able to reallocate 2 buffers this time
and the application continues with 2 buffers rather than 3.
Hook __system_property_get

Normally we don't have to wrap __system_property_get (libc.so) as it is only used
through the property_get (libcutils.so) function. However when property_get is used
internally in libcutils.so we don't have any chance to hook our replacement in.
Therefore we have to hook __system_property_get too and just replace it with the
implementation of our internal property handling

This was discovered when debugfs was mounted to /sys/kernel/debug. Once this is done the
internal atrace functionality of Android is activated which sits also in libcutils. It
needs additionally to the mounted debugfs a property set to enable the trace
functionality. As soon as this property was tried to read through bionic the whole
process crashed. With hooking __system_property_get everything works again.

Signed-off-by: Simon Busch <morphis@gravedo.de>
propcache: Remove one unnecessary strdup().

By simply returning the already allocated value, we avoid an unnecessary
allocation, as the caller already copies the value anyway.
Merge pull request #239 from sletta/fbdev-lazy-allocate

egl:fbdev: lazily allocate buffers.
Merge pull request #238 from rburchell/master

propcache: Remove one unnecessary strdup().
Merge pull request #236 from webOS-ports/atrace-crash

Hook __system_property_get
Prevent users from running standalone EGL clients with wayland platform

Running standalone EGL clients with the wayland EGL platform isn't supported and it is
better to prevent us from doing so rather than crashing with a segmentation fault later.

Upstream-Status: Pending (http://github.com/libhybris/libhybris)

Signed-off-by: Simon Busch <morphis@gravedo.de>
Merge pull request #237 from webOS-ports/egl-standalone

Prevent users from running standlone EGL clients with wayland platform
On destroying wl_egl_window, remove reference in WaylandNativeWindow

On some cases, wl_egl_window could be destroyed when WaylandNativeWindow
had still alive references. In this case, the code in WaylandNativeWindow
that detachs the reference to wl_egl_window will access already freed
memory. This was reported by valgrind.
Merge pull request #242 from jdapena/wl_egl_window_destroy_issue

On destroying wl_egl_window, remove reference in WaylandNativeWindow
Fix compilation with trace enabled

A couple of variables were missing.
Merge pull request #243 from heeen/fix-trace

Fix compilation with trace enabled
Add a function for getting the gralloc handle from a wl_buffer.
Merge pull request #244 from sletta/get-hardware-buffer

Add a function for getting the gralloc handle from a wl_buffer.