1275 Commits

Author SHA1 Message Date
Andrew Sutherland
0e9a59558b hwc-qsd8k: update drawLayerUsingCopybit and hwc_set
with new logic from caf

Change-Id: I9de48d2157ef3d8a35e7aa75061340a92f009ef6
2012-03-17 01:36:07 -05:00
Andrew Sutherland
081a89a5ad fixup after huge update
this brings us inline with cafs ics_chocolate branch
per: f696608c9d9e3b6b60a92423338f08d59d19d746

Change-Id: Ibaff05220e7d7f0ddd1b4d7507626a38d717340c
2012-03-16 23:53:44 -05:00
Saurabh Shah
e60d0f2d95 external_only_display: Fix static member naming.
CRs-Fixed: 325697
(cherry picked from commit 4fbdbb3a6c8606ed7472bb015e538a3c6ab55d6a)

Change-Id: I6de03fc84017fdf966e6a0acf65556a0d10ec81a
2012-03-16 23:35:48 -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
Carl Vanderlip
ab890c7518 liboverlay: Redirect Post Processing library header
The post processing library header has been included in the target output
now; thus, liboverlay should use the new location in the 'out' directory.

Change-Id: I53fad5503456fbb821c7eb8fb0092f6a762f4c3a
(cherry picked from commit b338d9e7a9c182a654de1a86418f5b1f27e7f308)
2012-03-16 23:16:03 -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
Naomi Luis
452832bb84 liboverlay: Setup the overlay and rotator if the geometry has changed.
Setup both the overlay and rotator for every geometry change event.
The mNoRot flag decides if the rotator needs to be setup for that
particular channel. SetTranform takes care of enabling/disabling the
rotator and correcting the params when the rotation changes.

CRs-fixed: 336037 336346
(cherry picked from commit 84c7068f405189542658529cc43a3d54b49b11ca)

Change-Id: I4c4c747bf365c50c48037c657c653d4903ec7e76
2012-03-16 23:15:29 -05:00
Naseer Ahmed
694752d90d display: Add flag to avoid mapping memory in userspace
For secure content the MM heap should never be
mapped in userspace. Add a flag to avoid
doing this for rotator which does not need
userspace mapping.

(cherry picked from commit 8d9f2fa336564d5a021dd932f5619b5f389d5fad)

Change-Id: I17d1faa40859e261518d928089f2ce86084d31fd
CRs-fixed: 332402
2012-03-16 23:15:06 -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
08f2e32737 liboverlay: Free rotator memory only if it was allocated.
Check if the rotator memory was allocated before attempting to free it.

CRs-fixed: 334607
(cherry picked from commit 4feb43e3a964878b2c708e7417df8d116e1d17ef)

Change-Id: Iac5d957ce7286848443e3d05f1c8d9c32b258b72
2012-03-16 23:14:33 -05:00
Arun Kumar K.R
297e73b6a9 qcom/display: Fix aspect ratio calculation for UI on HDMI
- Changed the aspect ratio of UI on HDMI based on the aspect
  ratio of the primary resolution.
- Remove the default values for action safe region.

Change-Id: I596611f8b01e6e1c1007ad7e6c323ea0ea710ec9
CRs-fixed: 323358
(cherry picked from commit b3c2e7f9d68db550f280ed60e37e7f4ee2a73058)

Conflicts:

	liboverlay/overlayLib.h
2012-03-16 23:14:12 -05:00
Naomi Luis
38e11bf7d4 liboverlay: Refactor setting overlay flags.
Modify the overlay APIs to use only one parameter to set the overlay
flags, instead of adding a parameter per required flag.

Change-Id: Ia753e10b9e2c7a5ee1aabfd48f30c9b7583beaa1
(cherry picked from commit 5535a95c8f69891090a81dbd8ccdc11aa889a42c)
2012-03-16 23:14:01 -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
Prabhanjan Kandula
f7154c6f4c hardware/qcom/display: set the default sharpening settings
set the default sharpening settings for overlay pipes
i.e, sharpening is enabled and sharpening strength to zero.

CRs-fixed: 328472

(cherry picked from commit ba5235a66a4424746a6d785f83333b3543dc2dd1)

Change-Id: I6e18321e96f74df99ca6c4b63d06bc831f9e81ae
2012-03-16 22:50:41 -05:00
Carl Vanderlip
91deade06b setVisualParam Overlay API
Pass visual parameters such as sharpness, brightness, contrast,
hue, and saturation from framework to kernel. Converts floating
point to int8_t to represent visual param values.

Change-Id: I3dfc7c38d305fb05f080efb624f61c76adb5e023
2012-03-16 22:50:27 -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
Andrew Sutherland
3ef9f39ba5 copybit: fix build for qsd8k
Change-Id: Ic9edb3149a96a251e4cf9f4957f5624cef85667c
2012-03-16 21:53:00 -05:00
Neti Ravi Kumar
4952f4297b libqcomui : Compose UI in S3D format
The new class QCBaseLayer has been added. It implementsthe composition
of S3D UI when 3D video is playing. HWC adds hints to UIlayers for
composing them in S3D format when running S3D video.
Compose them in requested format.

(cherry picked from commit 080e303a70f89a1b0601a45c0815042addb7ac63)

Change-Id: I1d33a1419914b8e06618acd335f89808dc692742
2012-03-16 21:34:47 -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 f2dbabe786a12e7e9ae15328550b5ba581c5492e.

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
Neti Ravi Kumar
022c7668c4 Define HDMI_AS_PRIMARY flag based on TARGET_USE_HDMI_AS_PRIMARY
S3D code is being conditionally compiled with HDMI_AS_PRIMARY.
So it is necessary to enable this flag, if board file indicates
HDMI as primary display

(cherry picked from commit dfc3782b8f23a6aadec9fd7501807778b0d3c542)

Change-Id: I3f6f84d76a3f7f5a3f83aa5ec31012b13b16431b
2012-03-16 21:25:12 -05:00
Neti Ravi Kumar
34e2e00e43 libqcomui: Add null check for incoming buffer
Add null check for incoming buffer in updateBufferS3DFormat function.
return invalid value if buffer is NULL

Change-Id: I97c535ae7291ee12648a92bff843c0c500bce4df
(cherry picked from commit e009dff7644d9b0663f3939e48ad1e955b1f76b5)

Conflicts:

	libqcomui/qcom_ui.cpp
2012-03-16 21:24:44 -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
2e18b6b9b2 libcopybit : Fix calculation of copybit source rect for blit
- Fix the copybit source rect calculation for 180 and 270
 degrees rotation. Calculate blit rects  based on the source crop.

 CRs-fixed: 337366

(cherry picked from commit 06aa97757bd7023234d3852801e05e077aaa1d2f)

Change-Id: Iba2e230acd84271fc5649e06918824752aa90670
2012-03-16 21:23:21 -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
Prabhanjan Kandula
a16a3bc002 libcopybit: Fix the software conversion from YV12.
Fix the software conversion from YV12 to YUV_420_SP
by reading the chroma based on chroma padding involved.

CRs-fixed: 333784
(cherry picked from commit b22b6b191644e3ef618d122d30cef4bb9f87019d)

Change-Id: Ie84c1cbb2635a6197c5a907dac1e720c29a66e6c
2012-03-16 21:22:50 -05:00
Ramakant Singh
739ac1ba01 Display/copybit:Fix YV12 multiple conversion issue
Use a temporary buffer to replace inplace conversion

CRs-fixed: 333784
(cherry picked from commit 927542660e4c6106f8062c79bd6461c7fef55b4a)

Change-Id: I044bdaa31faea98552e35267bb78318317d68866
2012-03-16 21:22:38 -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
Naseer Ahmed
128d5de4b5 gralloc: Add function to calculate buffer dimensions.
This function can be used from other components
to get the aligned dimensions and size of the buffer
given the width, height and color format.

Change-Id: I8d7532a262194f3883bf0f5166e806e0971392e2

Conflicts:

	libgralloc/gpu.cpp
2012-03-16 20:57:34 -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
Naseer Ahmed
bd1aed8185 gralloc: Set total pmem size correctly
(cherry picked from commit 574e0998140becdfcebf11530bc10de3bcf31533)

Change-Id: I67b1530de43dab609261efa592dc41e030c157ef
2012-03-16 20:43:15 -05:00
Jeremy Gebben
093c26a745 libgralloc: don't IonAlloc::close_device() on error
It is possible to use this object from multiple threads
and there could be a race between a failure in one thread
and another method call from a different thread which would
result in system calls being called with an invalid fd.

(cherry picked from commit 560ca6e8feb4f52c9aade34fa7cfcfed55288083)

Change-Id: Iefb94ba1ee7177ab20600bee4374daf8e818bdb9
2012-03-16 20:43:04 -05:00
Naomi Luis
2f579e15da libgenlock: Remove the call to GENLOCK_IOC_RELEASE.
The GENLOCK_IOC_RELEASE ioctl is now deprecated. This was done because to
avoid race conditions where the handle was released before another client
tried to unlock it.

(cherry picked from commit d1514357422ce130d3e2776f984294a9efeea83e)

Change-Id: Iaf433a79dd0dad992cbf67180765718beec4eb1c
CRs-fixed: 333141
2012-03-16 20:42:49 -05:00
Jeremy Gebben
115d446fcb libgralloc: fix libgralloc error codes
Several ioctl calls were returning -1 instead of -errno,
which may confuse upper layers, especially when the error
is -ENOMEM.  Also move some existing "err = -errno" calls
to the top of if statements so that errno cannot change
by libc calls in the error handling code.

(cherry picked from commit a8eda532452651eb1fbae419319455de2a078ef0)

Change-Id: I181f98d5a261e8e3e1b3f6ecd3ba288e7b4b5607
2012-03-16 20:42:36 -05:00
Naseer Ahmed
719d854bfd display: Standardize debug logging for all memory types
CRs-fixed: 331956
(cherry picked from commit fa7601fb06b265b4cb7c9aaaabea77e2a8d8c6e9)

Change-Id: I1cc99760186aa4a70ebe2464f44b19e1fa91acdf
2012-03-16 20:42:12 -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
Neti Ravi Kumar
8ac7719437 Dump PMEM usage in out of memory cases for debugging
(cherry picked from commit 87e533f5a605e5fa99f84aeb8869d5f084369c6d)

Change-Id: I0f4b99c115b36144587cc770cb3722b89d7cffbd
2012-03-16 20:41:44 -05:00
Neti Ravi Kumar
c616c48fc5 libqcomui: Do not create EGL image for 420 SP formats in 7x27A
This change is done to reduce the CPU utilization by SurfaceFlinger
thread. This feature may be turned On/Off using a compile time flag

(cherry picked from commit 9691e73556e5c0b66553aa55eb504b9ebb0fd400)

Change-Id: I1cb5b5c8abef135bc520c6e39c6ccf236b2270c3

Conflicts:

	libqcomui/Android.mk
2012-03-16 20:41:12 -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
Jeff Boody
1077e7cce3 add GRALLOC_USAGE_PRIVATE_UNSYNCHRONIZED for explicit synchronization.
Change-Id: I3d78f0517f7eeafc58ec5b0edfc6a04901ad48b2
(cherry picked from commit 35229ceb772a4a3c0a9dbfcb42fdb45344a91b4e)
2012-03-16 20:35:18 -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