Commit Graph

122 Commits

Author SHA1 Message Date
followmsi 1756272868 flo/deb: Camera: Add LOCAL_CLANG_CFLAGS
LOCAL_CLANG_CFLAGS += \
       -Wno-unreachable-code-loop-increment
2021-11-25 13:35:03 +01:00
Daniel Jarai d8c6d1aad3 flo: Move QCamera sockets from /data to /dev/socket/qcamera
Change-Id: I0241f6e0a3f56f0bbe34bb44997596d074efcec9
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2020-12-21 16:41:33 +01:00
followmsi 0dac8d1064 flo/deb: camera: Drop LOCAL_COPY_HEADERS 2020-11-05 12:20:47 +01:00
Artem Borisov 4e5720df30 Revert "flo: rename ion_allocation_data.heap_mask to heap_id_mask"
Our kernel doesn't declare it this way anymore.

This reverts commit 52811a9968.

Change-Id: Ibef35c44bc21a1e8fe15388799a9f8c5e90dcb01
2018-12-19 02:43:00 +00:00
Daniel Jarai e567e54529 camera: fix/hack static metadata reporting
Unfortunately, our camera blobs are too old to implement camera HAL 3.2
properly. These hacks fix most camera functionality with HAL 3.2, but
they're not exactly clean...

Some pieces are based on the hammerhead HAL.

This isn't passing CTS, but it's not too far away.
Sadly, in the foreseeable future, I won't have time to clean it up...

Change-Id: Iff4f0f25fe767e498db6e56fc2f47a13c4a97364
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 92a138f8ab QCamera3: Scene Mode Fix
Map FACE_PRIORITY mode as Auto Scene Mode, so that
we don't have undefined behavior.

Bug: 11045793

Change-Id: Iaa7a30eef902c2ca0a700c498f88b7c77aa441fa
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab 20545401d3 Camera3: Avoid starting streams twice
The start method of some streams
 (most notably the metadata) could be
 called twice. This scenario should be
 handled by returning immediatly and
 avoiding the initialization of new
 threads and resources.

This change is authored by Emilian Peev
<epeevs@codeaurora.org>

Bug: 18258028
Bug: 17912331
Change-Id: Ife6613bdca069bc63193802e0bb88273e63998f9
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab 5958ff24f1 Camera3: Validate request rate based on metadata rather than buffers
Bug: 11011342
Change-Id: I68c054027bb8b39ad30b0a3ca932b6cb888409c9
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 0289b67ed7 Camera3: Rework flush functionality
We can have two output buffers per request
 for cases like ZSL. When doing flush the
 process capture result has to be called
 only once for each frame number and should
 contain all cancelled output buffers. Doing
 this on a buffer basis will result in
 unexpected frame number errors in the upper
 framework.
 The buffers should be again grouped depending
 on their frame number and returned back in
 single 'process_capture_result()' call.

Bug: 17113762
Change-Id: I422e86debb2d8e5e8bca1d402479e42f02d915a4
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab 06f4759c72 Camera3: Initialize capture result structure before use
memset camera3_capture_result_t data structure before
using it in HAL.

Bug: 16132385
Change-Id: I0a55cf47984c1d1413b9a492d79543c47ff5bc23
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 480867917e Camera3: Fix invalid file description check
0 is a valid file descriptor. Fix the code for checking
valid file descriptor.

This is a precautionary change.

Bug: 17113762
Change-Id: I65b206254eb63d888049b6daf650204b13afa444
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab 189f07281e Camera3: Remove redundant Buffer tracking structure
Change-Id: I972e0868d08384209fe413fd5398c2e113a3fab0
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 4b9c922f40 Camera3: Remove unnecessary heap allocations
Remove unneeded heap allocations that could
 lead to future leaks.

Bug: 13301331

Change-Id: Ib7671b88ddbe36575beaa8418c147ffaba3ef9de
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Daniel Jarai d1b9c231fd camera: remove PARTIAL_RESULT support
Change-Id: Ic69c493b83c5a6ce4e5ba33d71208466bc2e73e3
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang dccf08a6bb Camera3: Remove buffer registration phase
Instead of registering all buffers upfront
all client buffers are registered on-the-fly
during process capture requests.

Bug: 13301331

Change-Id: I6230829f9ac8eb1c7ddc26f2408dc948ce7b4682
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Daniel Jarai 410f7a39e8 camera: fix ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS
Our old camera blobs don't report this correctly, so let's hardcode.

Change-Id: I38b814a3f99a0793cb8084a53844d587cedb0378
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 4c7b681ba8 Camera3: Set register_stream_buffers to NULL
Bug: 13301331
Change-Id: I6f2ffb7595fcd25d56b1fe14f6e21326a329533e
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab b401285aa3 Camera3: Add new static metadata
Add the new static metadata for 3.2

Bug: 13653652, 13516241, 13528518, 13527179, 13527177,
12958238, 12958122, 12958122, 12957740, 12958062, 12957596,
12957732, 12957688, 12957685, 12958201, 12957788, 13527175

Change-Id: Idb2ed5e963683556a0066b77e30bd160b1eb0e29
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang af9d64ef7d Camera3: Fix memory leak during frame reprocess
The 'streamCbRoutine()' method of the reprocess
 channel receive a camera super frame that was
 previously allocated on heap and must release it
 after exit

Bug: 13301331

Change-Id: Ie90f6b4f945f4b7fcc6c46d541871e44c3f6943b
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang d59188bcf5 Camera2: Add flash.available tag with new metadata spec
Bug: 12957430
Change-Id: I7c82a7821606dc95310000ea7ea4230454b69403
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 31a3b7eb46 Camera3: Make maximum thumbnail size to be 4x3
This aligns with most max resolution picture size
aspect ratio. Also make the supported thumbnail
sizes to be in increasing order per spec.

Bug: 12101500
Change-Id: I5ed791f08225605b3a538039a05576da458b9109
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang ddd2a8cf02 Camera3: Only use Plain Old Data for global variable
When a shared library is loaded, the order in which its global
variables is not defined. For example, for case like below:

A a;
int *ptr = NULL;

Class A {
A() {
  if (ptr == NULL) {
      //do this;
  } else {
      // do that;
  }
}
};

ptr could be initialized before or after A, which causes the
behavior of A's constructor to be different.

The fix is to use Plain Old Data (integer, float, char, or pointer)
as global variable, and defer instantiation of class instance to
runtime.

Bug: 11822202
Change-Id: I806c527f06e19fc44e880d9a536ee7a060b4fa4f
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab d9227a2b53 Camera3: Upgrade Camera device version to 3.2
Bug: 13609405
Change-Id: I4443126b5fc191798750da73cb750e5b98766e97
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang d00b95ed3c Camera3: Clean up ALOGE calls in non-error conditions
Use ALOGI/ALOGD instead.

Bug: 12489802
Change-Id: Id7fc9147395af3a9a0fe135d1017a155aad174fb
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang e73f66ef6b Camera3: Implement flush call for version 3.1
When flush is called, HAL drops all inflight requests
and buffers as soon as possible.

HAL implements this feature by:
1. Streams off all active streams,
2. Calls process_capture_result with ERROR_BUFFER for
   pending requests for which metadata is generated, but
   not all buffers are filled, and
3. Calls process_capture_result with ERROR_RESULT for
   pending requests for which metadata is not generated
   yet.

This change also fixes a bug in mm-camera-interface so
that queued_buffer_count is reset during reg_buf.

Bug: 9758581
Change-Id: Ibcb5dc52faf8d50f781ef514e4c79185311dafce
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 9e8335d5f1 Camera3: Reduce log spam
Bug: 11431304
Change-Id: I9f641188d3ae5c131ed1cd687300cc2b8ccd380e
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 9192c4c9c8 Camera3: Unblock capture_request in correct condition
Previously we were only checking max buffer dequeued when
metadata callback happens. HAL needs to do the same check
in buffer callback.

This change also breaks down the captureResultCb() function
which is long overdue.

This should help improve latency and performance because
we are unblocking capture_request early.

Bug: 11011342
Change-Id: I37a37e78a3534f780b4a92e46ab21f5ae78b5329
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang b324f55793 Camera3: Fixes instability during camera close
- As per documentation 'camera3_stream_t' objects
  are owned by the framework and will be freed
  before camera close. These objects are not to be
  used when the Hal destructor is invoked.

BUG: 10689446
Change-Id: I1409319e7340846ca574b3987132a0ca3bbae8e9
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 608057ce3d Camera3: Set name for stream process thread
Name the stream process thread in HAL

Bug: 10609699
Change-Id: Ib272cd237fea8ad9e27994352e7acc7a1f56551c
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 08d7638561 Camera3: Fix memory leaks during preview start/stop
- The array for holding registerd buffer handles
  is not released during camera close. Also the
  metadata frame allocated in 'QCamera3Stream'
  needs to be freed after returning to camera.

Change-Id: Idb9e278583382e08df9c64d20d7f1c2af2488071
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab b3386fd208 Camera3: Fix rapid ZSL snapshots
-In case of rapid back to back snapshots framework
 reuses ZSL YUV frame
-Remove code in HAL which assumes that once a buffer
 is passed as input it will not be used again

Change-Id: I72a0f527de99b96508c7020455a47bfe754d9df4
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Shuzhen Wang 80470cbf34 Camera3: Set extra usage flags for video stream buffers
For video stream buffers, set READ_RARELY and WRITE_RARELY usage
flags so that gralloc may make them uncached.

Code cleanup

Bug: 10328870
Change-Id: If3bbbbb0976266f69962db7df568c763dad488aa
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab 7e6cbb8a35 Camera3: Enable livesnapshot for zsl
Ensure that metadata is handled correctly for different
ZSL usecases.
Change-Id: Ic521f54b973535384cbc2ec94facea3a3f326648
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab 27b656d4de Camera3: Add reprocess path for ZSL
Add the reprocess path for ZSL to enable WNR, ASF and rotation
reprocess

Change-Id: I132be710e5fe1cc1436626679a7f533f73f9ae0a
Signed-off-by: Daniel Jarai <jaraidaniel@gmail.com>
2018-06-14 11:15:38 +03:00
Mansoor Aftab 81817709a7 Camera3: Name HAL threads
Name the HAL threads to make debugging easier

Bug: 10609699

Change-Id: Ic953947eca7e4fde7c87bd7c890d1811cc3ff2fb
2018-06-14 11:15:21 +03:00
Shuzhen Wang 1cab4ea949 QCamera2: Sync stream stop with poll updates
The stream command thread will be released as
 part of the stream stop but the channel poll
 thread can still run until the channel is released.
 In this case the synchronous poll delete during
 stream stop can fail if the asynchronous poll version
 got triggered immediately before that. The stop
 will proceed and release the stream command thread
 resources before the async poll update could be
 processed. The poll thread could then try and
 access the command thread resources resulting in
 a crash. The failing sync poll delete should be
 handled by syncing to the poll thread again and
 allowing any previously pending async updates to
 be processed before releasing any resources.

Bug: 14028116
CRs-Fixed: 629996
Change-Id: Ib6252445731d05c01a59503b3cfe70ef089a4ffd
2018-06-14 11:15:14 +03:00
Shuzhen Wang 79a61d2c36 QCamera2: More informative error message for qbuf/dqbuf
Bug: 14028116
Change-Id: I40c819f8bdfd4bd66ead9379e871f8a2fd6a5074
2018-06-14 11:15:08 +03:00
Shuzhen Wang 75041000c5 Camera3: Increase retry count when opening camera
This takes care of cases where mm-qcamera-daemon takes a long
time to launch. get_camera_info depends on mm-qcamera-daemon
being up and running to work.

In the worse case, get_camera_info will be held up by HAL for
200ms.

Bug: 10577806
Change-Id: I7068b0f60bf75c407b603f4e0a0bbb19b8f51f0c
2018-06-14 11:15:01 +03:00
Ajay Dudani da1088c3f7 Camera3: Fix thumbnail stretch issue
If image is already rotated by post proc, swap the thumbnail
destination buffer width and height before giving it to the
encoder

Change-Id: I328a762887b469fc88d298c131cde356dc2dd03f
(cherry picked from commit ab93af6714041141d8a66e6e2c921097e1341a08)
2018-06-14 11:14:54 +03:00
Ziyan a6ff72a04a camera: cleanup makefiles, build with -Wall -Werror, fix warnings
Change-Id: I06de62e53e95e5f6dbc19773fec0d4070c839c96
2018-06-14 11:13:50 +03:00
Yin-Chia Yeh 9547a44f41 Camera: fix HAL1 callback cookie
Test: HIDL HAL1 preview up and running
Bug: 30985004
Change-Id: I085f163de6c1c6552925c8241e744c723697d544
2018-02-10 09:58:29 +00:00
Jiyong Park 8e37e471f4 Move QCOM camera libs to vendor
In order to make generic system image, these QCOM-specific libs are
moved to vendor.img

Bug: 36043196
Test: make. flash. and chck that these are under /vendor/lib.
Change-Id: I53d84f1191b7562323b8405bc4a1ba35794375c0
2017-12-17 15:10:57 +03:00
Artem Borisov ce061b3b54 flo: camera: add missing liblog dependency
Change-Id: Ie6bd6fb560b9703f8d1dd8ee4f1233cec8485c59
2017-09-20 20:49:50 +00:00
Simon Shields c38ce575b5 Revert "flo: fix hardware/qcom/media paths"
* fix the pathmap instead

This reverts commit ad64e126b1.

Change-Id: I8d3f27c5945d1a3766ab49cb14817c5173ee5c21
2016-11-13 11:21:17 -08:00
Simon Shields ad64e126b1 flo: fix hardware/qcom/media paths
* reorganised in N, we want hardware/qcom/media/msm8974 now.

Change-Id: Idf0ac77b8b47c4c9ae5b8e00dbb6191ae8c17349
2016-11-12 21:14:07 +11:00
Zhao Wei Liew aad4d16249 flo: Build camera HAL with kernel headers
After removing the prebuilt kernel headers, we need to include
the kernel headers from source to fix the build.

Change-Id: I0e7074076db50032862ae4d8f001580405e9cd99
2016-10-29 23:06:32 +08:00
Ethan Chen a925e2e660 camera: Use project pathmap
Change-Id: Ib9e17014b8b8406a16e6b45962d06e364c2c3319
2016-10-29 23:06:32 +08:00
Eino-Ville Talvala 810bb4fd06 Fix build: One more camera module init placeholder
Change-Id: I86d840cbe8ff1285866e6f76f014bb68afa70ccd
2015-04-16 13:09:06 -07:00
Eino-Ville Talvala f3a249561e Camera: Add module init placeholder
Change-Id: I6d0e4bde4e8cd26db26268fe7be43094c71a71db
2015-04-15 15:29:39 -07:00
Eino-Ville Talvala 1a81bcff9d Fix build: Remove LENS_POSITION
Change-Id: Ia15e20f3665c19d8b6e2a38d8604f9b7349a5556
2015-04-10 17:19:16 -07:00