sm6375-common: Remove in-tree Livedisplay HAL
Change-Id: I6f6ccfdc816c2bfb7267f13b6e6787014282f446
This commit is contained in:
parent
928b8b38b5
commit
8d0f27975b
11 changed files with 0 additions and 392 deletions
|
@ -255,10 +255,6 @@ PRODUCT_ENABLE_UFFD_GC := false
|
|||
PRODUCT_PACKAGES += \
|
||||
android.hardware.keymaster@4.1.vendor
|
||||
|
||||
# LiveDisplay
|
||||
PRODUCT_PACKAGES += \
|
||||
vendor.lineage.livedisplay@2.1-service.motorola_holi
|
||||
|
||||
# Media
|
||||
PRODUCT_COPY_FILES += \
|
||||
$(LOCAL_PATH)/media/init.qti.media.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.media.sh \
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
// Copyright (C) 2019-2020 The LineageOS Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
cc_defaults {
|
||||
name: "livedisplay_motorola_holi",
|
||||
defaults: ["hidl_defaults"],
|
||||
relative_install_path: "hw",
|
||||
srcs: [
|
||||
":vendor.lineage.livedisplay@2.0-sdm-pa",
|
||||
":vendor.lineage.livedisplay@2.0-sdm-utils",
|
||||
"AntiFlicker.cpp",
|
||||
"SunlightEnhancement.cpp",
|
||||
"service.cpp",
|
||||
],
|
||||
shared_libs: [
|
||||
"libbase",
|
||||
"libbinder",
|
||||
"libcutils",
|
||||
"libdl",
|
||||
"libhidlbase",
|
||||
"libutils",
|
||||
"vendor.lineage.livedisplay@2.0",
|
||||
"vendor.lineage.livedisplay@2.1",
|
||||
],
|
||||
header_libs: [
|
||||
"vendor.lineage.livedisplay@2.0-sdm-headers",
|
||||
],
|
||||
}
|
||||
|
||||
cc_binary {
|
||||
name: "vendor.lineage.livedisplay@2.1-service.motorola_holi",
|
||||
init_rc: ["vendor.lineage.livedisplay@2.1-service.motorola_holi.rc"],
|
||||
defaults: ["livedisplay_motorola_holi"],
|
||||
vendor: true,
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2022 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "AntiFlicker.h"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/strings.h>
|
||||
|
||||
namespace {
|
||||
constexpr const char *kFileDc = "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc";
|
||||
}; // anonymous namespace
|
||||
|
||||
using ::android::base::ReadFileToString;
|
||||
using ::android::base::Trim;
|
||||
using ::android::base::WriteStringToFile;
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace livedisplay {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
AntiFlicker::AntiFlicker() {
|
||||
if (!access(kFileDc, R_OK | W_OK)) {
|
||||
file_ = kFileDc;
|
||||
enabled_mode_ = 1;
|
||||
} else {
|
||||
file_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool AntiFlicker::isSupported() {
|
||||
return file_ != nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::vendor::lineage::livedisplay::V2_1::IAntiFlicker follow.
|
||||
Return<bool> AntiFlicker::isEnabled() {
|
||||
std::string tmp;
|
||||
int32_t contents = 0;
|
||||
|
||||
if (ReadFileToString(file_, &tmp)) {
|
||||
contents = std::stoi(Trim(tmp));
|
||||
}
|
||||
|
||||
return contents > 0;
|
||||
}
|
||||
|
||||
Return<bool> AntiFlicker::setEnabled(bool enabled) {
|
||||
return WriteStringToFile(enabled ? std::to_string(enabled_mode_) : "0", file_, true);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace livedisplay
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2022 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vendor/lineage/livedisplay/2.1/IAntiFlicker.h>
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace livedisplay {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::Return;
|
||||
|
||||
class AntiFlicker : public IAntiFlicker {
|
||||
public:
|
||||
AntiFlicker();
|
||||
bool isSupported();
|
||||
|
||||
// Methods from ::vendor::lineage::livedisplay::V2_1::IAntiFlicker follow.
|
||||
Return<bool> isEnabled() override;
|
||||
Return<bool> setEnabled(bool enabled) override;
|
||||
|
||||
private:
|
||||
const char* file_;
|
||||
int32_t enabled_mode_;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace livedisplay
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2022 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "SunlightEnhancement.h"
|
||||
|
||||
#include <android-base/file.h>
|
||||
#include <android-base/strings.h>
|
||||
|
||||
namespace {
|
||||
constexpr const char *kFileHbm = "/sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm";
|
||||
}; // anonymous namespace
|
||||
|
||||
using ::android::base::ReadFileToString;
|
||||
using ::android::base::Trim;
|
||||
using ::android::base::WriteStringToFile;
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace livedisplay {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
SunlightEnhancement::SunlightEnhancement() {
|
||||
if (!access(kFileHbm, R_OK | W_OK)) {
|
||||
file_ = kFileHbm;
|
||||
enabled_mode_ = 1;
|
||||
} else {
|
||||
file_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool SunlightEnhancement::isSupported() {
|
||||
return file_ != nullptr;
|
||||
}
|
||||
|
||||
// Methods from ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement follow.
|
||||
Return<bool> SunlightEnhancement::isEnabled() {
|
||||
std::string tmp;
|
||||
int32_t contents = 0;
|
||||
|
||||
if (ReadFileToString(file_, &tmp)) {
|
||||
contents = std::stoi(Trim(tmp));
|
||||
}
|
||||
|
||||
return contents > 0;
|
||||
}
|
||||
|
||||
Return<bool> SunlightEnhancement::setEnabled(bool enabled) {
|
||||
return WriteStringToFile(enabled ? std::to_string(enabled_mode_) : "0", file_, true);
|
||||
}
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace livedisplay
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2022 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vendor/lineage/livedisplay/2.1/ISunlightEnhancement.h>
|
||||
|
||||
namespace vendor {
|
||||
namespace lineage {
|
||||
namespace livedisplay {
|
||||
namespace V2_1 {
|
||||
namespace implementation {
|
||||
|
||||
using ::android::hardware::Return;
|
||||
|
||||
class SunlightEnhancement : public ISunlightEnhancement {
|
||||
public:
|
||||
SunlightEnhancement();
|
||||
bool isSupported();
|
||||
|
||||
// Methods from ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement follow.
|
||||
Return<bool> isEnabled() override;
|
||||
Return<bool> setEnabled(bool enabled) override;
|
||||
|
||||
private:
|
||||
const char* file_;
|
||||
int32_t enabled_mode_;
|
||||
};
|
||||
|
||||
} // namespace implementation
|
||||
} // namespace V2_1
|
||||
} // namespace livedisplay
|
||||
} // namespace lineage
|
||||
} // namespace vendor
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2019-2020 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#define LOG_TAG "vendor.lineage.livedisplay@2.1-service.motorola_holi"
|
||||
|
||||
#include <android-base/logging.h>
|
||||
#include <binder/ProcessState.h>
|
||||
#include <hidl/HidlTransportSupport.h>
|
||||
#include <livedisplay/sdm/PictureAdjustment.h>
|
||||
#include <vendor/lineage/livedisplay/2.1/IPictureAdjustment.h>
|
||||
#include "AntiFlicker.h"
|
||||
#include "SunlightEnhancement.h"
|
||||
|
||||
using ::android::OK;
|
||||
using ::android::sp;
|
||||
using ::android::status_t;
|
||||
using ::android::hardware::configureRpcThreadpool;
|
||||
using ::android::hardware::joinRpcThreadpool;
|
||||
|
||||
using ::vendor::lineage::livedisplay::V2_0::sdm::PictureAdjustment;
|
||||
using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController;
|
||||
using ::vendor::lineage::livedisplay::V2_1::IPictureAdjustment;
|
||||
using ::vendor::lineage::livedisplay::V2_1::implementation::AntiFlicker;
|
||||
using ::vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement;
|
||||
|
||||
status_t RegisterAsServices() {
|
||||
status_t status = OK;
|
||||
|
||||
sp<SunlightEnhancement> se = new SunlightEnhancement();
|
||||
if (se->isSupported()) {
|
||||
status = se->registerAsService();
|
||||
if (status != OK) {
|
||||
LOG(ERROR) << "Could not register service for LiveDisplay HAL SunlightEnhancement Iface"
|
||||
<< " (" << status << ")";
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
sp<AntiFlicker> af = new AntiFlicker();
|
||||
if (af->isSupported()) {
|
||||
status = af->registerAsService();
|
||||
if (status != OK) {
|
||||
LOG(ERROR) << "Could not register service for LiveDisplay HAL AntiFlicker Iface"
|
||||
<< " (" << status << ")";
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<SDMController> controller = std::make_shared<SDMController>();
|
||||
sp<PictureAdjustment> pa = new PictureAdjustment(controller);
|
||||
status = pa->registerAsService();
|
||||
if (status != OK) {
|
||||
LOG(ERROR) << "Could not register service for LiveDisplay HAL PictureAdjustment Iface ("
|
||||
<< status << ")";
|
||||
return status;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
int main() {
|
||||
android::ProcessState::initWithDriver("/dev/vndbinder");
|
||||
|
||||
LOG(DEBUG) << "LiveDisplay HAL service is starting.";
|
||||
|
||||
configureRpcThreadpool(1, true /*callerWillJoin*/);
|
||||
|
||||
if (RegisterAsServices() == OK) {
|
||||
LOG(DEBUG) << "LiveDisplay HAL service is ready.";
|
||||
joinRpcThreadpool();
|
||||
} else {
|
||||
LOG(ERROR) << "Could not register service for LiveDisplay HAL";
|
||||
}
|
||||
|
||||
// In normal operation, we don't expect the thread pool to shutdown
|
||||
LOG(ERROR) << "LiveDisplay HAL service is shutting down.";
|
||||
return 1;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
on init
|
||||
# LiveDisplay sysfs
|
||||
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm
|
||||
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm
|
||||
chown system system /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc
|
||||
chmod 0660 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc
|
||||
|
||||
service vendor.livedisplay-hal-2-1 /vendor/bin/hw/vendor.lineage.livedisplay@2.1-service.motorola_holi
|
||||
class late_start
|
||||
user system
|
||||
group system
|
3
sepolicy/vendor/file_contexts
vendored
3
sepolicy/vendor/file_contexts
vendored
|
@ -64,9 +64,6 @@
|
|||
# Label read_ahead_kb in /data partition
|
||||
/sys/devices/platform/soc/1d84000.ufshc/host0/target0:0:0/0:0:0:0/block/sda/queue/read_ahead_kb u:object_r:vendor_sysfs_scsi_host:s0
|
||||
|
||||
# LiveDisplay
|
||||
/(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.1-service\.motorola_holi u:object_r:hal_lineage_livedisplay_qti_exec:s0
|
||||
|
||||
# Motobox
|
||||
/(vendor|system/vendor)/bin/motobox u:object_r:vendor_motobox_exec:s0
|
||||
|
||||
|
|
4
sepolicy/vendor/genfs_contexts
vendored
4
sepolicy/vendor/genfs_contexts
vendored
|
@ -20,10 +20,6 @@ genfscon sysfs /devices/virtual/input
|
|||
# Lights
|
||||
genfscon sysfs /devices/platform/soc/c440000.qcom,spmi/spmi-0/spmi0-02/c440000.qcom,spmi:qcom,pm8350c@2:qcom,leds@ef00/leds/charging u:object_r:sysfs_leds:s0
|
||||
|
||||
# LiveDisplay
|
||||
genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_hbm u:object_r:sysfs_livedisplay_tuneable:s0
|
||||
genfscon sysfs /devices/platform/soc/soc:qcom,dsi-display-primary/dsi_display_dc u:object_r:sysfs_livedisplay_tuneable:s0
|
||||
|
||||
# Motorola
|
||||
genfscon proc /bootinfo u:object_r:proc_moto_boot:s0
|
||||
genfscon proc /config u:object_r:vendor_proc_hw:s0
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
allow hal_lineage_livedisplay_qti sysfs_livedisplay_tuneable:file rw_file_perms;
|
Loading…
Reference in a new issue