Commit Graph

99 Commits

Author SHA1 Message Date
Harshad Bhutada
58676afccd hardware/qcom/display: Fix overcounting frames with CALC_FPS
With a recent change, debug.gr.calcfps was enabled, frames were
being overcounted. This change fixes it.

CRs-fixed: 350335
(cherry picked from commit e8ea630b6b629403ad713b8cb3d912c4d54e7699)

Change-Id: I863072f3311c584edd30f7be74a3ab8122f05f01
2012-06-02 23:38:31 -05:00
Arun Kumar K.R
98d413ef13 hwcomposer: fix blank screen on external display.
fixes the black screen when external display is connected
during bypass and when video is paused.

(cherry picked from commit 2ffc188a6cad26a347e565211564640173f340ac)

Change-Id: I6caeda8bbc744a45164e2ae139345ba4aab55dab
CRs-fixed: 346284
2012-06-02 21:09:46 -07:00
Neti Ravi Kumar
3e189158c5 Unlock overlay buffers before going to suspend
In video playback through overlay, it is observed that, during
suspend/resume, genlock TIMEOUT errors are seen at the component
level.

drawLayerUsingOverlay() function locks buffers, but doesn't unlock
them, before going to suspend, making the genlock_lock_buffer calls
from video component to fail.

Unlock any overlay buffers before going to suspend.

CRs-fixed: 342878
(cherry picked from commit 4ffcd156710184fe492294fd55beea7d5f412116)

Change-Id: Id0165f370d05d9b4bdf71ddaea15cf00caa65896
2012-06-02 21:07:47 -07:00
Ramakant Singh
d80af4df03 Display/hwcomposer:Add support for intermediate down scaling
Copybit module has a limited stretch to up/down scale.
Hence we need to do a intermediate stretch before going
to final stretch.
CRs-fixed: 341196

Change-Id: Ic547fdb8e88072f9f89032f047d04a7a26bddf71
(cherry picked from commit 256bde19b8f912388e19390570e5ea36f0208cfe)
2012-06-02 21:03:06 -07:00
Jeykumar Sankaran
beb7795769 libhwcomposer: Implement register_proc in HWC
register_proc in HWC is used by SurfaceFlinger to register
callback functions with HWC. This can be used by HWC to invoke
SurfaceFlinger functions. Currently invalidate is the only function
registerd and can be used by HWC to trigger a screen re-draw.

CRs-Fixed: 342060
(cherry picked from commit 03a5cf4b9c52da2bfbd9706e85fddae63110ee9b)

Change-Id: I464370ebf63b93e0ce238395b5c165647d777575
2012-06-02 20:59:01 -07:00
Raj Kamal
3853e4180a Avoid 3D video layer for GPU composition
libhwcomposer: Donot mark the 3D layer below HWC_SKIP_LAYER
for GPU composition. In these cases, let the layer be
composed through composition type decided in hwc_prepare.
This helps us in avoiding the cases where 3D videos
cannot be composed through GPU.

CRs-Fixed: 346973

(cherry picked from commit 0331f07ed4b5a3cf5a2e358c8417ac9e8103bc07)

Change-Id: I9f6c53cc2da35109fe789074a9d1accc11372dd8
2012-06-02 20:57:48 -07:00
Steve Kondik
02cb316eef hwcomposer: Add workaround for cropped layers during bypass
* Some hardware cannot handle cropping during bypass, or reports
   invalid rects during orientation change. If the invalid rect is
   cropped, MDP gets into a weird broken state where layers turn
   transparent, display blinks, etc.
 * Also use the VG pipe for 2 layers instead of just 1 in this case, it
   eliminates flicker when unlocking the device.

Change-Id: Ia5cb1a368bcc8949ba224a8510f577450449f22e
2012-06-02 20:57:17 -07:00
Ricardo Cerqueira
87284fc92f hwcomposer: Let the external display header be overloaded
Individual devices may want a different header

Change-Id: Ic2d9524dc2dfc4ff76e0516ac7cd02432f9c95f6
2012-06-02 20:54:40 -07:00
Sushil Chauhan
574e446d42 libhwcomposer: Set bypass transition flag before invalidate()
Set flag to ensure HWComposer::invalidate() does not draw with
bypass still enabled. Also, log comp bypass transition due to
idle-timeout.

Change-Id: I3343d092a92c9677d0b9d50ced094c96d229474a
(cherry picked from commit f27aebd66249d165c0a3342abf4064a5dc350a6d)
2012-06-02 20:52:57 -07:00
Sudhir Sharma
7d978483ed libhwcomposer: Implement idletimeout fallback for MDP composition .
Background: On MDP compositon, MDP keeps reading contents from the
pipes even on Idle Screen i.e. even when HWC is not queueing any new
buffers to MDP. Above data traffic leads to high power consumption.

Implementation: This change introduces a timer in HWC which will
timeout if there are no updates in bypass composition path for
the period specified via debug.bypass.idletime. Also SurfaceFlinger
will be notified to redraw the current frame which will be composed
into FB.

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: Ic3a467596068fa553271b5cd8c2831e544e3211d
(cherry picked from commit ad1d9a019234ab03dbc79b1ddb73c86e560e3e74)

Conflicts:

	libhwcomposer/hwcomposer.cpp
2012-06-02 20:52:29 -07:00
Arun Kumar K.R
17e503c9b1 libQcomUI: handle WFD and HDMI concurrency.
- Add external_display_type to differentiate WFD and HDMI
- based on the display type, handle wifi display and HDMI
  concurrency

Change-Id: I2bf928dcd232f2ea39c4fa8dca812a26112076b2
(cherry picked from commit 8e7490026832d8df6758f4aa615039f91ac0f5ff)
(cherry picked from commit 7c6b7979bf2d7ab12ff528be75b5e008405acbda)
2012-05-22 17:03:47 -05:00
Jeykumar Sankaran
6d56f14dff libqcomUI: Add utils folder to libqcomUI
-Introduce utils folder in qcomUI lib for all Qcom
 implemented utility classes.
-Move FPS calculation profiler class into utils
 folder.

CRs-Fixed: 342060
(cherry picked from commit e9469022741642cfd8483839de96e809f4d94f1e)

Change-Id: Ie0af0c0cc10b5304814b4f26aed581ea93ce7f5f
2012-05-22 17:03:47 -05:00
Mathew Karimpanal
49e5cace38 libhwcomposer: Unregister layer handles that fail validation.
Layer buffer handles that fail gralloc validation must be removed
from hwcomposer's register of previous bypass and overlay handles.

(cherry picked from commit 18c7f1951018b6632bd6e1a4957194c01423b6ee)

Change-Id: Idaaf3557b05adb5b3e938e9cd46dac5b104b729e
CRs-Fixed: 347157
2012-05-22 17:03:46 -05:00
Sushil Chauhan
4e0b4170a1 YUV layer updates during animation and popups.
-- During animation, if yuv layer is marked skip close overlay channels.
   But if HDMI is connected, let them remain open, and send data.

-- During popups on paused video, if the layer above it is skip,
   let the video layer be displayed via overlay.

-- Fix MDP pipe closing mechanism for yuv content.

-- Synchronize notification to gralloc with actual video channel status.

CRs-Fixed: 342892

Change-Id: I98f442c12e59e4fcf93af87a251e3d489e624c0b
(cherry picked from commit 752ee11eb0318dbb2bfdc5200c320cd2db972eb9)
2012-05-22 17:03:46 -05:00
Sudhir Sharma
a7dbdc7072 Display: Fix swap interval 0
- debug.gr.swapinterval is now deprecated. It has been replaced by
  debug.egl.swapinterval.
- Do not disable MDP bypass if we have ASYNCHRONOUS layers present
  and debug.egl.swapinterval=0.
- Do not lock overlay buffers if debug.egl.swapinterval=0

Conflicts:

	liboverlay/overlayLibUI.cpp

Change-Id: I004a437397570ad62b589bb68db2b9815917f551
2012-05-22 17:03:46 -05:00
Mathew Karimpanal
0f6ca9f6c9 libQcomUI/libhwcomposer: Log and dump layers of screen frames.
Log a frame-by-frame succession of HWComposer layers' data and write
their buffers, if any, into raw or png files based on system property
values.

CRs-fixed: 339748

Change-Id: I171a9891a0867548b34d45c0561f25f66cf0580c
(cherry picked from commit 8166b062df4765af0b0d9f95d55fa14dd4b75b8d)
2012-03-30 20:34:06 -05:00
Jeykumar Sankaran
43afc2743e libhwcomposer: Change dynamic composition strategy
Use copybit composition only for those frames where we
have maximum 2 full screen sized layers for composition.

Change-Id: Id34975f85dce11ba9365714655c994c6f3b0cabd
(cherry picked from commit 2f2c75f3c8d6700dcf981f980e817c813ed3e389)
2012-03-30 20:33:54 -05:00
Jeykumar Sankaran
dc22c8ffb5 hwcomposer: Force close bypass MDP pipes on suspend.
Since SF wont compose when device is on suspend mode, MDP_UNSET can
be called to close all allocated bypass pipes.

Change-Id: Ia4610c34e6d89028f8b3400af023296c459dd8d1
(cherry picked from commit 32a9e25b699d7abde661f3ad947ed58a09a1b132)
2012-03-30 20:33:41 -05:00
Jeykumar Sankaran
8d39eda441 hwcomposer: Close MDP pipe on invalid gralloc handle
Unused bypass pipes need to be closed after unlocking their
buffer handles.This change makes sure the pipes are closed even
if client releases the buffers(invalid buffer handle) before
this function gets called.

CRs-Fixed: 344765
(cherry picked from commit d8761a761f7d2eddcec12841f4d9afd4261ee79e)

Change-Id: I449d0dce4ec458e19446fcc26316a3794a15f909
2012-03-30 20:33:28 -05:00
Saurabh Shah
067c2f31a8 hardware/qcom/display: Compose once after animation is really over.
CRs-fixed: 335408 339193

(cherry picked from commit f24a8760d247e123f6c1bd24ee44ad4c604f4626)

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I9895e511e8d19fe3e58d3504afae399336afeb14
2012-03-30 20:33:15 -05:00
Jeff Boody
6ee9758eb8 libhwcomposer/libqcomui: disable composition bypass for asynchronous mode
The current composition bypass implementation prevents the app frame rate from
being decoupled with vsync. As a result when a graphics application requests
EGL swap interval zero it is still limited by vsync. This change disables
composition bypass if any layers being composited for the frame are in
asynchronous mode.

CRs-Fixed: 335498
(cherry picked from commit 8e1a74ffff6a07ac9ef649347b7ac23be143f2ea)

Change-Id: Ia0b6b14fbc953b04616667a494d98fcca99932f9
2012-03-16 23:30:29 -05:00
Naomi Luis
4636422dd7 libhwcomposer: Don't return an error if the list is NULL
- a NULL list parameter or a numHwLayers of zero indicates that the
entire composition will be handled by SurfaceFlinger with OpenGL ES.
- a NULL list parameter or a numHwLayers of zero indicates that the
entire composition has been handled by SurfaceFlinger with OpenGL ES.
In this case, (*set)() behaves just like eglSwapBuffers().
- dpy, sur, and list are set to NULL to indicate that the screen is
turning off. This happens WITHOUT prepare() being called first.

(cherry picked from commit 5047cf7b17c8546f33c432d67b3510a540a74391)

CRs-fixed: 336520

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I1eaa4b2360aea164ce389a9803bc1630b8fdf01c
2012-03-16 23:30:15 -05:00
Saurabh Shah
e15d259d8c hardware/qcom/display: External-only display.
Add support for external-only display. Layer buffers
marked with GRALLOC_USAGE_EXTERNAL_ONLY will be
displayed on external panel only, if available.

In addition if the layer buffer also has the flag
GRALLOC_USAGE_EXTERNAL_BLOCK then only that layer
will be displayed on external (During suspend).

When this mode is on, the default mirror mode for
external is stopped.

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I8ea2920384c5b68311ee3fe00707d01ab6568b52
2012-03-16 23:29:57 -05:00
Naomi Luis
6dd7f17b59 libhwcomposer: Disable FB fetch if there is only one video layer.
If we have a single layer for composition which goes via the overlay,
we can disable disable the framebuffer fetch thereby saving power.

CRs-Fixed: 338777
(cherry picked from commit c40d887d714d14182e867e5eb7942160b3feb197)

Change-Id: I361f5d8a60fb478a675b47163b7524c79e66624a
2012-03-16 23:16:52 -05:00
Jeykumar Sankaran
d98b6e5171 libhwcomposer: Fix MDP composition for negative coordinates
This change fixes destination rect calculation for negative coordinates

Change-Id: I0174ae3b9643f74d60d559e84bc36bd9ec1d0caa
(cherry picked from commit 3620e365fe9ffcc8d3ec21691707d46e11bdb9ae)
2012-03-16 23:16:37 -05:00
Zhoulu Luo
84961f81a5 libhwcomposer: Add support for 3 layer bypass
This change allows 3 or less layer use cases to get bypassed completely via MDP pipes.
If more than 3 layers, all of them gets composited on FB.

Intended FB fallback cases:
  1) 4 or more layers
  2) Any MDP pipe is in use
  3) Any layer needs rotation
  4) Any layer is allocated from non-pmem

Change-Id: Ieb2b30b8ab9893fd68c7fc61ec889ac9a01cb7dd
(cherry picked from commit 001ffcfef1d63948926b1be67c4977d13ae1b159)

Conflicts:

	libhwcomposer/hwcomposer.cpp
2012-03-16 23:16:24 -05:00
Arun Kumar K.R
eee6309c4f qcom/display: fixes for the external overlay channel
- During video playback, when the external display is connected,
  start the overlay channel on the right framebuffer.
- set the correct position for the new external display channel
- fix minor bug in the function getAspectRatioPosition for external
  display

CRs-fixed: 336674
(cherry picked from commit 6afc95ee1197718332461c8f0ddf9cf5f94cc7aa)

Change-Id: Ifa30dfea349c2a0f133790ab2dc91527d53152f8
2012-03-16 23:15:43 -05:00
Arun Kumar K.R
4c082b642a qcom/display: clean up overlay channels during initialization
- Add an interface to class Overlay to clean up the overlay
channels.  This interface will query the framebuffer device, and
will free(UNSET) them if they are in use
- hwcomposer hal will call this API during initialization

(cherry picked from commit 0d03b1b823bbf36f7adb16bb4344fc46d8748c6a)

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I4a4bedfdc409913ef31c1d5f5a869db730528096
2012-03-16 23:14:47 -05:00
Naomi Luis
d8588e1c12 overlay: Close correct channels during state change events.
When there is a state change, open/close only the required channels
instead of blindly closing all the channels. When HDMI is connected,
open the overlay for queueing the frames on the external, and when
hdmi is disconnected, only close the external overlay channel.

CRs-fixed: 333324
(cherry picked from commit a6b5ac4c385e03b3c798bb07d0d3ba6140aebbe8)

Change-Id: I7333a6fe106cd0aa99471542daf3c84c04c5d056
2012-03-16 23:13:48 -05:00
Arun Kumar K.R
37c2692006 qcom/display: Add support for WFD
- HDMI has priority over Wifi display, if HDMI is connected during
  Wifi, close the session for Wifi and start one for HDMI.
- the enableHDMIOutput parameter externaltype - HDMI/WIFI/OFF

Change-Id: If2cd9143fc7a953db49f38a6c166f9425ba5266e

Conflicts:

	libqcomui/qcom_ui.cpp
2012-03-16 23:13:28 -05:00
Arun Kumar K.R
ca1d2bab60 qcom/display: add true mirroring support on HDMI
Change-Id: I7e884e5dde2a08048a28610eb88760fcdd24d558

CRs-fixed: 316397
2012-03-16 22:50:16 -05:00
Paras Morabia
6fd8923a96 QCommUI/HWComposer: Allow application to set 3D format
This change allows the application to set the S3D format for the surface.
With this change application would be specifying 3D format and that would
be handled by hwcomposer would handle it appropriately.

Change-Id: I6b7b33712ab85b8a94231bd65a19709b3c2cd606

Conflicts:

	libqcomui/qcom_ui.cpp
2012-03-16 21:28:48 -05:00
Jeykumar Sankaran
bd35204368 Revert "Bypass: Turn off only after FB content is displayed."
This reverts commit f2dbabe786.

This change is not needed any more because we are caching the MDP pipe
contents when closing the channel. So no need to wait for postFB finish.

Change-Id: Ia6f01c33953762cb7a97e0b2b795d9afeb60d2d9
(cherry picked from commit 441f1824593bb12a97508b426b597a16b35091e6)
2012-03-16 21:25:51 -05:00
Jeykumar Sankaran
a0dc58fce0 libhwcomposer: Fix dynamic composition.
Layer orientation can be ignored since displayFrame always represents the
destination region in framebuffer orientation.

(cherry picked from commit f6ab48d14d32ba805fc25597533de14dae1c4e2b)

Change-Id: I0f9217e81a953a63cf9ea4ef9ddab25a1c67184e
2012-03-16 21:24:16 -05:00
Neti Ravi Kumar
1e5e65ae87 libhwcomposer: Avoid overlay specific code for non-overlay targets
(cherry picked from commit baeb7668e20e4513fd6d7e6e211555a3c17195b8)

Change-Id: I2a6f49d364aa4fac11ec950bf7fc88ecff7afdbb
2012-03-16 21:24:05 -05:00
Prabhanjan Kandula
917a203129 libhwcomposer: Fix temporary stretch in copybit
-Check only for 90 or 270 degrees rotation and interchange
width and height if rotation is one of them.
-make scaling computations in float

CRs-fixed: 337370
(cherry picked from commit 460d7b96c06aa33d61b38d146f76887a49cd8057)

Change-Id: I30255e3926917896223dba7306df60ff7cfa14e2
2012-03-16 21:23:05 -05:00
Naseer Ahmed
d19d1e2ff9 display: Use temporary buffer for internal conversion
(cherry picked from commit 7945ee46591ceba584b1b2167e5f750d3489d69c)

Change-Id: Ie71a8745e8810ade310103fdfed7db03cd170980
2012-03-16 21:22:11 -05:00
Rajulu Ponnada
e17722b895 hardware/qcom/display: Add debug feature to display FPS for both bypass,fb
Change-Id: Ib4991200db9bc64c823c57ed1fba43f836142957
(cherry picked from commit cc57c2f34b936636e9c52dc43689d9386bcd0e35)

Conflicts:

	libgralloc/Android.mk
	libhwcomposer/Android.mk
	libqcomui/Android.mk
2012-03-16 20:51:30 -05:00
Naomi Luis
72aff33e3e libhwcomposer: Continue the loop when we skip composition.
When the HWC_SKIP_COMPOSITION is enabled, continue looping through
the layers instead of breaking the loop. Thus we are assured that
all overlay layers are always drawn.

Change-Id: Ia8d4c7003838cbb86e2f0ea8b5ef2d47516aa011
CRs-fixed: 333986
(cherry picked from commit 8c2a615a0a3d89a5830af3b8117115ae8071bd27)
(cherry picked from commit 11ea4a3635a347182f6b2f8f2ad6e3b394a13eda)
2012-03-16 20:44:07 -05:00
Naomi Luis
7407479717 libhwcomposer: Unlock video layers below the SKIP_LAYER.
If there is any video layer below the HWC_SKIP_LAYER, we compose that
video layer using the GPU. Unlock any previous video buffer that were
sent to the overlay.

CRs-fixed: 333974
Change-Id: I1937ca8b139f40453a3bccb0b490fd4d65fa1f52
(cherry picked from commit 48a3996a2178244ce6365f97212c55e7ab33752a)
(cherry picked from commit f4a08165b2d3be97b72287fc4001cb5c90d57c07)
2012-03-16 20:43:54 -05:00
Ramakant Singh
5cfdca4008 Display/libhwcomposer:Add intermediate stretch for low resolution clips
Copybit module has a limited stretch to scale a clip.
Hence we need to do a intermediate stretch before going
to final stretch.

(cherry picked from commit 6503d323f9e113c0edf66e724bb422559ecbd5cb)

Change-Id: Ib8ea9a917896985d4f7d7ebf999222f2dc6f6480
2012-03-16 20:41:57 -05:00
Naseer Ahmed
6f273c5c6e hwcomposer: Enable dithering if FB format is RGB565
CRs-fixed: 329362

(cherry picked from commit acd73753d1da0ba587fea91a2605229c7274e7b7)

Change-Id: I5155e98a87d17066fab6075d2b067175e4a6b56c
2012-03-16 20:35:33 -05:00
Jeykumar Sankaran
e806dc448b libhwcomposer: Fix dynamic composition for 2 overlapping layers
This change allows composition to fall back to c2d even if the second
layer overlaps the base full screen layer.

CRs-Fixed: 326413
(cherry picked from commit b27338930d5bf3de17d03b06db6169e648d5e5fc)

Change-Id: Iaf1bf706fb216286047452173b58aeba1781cd9b
2012-03-16 20:35:04 -05:00
Naseer Ahmed
71e0e80dbd display: Add support for protected heaps
(cherry picked from commit c932690c5a9d0aedfd2580e5c5e9f79e32f54261)

Change-Id: Ibddab4252ecefa1c410430b89f94aba4d3ae1c96
2012-03-16 20:34:50 -05:00
Naomi Luis
cf67073149 libhwcomposer: Mark all layers below the SKIP layer for GPU composition.
If there is a SKIP layer present, the SKIP layers are first composited
using the GPU. If there any layer below the SKIP layer that performs
any operations on the FrameBuffer, it results in undesireable results
on the screen e.g. artifacts, since SurfaceFlinger draws the SKIP layers
before the HWComposer.

Change-Id: I198236673e2a0bd19a6087ff01049061547abb47
CRs-fixed: 327392
2012-03-16 20:31:07 -05:00
Naseer Ahmed
25297cbe9b display: Fix blending on MDP 3.0
Assign the correct blending value
for MDP 3.0, earlier it was
incorrectly assigned to zero
for cases where blending was not needed.

Change-Id: Icec6541616c8a9dc6ffc0e99c5b2936389799656
2012-02-06 23:19:37 -06:00
Saurabh Shah
90e1eda3a3 Refactor OverlayUI
Refactoring is necessary to attain flexibility in setting mdp overlay params
at runtime, while using composition bypass.
This change includes new APIs for setting crop rectangle, display params and
commiting mdp params, namely setCrop(), setDisplayParams() and commit(),
respectively.

Change-Id: Id57035602baabd954fd6b484be4f63fef632d74b
2012-02-06 23:19:37 -06:00
Jeykumar Sankaran
dadd73f13f libcopybit: Disable copybit blending for opaque layers
This change disables copybit blending when surface flinger sets
HWC_BLENDING_NONE for a layer.

Change-Id: Ie86a2d5c9e3d3dab1bc7a0a3cc31bff7afe604da
2012-02-06 23:19:37 -06:00
Ramakant Singh
36ba650a17 Display/libhwcomposer:align the copybit src and dst buffer
Align the copybit source and destination buffer according
to the frame buffer pixel format.
CRs-fixed: 327687

Change-Id: I00a0a047f2f6d639202e8395d85902b821e2a65c
2012-02-06 23:19:37 -06:00
Naomi Luis
42c4db1c6e libhwcomposer: Check the number of open overlay channels
When performing the setup for bypass operations, check the number
of bypass channels that are in open state. If the count does not
match the number of bypass layers, close all the bypass channels.
This is done to prevent the overlay channels from going into an
inconsistent/undefined state.

Change-Id: If471a4b4437e25642586616461c5d745f15b3287
CRs-fixed: 323676
2012-01-01 17:54:54 -05:00