Commit Graph

1804 Commits

Author SHA1 Message Date
Mathias Agopian
a9611c5d5b fix a corruption in Vector<> when adding new items
would happen when vectors are copied and new items is
added in both vectors. we didn't duplicate the underlying
storage when adding items in vectors.

Bug: 6515797
Change-Id: If544c07d96c05821e088d7f2c9b5736f7e306c31
2012-05-17 17:47:44 -07:00
Jamie Gennis
dd73996552 Merge changes I32fbc2b6,Ifd0ed05b into jb-dev
* changes:
  SurfaceFlinger: recompute visible regions less
  libgui: remove setPostTransformCrop
2012-05-15 11:33:42 -07:00
Glenn Kasten
542af12d10 Fix log spam about CPU frequency on one device
Previous kernels have allowed opening the CPU frequency file regardless
whether the CPU is up or not.  This fixes some log spam on one device
with dynamic hot plug CPU feature, which does not allow opening the CPU
frequency file if CPU is down.

Also, since the file descriptors are global and have long lives, add
the close-on-exec flag.

Change-Id: Ia14a2b9e20038dfb96a573920176a47a96bd3f5a
2012-05-14 16:55:26 -07:00
Jamie Gennis
b7a6b96301 libgui: remove setPostTransformCrop
This change removes the setPostTransformCrop function from
SurfaceTextureClient.  It also includes a small logging fix in BufferQueue.

Bug: 6299171
Change-Id: Ifd0ed05b95dad6085e7a8267fda4d69b76ea3bad
2012-05-14 15:41:22 -07:00
Jamie Gennis
f15a83f581 SurfaceFlinger: add a crop to the layer state
This change adds a crop rectangle specified in window coordinates to the layer
state.  The all window pixels outside this crop rectangle are treated as though
they were fully transparent.  This change also adds the plumbing necessary for
WindowManager to set that crop.

Change-Id: I582bc445dc8c97d4c943d4db8d582a6ef5a66081
2012-05-11 03:16:02 -07:00
Glenn Kasten
f30fd01497 Merge "Workaround for add_tid_to_cgroup failed to write" into jb-dev 2012-05-10 17:38:34 -07:00
Glenn Kasten
10cbbd8f1f Workaround for add_tid_to_cgroup failed to write
Bug: 6467109
Change-Id: I6dff8e608d83c7a7c453c25c94ad100f113769b9
2012-05-10 15:52:59 -07:00
Jamie Gennis
cd1806e210 libgui: improve some logging and dumping
This change updates some of the SurfaceTextureClient and BufferQueue logging
and dumping to include the crop, transform and scaling mode.  It also removes
the uses of the NO_SCALE_CROP scaling mode enum, which was added by accident in
a previous change.

Change-Id: I62912716a1e48885fb22f12b92678aa13f10fcd9
Bug: 6470541
2012-05-10 15:35:22 -07:00
Dianne Hackborn
555f89d8df Add callback hack to find out when to reload system properties.
Every IBinder object can accept a new transaction to tell it that
it might want to reload system properties, and in the process
anyone can register a callback to be executed when this happens.

Use this to reload the trace property.

This is very much ONLY for debugging.

Change-Id: I55c67c46f8f3fa9073bef0dfaab4577ed1d47eb4
2012-05-09 14:53:26 -07:00
Jamie Gennis
82c53806ad Merge "SurfaceTexture: improve texture matrix computation" into jb-dev 2012-05-09 12:52:25 -07:00
Jamie Gennis
cae7c0b955 Merge "libgui: Add support for post-xform crops." into jb-dev 2012-05-09 12:51:57 -07:00
Jamie Gennis
59df82f355 Merge "libui: add the Rect::transform method" into jb-dev 2012-05-09 12:51:39 -07:00
Jamie Gennis
5c1139fea3 SurfaceTexture: improve texture matrix computation
This change reduces the shrinking of the crop rectangle in some cases.  It adds
a way to inform the SurfaceTexture that its texture will be used without
bilinear interpolation, and uses knowledge of the pixel format to avoid
shrinking unecessarily.

Change-Id: I72365f39f74ecb7fcc51b4cf42f2d0fa97727212
2012-05-08 17:08:33 -07:00
Jamie Gennis
d72f233ffa libgui: Add support for post-xform crops.
This change adds support for specifying a crop rectangle to a
SurfaceTextureClient that is in post-transformed coordinate space.

Change-Id: I247901de343e71b32850f7ae3bac62dfa612ad3d
Bug: 6299171
2012-05-08 17:08:33 -07:00
Dianne Hackborn
34c65888d1 Change name of system property for traces.
This allows the property to be changed from the settings UI.

Change-Id: Ife7424b3549e5bbe51b6ad2fb8e5edde3a9fd608
2012-05-08 14:54:24 -07:00
Mathias Agopian
29267fe849 return errors properly in BitTube and SensorEventQueue
Change-Id: Idf31179f9fcc666e287c7b01b2007431cb60127d
2012-05-07 18:22:16 -07:00
Jamie Gennis
5933280430 libui: add the Rect::transform method
This change adds a method to Rect to transform a rectangle by a graphics HAL
transform.

Change-Id: Ic0d0988e731bdb5662faee41a5927b1242891658
Bug: 6299171
2012-05-07 15:25:52 -07:00
Mathias Agopian
2ebc4d6d94 set a Sensor's version properly
Bug: 6447433
Change-Id: Iaa5d074a8137d9543ea78c2c6f63a750774b3057
2012-05-04 15:47:13 -07:00
Jamie Gennis
5c8a608497 SurfaceTexture: fix a memory leak
This change fixes a memory leak.

Bug: 6414806
Change-Id: I43536689b4219a042749aec2096a1d5c4e664ae3
2012-05-02 13:10:56 -07:00
Mathias Agopian
6b8bef64f7 PixelFormat.UNKNOWN should return an error when queried
Bug: 6294260
Change-Id: Iad6f7bcbdda0a684abca6d9584da611a8b28f7ab
2012-04-24 23:27:31 -07:00
Jamie Gennis
efc7ab6dce libgui: Add plumbing for active rectangle
This change adds the plumbing to SurfaceTextureClient, BufferQueue, and
SurfaceTexture to get the active rectangle passed to the ANativeWindow to
the buffer consumer.

Change-Id: I35da0889b266327ebb079b6a7136fa3e2e8b00e6
2012-04-24 17:34:38 -07:00
Daniel Lam
f4b322801d SurfaceTexture: detachFromContext fixed
Fixed AttachToContextSucceeds test SurfaceTexture test by
not deleting the current texture when cleaning up memory.

Bug: 6363186
Change-Id: Ib886bfe6bb86e25ea4825d18b5008afba6b33eae
2012-04-24 17:25:00 -07:00
Mathias Agopian
2488b20aec add a way to query whether an ANativeWindow consumer is running ahead of the producer
Change-Id: Ibccfa1feb56db2ab11f0c0934ce2d570a2b65ae2
2012-04-23 20:06:02 -07:00
Mathias Agopian
24202f5676 update the binder protocol for connect to match that of queueBuffer
indeed, connect and queueBuffer return the same data, so it's
easier to have them use the same protocol.

Change-Id: I4f9fa3be0a80c9ab0a7a4039b282ae843aab02e1
2012-04-23 20:06:02 -07:00
Mathias Agopian
a0db308c3d remove SurfaceTexture::connect()
use BufferQueue::connect() instead

Change-Id: I04aab7cf11304bf962cde38470747f3b19ddba42
2012-04-23 20:06:02 -07:00
Glenn Kasten
a26e1cfbbc Scheduling group cleanup
Remove C++ APIs androidSetThreadSchedulingGroup and
androidGetThreadSchedulingGroup, and the ANDROID_TGROUP_* constants.

Former callers of these should now use the C APIs set_sched_policy and
get_sched_policy, and the SP_* constants.

Note: debug.sys.noschedgroups is not supported by the C APIs,
this needs to be discussed.

Change-Id: I32bbfc539ef4090faf9ef0320380e8cca9eae07c
2012-04-19 11:32:59 -07:00
Mathias Agopian
9798ff28b8 Merge "add set thread count" 2012-04-18 18:36:16 -07:00
Mathias Agopian
1b80f793d2 add set thread count
Change-Id: I70f02908d8362a465eb8a2a24356f6989847f7ba
2012-04-18 17:50:03 -07:00
Eino-Ville Talvala
6c47034f5e Fix BufferQueue verbose log
Change-Id: Id80742b5c1fd2960cc2eda3a9ba2db1078df5320
2012-04-18 14:47:12 -07:00
Eino-Ville Talvala
85b217668d Remove fixed USAGE_HW_TEXTURE flag from BufferQueue.
USAGE_HW_TEXTURE applies to SurfaceTexture, not to all uses of
BufferQueue. Refactor accordingly.

Change-Id: Ic7add5e1f2bbec3d3e796ba7f15eaa0633945d8f
2012-04-18 10:56:06 -07:00
Jeff Brown
992b4c556b Merge "Support tokenizing arbitrary content." 2012-04-17 18:20:55 -07:00
Jeff Brown
a8be8fa096 Support tokenizing arbitrary content.
Bug: 6110399
Change-Id: I37be63b68934fd451e6dffbf7d6079553619c0a3
2012-04-17 18:19:50 -07:00
Jamie Gennis
9aa74dbc70 SurfaceTexture: fix a memory leak
This change fixes an issue where we were sometimes setting the SurfaceTexture's
EGLDisplay to EGL_NO_DISPLAY in detachFromContext, and then subsequently
abandoning the texture.  Abandoning while in the detached state would result in
the eglDestroyImageKHR calls failing, which resulted in a memory leak.

Bug: 6302694
Change-Id: I24c1de0dac029a83c7508075fb8aaeaed96a14ea
2012-04-17 15:53:31 -07:00
Jamie Gennis
2efa4b2bb0 Merge changes Id79430f9,I541d3046
* changes:
  BufferQueue: check before tracing buffer index
  SurfaceTexture: shrink all sides when cropping
2012-04-17 15:52:49 -07:00
Jamie Gennis
695e331f01 BufferQueue: check before tracing buffer index
This change adds a check on ATRACE_ENABLED before calling snprintf to trace the
buffer index.

Change-Id: Id79430f9c69706393efd3d10780a4cc97055e9e0
2012-04-16 20:36:25 -07:00
Jamie Gennis
91a6826d67 SurfaceTexture: shrink all sides when cropping
This change makes SurfaceTexture include an offset for all sides of the crop
region when cropping.  This keeps the image centered, to minimize the visual
changes when switching between the texture transform matrix-based cropping and
something that does proper cropping (e.g. HWComposer).

Change-Id: I541d3046fd92e49221b488444df36d490924d1c5
2012-04-16 20:33:54 -07:00
Mathias Agopian
e8db871de7 double checked locking pattern is not safe on SMP
Change-Id: Ie6dd564bdcd45647cb4d62ab259462e3db112576
2012-04-16 19:30:56 -07:00
Mathias Agopian
3aecbb0715 fix Region const_iterator.
- it returned an empty rect when the region was empty, instead
of returning an empty list of rect.

- also fixed an infinite loop when boolean_operation was given
an empty list of rects

Change-Id: I62225c7dcd2832025bb8f12e6cb3762f2a7b36cb
2012-04-16 18:40:30 -07:00
Mathias Agopian
82ca93bf66 Merge "s/w rendered apps can now use n-buffering (n>2)" 2012-04-16 15:59:39 -07:00
Mathias Agopian
172a62a224 make sure to pass the transform-hint on ANW.connect
this optimization was probably lost during ST refactoring.

Change-Id: I845978c4b718cb91941d15b30484837f19714abe
2012-04-16 00:08:26 -07:00
Mathias Agopian
ac6035a12a s/w rendered apps can now use n-buffering (n>2)
Bug: 6311881
Change-Id: I6e52e281e8d432430aad011f6d9dcf35d7b4ac7d
2012-04-13 16:04:44 -07:00
Mathias Agopian
b364be8e55 fix a typo causing pre-rotation to never work
Change-Id: I8d698ec52d53ef1a553b887c7329413e1f49cc72
2012-04-12 19:40:28 -07:00
Daniel Lam
016c8cbce4 Enabled cropping support in SurfaceTexture
SurfaceTexture will modify the crop rect so it matches
the desired output aspect ratio when the scaling
mode is NATIVE_WINDOW_SCALING_MODE_CROP.  Added a test
for this new scaling mode.

Change-Id: I60f24dcbc294b65cd10a393d9e27d40f07d27bb6
2012-04-12 17:49:03 -07:00
Jamie Gennis
a96b6bdea3 SurfaceTexture: work around a compiler bug
This change works around a compiler bug with the GCC 4.6 toolchain.

Bug: 6292211
Change-Id: I004c4750d92a29f193a37d8e605a28fdc3b7f076
2012-04-11 18:37:54 -07:00
Jamie Gennis
c2c380259b SurfaceTexture: add a test for user sizes & prerotation
This change adds 3 tests for:
- User-overridden buffer size
- Transform hint
- User-overridden buffer size with transform hint

Change-Id: Ib15ea354685e436822c506099613b2bffa7b68c9
2012-04-11 18:37:54 -07:00
Michael I. Gold
55a701459d SurfaceTextureClient: support for application buffer dimensions
Add a new API native_window_set_buffers_user_dimensions to allow native
applications to override the native window size for the default buffer size.
This has lower precedence than the existing
native_window_set_buffers_dimensions and allows the two to co-exist.

Change-Id: Ie73590e1c94ef0dadbce500bd0941dfabbcace3c
2012-04-11 18:37:54 -07:00
Mathias Agopian
f0bc2f1d8d use in/out structures for queueBuffer() IPC
Change-Id: Ie125df2444b62a9a2200586a717dca268852afc9
2012-04-10 21:04:12 -07:00
Mathias Agopian
cac72cdbdf Merge "BufferQueue returns proper code on acquire" 2012-04-10 18:53:50 -07:00
Daniel Lam
fbcda930dd BufferQueue returns proper code on acquire
Also removed unnecessary debug messages from
SurfaceTextureClient.

Change-Id: I291897a44170142f9d42a007b008823fad4683e0
2012-04-09 23:21:33 -07:00
Mathias Agopian
d5caca1d0d Merge "BufferQueue no longer hardcodes buffer counts" 2012-04-09 17:35:00 -07:00