90 Commits

Author SHA1 Message Date
Naseer Ahmed
0856a1cf2f gralloc: header change for ION support
Change-Id: Ibbb81034c1c4cbc6ddc79719c7d47ded97bd816e
2011-11-08 10:57:43 -08:00
Rajulu Ponnada
802829be05 hardware/msm7k/libgralloc-qsd8k - framebuffer.cpp fps calaculation for a time interval
Change-Id: I11ee7973e192e5cc3cf5086b865632eec46eaf8c
2011-10-18 13:22:49 -07:00
Naomi Luis
f105d784da Set correct parameters in the gralloc handle
Set the aligned width and height in the gralloc handle.

Change-Id: I9cb2d9b681bb022bec2fa7cbe495974865f92a54
CRs-fixed: 306991
2011-09-26 12:59:51 -07:00
Omprakash Dhyade
49008be4a3 hardware/msm7k: libgralloc-qsd8k: Remove wait in fb_post and lockBuffer implementation
Since fb_post and dequeueBuffer may be called
from different threads, it might happen
that both wait for available buffer causig
both threads to go in sleep. To solve this
problem we add lockBuffer implementation
and remove waits from fb_post and dequeueBuffer.
This will also be consistent with native window
implementation.

Change-Id: Id5e6e2feac5153156fabd9266b0c1cd5a5681514
2011-09-23 18:37:43 -07:00
Harshad Bhutada
98fc1499db ligralloc-qsd8k: Add debug feature to display FPS
Change-Id: I0fe7e31f6301d5abca3a81dcd4112ffa2ec937df
2011-09-19 19:16:37 -05:00
Naomi Luis
28bb235bc3 libgralloc-qsd8k: Use correct vaddr for clean/invalidate pmem regions
CRs-fixed: 304740
Change-Id: Id72bb9ae874a56be89aec79d23e8d2e79856409d
2011-09-19 19:16:37 -05:00
Naomi Luis
e8ded16374 libgralloc-qsd8k: Invalidate the ashmem cache
Invalidate the ashmem cache after allocating an ashmem buffer

Change-Id: Id38a4776a80a9b1d8be7fe6bf00f8b187a3278f6
2011-09-19 19:16:37 -05:00
Naomi Luis
f75b90721f libgralloc-qsd8k: Check PMEM_ADSP flag
Check the PMEM_ADSP flag during the terminateBuffer and gralloc_unmap
operations.

CRs-fixed: 296807, 298849, 296817
Change-Id: Ia97aca71935ca3c921f53fc88f5b4f918d7434c0
2011-09-19 19:16:37 -05:00
Naseer Ahmed
3de087d0bb gralloc: Clean pmem caches after memset
Change-Id: If403dde70863e0d6ea221f2a105b86bdec134261
2011-09-19 19:16:37 -05:00
Naomi Luis
d74d663374 libgralloc-qsd8k: Fallback to ashmem in case of pmem failure
Add a fallback mechanism to allocate memory from ashmem if pmem
allocation fails.
Do not fallback in the following cases:
- MDP composition is being used.
- Client has explicitly requested that the memory be allocated from
pmem.
- Buffer will not be sent to the overlay.

Change-Id: Ic690af48f81914cb4c9a102cb386356797451141
2011-09-19 19:16:36 -05:00
Naomi Luis
3ae7f52726 libgralloc-qsd8k: Support for additional gralloc usage flags.
Add support for the GRALLOC_USAGE_EXTERNAL_DISP and the
GRALLOC_USAGE_PROTECTED usage bits. If any of the two usage bits are
set, we need to send the buffers to the overlay.
Since we send the buffers to the overlay, we need to allocate these
buffers from the PMEM region.

(cherry picked from commit 195345cd63f0e19cfee4cf055587d5fffe76d0ef)

Change-Id: I64116b9be07c8ddadbd5a132ef21b19e5326737b
2011-09-19 19:16:36 -05:00
Naomi Luis
7e2db6e3d0 liboverlay: Add YV12 support
Add support in the overlay for the YV12 color format.

(cherry picked from commit 0f9a27cc39b6d4202b54059bc7c64eea9efcf3f1)

Change-Id: I4b57eb383ca8f728243bd7e397696932e26c8889
2011-09-19 19:16:36 -05:00
Naomi Luis
49dbd79cf7 Add overlay_buffer_info structure to hold the buffer geometry
The overlay_buffer_info buffer geometry and size. When calling the
overlay from the gralloc or hardware composer, populate this structure
with the information from the gralloc handle.

(cherry picked from commit 128adc3b8177ef72f2bf21f4022d7ef06ed9281b)

Change-Id: I2f60f691ac01e67f150c753f168be754b14f94e6
2011-09-19 19:16:36 -05:00
Saurabh Shah
fc966d1448 Remove FPS calculations from userspace.
The FPS is stored in reserved[4] field of fb_var_screeninfo
structure. Read directly from this field.

CRs-fixed: 283750
(cherry picked from commit 0dec3f333db5b58c5ddd9c65fb7fd5c61cc5ef59)

Change-Id: I26632dc489ed8a95502b9071fed5b7527b33e54d
2011-09-19 19:16:36 -05:00
Naomi Luis
1efe8832e9 libgralloc-qsd8k: ashmem changes
- Remove unused GRALLOC_USAGE_PRIVATE_PMEM flag. This flag is no
longer used.
- Flush ashmem region cache instead of Invalidating it.

(cherry picked from commit 12254ff74f5a97dcf5ded90f53e9d6fd0fa47b9c)

Change-Id: I92e4dcd8c89eb9ae0c0484f039d152b7bbb28bbe
2011-09-19 19:16:36 -05:00
Naomi Luis
42c6d72977 libgralloc-qsd8k: Remove submaps for PmemKernelAllocators
Removing submapping for buffers allocated by the PmemKernelAllocator
This can be done since the restriction on multiple master maps has
been removed from the kernel

Change-Id: Iabe9cdfaa121bbffbfaf6503e037afebf5ac8455
2011-09-19 19:16:36 -05:00
Kinjal Bhavsar
1b51063e0d liboverlay: Add TV detection and monoscopic display for S3D
Add the state machine for overlay configuration. When connected,
check whether the TV on HDMI is 3D capable or not using the EDID
info. Show L channel on primary panel; and R channel on 2D TV if
non 3DTV is connected via HDMI, else switch TV to 3D mode.

Change-Id: I3109f8b0b81a8f5ad542db038262fd668e225e96
2011-09-19 19:16:35 -05:00
Naomi Luis
dc7076e724 libgralloc-qsd8k: Modify buffer sizes for NV12, NV21 and YV12 formats
Allocate buffer sizes that are multiples of 4K for the NV21, NV12 and
YV12 formats.

Change-Id: I3febaef9dda2586ef3b35945f30f655e07f5e369
CRs-fixed: 287882
2011-09-19 19:16:35 -05:00
Naomi Luis
d71c65326e libgralloc-qsd8k: Clean getGrallocInformationFromFormat function
- Stagefright no longer sends the OMX Formats to the gralloc, remove
unnecessary code from the function.
- Add support for the YV12 format in getGrallocInformationFromFormat

Change-Id: Id21baf8890f07ef8fb8a32d3b0d218540005f469
2011-09-19 19:16:35 -05:00
Arun Kumar K.R
1b5cb629f4 hardware/msm7k: Remove ioctl call from getOrientation
- The ioctl call from getOrientation is removed.
- In gralloc use getOrientation instead of storing the
  orientation.

Change-Id: Idb08568ff5d46ce99e0a9a8c6f492b90bb666f0c
2011-09-19 19:16:35 -05:00
Naomi Luis
9c2ba115fd Add support for dynamic resolution change with overlays
Whenever there is a change in the buffer geometry, set a flag in the
gralloc handle stating that the buffer geometry has changed.
In the HWC, whenever we encounter an update in the geometry, if the
channel is already open, we just call the necessary ioctls to update
the overlay information and not unnecessarily open/close channels.

Change-Id: I27db8fc497ebc514e262d6b7854739f312644714
2011-09-19 19:16:35 -05:00
Naomi Luis
2e44876757 libgralloc-qsd8k: Add perform api to update the handle
The new perform api will update the width, height and
format of the buffer in the gralloc handle.
The GRALLOC_MODULE_PERFORM_DECIDE_PUSH_BUFFER_HANDLING perform
is not longer used in Honeycomb. Remove unused code.

CRs-fixed: 283849
2011-09-19 19:16:35 -05:00
Kinjal Bhavsar
cc2834b226 msm7k: Use sanitized kernel headers
Add the exported sanitized kernel headers to include path in C2D/
copybit, gralloc and overlay HAL libraries.

(cherry picked from commit a70f426e8695cc5bbf8a45b987b5715784f7e924)

Change-Id: I1dbb79a086e9cb062e1264c1c354ac5ce1a05f27
2011-09-19 19:16:34 -05:00
Harshad Bhutada
b10f481ae2 libgralloc-qsd8k: disable framebuffer state related error reporting when swapinterval set to 0
Change-Id: Idf0d8b7d261240f6300c5df805cc42dee8098310
2011-09-19 19:16:34 -05:00
Arun Kumar K.R
ed35d42ee4 liboverlay: Always use rotator for UI mirroring on HDMI
- Use rotator buffer for UI mirroring on HDMI
- Avoid ioctl calls on getPosition

CRs-fixed: 278858
Change-Id: Id390e2b85fe939d8388ed17f5f9c7fcd30499755
2011-09-19 19:16:34 -05:00
Naomi Luis
7a23eb34e1 libgralloc-qsd8k: support for specifying buffer size during allocation
Add support in the gralloc to specify the desired buffer size during
buffer allocation. This is done via a new function in the gralloc(allocSize).

If the specified size is lesser that the calculated size,
set the buffer size to the calculated size.

Change-Id: Iad9609d3b9074dcf3af07430966590078081ab72
2011-09-19 19:16:34 -05:00
Arun Kumar K.R
e10754c16c gralloc: Avoid multiple signals from videoOverlayStarted
Signal hdmi_ui_loop from fb_videoOverlayStarted only if there is a
state change

CRs-fixed: 279095
Change-Id: I43bc87b4d78fae139bcfc0318ad8b271a6a325c7
2011-09-19 19:16:34 -05:00
Arun Kumar K.R
1ae5a28caa gralloc: Avoid unnecessary overlay set calls for HDMI
Call setPosition and setParameter for HDMI only when there is a
change in the rotation or position.

Change-Id: Id11b58408607c2f9799bb332c30d52f52957ec4e
2011-09-19 19:16:34 -05:00
Naomi Luis
e03a345a11 libgralloc-qsd8k: Flush the cache after buffer allocation
Change-Id: Idb720b8c64b323216f77de834c83c328caccd6ef
2011-09-19 19:16:33 -05:00
Harshad Bhutada
36342178c2 libgralloc-qsd8k: Add support for triple buffering
Change-Id: I15c0a2c76f4ee1a87a8b2be369c24ab8d4c38101
2011-09-19 19:16:33 -05:00
Naseer Ahmed
8864a8d075 gralloc: Fix compilation issue with ashmem on 7x27
Change-Id: I02fcbd7bdefd83be4a55a79ccd82c0df4b74f7ae
2011-09-19 19:16:33 -05:00
Saurabh Shah
f7c6371137 hardware/msm7k: Fix aspect ratio in HDMI UI
For portrait mode: Actionsafe width depends on actionsafe
height, thus maintaining the  aspect ratio.
User entered value for actionsafe width doesn't matter.

For landscape mode: Both, user entered actionsafe width
and height matter. Aspect ratio may change, in an attempt to fill
up the TV screen till the edges to avoid overscan/underscan.

Picks actionsafe rectangle as the final rectangle.

Change-Id: I4e16a2d57978d3443283e9311c2efdc6494f8a94
CRs-fixed: 271567
2011-09-19 19:16:33 -05:00
Shubhraprakash Das
76595c17bd libgralloc-qsd8k: Port part of change Ice6a7c28
Port over part of change Ice6a7c28 that frees ashmem
memory.

Change-Id: I467617f3bc35a0e448fbf41207853e669aed657a
2011-09-19 19:16:33 -05:00
Saurabh Shah
a2d029bef1 hardware/msm7k: Fix position, aspect ratio on HDMI UI
Fix position, aspect ratio of HDMI UI when the
primary panel type is MIPI, 8660 Panel or 7x30 Panel

Change-Id: I8e9824520317e3facb4ef25bc25dd9b1de60b4ce
CRs-fixed: 263690, 269433
2011-09-19 19:16:33 -05:00
Naomi Luis
ed76fc69a8 libgralloc-qsd8k: Close the gralloc module
Close the gralloc module in the fb_device_open api.

CRs-fixed: 269234

Change-Id: Ifcb1909e0cf8bf40f2b505716cb624531309556b
2011-09-19 19:16:33 -05:00
Naomi Luis
9cdf0b93ca libgralloc-qsd8k: Align the chroma size for NV12Tiled formats to 8K
The video decoder requires the chroma and luma sizes to be aligned to 8K.

Change-Id: Ie378728647348812197b48ca4a9299344e56c3af
2011-09-19 19:16:33 -05:00
Naomi Luis
06304d437b Align pmem for NV12 Tiled buffers
The decoder requires the NV12Tiled buffers to be physically aligned to 8k.

Change-Id: I07a40d2a390601192a01213a5de94df2ab1ee06c
2011-09-19 19:16:33 -05:00
Naomi Luis
3be64f08f9 libgralloc-qsd8k: Close the masterFd when freeing video/camera buffers
Buffers allocated from the adsp or smipool regions have a masterFd associated with each buffer.
Make sure both the fds are closed when the buffers are freed to avoid memory leaks.

Change-Id: I7dd194bae9ebfffb5e8c1ed647bff6210409a731
2011-09-19 19:16:33 -05:00
Naomi Luis
5a1bf4cb9e overlay: Add support for additional S3D formats
Add support for Side-by-Side full, Side-By-Side-half formats in the overlay.
The Side by Side half formats could either be in Left-Right or Right-Left mode.

Change-Id: Ie1f0ccb5b1a8254f7256aafdd3f0ce9a3faa0df4
2011-09-19 19:16:32 -05:00
Naomi Luis
3a51941fe6 Add support for S3D content over HDMI
Add support in the overlay to display 3D content on the HDMI.
The 3D input and out formats are passed along with the regular color format.

Change-Id: I4e0338e8b2c07eca0f211c50a17bf7d82c35279b
2011-09-19 19:16:32 -05:00
Naomi Luis
1e95e224d6 libgralloc-qsd8k: Move the OMX format definitions to gpu.cpp
Change-Id: Ieb6e1f07b6e676d6d9556572a61b70780e4483fc
2011-09-19 19:16:32 -05:00
Naomi Luis
d1fc805f34 libgralloc-qsd8k: Initial gralloc changes for honeycomb
This commit contains the following changes in the gralloc:
- Add buffertype in the gralloc handle i.e video buffer or UI buffer
- Add support for allocating memory from the /dev/pmem_smipool
- Add support for obtaining the buffer type and the HAL formats from the
input format which could be an OMX format.
- Add buffer type, format, width and height in the gralloc handle

Change-Id: Ie801cfcf5cea9c4b718b75e88abf71be6b087de7
2011-09-19 19:16:32 -05:00
Naomi Luis
a709f0300c libgralloc-qsd8k: Initial gralloc commit
Update the gralloc HAL to match commit:

        commit 4d3c9ca6fabf2b0111ef6b567df7d244e124b9c2
        Author: Arun Kumar K.R <akkr@codeaurora.org>
        Date:   Fri Dec 17 13:14:58 2010 -0800

            libgralloc-qsd8k: Add support for non-aligned width on HDMI

            While creating overlay channel for HDMI consider the aligned
            width and set the crop rectangle to the actual width and height.

Change-Id: I8858d71bb10b2be4c57edb605b5da680f53051dc
2011-09-19 19:16:32 -05:00
Mathias Agopian
9efee771b2 reject odd widths or heights for YV12 format
Change-Id: I66cbb5fbc20630218947cd41552a95503b58e15e
2010-09-10 14:40:10 -07:00
Mathias Agopian
31f0df4eba don't revert to ashmem if HW usage bits are set
this wouldn't make sense, since the h/w wouldn't be able
to use the buffer. in this case it it better to fail to
let the caller a change to try again with different usage bits.

Change-Id: Ibecaf069b6b58ee9c026affc95a45512660d5881
2010-08-20 16:02:29 -07:00
Mathias Agopian
0ff47fbdac only set the PRIV_FLAGS_NEEDS_FLUSH flag on PMEM buffers
PRIV_FLAGS_NEEDS_FLUSH will trigger an ioctl call into the PMEM
driver in unlock(), so it makes not sense to set this flag for
non pmem buffers.

Change-Id: Ie1e077c10df86d3689b82fa6ce5d6c856fc95688
2010-08-20 11:47:44 -07:00
Mathias Agopian
7461d57eca add qcom specific pixelformats
Change-Id: I70395b93afc4dee13e805649ee2307ffe895aaf1
2010-08-19 13:15:39 -07:00
Jamie Gennis
38b90c13c4 Change the constant name identifying the NV21 Adreno format.
This updates the qsd8k gralloc to support the new name for the NV21 Adreno
pixel format.

Change-Id: I358bf12db058d3740a5e49ee30d95c2afb708295
2010-08-06 12:09:15 -07:00
Mathias Agopian
041cfdf2cf fix [2855380] GRG19 monkey native crash in GraphicBufferAllocator
we were dereferencing the null pointer when freeing ashmem buffers.

Change-Id: I7be6e1ae064148bea1076193c21a73b5a3f90297
2010-07-28 18:12:39 -07:00
Mathias Agopian
fce1cc8a83 Remove the YV16 format.
Change-Id: I3f7995ba0cf41bcde995df293bea78bce7d82fc9
2010-07-14 16:29:43 -07:00