Demo video: https://youtu.be/FZ92-Z80QNE
Tested on Evolution X (android 12.1)
Steps:
- Cherry-pick kernel modifications: https://github.com/ngxson/kernel_xiaomi_laurel_sprout/commits/feat/fod_dim_layer
From https://github.com/ngxson/kernel_xiaomi_laurel_sprout/commit/382b0c5209a6cb71254d18a0874f2f5028441d97
to https://github.com/ngxson/kernel_xiaomi_laurel_sprout/commit/a2bfea4962d05398847b1417a69bccc5f4b94dc9 - For device tree, replace files under
/biometrics
with these files: https://github.com/ngxson/device_xiaomi_laurel_sprout/tree/38b24ab58a428962e3e3c34bd70827ca469daf7b/biometrics - Only required if you're using android 12.1: Open
frameworks/base/packages/SystemUI/src/com/android/systemui/biometrics/DummyUdfpsHbmProvider.kt
and replace with content below:
package com.android.systemui.biometrics
import android.content.Context
import android.view.Surface
import android.os.Handler
import java.io.File
class DummyUdfpsHbmProvider constructor(
private val context: Context
): UdfpsHbmProvider {
override fun enableHbm(hbmType: Int, surface: Surface?, onHbmEnabled: Runnable?) {
onHbmEnabled?.run()
}
override fun disableHbm(onHbmDisabled: Runnable?) {
onHbmDisabled?.run()
try {
File("/sys/devices/platform/soc/soc:qcom,dsi-display/dimlayer_hbm").writeText("0")
File("/sys/class/drm/card0-DSI-1/disp_param").writeText("0x20f0F20")
} catch (e: Exception) {
e.printStackTrace()
}
}
}
- Compile the ROM
Not working, display still goes in HBM and no dim layer applied.