Compare commits

25 Commits
vic ... bka

Author SHA1 Message Date
Hexdare
2ff11cdcfa [TMP]haydn: Change kernel remote 2025-09-16 18:34:09 +05:30
Hexdare
aab73c7543 haydn: Update dependencies 2025-09-04 12:56:57 +00:00
Hexdare
e34556363b haydn: Track TimeKeep from Los 2025-08-14 04:31:57 +00:00
Giovanni Ricca
d41260fced haydn: Commonize citsensor stack .
Change-Id: Iec2ab62feab3ea84aaf9ba31aa8619d8b2fa51aa
2025-08-10 12:51:54 +00:00
Giovanni Ricca
37aeb9af26 haydn: Decommonize libQnnHtpStub
Turns out this is platform specific. Fixes crashes on
libarcsoft_super_night_raw calls on yupik devices

Change-Id: I06b22517d313a8eeb116b0b969615203b0d53823
2025-08-10 12:51:53 +00:00
Hexdare
b826d8ca7a haydn: move TARGET_INIT_VENDOR_LIB to soong_config 2025-07-28 18:30:00 +00:00
therealmharc
3e856c0771 haydn: Add libinit for haydn
Signed-off-by: Hexdare <mohammedasimuddin786@gmail.com>
Signed-off-by: therealmharc <therealmharc@gmail.com>
2025-07-28 11:49:20 +05:30
Hexdare
2e2794b278 haydn: Add workflow to push latest changes automatically 2025-07-10 07:19:37 +05:30
Hexdare
5262fbb3ee haydn: Drop BCR
Source already has support
2025-07-10 01:54:57 +05:30
Hexdare
e51316b08b haydn: Initialize for EvolutionX 11.X 2025-07-10 01:51:21 +05:30
Bin
1ad1a69548 haydn: Patch audio to load libaudioroute-v34.so
Change-Id: Idad20512982b8753820fffa6d956df137e462638
2025-07-10 01:51:21 +05:30
Karan Parashar
a137c9ec2c haydn: Copy lahaina powerhint from common tree
Change-Id: I65a84dfad57487e4f1218e8b0c8ce258a9186faa
2025-07-10 01:51:21 +05:30
Hexdare
ffd0987cb4 haydn: Add vendorsetup.sh
Signed-off-by: Hexdare <hexdare@outlook.com>
2025-06-21 18:38:15 +05:30
Hexdare
273ebe63d6 haydn: set camera override format from reserved via soong config 2025-06-21 18:36:38 +05:30
Asimuddin Mohammed
6e516e717c haydn: Add props for GameBar 2025-06-21 18:36:38 +05:30
Asimuddin Mohammed
00386110c7 haydn: Add Bcr 2025-06-21 18:36:38 +05:30
1xtAsh
6e3d20c97e haydn: drop dependencies 2025-06-21 18:36:38 +05:30
1xtAsh
812df794e6 haydn: : Enable min/max refresh rate settings 2025-06-21 18:36:38 +05:30
chemusqui1
af1812e67b haydn: Define thresholds for switching refresh rate
* The display uses different gamma curves for different refresh rates.It's hard for panel vendor to tune the curves to have exact same brightness for different refresh rate (lazy), rr can switch so fast that makes a weird really annoying flicker, like a CRT, so we need to set a threshold for avoiding that flicker.

* Also, increasing rr switching timers, even if they made the CRT bug to be reduced, slowly scrolling on GMaps while Smooth Display is enabled, led to a weird gamma switching to a green tint, so we need to tune that too for avoiding that shifting.

Signed-off-by: 1xtAsh <ashraykrsingh321@gmail.com>
2025-06-21 18:36:38 +05:30
AdarshGrewal
532d994fa7 haydn: Include Leica Camera if exists 2025-06-21 18:36:38 +05:30
AdarshGrewal
871b013922 haydn: Include Firmware images 2025-06-21 18:36:33 +05:30
Mohammad Hasan Keramat J
ebca763bb0 haydn: Update blobs to V816.0.18.0.UKKMIXM
Change-Id: I7787a9c44ae0babc372ae4a74b610ebc13ccff4f
2025-06-11 04:13:46 +03:30
Giovanni Ricca
35fa0c30aa haydn: Drop 64bit listen blobs
Those are present already in the common tree

Change-Id: I4bbb62d5bf3e2414a4eec599be2765f9777ae038
2025-06-11 01:10:03 +03:30
Bruno Martins
84f7be379b haydn: Shim camera libs
Change-Id: Id4bec2bc8bf5da014a69e1953bdb36bc85d11f1e
2025-06-11 01:04:06 +03:30
Cosmin Tanislav
b21ab93a3d haydn: move vibrator effect stream config to select
Change-Id: I0878e645d12474da2d1971ce459db43c09bc97b7
2025-06-11 00:57:58 +03:30
16 changed files with 306 additions and 27 deletions

32
.github/workflows/sync.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Sync to Evolution-X-Devices
on:
push:
branches:
- evo
jobs:
sync:
if: github.repository == 'Haydn-Lab/device_xiaomi_haydn'
runs-on: ubuntu-latest
steps:
- name: Checkout source repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git identity
run: |
git config --global user.name "${{ secrets.GIT_USER_NAME }}"
git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
- name: Force Push to Target Repository
run: |
git config --unset-all http.https://github.com/.extraheader
git remote add target https://x-access-token:${{ secrets.TARGET_REPO_TOKEN }}@github.com/Evolution-X-Devices/device_xiaomi_haydn.git
git push target evo:bka --force

View File

@@ -18,6 +18,9 @@ TARGET_BOOTLOADER_BOARD_NAME := haydn
# HIDL
DEVICE_MANIFEST_FILE += $(DEVICE_PATH)/hidl/manifest.xml
# Init
TARGET_RECOVERY_DEVICE_MODULES := libinit_haydn
# Kernel
TARGET_KERNEL_CONFIG += vendor/haydn_QGKI.config
@@ -36,9 +39,11 @@ BOARD_DTBOIMG_PARTITION_SIZE := 25165824
# Properties
TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop
# Vibrator
TARGET_QTI_VIBRATOR_EFFECT_LIB := libqtivibratoreffect.xiaomi
TARGET_QTI_VIBRATOR_USE_EFFECT_STREAM := true
# Include proprietary files
include vendor/xiaomi/haydn/BoardConfigVendor.mk
# Firmware
include vendor/xiaomi/haydn-firmware/BoardConfigVendor.mk
# Inherit from proprietary files for Leica Camera
-include vendor/xiaomi/haydn-miuicamera/products/board.mk

View File

@@ -4,6 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
#
COMMON_PATH := device/xiaomi/sm8350-common
# Inherit from sm8350-common
$(call inherit-product, device/xiaomi/sm8350-common/common.mk)
@@ -21,6 +23,8 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/etc/init.haydn.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.haydn.rc
$(call soong_config_set,libinit,vendor_init_lib,//$(LOCAL_PATH):libinit_haydn)
# Overlays
DEVICE_PACKAGE_OVERLAYS += \
$(LOCAL_PATH)/overlay \
@@ -41,9 +45,21 @@ PRODUCT_PACKAGES += \
PRODUCT_PROPERTY_OVERRIDES += \
ro.surface_flinger.use_content_detection_for_refresh_rate=false
# Power
PRODUCT_COPY_FILES += \
$(COMMON_PATH)/configs/powerhint_lahaina.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += \
$(LOCAL_PATH)
# Vibrator
$(call soong_config_set,qti_vibrator,effect_lib,libqtivibratoreffect.xiaomi)
$(call soong_config_set,qti_vibrator,use_effect_stream,true)
# Call the proprietary setup
$(call inherit-product, vendor/xiaomi/haydn/haydn-vendor.mk)
# Call the Leica Camera setup
$(call inherit-product-if-exists, vendor/xiaomi/haydn-miuicamera/products/miuicamera.mk)
$(call soong_config_set,camera,override_format_from_reserved,true)

53
evolution.dependencies Normal file
View File

@@ -0,0 +1,53 @@
[
{
"remote" : "github-non-los",
"repository" : "Haydn-Lab/device_xiaomi_sm8350-common",
"target_path": "device/xiaomi/sm8350-common",
"branch" : "16"
},
{
"remote" : "github-non-los",
"repository" : "Haydn-Lab/vendor_xiaomi_sm8350-common",
"target_path": "vendor/xiaomi/sm8350-common",
"branch" : "16"
},
{
"repository" : "vendor_xiaomi_haydn",
"target_path": "vendor/xiaomi/haydn",
"branch" : "bka"
},
{
"repository" : "hardware_xiaomi",
"target_path": "hardware/xiaomi"
},
{
"remote" : "github-non-los",
"repository" : "Haydn-Lab/hardware_dolby",
"target_path": "hardware/dolby",
"branch" : "16"
},
{
"remote" : "github-non-los",
"repository" : "LineageOS/android_hardware_sony_timekeep",
"target_path": "hardware/sony/timekeep",
"branch" : "lineage-22.2"
},
{
"remote" : "gitlab",
"repository" : "Hexdare/haydn-miuicamera",
"target_path": "vendor/xiaomi/haydn-miuicamera",
"branch" : "fifteen-leica"
},
{
"remote" : "gitlab",
"repository" : "Hexdare/vendor_xiaomi_haydn-firmware",
"target_path": "vendor/xiaomi/haydn-firmware",
"branch" : "fourteen"
},
{
"remote" : "github-non-los",
"repository" : "Haydn-Lab/kernel_xiaomi_haydn",
"target_path": "kernel/xiaomi/sm8350",
"branch" : "lineage-22.2-NO-KSU"
}
]

7
extract-files.py Executable file → Normal file
View File

@@ -32,10 +32,15 @@ lib_fixups: lib_fixups_user_type = {
blob_fixups: blob_fixups_user_type = {
'vendor/etc/camera/pureShot_parameter.xml': blob_fixup()
.regex_replace(r'=(\d+)>', r'="\1">'),
('vendor/lib/hw/audio.primary.lahaina.so', 'vendor/lib/libaudioroute_ext.so'): blob_fixup()
.replace_needed('libaudioroute.so', 'libaudioroute-v34.so'),
'vendor/lib64/hw/camera.qcom.so': blob_fixup()
.binary_regex_replace(b'\x73\x74\x5F\x6C\x69\x63\x65\x6E\x73\x65\x2E\x6C\x69\x63', b'\x63\x61\x6D\x65\x72\x61\x5F\x63\x6E\x66\x2E\x74\x78\x74'),
.binary_regex_replace(b'\x73\x74\x5F\x6C\x69\x63\x65\x6E\x73\x65\x2E\x6C\x69\x63', b'\x63\x61\x6D\x65\x72\x61\x5F\x63\x6E\x66\x2E\x74\x78\x74')
.add_needed('libprocessgroup_shim.so'),
'vendor/lib64/hw/camera.xiaomi.so': blob_fixup()
.sig_replace('52 07 00 94', '1F 20 03 D5'),
'vendor/lib64/hw/com.qti.chi.override.so': blob_fixup()
.add_needed('libprocessgroup_shim.so'),
'vendor/lib64/vendor.xiaomi.hardware.cameraperf@1.0-impl.so': blob_fixup()
.sig_replace('21 00 80 52 7c 00 00 94', '21 00 80 52 1F 20 03 D5'),
('vendor/lib64/libalAILDC.so', 'vendor/lib64/libalLDC.so', 'vendor/lib64/libalhLDC.so'): blob_fixup()

25
init/Android.bp Normal file
View File

@@ -0,0 +1,25 @@
//
// Copyright (C) 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_library_static {
name: "libinit_haydn",
srcs: ["init_haydn.cpp"],
recovery_available: true,
include_dirs: [
"system/core/init",
],
shared_libs: ["libbase"],
}

109
init/init_haydn.cpp Normal file
View File

@@ -0,0 +1,109 @@
/*
Copyright (C) 2020 The LineageOS Project.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of The Linux Foundation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <vector>
#include <android-base/properties.h>
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>
using android::base::GetProperty;
std::vector<std::string> ro_props_default_source_order = {
"",
"odm.",
"product.",
"system.",
"system_ext.",
"vendor.",
"vendor_dlkm.",
};
void property_override(char const prop[], char const value[], bool add = true)
{
prop_info *pi;
pi = (prop_info *) __system_property_find(prop);
if (pi)
__system_property_update(pi, value, strlen(value));
else if (add)
__system_property_add(prop, strlen(prop), value, strlen(value));
}
void set_ro_build_prop(const std::string &prop, const std::string &value) {
for (const auto &source : ro_props_default_source_order) {
auto prop_name = "ro." + source + "build." + prop;
if (source == "")
property_override(prop_name.c_str(), value.c_str());
else
property_override(prop_name.c_str(), value.c_str(), false);
}
};
void set_ro_product_prop(const std::string &prop, const std::string &value) {
for (const auto &source : ro_props_default_source_order) {
auto prop_name = "ro.product." + source + prop;
property_override(prop_name.c_str(), value.c_str(), false);
}
};
void vendor_load_properties() {
std::string region = GetProperty("ro.boot.hwc", "GL"); // Default to Global if missing
std::string model;
std::string device;
std::string mod_device;
if (region == "CN") {
// CN variant IMX686 main sensor
model = "M2012K11C";
device = "haydn";
mod_device = "haydn_cn";
property_override("persist.vendor.camera.main_sensor", "imx686");
} else if (region == "IN") {
// India variant HM2 108MP
model = "M2012K11I";
device = "haydnin";
mod_device = "haydn_in_global";
property_override("persist.vendor.camera.main_sensor", "hm2");
} else {
// Global variant HM2 108MP
model = "M2012K11G";
device = "haydn";
mod_device = "haydn_global";
property_override("persist.vendor.camera.main_sensor", "hm2");
}
set_ro_product_prop("device", device);
set_ro_product_prop("model", model);
if (!mod_device.empty()) {
property_override("ro.product.mod_device", mod_device.c_str());
}
}

View File

@@ -1,6 +0,0 @@
[
{
"repository": "android_device_xiaomi_sm8350-common",
"target_path": "device/xiaomi/sm8350-common"
}
]

View File

@@ -16,9 +16,17 @@ PRODUCT_MANUFACTURER := Xiaomi
PRODUCT_MODEL := M2012K11G
PRODUCT_NAME := lineage_haydn
WITH_GMS := true
TARGET_DISABLE_EPPE := true
TARGET_BOOT_ANIMATION_RES := 1080
TARGET_ENABLE_BLUR := true
EVO_BUILD_TYPE := Official
TARGET_SUPPORTS_QUICK_TAP := true
BYPASS_CHARGE_SUPPORTED := true
PRODUCT_BUILD_PROP_OVERRIDES += \
BuildDesc="haydn_global-user 14 UKQ1.231207.002 V816.0.11.0.UKKMIXM release-keys" \
BuildFingerprint=Xiaomi/haydn_global/haydn:14/UKQ1.231207.002/V816.0.11.0.UKKMIXM:user/release-keys \
BuildDesc="haydn_global-user 14 UKQ1.231207.002 V816.0.18.0.UKKMIXM release-keys" \
BuildFingerprint=Xiaomi/haydn_global/haydn:14/UKQ1.231207.002/V816.0.18.0.UKKMIXM:user/release-keys \
DeviceProduct=haydn \
SystemName=haydn_global

View File

@@ -340,4 +340,21 @@
<item>haydn</item>
<item>haydnpro</item>
</string-array>
<!-- The display uses different gamma curves for different refresh rates. It's hard for panel
vendor to tune the curves to have exact same brightness for different refresh rate. So
flicker could be observed at switch time. The issue is worse at the gamma lower end.
In addition, human eyes are more sensitive to the flicker at darker environment.
To prevent flicker, we only support higher refresh rates if the display brightness is above
a threshold. And the darker environment could have higher threshold.
For example, no higher refresh rate if
display brightness <= disp0 && ambient brightness <= amb0
|| display brightness <= disp1 && ambient brightness <= amb1
-->
<integer-array name="config_brightnessThresholdsOfPeakRefreshRate">
<item>74</item> <!-- 77% UI brightness -->
</integer-array>
<integer-array name="config_ambientThresholdsOfPeakRefreshRate">
<item>63</item>
</integer-array>
</resources>

View File

@@ -5,6 +5,11 @@
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Whether to show Minimum and Maximum refresh rate in display settings -->
<bool name="config_show_peak_refresh_rate_switch">true</bool>
<bool name="config_show_min_refresh_rate_switch">true</bool>
<!-- If using legacy - please use config_show_min_refresh_rate_switch prop -->
<!-- Whether to show Smooth Display feature in Settings Options -->
<bool name="config_show_smooth_display">true</bool>
<bool name="config_show_smooth_display">false</bool>
</resources>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019-2024 Evolution X
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- About device screen, build maintainer -->
<string name="build_maintainer_summary">Hexdare</string>
<string name="build_maintainer_donate_url">https://linktr.ee/Hexdare</string>
</resources>

View File

@@ -1,4 +1,4 @@
# All unpinned blobs below are extracted from haydn V816.0.11.0.UKKMIXM
# All unpinned blobs below are extracted from haydn V816.0.18.0.UKKMIXM
# ACDB
vendor/etc/acdbdata/Forte/Forte_Bluetooth_cal.acdb
@@ -179,6 +179,7 @@ vendor/lib64/hw/com.qti.chi.override.so
vendor/lib64/libAF.so
vendor/lib64/libBlinkStub.so
vendor/lib64/libFlickerDet.so
vendor/lib64/libQnnHtpStub.so
vendor/lib64/libI420colorconvert.so
vendor/lib64/libSNPE.so
vendor/lib64/lib_sr_models.so
@@ -221,9 +222,6 @@ vendor/lib64/libcamxstatscore.so
vendor/lib64/libcamxswispiqmodule.so
vendor/lib64/libcamxswprocessalgo.so
vendor/lib64/libcamxtintlessalgo.so
vendor/lib64/libcapiv2svacnn.so
vendor/lib64/libcapiv2svarnn.so
vendor/lib64/libcapiv2vop.so
vendor/lib64/libchilog.so
vendor/lib64/libcom.qti.chinodeutils.so
vendor/lib64/libcom.xiaomi.debug.so
@@ -642,14 +640,6 @@ vendor/lib64/sensors.mius.proximity.so
vendor/lib64/sensors.ssc.so
vendor/lib64/sensors.touch.detect.so
# Sensors (citsensor)
vendor/bin/hw/vendor.xiaomi.hardware.citsensorservice@1.1-service
vendor/etc/init/vendor.xiaomi.hardware.citsensorservice@1.1-service.rc
vendor/etc/vintf/manifest/vendor.xiaomi.hardware.citsensorservice@1.1-service.xml
vendor/lib64/hw/vendor.xiaomi.hardware.citsensorservice@1.1-impl.so
vendor/lib64/vendor.xiaomi.hardware.citsensorservice@1.0.so
vendor/lib64/vendor.xiaomi.hardware.citsensorservice@1.1.so
# Sensors configs
vendor/etc/sensors/config/ak991x_dri_0.json
vendor/etc/sensors/config/bmp285_0.json

View File

@@ -1,4 +1,4 @@
# All unpinned blobs below are extracted from haydn V816.0.11.0.UKKMIXM
# All unpinned blobs below are extracted from haydn V816.0.18.0.UKKMIXM
abl.img;AB
aop.img;AB

View File

@@ -46,3 +46,11 @@ on boot && property:ro.boot.hwc=GL
on boot && property:ro.boot.hwc=IN
setprop bluetooth.device.default_name "Mi 11X Pro"
on property:vendor.post_boot.parsed=1
chown system graphics /sys/class/drm/sde-crtc-0/measured_fps
chmod 0660 /sys/class/drm/sde-crtc-0/measured_fps
chown system system /sys/class/power_supply/battery/temp
chmod 0660 /sys/class/power_supply/battery/temp

2
vendorsetup.sh Normal file
View File

@@ -0,0 +1,2 @@
rm -rf hardware/xiaomi/dolby
rm -rf hardware/xiaomi/DSP*