diff options
Diffstat (limited to 'automotive')
3 files changed, 97 insertions, 100 deletions
diff --git a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp index 623438f70e..9c8bfc4996 100644 --- a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp +++ b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp @@ -250,8 +250,7 @@ protected: // Stream configurations are found in metadata RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; targetCfg.format = static_cast<PixelFormat>(ptr->format); @@ -631,29 +630,29 @@ TEST_P(EvsHidlTest, CameraToDisplayRoundTrip) { targetDisplayId = ids[0]; }); - // Request exclusive access to the first EVS display - sp<IEvsDisplay_1_1> pDisplay = pEnumerator->openDisplay_1_1(targetDisplayId); - ASSERT_NE(pDisplay, nullptr); - LOG(INFO) << "Display " << targetDisplayId << " is alreay in use."; - - // Get the display descriptor - pDisplay->getDisplayInfo_1_1([](const HwDisplayConfig& config, const HwDisplayState& state) { - ASSERT_GT(config.size(), 0); - ASSERT_GT(state.size(), 0); - - android::ui::DisplayMode* pConfig = (android::ui::DisplayMode*)config.data(); - const auto width = pConfig->resolution.getWidth(); - const auto height = pConfig->resolution.getHeight(); - LOG(INFO) << " Resolution: " << width << "x" << height; - ASSERT_GT(width, 0); - ASSERT_GT(height, 0); - - android::ui::DisplayState* pState = (android::ui::DisplayState*)state.data(); - ASSERT_NE(pState->layerStack, android::ui::INVALID_LAYER_STACK); - }); - // Test each reported camera for (auto&& cam: cameraInfo) { + // Request exclusive access to the first EVS display + sp<IEvsDisplay_1_1> pDisplay = pEnumerator->openDisplay_1_1(targetDisplayId); + ASSERT_NE(pDisplay, nullptr); + LOG(INFO) << "Display " << targetDisplayId << " is already in use."; + + // Get the display descriptor + pDisplay->getDisplayInfo_1_1([](const HwDisplayConfig& config, const HwDisplayState& state) { + ASSERT_GT(config.size(), 0); + ASSERT_GT(state.size(), 0); + + android::ui::DisplayMode* pConfig = (android::ui::DisplayMode*)config.data(); + const auto width = pConfig->resolution.getWidth(); + const auto height = pConfig->resolution.getHeight(); + LOG(INFO) << " Resolution: " << width << "x" << height; + ASSERT_GT(width, 0); + ASSERT_GT(height, 0); + + android::ui::DisplayState* pState = (android::ui::DisplayState*)state.data(); + ASSERT_NE(pState->layerStack, android::ui::INVALID_LAYER_STACK); + }); + bool isLogicalCam = false; getPhysicalCameraIds(cam.v1.cameraId, isLogicalCam); if (mIsHwModule && isLogicalCam) { @@ -708,10 +707,10 @@ TEST_P(EvsHidlTest, CameraToDisplayRoundTrip) { // Explicitly release the camera pEnumerator->closeCamera(pCam); activeCameras.clear(); - } - // Explicitly release the display - pEnumerator->closeDisplay(pDisplay); + // Explicitly release the display + pEnumerator->closeDisplay(pDisplay); + } } @@ -1632,12 +1631,12 @@ TEST_P(EvsHidlTest, HighPriorityCameraClient) { // Get the camera list loadCameraList(); - // Request exclusive access to the EVS display - sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); - ASSERT_NE(pDisplay, nullptr); - // Test each reported camera for (auto&& cam: cameraInfo) { + // Request exclusive access to the EVS display + sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); + ASSERT_NE(pDisplay, nullptr); + // Read a target resolution from the metadata Stream targetCfg = getFirstStreamConfiguration(reinterpret_cast<camera_metadata_t*>(cam.metadata.data())); @@ -1979,10 +1978,9 @@ TEST_P(EvsHidlTest, HighPriorityCameraClient) { pEnumerator->closeCamera(pCam1); activeCameras.clear(); + // Explicitly release the display + pEnumerator->closeDisplay(pDisplay); } - - // Explicitly release the display - pEnumerator->closeDisplay(pDisplay); } @@ -1998,12 +1996,12 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { // Get the camera list loadCameraList(); - // Request exclusive access to the EVS display - sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); - ASSERT_NE(pDisplay, nullptr); - // Test each reported camera for (auto&& cam: cameraInfo) { + // Request exclusive access to the EVS display + sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); + ASSERT_NE(pDisplay, nullptr); + // choose a configuration that has a frame rate faster than minReqFps. Stream targetCfg = {}; const int32_t minReqFps = 15; @@ -2017,13 +2015,12 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { // Stream configurations are found in metadata RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { - + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; + targetCfg.format = static_cast<PixelFormat>(ptr->format); maxArea = ptr->width * ptr->height; foundCfg = true; @@ -2032,8 +2029,6 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { ++ptr; } } - targetCfg.format = - static_cast<PixelFormat>(HAL_PIXEL_FORMAT_RGBA_8888); if (!foundCfg) { // Current EVS camera does not provide stream configurations in the @@ -2082,10 +2077,10 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { // Explicitly release the camera pEnumerator->closeCamera(pCam); activeCameras.clear(); - } - // Explicitly release the display - pEnumerator->closeDisplay(pDisplay); + // Explicitly release the display + pEnumerator->closeDisplay(pDisplay); + } } @@ -2120,13 +2115,12 @@ TEST_P(EvsHidlTest, MultiCameraStreamUseConfig) { // Stream configurations are found in metadata RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { - + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; + targetCfg.format = static_cast<PixelFormat>(ptr->format); maxArea = ptr->width * ptr->height; foundCfg = true; @@ -2135,8 +2129,6 @@ TEST_P(EvsHidlTest, MultiCameraStreamUseConfig) { ++ptr; } } - targetCfg.format = - static_cast<PixelFormat>(HAL_PIXEL_FORMAT_RGBA_8888); if (!foundCfg) { LOG(INFO) << "Device " << cam.v1.cameraId diff --git a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp index 9c6c573174..3cab204aec 100644 --- a/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp +++ b/automotive/evs/aidl/vts/VtsHalEvsTargetTest.cpp @@ -231,8 +231,7 @@ class EvsAidlTest : public ::testing::TestWithParam<std::string> { // Stream configurations are found in metadata RawStreamConfig* ptr = reinterpret_cast<RawStreamConfig*>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; targetCfg.format = static_cast<PixelFormat>(ptr->format); @@ -601,21 +600,21 @@ TEST_P(EvsAidlTest, CameraToDisplayRoundTrip) { EXPECT_GT(displayIds.size(), 0); targetDisplayId = displayIds[0]; - // Request exclusive access to the first EVS display - std::shared_ptr<IEvsDisplay> pDisplay; - ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); - EXPECT_NE(pDisplay, nullptr); - LOG(INFO) << "Display " << static_cast<int>(targetDisplayId) << " is in use."; - - // Get the display descriptor - DisplayDesc displayDesc; - ASSERT_TRUE(pDisplay->getDisplayInfo(&displayDesc).isOk()); - LOG(INFO) << " Resolution: " << displayDesc.width << "x" << displayDesc.height; - ASSERT_GT(displayDesc.width, 0); - ASSERT_GT(displayDesc.height, 0); - // Test each reported camera for (auto&& cam : mCameraInfo) { + // Request exclusive access to the first EVS display + std::shared_ptr<IEvsDisplay> pDisplay; + ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); + EXPECT_NE(pDisplay, nullptr); + LOG(INFO) << "Display " << static_cast<int>(targetDisplayId) << " is in use."; + + // Get the display descriptor + DisplayDesc displayDesc; + ASSERT_TRUE(pDisplay->getDisplayInfo(&displayDesc).isOk()); + LOG(INFO) << " Resolution: " << displayDesc.width << "x" << displayDesc.height; + ASSERT_GT(displayDesc.width, 0); + ASSERT_GT(displayDesc.height, 0); + bool isLogicalCam = false; getPhysicalCameraIds(cam.id, isLogicalCam); if (mIsHwModule && isLogicalCam) { @@ -669,10 +668,10 @@ TEST_P(EvsAidlTest, CameraToDisplayRoundTrip) { // Explicitly release the camera ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); mActiveCameras.clear(); - } - // Explicitly release the display - ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + // Explicitly release the display + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + } } /* @@ -1396,20 +1395,20 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { // Get the camera list loadCameraList(); - // Request available display IDs - uint8_t targetDisplayId = 0; - std::vector<uint8_t> displayIds; - ASSERT_TRUE(mEnumerator->getDisplayIdList(&displayIds).isOk()); - EXPECT_GT(displayIds.size(), 0); - targetDisplayId = displayIds[0]; - - // Request exclusive access to the EVS display - std::shared_ptr<IEvsDisplay> pDisplay; - ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); - EXPECT_NE(pDisplay, nullptr); - // Test each reported camera for (auto&& cam : mCameraInfo) { + // Request available display IDs + uint8_t targetDisplayId = 0; + std::vector<uint8_t> displayIds; + ASSERT_TRUE(mEnumerator->getDisplayIdList(&displayIds).isOk()); + EXPECT_GT(displayIds.size(), 0); + targetDisplayId = displayIds[0]; + + // Request exclusive access to the EVS display + std::shared_ptr<IEvsDisplay> pDisplay; + ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); + EXPECT_NE(pDisplay, nullptr); + // Read a target resolution from the metadata Stream targetCfg = getFirstStreamConfiguration( reinterpret_cast<camera_metadata_t*>(cam.metadata.data())); @@ -1688,10 +1687,10 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) { ASSERT_TRUE(mEnumerator->closeCamera(pCam0).isOk()); ASSERT_TRUE(mEnumerator->closeCamera(pCam1).isOk()); mActiveCameras.clear(); - } - // Explicitly release the display - ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + // Explicitly release the display + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + } } /* @@ -1713,13 +1712,13 @@ TEST_P(EvsAidlTest, CameraUseStreamConfigToDisplay) { EXPECT_GT(displayIds.size(), 0); targetDisplayId = displayIds[0]; - // Request exclusive access to the EVS display - std::shared_ptr<IEvsDisplay> pDisplay; - ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); - EXPECT_NE(pDisplay, nullptr); - // Test each reported camera for (auto&& cam : mCameraInfo) { + // Request exclusive access to the EVS display + std::shared_ptr<IEvsDisplay> pDisplay; + ASSERT_TRUE(mEnumerator->openDisplay(targetDisplayId, &pDisplay).isOk()); + EXPECT_NE(pDisplay, nullptr); + // choose a configuration that has a frame rate faster than minReqFps. Stream targetCfg = {}; const int32_t minReqFps = 15; @@ -1732,11 +1731,11 @@ TEST_P(EvsAidlTest, CameraUseStreamConfigToDisplay) { // Stream configurations are found in metadata RawStreamConfig* ptr = reinterpret_cast<RawStreamConfig*>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; + targetCfg.format = static_cast<PixelFormat>(ptr->format); maxArea = ptr->width * ptr->height; foundCfg = true; @@ -1745,7 +1744,6 @@ TEST_P(EvsAidlTest, CameraUseStreamConfigToDisplay) { ++ptr; } } - targetCfg.format = static_cast<PixelFormat>(HAL_PIXEL_FORMAT_RGBA_8888); if (!foundCfg) { // Current EVS camera does not provide stream configurations in the @@ -1793,10 +1791,10 @@ TEST_P(EvsAidlTest, CameraUseStreamConfigToDisplay) { // Explicitly release the camera ASSERT_TRUE(mEnumerator->closeCamera(pCam).isOk()); mActiveCameras.clear(); - } - // Explicitly release the display - ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + // Explicitly release the display + ASSERT_TRUE(mEnumerator->closeDisplay(pDisplay).isOk()); + } } /* @@ -1829,11 +1827,11 @@ TEST_P(EvsAidlTest, MultiCameraStreamUseConfig) { // Stream configurations are found in metadata RawStreamConfig* ptr = reinterpret_cast<RawStreamConfig*>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; + targetCfg.format = static_cast<PixelFormat>(ptr->format); maxArea = ptr->width * ptr->height; foundCfg = true; @@ -1842,7 +1840,6 @@ TEST_P(EvsAidlTest, MultiCameraStreamUseConfig) { ++ptr; } } - targetCfg.format = static_cast<PixelFormat>(HAL_PIXEL_FORMAT_RGBA_8888); if (!foundCfg) { LOG(INFO) << "Device " << cam.id diff --git a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h index 622846a301..f023fd2063 100644 --- a/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h +++ b/automotive/vehicle/aidl/impl/default_config/include/DefaultConfig.h @@ -167,7 +167,15 @@ const std::vector<ConfigDeclaration> kVehicleProperties = { .maxSampleRate = 10.0f, }, .initialValue = {.floatValues = {0.0f}}}, - + {.config = + { + .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED_DISPLAY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.floatValues = {0.0f}}}, {.config = { .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), @@ -177,7 +185,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = { toInt(VehicleUnit::MILES_PER_HOUR), toInt(VehicleUnit::KILOMETERS_PER_HOUR)}, }, - .initialValue = {.int32Values = {toInt(VehicleUnit::KILOMETERS_PER_HOUR)}}}, + .initialValue = {.int32Values = {toInt(VehicleUnit::MILES_PER_HOUR)}}}, {.config = { @@ -1025,7 +1033,7 @@ const std::vector<ConfigDeclaration> kVehicleProperties = { .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {(int)VehicleUnit::LITER, (int)VehicleUnit::US_GALLON}, }, - .initialValue = {.int32Values = {(int)VehicleUnit::LITER}}}, + .initialValue = {.int32Values = {(int)VehicleUnit::US_GALLON}}}, {.config = { |