Commit graph

1133 commits

Author SHA1 Message Date
Eino-Ville (Eddy) Talvala
715c835a01 Merge "Camera: Fix some minor formatting in new flash strength docs." into main 2024-06-08 00:11:45 +00:00
Eino-Ville Talvala
d5589aa1eb Camera: Fix some minor formatting in new flash strength docs.
Test: Builds
Flag: Docs only
Change-Id: If90658e06cd0b7bb15c0e1ec3e2ebab244d02704
2024-06-07 15:23:55 -07:00
Shuzhen Wang
e8d40f9055 Merge "Camera: VTS: Skip session characterstics test for older HAL" into main 2024-05-08 06:14:09 +00:00
Treehugger Robot
ef0f81fb45 Merge "Camera: Fix processCaptureRequestBurstISO" into main am: 419aa1a845 am: c8c2e7d008
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3005172

Change-Id: I29b80b6eaa137e7dfa76cbab954016e72276acf8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-07 18:22:57 +00:00
Treehugger Robot
419aa1a845 Merge "Camera: Fix processCaptureRequestBurstISO" into main 2024-05-07 17:45:42 +00:00
Shuzhen Wang
ced09a50dc Camera: VTS: Skip session characterstics test for older HAL
getSessionCharacteristics test needs to be gated by HAL version.

Bug: 339233213
Test: vendor testing
Change-Id: Ib611ec64089eecab99f3b82c6c7c2826cfdb62c5
2024-05-07 10:26:02 -07:00
Fang Hui
f097c4d9bc Camera: Fix processCaptureRequestBurstISO
android_convertGralloc1To0Usage() is used to convert gralloc1_usage(uint64_t) to gralloc_usage (int32_t),
then passed as a para in allocateGraphicBuffer(). But definition of allocateGraphicBuffer() is as
void CameraAidlTest::allocateGraphicBuffer(uint32_t width, uint32_t height, uint64_t usage, PixelFormat format, buffer_handle_t* buffer_handle).
The type of "usage" is uint64_t. So the convert (uint64_t -> int32_t -> uint64_t) will change usages(31 bit is 1)
such as 0x0000000080020b00 to 0xffffffff80020b00. It's unexpected.

Use ANDROID_NATIVE_UNSIGNED_CAST to fix the issue.

Bug: https://issuetracker.google.com/issues/330051542

Change-Id: I23dfd603be0da6864d1021a57c3c3ce76cb78bda
Signed-off-by: Fang Hui <hui.fang@nxp.com>
2024-05-07 16:49:45 +00:00
Treehugger Robot
31cf5e1b63 Merge "Camera: Trim required stream combination queries" into main 2024-05-01 01:58:07 +00:00
Shuzhen Wang
522ae3ecdf Camera: Trim required stream combination queries
Based on social media app usage, trim required stream combination
queries.

Test: Build
Bug: 314229449
Change-Id: I3c48988c7a8598c1d3a091cf32e00360e6609156
2024-04-30 09:29:39 -07:00
Treehugger Robot
40ed080367 Merge "getSessionCharacteristic bug fix" into main 2024-04-29 17:27:34 +00:00
Golden Hsu
c6589f9ea8 getSessionCharacteristic bug fix
close session in the end of for loop

Bug: 337711677
Test: Vendor testing
Change-Id: Ie82622af10079fe7e882cabd4eccdcc1e59a5464
2024-04-29 09:25:41 -07:00
Sai
c6a95c2fd5 Update vts test to support automotive devices
Includes LENS_POSE_AUTOMOTIVE as a valid lens_pose_reference value for vts tests.

Bug: 315076224

Test: atest VtsHalCameraProvider
Change-Id: Iafb7963cb828e1b40308fddd6ab417f8bc0c2115
2024-04-25 10:53:27 -07:00
Avichal Rakesh
9dcc9eff81 ExternalCameraHAL: Pad AllocatedFrame by DCTSIZE
jpeglib expects height and width of Y component to be an integral
multiple of 2*DCTSIZE, and heights and widths of Cb and Cr components
to be an integral multiple of DCTSIZE. If the image size does not
meet this requirement, libjpeg expects its input to be padded to
meet the constraints.

The current implementation of AllocatedFrame::allocate did not consider
this padding when allocating buffers. This could lead to crashes when
attempting to call libjpeg functions on images with dimensions that
are _not_ an exact multiple of 2*DCTSIZE (=16), for example: 424x240.

This CL ensures that the allocated buffer is padded such that libjpeg
never attempts to access unallocated buffer.

Bug: 333961771
Test: Verified that the HAL no longer crashes for certain resolutions.
Change-Id: I05b5f3390385ad005481141312a2e3e281433f7a
2024-04-15 18:39:19 -07:00
Treehugger Robot
f987ba014d Merge "Camera:Update condition to validate flash keys." into main 2024-04-11 17:46:35 +00:00
Rucha Katakwar
c0355fdb39 Camera:Update condition to validate flash keys.
Bug: 332613252
Test: Tested locally on a pixel device.
Change-Id: Ic95dd58288cd8e93e29ebb2259c1f783a589898f
2024-04-11 09:35:57 -07:00
Rucha Katakwar
0cea523ba3 Camera: Close session after validating flash keys
Bug: 333353956
Test: Tested on a pixel device
Change-Id: Ic48ec93cc579579fa7a39b66d0dc4cf0a7c11531
2024-04-10 14:28:08 -07:00
Tang Lee
45d7a9e1b4 ExternalCameraHAL: fix CTS failures with callback for errors
For every request, either requestStreamBuffers fails or
handling of the requested buffer fails, always trigger
the processCaptureResult callback by notifying the request
is ready. This avoids the errors like the service side
receives fewer results than the requests and waits until
timeout.

Bug: 299182874
Test: cts
cts-tradefed run cts \
  --include-filter  "CtsCameraTestCases android.hardware.camera2.cts.RobustnessTest" \
  --include-filter "CtsCameraTestCases android.hardware.camera2.cts.PerformanceTest" \
  --include-filter "CtsCameraTestCases android.hardware.camera2.cts.StillCaptureTest" \
  --include-filter "CtsCameraTestCases android.hardware.camera2.cts.SurfaceViewPreviewTest" \
  --include-filter "CtsCameraTestCases android.hardware.cts.CameraGLTest" \
  --include-filter "CtsCameraTestCases android.hardware.cts.LegacyCameraPerformanceTest" \

Merged-in: I86ba422524e79af6b318b50bd6eebe2cb27fa50a
Change-Id: I86ba422524e79af6b318b50bd6eebe2cb27fa50a
2024-03-25 17:28:06 -07:00
Tang Lee
895f5bbddc ExternalCameraHAL: improve buffer and error handling
After enabling HALL Buffer Management, it requires more careful
error handling and syncing. Process the buffer request error correctly.
Handle the lock and states correctly.

Bug: 299182874
Test: CTS passed, expecially
./cts-tradefed run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.NativeCameraDeviceTest
./cts-tradefed run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.RobustnessTest

Merged-in: I04d8e19a2ee78580e54340378122c724a3de8edb
Change-Id: I04d8e19a2ee78580e54340378122c724a3de8edb
2024-03-25 17:27:59 -07:00
Avichal Rakesh
a52542e856 ExternalCameraHAL: Skip importing buffer from capture request
ExternalCameraHAL supports HAL buffer management which means
cameraservice will not send it an output buffer along with the
capture request, and the HAL has the freedom to request an
output buffer when an output buffer is needed.

As a remnant of migration from HIDL to AIDL, the
ExternalCameraHAL still attempted to import buffers that
the cameraservice has sent with the CaptureRequest. However,
with HAL buffer manager enabled, this buffer is always null and
results in the HAL failing to process the capture request.

This CL removes the logic for importing output buffers when
processing capture requests from the cameraservice, and lets
the HAL call requestStreamBuffers when it needs an output buffer.

Bug: 299182874
Test: VTS Tests now pass
Merged-in: I00654836b7ae91a91a2afa4b149712977e07dcc5
Change-Id: I00654836b7ae91a91a2afa4b149712977e07dcc5
2024-03-25 17:27:47 -07:00
Avichal Rakesh
b3b02babbb ExternalCameraHAL: Prevent memory leak when manipulating native_handle
native_handle objects created by makeFromAidl need to be deleted
with native_handle_delete. Not doing so leads to a memory leak
every time makeFromAidl is called.

This CL ensures that native_handle_delete is called on the
return value of makeFromAidl wherever it is used.

Bug: 305638723
Test: n/a. No functional change.
Merged-in: Ia99ba6e3abbdf7dec75383450a60c944b92a9c74
Change-Id: Ia99ba6e3abbdf7dec75383450a60c944b92a9c74
2024-03-25 17:27:32 -07:00
Avichal Rakesh
ea30826bf3 ExternalCameraHAL: dup fd when creating AIDL NativeHandle
AIDL's NativeHandle do not have a concept of unowned file
descriptors. If a NativeHandle object is created with an
fd, NativeHandle implicitly assumes ownership of the fd.
When passing fds over binder, ExternalCameraHAL used
makeToAidl which which accidentally transferred ownership
to the AIDL objects. Additionally, NativeHandles close
owned fds on destruction, which led to multiple closure
of fences.

This CL changes the logic to use dupToAidl to ensure that
NativeHandle objects are given ownership of a duped fds
and don't interfere with any of the fds used for internal
bookkeeping.

Bug: 313115623
Test: Verified by partner that ExternalCameraHAL no longer double closes fds.
Merged-In: Ic406634de6f22a290abb414e80a7747927368b68
Change-Id: Ic406634de6f22a290abb414e80a7747927368b68
2024-03-25 21:59:11 +00:00
Devin Moore
9eec1433fa Merge "Vendor API level 202404 is now frozen" into main 2024-02-29 17:14:40 +00:00
Bharatt Kukreja
3c34aeefe7 Merge "Restrict HAL to only required keys for session chars" into main 2024-02-21 23:15:11 +00:00
Devin Moore
a8efdb127e Vendor API level 202404 is now frozen
Ignore-AOSP-First: VINTF 202404 Finalization
Bug: 279809333
Test: build
Change-Id: Ie6d38d27a287e258c30516e0030ad8c931d06432
2024-02-20 21:05:23 +00:00
Treehugger Robot
c78f9f21f6 Merge "[DON'T BLOCK] Test ownership migration rules" into main am: 27e97308c4 am: 74dc4cc5d7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2950589

Change-Id: I9a26bb26763d77e109f1d911d0ea7c95f632703f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-07 02:26:27 +00:00
Treehugger Robot
74dc4cc5d7 Merge "[DON'T BLOCK] Test ownership migration rules" into main am: 27e97308c4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2950589

Change-Id: Ie4f36b193820490e606e7f5100ca29200f832fa2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-07 01:45:21 +00:00
Treehugger Robot
27e97308c4 Merge "[DON'T BLOCK] Test ownership migration rules" into main 2024-02-07 00:55:34 +00:00
Jayant Chowdhary
d5fb309d31 Merge "Camera VTS: Test only CROPPED_RAW use case for RAW_SENSOR streams" into android14-tests-dev am: e51dca227c am: 02cb71bd4d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2944865

Change-Id: Ib74ae9c579d503933012c28080a87312122fa45e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 19:12:23 +00:00
Jayant Chowdhary
02cb71bd4d Merge "Camera VTS: Test only CROPPED_RAW use case for RAW_SENSOR streams" into android14-tests-dev am: e51dca227c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2944865

Change-Id: I7e8bd1591f4520c63f3fe7449353a55961014334
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-05 18:30:10 +00:00
Jayant Chowdhary
e51dca227c Merge "Camera VTS: Test only CROPPED_RAW use case for RAW_SENSOR streams" into android14-tests-dev 2024-02-05 17:45:14 +00:00
Aditya Choudhary
ad2ba1b851 [DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
go/new-android-ownership-model

Bug: 304529413
Test: N/A
Change-Id: Ic8c4bd6ac246e7efa98bbdaf822d12ae8e1230a5
2024-02-05 15:45:22 +00:00
Tang Lee
4e95fdd9a2 Revert Return ILLEGAL_ARGUMENT for setting null callback for 2.4 HAL
This reverts part of the CL(ag/24741349) on 2.4 HAL file to pass 2.4
VTS. Since ag/24741349 was just for passing latest VTS on default HAL,
it's ok to keep 2.4 HAL aligned with 2.4's VTS case.

Bug: 320925606
Test: none
Change-Id: I3c5e34930925c466ef6be4209e49122af1c791f6
2024-02-02 16:01:40 +08:00
Jayant Chowdhary
7a9ee22a51 Camera VTS: Test only CROPPED_RAW use case for RAW_SENSOR streams
There are no mandatory stream combinations for RAW_SENSOR streams that
do not involve the CROPPED_RAW stream use case. So we don't need to test
stream non CROPPED_RAW stream use cases with the RAW_SENSOR format,
since we don't have a definite answer to whether they will be supported or not.

Bug: 317773720

Test: Camera VTS on cf
Test: Vendor testing

Merged-In: I0870e90ae68a5e35196f0ba0afaa6b8bf7fbfbd8
Change-Id: I0870e90ae68a5e35196f0ba0afaa6b8bf7fbfbd8
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 6847115a00)
2024-02-01 18:51:13 +00:00
Treehugger Robot
3550837150 Merge changes from topic "cherrypicker-L21800030001689425:N42900030026677133-main" into main
* changes:
  ExternalCameraHAL: fix CTS failures with callback for errors
  ExternalCameraHAL: improve buffer and error handling
  ExternalCameraHAL: Skip importing buffer from capture request
2024-02-01 01:44:16 +00:00
Tang Lee
ba1854fb0e ExternalCameraHAL: fix CTS failures with callback for errors
For every request, either requestStreamBuffers fails or
handling of the requested buffer fails, always trigger
the processCaptureResult callback by notifying the request
is ready. This avoids the errors like the service side
receives fewer results than the requests and waits until
timeout.

Bug: 299182874
Test: cts
cts-tradefed run cts \
  --include-filter  "CtsCameraTestCases android.hardware.camera2.cts.RobustnessTest" \
  --include-filter "CtsCameraTestCases android.hardware.camera2.cts.PerformanceTest" \
  --include-filter "CtsCameraTestCases android.hardware.camera2.cts.StillCaptureTest" \
  --include-filter "CtsCameraTestCases android.hardware.camera2.cts.SurfaceViewPreviewTest" \
  --include-filter "CtsCameraTestCases android.hardware.cts.CameraGLTest" \
  --include-filter "CtsCameraTestCases android.hardware.cts.LegacyCameraPerformanceTest" \

Change-Id: I86ba422524e79af6b318b50bd6eebe2cb27fa50a
2024-02-01 00:36:22 +00:00
Jayant Chowdhary
17981cffcb Merge "Camera VTS: Test only CROPPED_RAW use case for RAW_SENSOR streams" into main 2024-01-31 21:50:20 +00:00
Jayant Chowdhary
6847115a00 Camera VTS: Test only CROPPED_RAW use case for RAW_SENSOR streams
There are no mandatory stream combinations for RAW_SENSOR streams that
do not involve the CROPPED_RAW stream use case. So we don't need to test
stream non CROPPED_RAW stream use cases with the RAW_SENSOR format,
since we don't have a definite answer to whether they will be supported or not.

Bug: 317773720

Test: Camera VTS on cf
Test: Vendor testing

Change-Id: I0870e90ae68a5e35196f0ba0afaa6b8bf7fbfbd8
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2024-01-31 19:36:54 +00:00
Xin Li
763c473c3d Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: I976f80006aeb88bde2ae34ca4f9be72cea727d9e
Change-Id: Id94b25af52bd2e2847b6858697ab21cc6ce27aa3
2024-01-30 10:36:50 -08:00
Tang Lee
ef97150dc9 ExternalCameraHAL: improve buffer and error handling
After enabling HALL Buffer Management, it requires more careful
error handling and syncing. Process the buffer request error correctly.
Handle the lock and states correctly.

Bug: 299182874
Test: CTS passed, expecially
./cts-tradefed run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.NativeCameraDeviceTest
./cts-tradefed run cts -m CtsCameraTestCases -t android.hardware.camera2.cts.RobustnessTest

Change-Id: I04d8e19a2ee78580e54340378122c724a3de8edb
2024-01-30 04:07:35 +00:00
Avichal Rakesh
43549d934e ExternalCameraHAL: Skip importing buffer from capture request
ExternalCameraHAL supports HAL buffer management which means
cameraservice will not send it an output buffer along with the
capture request, and the HAL has the freedom to request an
output buffer when an output buffer is needed.

As a remnant of migration from HIDL to AIDL, the
ExternalCameraHAL still attempted to import buffers that
the cameraservice has sent with the CaptureRequest. However,
with HAL buffer manager enabled, this buffer is always null and
results in the HAL failing to process the capture request.

This CL removes the logic for importing output buffers when
processing capture requests from the cameraservice, and lets
the HAL call requestStreamBuffers when it needs an output buffer.

Bug: 299182874
Test: VTS Tests now pass
Change-Id: I00654836b7ae91a91a2afa4b149712977e07dcc5
2024-01-29 15:08:19 -08:00
Bharatt Kukreja
a343d98e8c Restrict HAL to only required keys for session chars
Don't allow Camera HAL to send keys other than the required ones for
session characteristics.

Test: atest VtsAidlHalCameraProvider_TargetTest
Bug: 314386872
Change-Id: I3808840e0d404b4a82c8bcfc6d51eab9b171b1e9
2024-01-26 20:54:34 +00:00
Jayant Chowdhary
850621640a Camera: ANAPIC AIDL feedback
- In metadata comments, add reference source file where details can be
  found
- Fix grammar in ICameraDeviceSession.aidl comments

Bug: 318762864

Test: build

Change-Id: Id0f88aacd60e9ae444a0f6d4a9dfca67f8d75eaa
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2024-01-24 19:25:33 +00:00
Treehugger Robot
b28ec8ac00 Merge "ExternalCameraHAL: Prevent memory leak when manipulating native_handle" into main 2024-01-19 05:39:42 +00:00
Treehugger Robot
1c5de72f52 Merge "ExternalCameraHAL: dup fd when creating AIDL NativeHandle" into main 2024-01-19 05:39:41 +00:00
Jayant Chowdhary
df5baff289 camera vts: Remove redundant capabilities fetch am: 23f338bac4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2912754

Change-Id: I13e49647cc7f340fa18265dac415c83a2850d025
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 22:31:52 +00:00
Jayant Chowdhary
331ac42624 Check for stream use case capability before stream use case test am: 5554de2fa8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2913463

Change-Id: I41668e65f44bebddc4b82ac2e030a0a5d8cf75d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-17 22:31:33 +00:00
Jayant Chowdhary
23f338bac4 camera vts: Remove redundant capabilities fetch
Bug: 299202800

Test: build

Merged-In: Ia6ca1ee0fb65e357398ba62c6a787c6530b989e4
Change-Id: Ia6ca1ee0fb65e357398ba62c6a787c6530b989e4
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 571cbf1b4c)
2024-01-17 18:48:49 +00:00
Jayant Chowdhary
8fca9cd84d Merge "camera vts: Remove redundant capabilities fetch" into main 2024-01-17 18:48:17 +00:00
Jayant Chowdhary
5554de2fa8 Check for stream use case capability before stream use case test
Bug: 299202800

Test: Vendor testing

Merged-In: If30ead47072dc1f950b8fb6384072cc38cd51c58
Change-Id: If30ead47072dc1f950b8fb6384072cc38cd51c58
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit da59822642)
2024-01-17 18:33:57 +00:00
Jayant Chowdhary
571cbf1b4c camera vts: Remove redundant capabilities fetch
Bug: 299202800

Test: build

Change-Id: Ia6ca1ee0fb65e357398ba62c6a787c6530b989e4
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2024-01-16 18:40:05 +00:00