Commit Graph

9 Commits

Author SHA1 Message Date
Naseer Ahmed
da10c14304 hwc: Add support for faking vsync
Can be set for debugging, valgrind, board bringup etc.
Also - we fail reading the sysfs vsync, we fall back and fake it.

Bug: 7301591
Change-Id: I9509fd7aa8862d5af7d521e29fe32bef9654168c
Signed-off-by: Iliyan Malchev <malchev@google.com>

Conflicts:

	libhwcomposer/hwc_vsync.cpp
2012-12-03 15:33:01 -05:00
Naseer Ahmed
276e9f5146 hwc: dont return from vsync thread when read fails.
Read can return fail when the panel is off.
When read fails do not exit from the vsync thread,
continue with the vsync signal, as later there will
be correct vsync event from the driver

Change-Id: I0f145b93fe5d365eafb6b9e7661160f00f84db40
Acked-by: Arun Kumar K.R<akumarkr@codeaurora.org>
(cherry picked from commit ef93ede83eba15252a5e902981c491bf8ed228cc)
2012-11-19 12:45:39 -05:00
Naseer Ahmed
08212c04d2 hwc: Open sysfs node when thread is initialized.
Earlier, the sysfs node was created in the driver for the
first time in dsi_video_on. This has now been moved to probe
so this node can be opened to the start of the thread.

Bug: 7305728
Change-Id: I01230e4fdc2bddd160ce0d84e153f1f8c179b8df
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-17 18:47:07 -07:00
Iliyan Malchev
0f9c397181 hwc: add some logging
We are seeing errors where a device's hwcVsyncThread is not present for some
reason.  The surface flinger has not crashed, so either the thread never got
created, or it exited withouth throwing an error.  This patch adds some more
verbose on-error logging to the HWC as an attempt to verify the theory that the
thread does not get created, or fails in pthread_create.  While we're at it, we
add the same logging at pthread_create() for hwcUeventThread, as well.

Also, replace the lseek()+read() with a pread() combo in the vsync thread.

Change-Id: I555d786a7d66ff4ef1dbfd95947a7d9341e56f11
related-to-bug: 7305728
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-11 15:45:38 -07:00
Naseer Ahmed
4014777bab hwc: don't open sysfs on every iteration
Also, read again if vsync read is interrupted

Bug: 7305728
Bug: 7274951
Change-Id: I563a4c4cacab8f124ac988ad98640b57a3d09813
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-08 14:55:58 -07:00
Saurabh Shah
ae823e7735 hwc: more error checks
-- numHwLayers==1 means that there is only the FB_TARGET which HWC shouldn't
   draw. Also check for blank in set.  Checking for this in prepare prevents us
   from acquiring pipes.
-- add null check for private handle
-- print out vsync timestamp data on error

bug: 7274417
related-to-bug: 7288769
Change-Id: I8dae0d0748c5226fdc33ed8f5cc5259835dec2de
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-07 17:20:17 -07:00
Naseer Ahmed
c7faa70f4a hwc: move enable disable ioctls to vsync thread
This patch stabilized the vsync signal.

Bug: 7274951
Change-Id: Ieb6396c67d4dfb20cfde39a63a45ab6742d9ec5b
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-04 14:03:41 -07:00
Iliyan Malchev
eac8965bf4 hwc: fix some race conditions
Fix some race conditions between hwc_eventControl and the hwcVsyncThread.

Bug: 7274951
Change-Id: Ic71d65918303b4cef6a379ff5397702b2b578373
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-04 14:03:23 -07:00
Naseer Ahmed
ff4f0254be hwcomposer : Use sysfs to read vysnc information
* Read sysfs entries to get vsync timestamp from kernel.
* External display continues to use uevents for hotplug events
* A new thread, vsyncThread is created to read and send vsync
  timestamps to HAL.
* Disable H/W VSYNC for MDP 5.x targets until kernel changes are
  complete.
* Synchronization is needed to make sure read() is not called
by hwcVsyncThread when VSYNC is disabled.

Change-Id: Iab0a94a3cfce9142b8867859f2a7d9bcaecb0996
Acked-by:  Neti Ravi Kumar <ravineti@codeaurora.org>
2012-10-02 16:54:14 -07:00