|
@@ -68,6 +68,11 @@ static disp_event_resp* parseDispEvent(int fd) {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
+struct disp_base displayBasePrimary = {
|
|
|
+ .flag = 0,
|
|
|
+ .disp_id = MI_DISP_PRIMARY,
|
|
|
+};
|
|
|
+
|
|
|
} // anonymous namespace
|
|
|
|
|
|
class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
|
@@ -145,11 +150,11 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
|
|
ioctl(touch_fd_.get(), TOUCH_IOC_SET_CUR_VALUE, &touchRequest);
|
|
|
|
|
|
// Request HBM
|
|
|
- disp_local_hbm_req req;
|
|
|
- req.base.flag = 0;
|
|
|
- req.base.disp_id = MI_DISP_PRIMARY;
|
|
|
- req.local_hbm_value = LHBM_TARGET_BRIGHTNESS_WHITE_1000NIT;
|
|
|
- ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &req);
|
|
|
+ struct disp_local_hbm_req displayLhbmRequest = {
|
|
|
+ .base = displayBasePrimary,
|
|
|
+ .local_hbm_value = LHBM_TARGET_BRIGHTNESS_WHITE_1000NIT,
|
|
|
+ };
|
|
|
+ ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &displayLhbmRequest);
|
|
|
}
|
|
|
|
|
|
void onFingerUp() {
|
|
@@ -160,11 +165,11 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
|
|
mDevice->extCmd(mDevice, COMMAND_FOD_PRESS_STATUS, PARAM_FOD_RELEASED);
|
|
|
|
|
|
// Disable HBM
|
|
|
- disp_local_hbm_req req;
|
|
|
- req.base.flag = 0;
|
|
|
- req.base.disp_id = MI_DISP_PRIMARY;
|
|
|
- req.local_hbm_value = LHBM_TARGET_BRIGHTNESS_OFF_FINGER_UP;
|
|
|
- ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &req);
|
|
|
+ struct disp_local_hbm_req displayLhbmRequest = {
|
|
|
+ .base = displayBasePrimary,
|
|
|
+ .local_hbm_value = LHBM_TARGET_BRIGHTNESS_OFF_FINGER_UP,
|
|
|
+ };
|
|
|
+ ioctl(disp_fd_.get(), MI_DISP_IOCTL_SET_LOCAL_HBM, &displayLhbmRequest);
|
|
|
|
|
|
// Update fod_finger_state node in case hwmodule polls it
|
|
|
struct touch_mode_request touchRequest = {
|
|
@@ -181,9 +186,7 @@ class XiaomiSm8450UdfpsHander : public UdfpsHandler {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- void cancel() {
|
|
|
- LOG(DEBUG) << __func__;
|
|
|
- }
|
|
|
+ void cancel() { LOG(DEBUG) << __func__; }
|
|
|
|
|
|
private:
|
|
|
fingerprint_device_t* mDevice;
|