From 34766e8141ea82958bf3b263df3c185a30b6c166 Mon Sep 17 00:00:00 2001 From: hobbycao Date: Tue, 20 Sep 2022 20:02:21 +0800 Subject: [PATCH] fix: modify drivers usage Signed-off-by: hobbycao --- distributed_camera/distributedcamera.gni | 2 -- distributed_camera/hdi_service/BUILD.gn | 1 - .../hdi_service/include/dstream_operator/dbuffer_manager.h | 1 - .../hdi_service/src/dstream_operator/dbuffer_manager.cpp | 6 +++--- .../hdi_service/src/dstream_operator/dcamera_stream.cpp | 4 ++-- distributed_camera/hdi_service/test/common.h | 1 - .../test/unittest/common/dcamera_device/BUILD.gn | 1 - .../test/unittest/common/dstream_operator/BUILD.gn | 1 - 8 files changed, 5 insertions(+), 12 deletions(-) diff --git a/distributed_camera/distributedcamera.gni b/distributed_camera/distributedcamera.gni index 61543dab5a..4607910602 100644 --- a/distributed_camera/distributedcamera.gni +++ b/distributed_camera/distributedcamera.gni @@ -16,5 +16,3 @@ distributedcamera_hdf_path = "//drivers/peripheral/distributed_camera" camera_hdf_path = "//drivers/peripheral" hdf_framework_path = "//drivers/hdf_core/framework" - -display_hdf_path = "//drivers/peripheral/display" diff --git a/distributed_camera/hdi_service/BUILD.gn b/distributed_camera/hdi_service/BUILD.gn index 0a714753c8..ae2b951351 100644 --- a/distributed_camera/hdi_service/BUILD.gn +++ b/distributed_camera/hdi_service/BUILD.gn @@ -69,7 +69,6 @@ ohos_shared_library("libdistributed_camera_hdf_service_1.0") { "include/dstream_operator", "include/utils", "//utils/system/safwk/native/include", - "${display_hdf_path}/interfaces/include", "${hdf_framework_path}/include/utils", "${hdf_framework_path}/include/core", "${hdf_framework_path}/include/osal", diff --git a/distributed_camera/hdi_service/include/dstream_operator/dbuffer_manager.h b/distributed_camera/hdi_service/include/dstream_operator/dbuffer_manager.h index f353dec59e..23f6fcd350 100644 --- a/distributed_camera/hdi_service/include/dstream_operator/dbuffer_manager.h +++ b/distributed_camera/hdi_service/include/dstream_operator/dbuffer_manager.h @@ -21,7 +21,6 @@ #include "constants.h" #include "dimage_buffer.h" -#include "display_type.h" #include "surface.h" #include "surface_buffer.h" diff --git a/distributed_camera/hdi_service/src/dstream_operator/dbuffer_manager.cpp b/distributed_camera/hdi_service/src/dstream_operator/dbuffer_manager.cpp index ff607b54ce..708fdce199 100644 --- a/distributed_camera/hdi_service/src/dstream_operator/dbuffer_manager.cpp +++ b/distributed_camera/hdi_service/src/dstream_operator/dbuffer_manager.cpp @@ -102,13 +102,13 @@ uint64_t DBufferManager::CameraUsageToGrallocUsage(const uint64_t cameraUsage) for (uint32_t i = 0; i < sizeof(cameraUsage) * BYTE; i++) { switch (cameraUsage & (test << i)) { case CAMERA_USAGE_SW_READ_OFTEN: - grallocUsage |= HBM_USE_CPU_READ; + grallocUsage |= BUFFER_USAGE_CPU_READ; break; case CAMERA_USAGE_SW_WRITE_OFTEN: - grallocUsage |= HBM_USE_CPU_WRITE; + grallocUsage |= BUFFER_USAGE_CPU_WRITE; break; case CAMERA_USAGE_MEM_DMA: - grallocUsage |= HBM_USE_MEM_DMA; + grallocUsage |= BUFFER_USAGE_MEM_DMA; break; default: break; diff --git a/distributed_camera/hdi_service/src/dstream_operator/dcamera_stream.cpp b/distributed_camera/hdi_service/src/dstream_operator/dcamera_stream.cpp index 11f8fe13e7..dbd851ce2a 100644 --- a/distributed_camera/hdi_service/src/dstream_operator/dcamera_stream.cpp +++ b/distributed_camera/hdi_service/src/dstream_operator/dcamera_stream.cpp @@ -46,7 +46,7 @@ DCamRetCode DCameraStream::InitDCameraStream(const StreamInfo &info) dcStreamAttribute_.height_ = dcStreamInfo_->height_; dcStreamAttribute_.overrideFormat_ = dcStreamInfo_->format_; dcStreamAttribute_.overrideDataspace_ = dcStreamInfo_->dataspace_; - dcStreamAttribute_.producerUsage_ = HBM_USE_CPU_READ | HBM_USE_CPU_WRITE | HBM_USE_MEM_DMA; + dcStreamAttribute_.producerUsage_ = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA; dcStreamAttribute_.producerBufferCount_ = BUFFER_QUEUE_SIZE; dcStreamAttribute_.maxBatchCaptureCount_ = BUFFER_QUEUE_SIZE; @@ -185,7 +185,7 @@ DCamRetCode DCameraStream::GetNextRequest() OHOS::sptr surfaceBuffer = nullptr; int32_t fence = -1; - int32_t usage = HBM_USE_CPU_READ | HBM_USE_CPU_WRITE | HBM_USE_MEM_DMA; + int32_t usage = BUFFER_USAGE_CPU_READ | BUFFER_USAGE_CPU_WRITE | BUFFER_USAGE_MEM_DMA; OHOS::BufferRequestConfig config = { .width = dcStreamInfo_->width_, .height = dcStreamInfo_->height_, diff --git a/distributed_camera/hdi_service/test/common.h b/distributed_camera/hdi_service/test/common.h index 5aff688935..19a4e0ae47 100644 --- a/distributed_camera/hdi_service/test/common.h +++ b/distributed_camera/hdi_service/test/common.h @@ -30,7 +30,6 @@ #include #include "camera_metadata_info.h" -#include "display_type.h" #include "distributed_hardware_log.h" #include "idistributed_hardware_source.h" #include "iservice_registry.h" diff --git a/distributed_camera/hdi_service/test/unittest/common/dcamera_device/BUILD.gn b/distributed_camera/hdi_service/test/unittest/common/dcamera_device/BUILD.gn index da96dc0d64..ce53f8ae13 100644 --- a/distributed_camera/hdi_service/test/unittest/common/dcamera_device/BUILD.gn +++ b/distributed_camera/hdi_service/test/unittest/common/dcamera_device/BUILD.gn @@ -31,7 +31,6 @@ config("module_private_config") { "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/device", "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/host", "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/operator", - "${display_hdf_path}/interfaces/include", "${hdf_framework_path}/include/utils", "${hdf_framework_path}/include/core", "${hdf_framework_path}/include/osal", diff --git a/distributed_camera/hdi_service/test/unittest/common/dstream_operator/BUILD.gn b/distributed_camera/hdi_service/test/unittest/common/dstream_operator/BUILD.gn index 561cad82ea..be702ab013 100644 --- a/distributed_camera/hdi_service/test/unittest/common/dstream_operator/BUILD.gn +++ b/distributed_camera/hdi_service/test/unittest/common/dstream_operator/BUILD.gn @@ -32,7 +32,6 @@ config("module_private_config") { "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/device", "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/host", "${distributedcamera_hdf_path}/interfaces/hdi_ipc/server/operator", - "${display_hdf_path}/interfaces/include", "${hdf_framework_path}/include/utils", "${hdf_framework_path}/include/core", "${hdf_framework_path}/include/osal", -- Gitee