Commit Graph

44 Commits

Author SHA1 Message Date
Arun Kumar K.R
6c85f050b2 libgralloc: use proper types and type casts
- Use proper types for pointers
- Resolve compiler errors
- handle proper type casts
- remove unused variables

Change-Id: I628ebe174485d30abadea4ca40b67f9aab1a0652
2014-03-28 15:14:58 -07:00
Manoj Kumar AVM
1f6a82159c gralloc: Add GRALLOC_PRIVATE_USAGE_WFD flag
1. Screenrecord and WFD use virtual display and encoder.
   Since HAL supports only one virtual display, we need a
   definite way to distinguish both use-cases.

   Failure to differentiate will break Screen record + WFD
   concurrent usecase.

   WFD stack will set this usage flag and SF will query the usage
   flags to differentiate WFD and screenrecord usecase.

2. Deprecate GRALLOC_USAGE_PRIVATE_EXTERNAL_CC and
   GRALLOC_USAGE_PRIVATE_EXTERNAL_BLOCK flags as these are no
   longer used.

Change-Id: Ifa260c5af2371eea830744ce62a5a83b8cfd0de7
2014-02-20 11:22:33 -08:00
Manoj Kumar AVM
cdb4fd513c gralloc: Set default value for implementation defined formats
For implementation defined formats which go via HWC, set the
default value to RGBA8888

Change-Id: I7f8c46bc47746dcf1c4a03438b8f93d7bab78bb1
2014-02-03 12:51:04 -08:00
Linux Build Service Account
bbba2e6206 Merge "hwc: RGB888 is considered as a VIDEO type" 2014-01-21 12:34:06 -08:00
Manoj Kumar AVM
8a22081e49 hwc: Add support for Macro Tile feature
Macro tile is enabled only if all the conditions are met:
  1. GPU hardware should support Macro Tiling.
  2. MDSS hardware should support Macro Tiling.
  3. USAGE flags shouldnt contain GRALLOC_USAGE_SW_READ_OFTEN and
     GRALLOC_USAGE_SW_WRITE_OFTEN.
  4. RGB 16bit and 32bit formats.
  5. persist.hwc.macro_tile_enable flag should be enabled.

PRIV_FLAGS_TILE_RENDERED flag is added to indicate whether the layer
is rendered/composited in Macro Tiling or Linear format.

Change-Id: Ie3139839c84d76c5d1a2300f33910a09eb7336f4
2014-01-14 13:32:31 -08:00
Zohaib Alam
17e4856b9e hwc: RGB888 is considered as a VIDEO type
For mpq8092, RGB888 is the output video format, so need to make
it a video buffer type, so that VIG pipe gets allocated for
it. Another reason is that GPU cannot process RGB888, so marking
it as a VIDEO layer will ensure that it will get picked by MDP.

Change-Id: I5d1812a70f5e4d1fb7448d0a145a15c07c6fc188
2014-01-09 13:34:12 -05:00
Baldev Sahu
5f673b4749 libgralloc: correct assigment of HAL_PIXEL_FORMAT_RGBA_8888
For implementation defined formats which go via HWC, set the
default value to RGBA8888.

Change-Id: I741504d54694ac061ecd6c870cb8f815cc61ab24
CRs-Fixed: 588596
2013-12-13 14:00:20 +05:30
Naseer Ahmed
f2feca9bcf Revert "display: Video Encoding not working"
This reverts commit 0a1db6aef28c3b90d1f992f56abc562dbae10b55.
Video encoder uses the NV12 encodeable format again.

Change-Id: I1b5170a5c2b5c7de0791cc5bc44457257519f749
2013-11-08 15:32:52 -08:00
Jesse Hall
fbe96d2b78 Replace sRGB_888 with sRGB_X_8888
As sRGB_888 is not defined, replace it with sRGB_X_8888

Change-Id: Ie7e27ffea1ca6ec99de8e746c0f784e5fc9a4e53
(cherry picked from commit b81796dc9a0c4178004ae947e9d756c5cae6967a)
2013-11-08 15:23:10 -08:00
Naseer Ahmed
82fc4b733f gralloc: Add allocation support for sRGB formats
Refer to graphics.h for the definition of these new formats.
The HWC doesn't yet support output to these formats.

Change-Id: I14dade3412d262d853d3783ba77d559c76d331bf
(cherry picked from commit 3a63837a3d006aee3d176d379409bf3134f6189b)
2013-11-08 15:22:57 -08:00
Ramkumar Radhakrishnan
ff511027c4 display: Add support to HAL_PIXEL_FORMAT_NV21_ZSL format
Add Support to HAL_PIXEL_FORMAT_NV21_ZSL format in gralloc for
camera capture usecase.
This support is required because, CPP module requires 64 byte
aligned width and height to resolve corruption in bottom/left edge
of the landscape/portrait buffer.

Change-Id: Id3e0e5f3d695d5111f3469f78a1d52aad9bea4f4
(cherry picked from commit 512ee1dcef6fa47dfdcf3990fea29bd85f967f02)
2013-11-08 15:22:07 -08:00
Ramkumar Radhakrishnan
ba713389c2 hwc: Add support for Secure display
- Identify secure display layer in the hwc_list
- Need to set both SECURE_OVERLAY and SECURE_DISPLAY flags for the secure
  display layer
- Disable idle timeout for secure display usecase, as GPU should not be
  accessing secure display layer

Change-Id: I555910db77c466b5e103b24b4f0ec7f47bb210a5
2013-10-08 16:03:24 -07:00
Arun Kumar K.R
1062ea1607 libgralloc: Don't set buffer type to be BUFFER_TYPE_VIDEO
For buffers with usage set as GRALLOC_USAGE_EXTERNAL_DISP or
GRALLOC_USAGE_PROTECTED, dont mark them as BUFFER_TYPE_VIDEO,
as they can be either RGB/YUV

Change-Id: If4ee80ae85427b2bd850a9f6aeb2c914d4c7c198
CRs-fixed: 537052
2013-09-06 17:29:43 -07:00
Naseer Ahmed
22fa2d3545 gralloc: Fix ITU formats for camera
Make sure ITU formats are applied exclusively for camera buffers.
Camera HW_TEXTURE buffers go to GPU and should be marked as 601 FR.
Earlier, this was OR'd with video encoder due to which it
incorrectly got marked as 709.

Change-Id: Icaf3692b581b7861229e613dd632123d21dda2cf
2013-08-14 13:28:54 -04:00
Naseer Ahmed
8478672bdb gralloc: Use compile time flag for mdss.
The gralloc allocation can happen from processes other than
surfaceflinger in which case we cannot open the framebuffer
device to get the mdp version. Use the MDSS_TARGET flag to
differentiate.

Change-Id: I69bc9ff6004b382a2836274a32fbbd3b2e67dea2
2013-06-14 17:39:22 -04:00
Naseer Ahmed
fc940ef958 gralloc: Add ITU-R standard info for YUV formats
These format qualifiers will help graphics decide which
standard to use when working with a YUV texture.

Change-Id: I6ad464e6b070d3b375c5e07f03228308d15407cd
2013-05-08 12:21:02 -07:00
Linux Build Service Account
08746980da Merge "gralloc: Set correct private gralloc format for video buffers" 2013-04-23 20:01:49 -07:00
Shuzhen Wang
a11b6ba75c gralloc: Set correct private gralloc format for video buffers
For IMPLEMENTATION_DEFINED pixel format, if the usage flag is
HW_VIDEO_ENCODER, the private gralloc format should be
HAL_PIXEL_FORMAT_NV12_ENCODEABLE.

Change-Id: I61e8aabe124179e8bebda5d50ad1d8681060b99a
2013-04-21 14:29:05 -07:00
Shuzhen Wang
46ca226768 gralloc: Mark buffers used by HW Texture
Consumer of gralloc buffers need to distinguish between buffers
with different usage flags, such as HW_TEXTURE vs VIDEO_ENCODER.

Change-Id: Idc330390c184ea942c096b84d29afe7705c06e4d
2013-04-18 09:53:50 -07:00
Naseer Ahmed
47aa15ed78 gralloc: Enable framebuffer memory mapping.
Enable mapping from framebuffer if debug.gralloc.map_fb_memory
is set to 1. This is useful for bringup.

Change-Id: I3c860148729c5f5c98d84bf17e6633285b4b0af1
2013-04-11 13:16:06 -04:00
Naseer Ahmed
e41ad9c8c1 gralloc: Mark buffers used by HWC
Some clients need to distinguish between buffers going to HWC
for composition and other regular buffers.

Change-Id: Ia05a765afe2f8bd223f3e47edd0fb746d6ade531
2013-04-08 08:32:13 -07:00
Ramkumar Radhakrishnan
73f952ae3f gralloc: Override gralloc calculated size only if bufferSize is greater.
bufferSize set using native window set buffer size will override gralloc
calculated size only if bufferSize is greater.
Fix for 720P, 1080P HD content playback is not working on 7x27A due to
buffer size mismatch between requested size by frameworks and allocated
size by gralloc for HAL_PIXEL_FORMAT_YCrCb_420_SP and
HAL_PIXEL_FORMAT_YCrCb_420_SP format

Change-Id: I16d04e406ab8f1f35e0e0a70e19d99a019adc5ef
CRs-Fixed: 451783
2013-03-26 11:30:50 -07:00
Jeykumar Sankaran
c1f8682f7b display: Remove framebuffer HAL usage
This patch removes the usage of the framebuffer HAL which is
deprecated in JB MR1 onwards. The code is left for compatibility
such as conformance tests but it is unused for normal display
usage.

Change-Id: If98133bdaa759cdc41d4503ff695b225ee43cb6f

Conflicts:

	libhwcomposer/hwc_utils.cpp
2013-03-18 16:38:54 -04:00
Naseer Ahmed
a163b73bea display: Remove genlock usage
genlock is no-op from Android 4.2 onwards since the sync framework
is used for explicit synchronization.

Change-Id: Idd1df589516534a683e0fa1ef0cfbb7f0e411f67
2013-03-15 11:48:59 -07:00
Linux Build Service Account
961407fe41 Merge "display: Reconcile display HALs" 2013-02-13 10:16:51 -08:00
Duy Truong
73d36df685 Update copyright to The Linux Foundation
Change-Id: I145b66896159ff9886ed73507f17b3165ba0266d
2013-02-09 20:33:23 -08:00
Naseer Ahmed
7421472e5c display: Reconcile display HALs
Make the display HALs compile with/without the Qualcomm BSP
specific features so they can work with pure AOSP.
Change-Id: I1ad7282c4fe1fe7e3309afb530a07735f165ffbe
2013-02-09 08:29:49 -05:00
Sushil Chauhan
7651a80dc9 display: Use GRALLOC_USAGE_PROTECTED to indicate secure content
For secure content, use GRALLOC_USAGE_PROTECTED flag instead of
the obsolete flag GRALLOC_USAGE_PRIVATE_CP_BUFFER.

Change-Id: I69bf8cfd3a978fd472608beb44056e1bf55c1414
2013-01-15 16:50:57 -08:00
Linux Build Service Account
8714496fd4 Merge "libgralloc: force 1M alignment for secure buffers" 2013-01-15 04:09:58 -08:00
Praveen Chavan
4e931c1d7d libgralloc: force 1M alignment for secure buffers
Align secure buffers to 1M alignment as TZ expects this for
protecting the buffers, MDP5 onwards.
Update the buffer-size to the same alignment used.

Change-Id: I369932a4a72b28c05a3ea216a8bba681de1f9dad
2013-01-10 14:23:02 -08:00
Linux Build Service Account
f51bfae5ee Merge "libgralloc: Add support for custom buffer size." 2013-01-08 18:08:13 -08:00
Ramkumar Radhakrishnan
47573e20d5 display: Add display metadata in buffer handle
Allocate extra space for metadata in buffer handles
Provide api to map this space in client process and set the metadata

Change-Id: I8bca8448670d4aa88d439320faf402dae30458f8
2012-12-26 15:45:17 -08:00
Ramkumar Radhakrishnan
3d4c0ac4f2 libgralloc: Add support for custom buffer size.
Init allocSize hook function with alloc_size function

Change-Id: I514d47928f10b6c41404aa19d8b704f64327211b
2012-12-19 14:54:00 -08:00
Naseer Ahmed
d7f842768a gralloc: Mark framebuffer as ION memory
Change-Id: I859d4d03b62279b7e66ba52e3215fe7394a63434
2012-12-13 13:20:04 -05:00
Naseer Ahmed
768619ecdf libgralloc: Discontinue allocating FB buffers from carveout.
Don't allocate primary framebuffer from carveout.
Allocate them from IOMMU heap just like the external framebuffer.

Bug: 7626586
Change-Id: I52a8db1a34d19856302b38d2c30c1290d1f2f060
Signed-off-by: Saurabh Shah <saurshah@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-12-03 15:35:26 -05:00
Saurabh Shah
d80a52cbf9 gralloc: Send first 2 FB buffers to carveout and next to IOMMU
Gralloc uses the GRALLOC_USAGE_HW_FB flag to allocate memory from carveout.
This is fine for primary framebuffer, but for external framebuffer we need IOMMU
heap buffers, since the ioctls for external work with those.

Ideally, the primary buffers also need to come from IOMMU heap, which is ongoing
work. This patch allocates the first 2 FB buffer requests (assuming they are for
primary) from carveout and allocates all subsequent buffers from IOMMU heap.

Bug: 7124159
Change-Id: Ie53b2e1e7fcac136acd2d251f39cefe367fc7125
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-10-02 23:43:31 -07:00
Saurabh Shah
aedf236884 gralloc: Check for HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED
Check for HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED before assigning format based
on usage bits.

Change-Id: Ie140f3f8a7002febc2fab729686d646b349c3b75
2012-09-05 22:06:25 -07:00
Shuzhen Wang
79cf7c7454 Gralloc: Fall back to HW_CAMERA_WRITE if HW_VIDEO_ENCODER is not set.
In both video encoding and camera preview cases, HW_CAMERA_WRITE will
be set. This is a hack so that if HW_VIDEO_ENCODER is set, allocate
NV12 format; otherwise, allocate NV21 format.

Change-Id: I61dc96b125e026159f55048cb79783578832460a
2012-09-04 21:16:38 -07:00
Naseer Ahmed
59802500bc gralloc: Support camera and video encoder flags
- Set private flags for these formats so that the camera HAL
can differentiate between the allocated buffers.
- Usage flags define format

Change-Id: Ib3cfad12ab2ba79662207609138633769b1504e6
2012-08-23 09:43:54 -07:00
Naseer Ahmed
4c588a200c hwc: Add support for external-only layers
Add support for different types of external-only layers
EXTERNAL_ONLY: General purpose
EXTERNAL_BLOCK: Blocks the display of other ext-only layers
EXTERNAL_CC: Used for closed captions with videos.

Change-Id: I9cc7b9a1dbf1085194725474d6a4d1094e27a0c8
Acked-by: Saurabh Shah <saurshah@codeaurora.org>
2012-08-14 14:18:13 -07:00
Naseer Ahmed
01d3fd3318 display: Clean up gralloc
* Remove pmem and ashmem implementations
* Remove usage of RefBase
* Reduce log verbosity

Change-Id: If8ef543d236e5305bd5430f4f9c62c51b3a13787
2012-07-23 12:39:29 -07:00
Naseer Ahmed
65f1656621 gralloc: Update YUV420 SP tiled format to match OMX
The value of OMX color format for YUV 420 SP tiled is 0x7FA30C03.
Add this format and also remove masking for interlaced videos
and S3D which were causing the format to be masked incorrectly

Change-Id: I76fe5e6e00a36130b065c5d88a8f52eebcfa162b
2012-06-21 16:31:57 -07:00
Naseer Ahmed
29a26818d7 qcom/display: Update HALs
- Update the display HAL from Code Aurora Forum
- Add updated overlay library
- Enable HWC with basic video going through overlay
- Cleanup some files

Change-Id: I65c687c51be458cee71213c79e03eeda962d9086
2012-06-21 11:52:07 -07:00
Iliyan Malchev
202a77d28a initial GL libraries for msm8960
Change-Id: I16451c70a079894ac326d3564d96f1fbafcd4f1b
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-06-11 23:50:46 -07:00