mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 03:43:03 +00:00
Merge "msm: face detect: fill correct pose in face detection result"
This commit is contained in:
commit
bdfa6d08f4
|
@ -374,11 +374,34 @@ void msm_fd_hw_get_result_angle_pose(struct msm_fd_device *fd, int idx,
|
|||
u32 *angle, u32 *pose)
|
||||
{
|
||||
u32 reg;
|
||||
u32 pose_reg;
|
||||
|
||||
reg = msm_fd_hw_read_reg(fd, MSM_FD_IOMEM_CORE,
|
||||
MSM_FD_RESULT_ANGLE_POSE(idx));
|
||||
*angle = (reg >> MSM_FD_RESULT_ANGLE_SHIFT) & MSM_FD_RESULT_ANGLE_MASK;
|
||||
*pose = (reg >> MSM_FD_RESULT_POSE_SHIFT) & MSM_FD_RESULT_POSE_MASK;
|
||||
pose_reg = (reg >> MSM_FD_RESULT_POSE_SHIFT) & MSM_FD_RESULT_POSE_MASK;
|
||||
|
||||
switch (pose_reg) {
|
||||
case MSM_FD_RESULT_POSE_FRONT:
|
||||
*pose = MSM_FD_POSE_FRONT;
|
||||
break;
|
||||
case MSM_FD_RESULT_POSE_RIGHT_DIAGONAL:
|
||||
*pose = MSM_FD_POSE_RIGHT_DIAGONAL;
|
||||
break;
|
||||
case MSM_FD_RESULT_POSE_RIGHT:
|
||||
*pose = MSM_FD_POSE_RIGHT;
|
||||
break;
|
||||
case MSM_FD_RESULT_POSE_LEFT_DIAGONAL:
|
||||
*pose = MSM_FD_POSE_LEFT_DIAGONAL;
|
||||
break;
|
||||
case MSM_FD_RESULT_POSE_LEFT:
|
||||
*pose = MSM_FD_POSE_LEFT;
|
||||
break;
|
||||
default:
|
||||
dev_err(fd->dev, "Invalid pose from the engine\n");
|
||||
*pose = MSM_FD_POSE_FRONT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -77,6 +77,11 @@
|
|||
#define MSM_FD_RESULT_ANGLE_SHIFT (0x000)
|
||||
#define MSM_FD_RESULT_POSE_MASK (0x7)
|
||||
#define MSM_FD_RESULT_POSE_SHIFT (0x9)
|
||||
#define MSM_FD_RESULT_POSE_FRONT (0x1)
|
||||
#define MSM_FD_RESULT_POSE_RIGHT_DIAGONAL (0x2)
|
||||
#define MSM_FD_RESULT_POSE_RIGHT (0x3)
|
||||
#define MSM_FD_RESULT_POSE_LEFT_DIAGONAL (0x4)
|
||||
#define MSM_FD_RESULT_POSE_LEFT (0x5)
|
||||
|
||||
/* FD misc registers */
|
||||
#define MSM_FD_MISC_HW_VERSION (0x00)
|
||||
|
|
Loading…
Reference in a new issue