Commit Graph

1333 Commits

Author SHA1 Message Date
Prabhanjan Kandula
72e6062ee9 libhwcomposer: Remove dimension Align checks for copybit
gralloc is already taking care of source buffer width alignment
based on the color format.Alignment should be based on source format,
But not dependent on FB format.

CRs-fixed: 344311 355814
(cherry picked from commit 8c8edc440288def7017eb12d93391cb785196f55)

Change-Id: Id83f926068d65896b6c7bb93dd086aa9d8c3b406
2012-06-03 02:49:05 -05:00
Saurabh Shah
3d6a8ffaf3 Implement single vsync for YUV + RGB content
-- For UI updates, mark the MDP pipe for single layer YUV to be NO_WAIT.
-- Remove premature unlocking of buffers, except error cases.
-- Unlock buffers only after a single Vsync (PAN or PLAY) and after pipe UNSET.

This ensures smooth transition from MDP to GPU and prevents tearing.

Change-Id: Icfcb770dae12d4a7e0ff96d04149b2eaf0c07121
CRs-fixed: 359140
2012-06-03 02:49:05 -05:00
Ramakrishna Prasad N
b942708b15 libhwcomposer: Wait for framebuffer post complete before releasing composition buffers on bypass failure.
When bypass fails, MDP keeps reading the last submitted buffers until
the next VSYNC i.e., until PAN_DISPLAY is called on framebuffer. So
the previous buffers can be released only after PAN_DISPLAY IOCTL
call returns.

CRs-fixed: 348953

(cherry picked from commit c3a7ed7db39609e8f4d7ce0d6a56e82303ddb7f1)

Conflicts:

	libhwcomposer/hwcomposer.cpp

Change-Id: I5fb5a9eb275006a3158a111aad1eafac79973095
2012-06-03 02:49:05 -05:00
Naseer Ahmed
6b64b4881e gralloc: Reduce log severity for invalid handles
The calling function logs the appropriate error

Change-Id: I41f446b1495e23995aff4778f1c1a488d83537fb
CRs-fixed: 361831
(cherry picked from commit 81fd358ee8b70946b306417064d104fa3341d6fa)
2012-06-03 02:49:05 -05:00
Saurabh Shah
7015a91bc8 framebuffer: Remove extraneous update on HDMI
HDMI should be updated only in conjunction with primary.
Which means on a resume from suspend (which is treated as
cable connect in HALs) we need not draw ahead of primary.

A good way (already existing) is to call invalidate() on SF
on cable connect so that primary is updated and only then HDMI,
by a trigger from disp_loop thread.

Change-Id: I7d5268b2f0e27adb04aade757c36483cdfc1333e
CRs-fixed: 335763

Conflicts:

	libgralloc/framebuffer.cpp
	libhwcomposer/hwcomposer.cpp
2012-06-03 02:49:05 -05:00
Saurabh Shah
1e2be7b5b0 hardware/qcom/display: Add events for secure session setup
Change-Id: I0c0b5b7ae70d7ea8b341285479cd92750e1f6274

Conflicts:

	libgralloc/framebuffer.cpp
	libqcomui/qcom_ui.h
2012-06-03 02:49:05 -05:00
Ramakrishna Prasad N
5875b20445 libgralloc: Add API's to synchronize framebuffer update.
This change introduces API's in gralloc to allow clients
to synchronize with framebuffer posts.

CRs-fixed: 348953

(cherry picked from commit f81de75b1adb78018c0bd54b7f27901ba467defd)

Conflicts:

	libgralloc/framebuffer.cpp
	libqcomui/qcom_ui.h

Change-Id: I98b6a2b3243f520138cb5d1c76493cdfa3af60b6
2012-06-03 02:49:05 -05:00
Arun Kumar K.R
ac786968e3 qcom/display: add perform function to fb/hwc HALS
- Add perform function to framebuffer and HWComposer HALS
- This will be used communicate custom events(external display,
  video overlay, orientation, etc.,) to HALS
- remove setActionsafe API(not used)

CRs-Fixed: 341947
(cherry picked from commit 31999628ddd4a6c0996e22e9fbf1f311d6efb160)

Change-Id: I221f2ab49770e8db7602bb1881ef9972567b7780
2012-06-03 02:49:04 -05:00
Sudhir Sharma
5e6e965be7 Revert "Revert "libgenlock: add support for genlock_write_to_read locking semantics""
This reverts commit b419ca44a137f8f5bc9b80412c7a6459583addab.
2012-06-03 02:49:04 -05:00
Kinjal Bhavsar
7c05f8ce9d display: Fix Overlay state transitions
Trigger overlay state change for S3D format changes.

Close both overlay channels only when transition to/from 3D display
happen.

The closeChannel resets the Overlay state variables. Any changes to
the state variables prior to closechannel are lost. Update state
variables after calling closeChannel.

Remove unused variables.

Change-Id: Ia5aa84d02df1e1874df93530cf3e55298ebc81e3
CRs-fixed: 342350 342987 347382 350326
(cherry picked from commit 6706fd708dace780751a4602d6125e089851789f)
2012-06-02 23:39:24 -05:00
Naseer Ahmed
0371a6cfa9 display: Use a new flag for content protection
The GRALLOC_USAGE_PROTECTED flag that was used
earlier for content protection is also used for
some other use cases such as disabling of
screen captures. Define this new flag that
is explicitly used for allocating secured
buffers for DRM.

Change-Id: Ia33f79fa0dea7f2f16dd320f267203e6173af48e
CRs-fixed: 348454
(cherry picked from commit 440a996f13be732895524412762793f109681c11)
2012-06-02 23:39:24 -05:00
Naseer Ahmed
b904eeeec8 gralloc: Allow SF to use IOMMU heap
(cherry picked from commit 9ff9a8df77ce6887b6d45fdb7dc7400690d408c5)

Change-Id: Ia079f4c68b88201f638cfc2b4618de381d246e49
2012-06-02 23:39:24 -05:00
Arun Kumar K.R
9089a0e4ca liboverlay: check for flip when rotating 90 or 270 deg
- In setTransform, when rotating to 90 or 270 deg, also consider
  the case of current flip values(if any)
- This is needed when switching b/w front camera/back camera/
  camcorder

Change-Id: Ieae8f90438dda24006ede4cf925acf46ecec5b32
(cherry picked from commit c5defdb54862490c502f255d7811cf73b8962b8d)
2012-06-02 23:39:24 -05:00
Saurabh Shah
10d91371c2 Fix secure flags value in overlay.
Remove the member "secure" from overlay_buf_info.
This member was used to indicate secure content and this info was
later extracted out into existing flags. Now we use the same flags,
right from hwc to mark secure content.

The member above had junk value, since it wasnt initialized.
This caused, normal videos to fail with IOMMU. Removal of the member and
marking the existing flags fixes this.

Change-Id: Ib5a2439fde7114c20e478fbee5e4d276680c316a
2012-06-02 23:39:24 -05:00
Saurabh Shah
050ef1b611 liboverlay: Call overlay set ioctl, only if input params change.
Change-Id: I753c30be4062be10655d7072c795052ef65f87ae

Conflicts:

	liboverlay/overlayLibUI.cpp
2012-06-02 23:39:24 -05:00
Arun Kumar K.R
0358ea0b84 qcom/display: Add support for video rotation on HDMI
- Enable rotator for HDMI for video
- cleanup updateOverlaySource API, it does not need
  orientation info

Change-Id: Id53a42cbc4265015ea2714d25df1b02af60ee5e4
CRs-fixed: 341691, 330719, 342199, 344308
2012-06-02 23:39:24 -05:00
Sushil Chauhan
8f3c0e6d8c liboverlay: Remove evening-out of layer destination coords.
Evening-out of layer destination coords causes a noticeable up & down
shift in the screen when video layer drawing switches between Overlay
and GPU. This is most easily observed during video playback or pause,
when a UI layer (like Menu) is displayed / hidden. Remove evening-out
of layer destination coords to fix the video layer "twitching" issue.

Change-Id: I3f43b53a7609c9ad8cc983c353fba6dc97460158
CRs-fixed: 348856 350073
2012-06-02 23:39:23 -05:00
Arun Kumar K.R
73b4678d06 liboverlay: set correct flags for external display channel
When external display is connected during video playback, the
flags to overlay was not set properly.
Pass the flags which comes from the hwc, by just changing the
WAIT_FOR_VSYNC(external should not wait for vsync)

(cherry picked from commit 857cfcba2d120d5da4916c7cb4fe119a08d1ce68)

Change-Id: I13100bebd223780eb9c709f384f0e4644e8295dc
2012-06-02 23:39:23 -05:00
Prabhanjan Kandula
70139de6a2 libgralloc: fix the calculation of fb virtual y resolution
calculate the yresolution virtual according to the hole
introduced by 4k alignment of frame buffer.

CRs-fixed: 325134

(cherry picked from commit 464443a5d3b216e06e644d0e41c234490c3c46c2)

Change-Id: Id7a93e11e2f3c1d52a26ec3669a9d710c369bf41
2012-06-02 23:38:31 -05:00
Prabhanjan Kandula
e80c89a867 libgralloc: fb size alignment to pagesize
Align framebuffer size and offset to pagesize, calculate
framebuffer size based on this alignment and use it for
mapping framebuffer in userspace and page flipping.

CRs-fixed: 332175

(cherry picked from commit d89b0493b4651fbaaeccccf0ae880cbf1a3a3479)

Change-Id: I7840f7f3c5c42852087cb9df6ae85680c971c601
2012-06-02 23:38:31 -05:00
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
9a02b8e9d6 framebuffer: In enableHDMI, check if target supports true mirroring.
- check if the target supports true mirroring in fb_enableHDMIOutput
  instead of framebuffer HAL initialization.
- We check if the target can support true mirroring by using the RGB1
  pipe, with new driver changes, RGB1 pipe is allocated only after
  first display update.
- Hence moved this call to fb_enableHDMIOutput

(cherry picked from commit db5225cc97b7c42871d5674702e1ca48a5a27904)

Change-Id: I9838fb0bfe6d49c5de3a7b1f4c116bd93c7b375c
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
2012-06-02 23:38:31 -05:00
Andrew Sutherland
f6d6c9b301 qsd8k: hwcomposer: update drawLayerUsingCopybit
fe623a3 libhwcomposer: Remove dimension Align checks for copybit
5ceafe7 libhwcomposer: Make fb width 32 aligned.
4c56f52 Display/hwcomposer:Add support for intermediate down scaling

Change-Id: Id52e04db2055f1f58543eaf3a9b84e103af739b5
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
Saurabh Shah
272e6ecb11 Fix heap corruption in overlay clients.
Fix heap corruption in overlay clients, caused by missing
compilation flags. All libraries using overlayLib.h should
have flags used for conditional member declaration in overlay.

CRs-fixed: 342959
(cherry picked from commit 42120b29500560ebedbd897e2e7adf7369eb0a21)

Change-Id: Idf613861c4dc67e96ecadf7ce7e37472cb4e4daf
2012-06-02 20:57:09 -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
Andrew Sutherland
0fefc37909 Makefiles: remove QCOM_HARDWARE cflag
Change-Id: Ief3ab8c3eb89fa54fdf3f7889c962311615d7542
2012-05-22 17:06:11 -05:00
Andrew Sutherland
9bcdf571d7 libgralloc: add missing ion ifdefs
Change-Id: I34ce6e17da0ad7b1831008e7d6555c8e530d09b2
2012-05-22 17:05:46 -05:00
Andrew Sutherland
22a0392cf3 libgenlock: always define USE_GENLOCK
Change-Id: I865499212dc96fb19a536040c06767ccda93e21c
2012-05-22 17:04:57 -05: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
Naseer Ahmed
3d3e9400aa overlay: Continue when one of the framebuffer fd's fail to open
Change-Id: I4b1f071ebcf04a189bab612dd0d3def1a660105c
2012-05-22 17:03:46 -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
Naseer Ahmed
d6ffef4cef gralloc: Add locking to alloc and free in ION
Change-Id: I16e24e3d366b15a458b19983827233a7bd27d9f7
(cherry picked from commit edad58e17deb0cb1d9ff4754fbac511eea8e4ecf)
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
Naseer Ahmed
c92339fb57 gralloc: Allow temporary buffer to choose to be cached
The flag GRALLOC_USAGE_PRIVATE_UNCACHED can be set in the
usage to allow it to be uncached. If not set, the buffer
will be cached by default.

CRs-fixed: 341196
(cherry picked from commit 6232816aadd311dbb57b714c7c0a4073d3ddc7f7)

Change-Id: Ic10677d105328702972dd69581b919c984d17fe9
2012-05-22 17:03:46 -05:00
Naseer Ahmed
840a257b9e gralloc: Initialize and handle allocType correctly.
CRs-fixed: 346154
(cherry picked from commit a235dd6b4e8efe3cc432057806b3d5fb2cb4881d)

Change-Id: Ie657f6e52df5a4b39c9fa04e74aabe1135e5bdd5
2012-05-22 17:03:46 -05:00
Panneer Arumugam
873b6a9a79 libgralloc: Clearing PRIV_FLAGS_NOT_MAPPED.
- clearing PRIV_FLAGS_NOT_MAPPED if
  GRALLOC_USAGE_PRIVATE_DO_NOT_MAP flag is not set
  so mmap can be skipped.

Crs-fixed:342782

Change-Id: I01de82dedf08c8c41db179789cc3a9927aa7e221
(cherry picked from commit 67215121cdff9df78d6a80cda442a6bfc7aa27b3)
2012-05-22 17:03:46 -05:00
Sushil Chauhan
4b0638777a libcopybit: Fix source stride for software YUV buffer copy.
Incorrect source stride setting for software YUV buffer copy causes
the software converter used by apps like Video Telephony app to
crash. Correct the source stride setting passed to YUV buffer memcpy.

CRs-Fixed: 346928
(cherry picked from commit db92bedc081365e447233bbdd6e070e88a5cbc19)

Change-Id: I5edf7ff4d38e8b55eece9e856adeeab972e80fa0
2012-05-22 16:32:13 -05:00
Prabhanjan Kandula
0c3b559c20 libcopybit: Enable premultiplied alpha support
Premultiplied alpha is now supported on MDP3.x.
Enable it from userspace.
Also make flags as int since values are exceeding 255(uint8_t).

CRs-fixed: 347803
(cherry picked from commit 3dcbcb1f8672067f85e2f53e6321c27df6d6fbe6)

Change-Id: I865379b368726e95cab7aa669fbf27d5207240c5
2012-05-22 16:31:19 -05:00
Andrew Sutherland
906031e60f gralloc: hide pmem debug messages
these tend to dominate logcat especially when playing videos

Change-Id: Iaeb73b164bd2baf71c2f1ea93e0105a843e21ff3
2012-03-30 21:11:00 -05:00
Andrew Sutherland
ab071af114 libqcomui: qsd8k: enable BYPASS_EGLIMAGE CHECK_FOR_EXTERNAL_FORMAT
these work arounds are originally for msm7x27a but seem to work ok on qsd8k

Change-Id: Ie903598ff0d532d5a6d8ee4725977117ec1bfb36
2012-03-30 20:34:23 -05:00