Commit graph

1120 commits

Author SHA1 Message Date
Xin Li
64e598ce2b Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550
Merged-In: I53a278f1317f5307441103dc42dc5be6f20d7075
Change-Id: I3a53ebf7339cdb886d3c1b733b8eee1847f8832a
2024-05-24 08:28:04 -07:00
Treehugger Robot
419aa1a845 Merge "Camera: Fix processCaptureRequestBurstISO" into main 2024-05-07 17:45:42 +00: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
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
Shuzhen Wang
84bc4a190d Merge "Camera: Allow non-session parameters in SessionConfiguration" into main 2024-01-16 16:38:31 +00:00
Avichal Rakesh
ce54ff9989 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.
Change-Id: Ia99ba6e3abbdf7dec75383450a60c944b92a9c74
2024-01-12 17:34:59 -08:00
Avichal Rakesh
31437d0f3c 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.
Change-Id: Ic406634de6f22a290abb414e80a7747927368b68
2024-01-12 17:34:51 -08:00
Avichal Rakesh
aca04275d9 Merge changes from topic "309543399-ext-hal" into main
* changes:
  ExternalCameraHAL: Add ANDROID_SENSOR_READOUT_TIMESTAMP key.
  camera: Make readoutTimestamp visible to HALs
2024-01-13 00:33:57 +00:00
Jayant Chowdhary
1748677f02 Merge "Check for stream use case capability before stream use case test" into main 2024-01-12 21:47:30 +00:00
Jayant Chowdhary
da59822642 Check for stream use case capability before stream use case test
Bug: 299202800

Test: Vendor testing

Change-Id: If30ead47072dc1f950b8fb6384072cc38cd51c58
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2024-01-11 21:02:08 +00:00
Avichal Rakesh
1fb9ba494c ExternalCameraHAL: Add ANDROID_SENSOR_READOUT_TIMESTAMP key.
As ExternalCameraHAL does not support sensor readout timestamp,
it should set ANDROID_SENSOR_READOUT_TIMESTAMP to
ANDROID_SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED in CameraDevice
characteristics.

This CL adds the CameraMetadata entry to ExternalCameraDevice.

Bug: 309543399
Test: ReadoutTimestampTest#testReadoutTimestamp passes for
      ExternalCameraHAL
Change-Id: I12203f0832416b4ca325380e671675ddc1d788d4
2024-01-10 12:47:07 -08:00
Avichal Rakesh
468341e677 camera: Make readoutTimestamp visible to HALs
`readoutTimestamp` metadata key was previously only visible to
SDK and the framework, and the camera framework force set the values
based on if the HAL implemented the AIDL or the HIDL interface.

This CL makes readoutTimestamp available to HALs and lets AIDL
HALs choose if they can support sensor readout timestamp or not.

Bug: 309543399
Test: External Camera HAL now sets this value and passes VTS
Change-Id: Ifee2b4020b7630383dc32ef7590f8a9ccdaf49d2
2024-01-10 12:46:57 -08:00
Jayant Chowdhary
2d51f59db5 Merge "camera: Add boolean to HalStream for stream specific HAL buffer manager" into main 2024-01-06 07:15:44 +00:00
Shuzhen Wang
918ecd17aa Camera: Allow non-session parameters in SessionConfiguration
Also remove a workaround in VTS test

Test: Build
Bug: 309627704
Change-Id: I0ed266e837f5d0bec6197ff9f725a897048038ae
2024-01-05 23:22:56 +00:00
Jayant Chowdhary
4869ae7838 camera: Add boolean to HalStream for stream specific HAL buffer manager
Whether the HAL buffer manager is used or not is decided
based on the presence of a static camera characteristics key -
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION. This behavior cannot
be toggled depending on stream configuration / session parameters.

The HAL buffer manager does reduce memory consumption at the cost of
extra IPC calls, which may not be always desirable.

Therefore, HalStream.aidl - the parcelable returned by the camera HAL
for each stream configured now holds a boolean value, specifying
whether output buffers must be managed by the HAL or the camera
framework for the particular session configured.

Bug: 311263114

Test: builds

Test: Run Camera CTS on HAL supporting
      ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE

Test: VTS

Change-Id: Id6bda31eab3d66361991e2f883231a5a55a2ef82
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2024-01-04 18:32:19 +00:00
Treehugger Robot
15cafadf28 Merge "Camera: Add missing characteristics for using buffermanager in ExternalCamera" into main am: 4103ef0c5a am: 5151c1f477 am: 36af76605f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2884368

Change-Id: I3523501e297d5b4c61ae6760b3f25782c8654bec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-03 20:29:11 +00:00
Treehugger Robot
36af76605f Merge "Camera: Add missing characteristics for using buffermanager in ExternalCamera" into main am: 4103ef0c5a am: 5151c1f477
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2884368

Change-Id: I78b8342906cea80ed61c59d69ae2e2dc2f395a0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-03 19:48:41 +00:00