msm: camera: MSM FD face detection driver

MSM FD (Face detection) driver - Detects faces from a given input buffer.

The driver implements standard V4L2 interface, and supports
V4L2 event interface. Uses standard V4L2 IOCTLs and controls.
However there is one private IOCTL used to
obtain the result of the driver:

"VIDIOC_MSM_FD_GET_RESULT"

Compat support is also added for this IOCTL.

The driver can operate simultaneously
with multiple open file descriptors.

Change-Id: I50ebdd9c966c18dec27a06630a0cbd0affc0b1bb
Signed-off-by: Gjorgji Rosikopulos <grosik@codeaurora.org>
This commit is contained in:
Gjorgji Rosikopulos 2014-03-27 16:35:15 -07:00
parent ffbfa10bf9
commit 2fb71e29c3
9 changed files with 3015 additions and 0 deletions

View file

@ -0,0 +1,52 @@
* Qualcomm MSM FD
Face detection hardware block.
The Face Detection Hardware Block will offload processing
on the host and also reduce power consumption.
Supports:
Front and back camera face detection concurrently.
Sizes: QVGA, VGA, WQVGA, WVGA at 20 pix minimum face size.
Required properties:
- compatible:
- "qcom,face-detection"
- reg: offset and length of the register set for the device.
- reg-names: should specify relevant names to each reg property defined.
- "fd_core" - FD CORE hardware register set.
- "fd_misc" - FD MISC hardware register set.
- "fd_vbif" - FD VBIF hardware register set.
- interrupts: should contain the fd interrupts.
- interrupt-names: should specify relevant names to each interrupts
property defined.
- vdd-supply: phandle to GDSC regulator controlling face detection hw.
- clocks: list of entries each of which contains:
- phandle to the clock controller.
- macro containing clock's name in hardware.
- clock-names: should specify relevant names to each clocks
property defined.
Optional properties:
- clock-rates: should specify clock rates in Hz to each clocks
property defined.
Example:
qcom,fd@fd878000 {
compatible = "qcom,face-detection";
reg = <0xfd878000 0x800>,
<0xfd87c000 0x800>,
<0xfd860000 0x1000>;
reg-names = "fd_core", "fd_misc", "fd_vbif";
interrupts = <0 316 0>;
interrupt-names = "fd";
vdd-supply = <&gdsc_fd>;
clocks = <&clock_mmss clk_fd_core_clk>,
<&clock_mmss clk_fd_ahb_clk>,
<&clock_mmss clk_fd_axi_clk>,
<&clock_mmss clk_fd_core_uar_clk>;
clock-names = "fd_core_clk", "fd_core_uar_clk",
"fd_axi_clk", "fd_ahb_clk";
clock-rates = <400 400 334 80 240>;
};

View file

@ -0,0 +1,4 @@
GCC_VERSION := $(shell $(CONFIG_SHELL) $(PWD)/scripts/gcc-version.sh $(CROSS_COMPILE)gcc)
ccflags-y += -Idrivers/media/video/msm
obj-$(CONFIG_MSM_FD) += msm_fd_dev.o msm_fd_hw.o

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,238 @@
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_FD_DEV_H__
#define __MSM_FD_DEV_H__
#include <media/v4l2-device.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-ctrls.h>
#include <media/msm_fd.h>
/* Maximum number of result buffers */
#define MSM_FD_MAX_RESULT_BUFS 5
/* Max number of clocks defined in device tree */
#define MSM_FD_MAX_CLK_NUM 10
/* Max number of clock rates defined in device tree */
#define MSM_FD_MAX_CLK_RATES 5
/* Max number of faces which can be detected in one hw processing */
#define MSM_FD_MAX_FACES_DETECTED 32
/*
* struct msm_fd_size - Structure contain FD size related values.
* @width: Image width.
* @height: Image height.
* @reg_val: Register value for this size.
* @work_size: Working buffer size in bytes for this size.
*/
struct msm_fd_size {
int width;
int height;
u32 reg_val;
int work_size;
};
/*
* struct msm_fd_setings - Structure contain FD settings values.
* @min_size_index: Minimum face size array index.
* @angle_index: Face detection angle array index.
* @direction_index: Face detection direction array index.
* @threshold: Face detection threshold value.
* @speed: Face detection speed value (it should match with clock rate index).
*/
struct msm_fd_setings {
unsigned int min_size_index;
unsigned int angle_index;
unsigned int direction_index;
unsigned int threshold;
unsigned int speed;
};
/*
* struct msm_fd_format - Structure contain FD format settings.
* @size: Pointer to fd size struct used for this format.
* @crop: V4l2 crop structure.
* @bytesperline: Bytes per line of input image buffer.
* @sizeimage: Size of input image buffer.
* @pixelformat: Pixel format of input image buffer.
*/
struct msm_fd_format {
struct msm_fd_size *size;
struct v4l2_rect crop;
int bytesperline;
int sizeimage;
u32 pixelformat;
};
/*
* struct msm_fd_mem_pool - Structure contain FD memory pool information.
* @client: Pointer to ion client.
* @domain_num: Domain number associated with FD hw.
*/
struct msm_fd_mem_pool {
struct ion_client *client;
int domain_num;
};
/*
* struct msm_fd_buf_handle - Structure contain FD buffer handle information.
* @fd: ion FD from which this buffer is imported.
* @pool: Pointer to FD memory pool struct.
* @handle: Pointer to ion handle.
* @size: Size of the buffer.
* @addr: Adders of FD mmu mapped buffer. This address should be set to FD hw.
*/
struct msm_fd_buf_handle {
int fd;
struct msm_fd_mem_pool *pool;
void *handle;
unsigned long size;
ion_phys_addr_t addr;
};
/*
* struct msm_fd_buffer - Vb2 buffer wrapper structure.
* @vb: Videobuf 2 buffer structure.
* @active: Flag indicating if buffer currently used by FD hw.
* @completion: Completion need to wait on, if buffer is used by FD hw.
* @format: Format information of this buffer.
* @settings: Settings value of this buffer.
* @work_addr: Working buffer address need to be used when for this buffer.
* @list: Buffer is part of FD device processing queue
*/
struct msm_fd_buffer {
struct vb2_buffer vb;
atomic_t active;
struct completion completion;
struct msm_fd_format format;
struct msm_fd_setings settings;
ion_phys_addr_t work_addr;
struct list_head list;
};
/*
* struct msm_fd_stats - Structure contains FD result statistic information.
* @frame_id: Frame id for which statistic corresponds to.
* @face_cnt: Number of faces detected and included in face data.
* @face_data: Structure containing detected face data information.
*/
struct msm_fd_stats {
atomic_t frame_id;
u32 face_cnt;
struct msm_fd_face_data face_data[MSM_FD_MAX_FACES_DETECTED];
};
/*
* struct fd_ctx - Structure contains per open file handle context.
* @fd_device: Pointer to fd device.
* @fh: V4l2 file handle.
* @vb2_q: Videobuf 2 queue.
* @sequence: Sequence number for this statistic.
* @format: Current format.
* @settings: Current settings.
* @mem_pool: FD hw memory pool.
* @stats: Pointer to statistic buffers.
* @work_buf: Working memory buffer handle.
* @wait_stop_stream: Pointer to completion to wait on stop stream.
*/
struct fd_ctx {
struct msm_fd_device *fd_device;
struct v4l2_fh fh;
struct vb2_queue vb2_q;
unsigned int sequence;
atomic_t subscribed_for_event;
struct msm_fd_format format;
struct msm_fd_setings settings;
struct msm_fd_mem_pool mem_pool;
struct msm_fd_stats *stats;
struct msm_fd_buf_handle work_buf;
struct completion *wait_stop_stream;
};
/*
* enum msm_fd_device_state - FD device state.
* @MSM_FD_DEVICE_IDLE: Device is idle, we can start with processing.
* @MSM_FD_DEVICE_RUNNING: Device is running, next processing will be
* scheduled from fd irq.
*/
enum msm_fd_device_state {
MSM_FD_DEVICE_IDLE,
MSM_FD_DEVICE_RUNNING,
};
/*
* enum msm_fd_mem_resources - FD device iomem resources.
* @MSM_FD_IOMEM_CORE: Index of fd core registers.
* @MSM_FD_IOMEM_MISC: Index of fd misc registers.
* @MSM_FD_IOMEM_VBIF: Index of fd vbif registers.
* @MSM_FD_IOMEM_LAST: Not valid.
*/
enum msm_fd_mem_resources {
MSM_FD_IOMEM_CORE,
MSM_FD_IOMEM_MISC,
MSM_FD_IOMEM_VBIF,
MSM_FD_IOMEM_LAST
};
/*
* struct msm_fd_device - FD device structure.
* @lock: Lock used for reference count.
* @slock: Spinlock used to protect FD device struct.
* @ref_count: Device reference count.
* @res_mem: Array of memory resources used by FD device.
* @iomem_base: Array of register mappings used by FD device.
* @vdd: Pointer to vdd regulator.
* @clk_num: Number of clocks attached to the device.
* @clk: Array of clock resources used by fd device.
* @clk_rates: Array of clock rates set.
* @iommu_domain: Pointer to FD device iommu domain handler.
* @iommu_domain_num: FD device iommu domain number.
* @iommu_dev: Pointer to Ion iommu device.
* @dev: Pointer to device struct.
* @v4l2_dev: V4l2 device.
* @video: Video device.
* @state: FD device state.
* @buf_queue: FD device processing queue.
* @work_queue: Pointer to FD device IRQ bottom half workqueue.
* @work: IRQ bottom half work struct.
*/
struct msm_fd_device {
struct mutex lock;
spinlock_t slock;
int ref_count;
int irq_num;
struct resource *res_mem[MSM_FD_IOMEM_LAST];
void __iomem *iomem_base[MSM_FD_IOMEM_LAST];
struct resource *ioarea[MSM_FD_IOMEM_LAST];
struct regulator *vdd;
unsigned int clk_num;
struct clk *clk[MSM_FD_MAX_CLK_NUM];
unsigned int clk_rates_num;
unsigned int clk_rates[MSM_FD_MAX_CLK_RATES][MSM_FD_MAX_CLK_NUM];
struct iommu_domain *iommu_domain;
int iommu_domain_num;
struct device *iommu_dev;
struct device *dev;
struct v4l2_device v4l2_dev;
struct video_device video;
enum msm_fd_device_state state;
struct list_head buf_queue;
struct workqueue_struct *work_queue;
struct work_struct work;
};
#endif /* __MSM_FD_DEV_H__ */

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,69 @@
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_FD_HW_H__
#define __MSM_FD_HW_H__
#include "msm_fd_dev.h"
int msm_fd_hw_is_finished(struct msm_fd_device *fd);
int msm_fd_hw_get_face_count(struct msm_fd_device *fd);
int msm_fd_hw_get_result_x(struct msm_fd_device *fd, int idx);
int msm_fd_hw_get_result_y(struct msm_fd_device *fd, int idx);
void msm_fd_hw_get_result_conf_size(struct msm_fd_device *fd,
int idx, u32 *conf, u32 *size);
void msm_fd_hw_get_result_angle_pose(struct msm_fd_device *fd, int idx,
u32 *angle, u32 *pose);
void msm_fd_hw_release_mem_resources(struct msm_fd_device *fd);
int msm_fd_hw_get_mem_resources(struct platform_device *pdev,
struct msm_fd_device *fd);
int msm_fd_hw_get_iommu(struct msm_fd_device *fd);
void msm_fd_hw_put_iommu(struct msm_fd_device *fd);
int msm_fd_hw_get_clocks(struct msm_fd_device *fd);
int msm_fd_hw_put_clocks(struct msm_fd_device *fd);
int msm_fd_hw_get(struct msm_fd_device *fd, unsigned int clock_rate_idx);
void msm_fd_hw_put(struct msm_fd_device *fd);
int msm_fd_hw_map_buffer(struct msm_fd_mem_pool *pool, int fd,
struct msm_fd_buf_handle *buf);
void msm_fd_hw_unmap_buffer(struct msm_fd_buf_handle *buf);
void msm_fd_hw_add_buffer(struct msm_fd_device *fd,
struct msm_fd_buffer *buffer);
void msm_fd_hw_remove_buffers_from_queue(struct msm_fd_device *fd,
struct vb2_queue *vb2_q);
int msm_fd_hw_buffer_done(struct msm_fd_device *fd,
struct msm_fd_buffer *buffer);
struct msm_fd_buffer *msm_fd_hw_get_active_buffer(struct msm_fd_device *fd);
int msm_fd_hw_schedule_and_start(struct msm_fd_device *fd);
int msm_fd_hw_schedule_next_buffer(struct msm_fd_device *fd);
#endif /* __MSM_FD_HW_H__ */

View file

@ -0,0 +1,148 @@
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_FD_REGS_H__
#define __MSM_FD_REGS_H__
/* FD core registers */
#define MSM_FD_VERSION (0x38)
#define MSM_FD_CONTROL (0x00)
#define MSM_FD_CONTROL_SRST (1 << 0)
#define MSM_FD_CONTROL_RUN (1 << 1)
#define MSM_FD_CONTROL_FINISH (1 << 2)
#define MSM_FD_RESULT_CNT (0x04)
#define MSM_FD_RESULT_CNT_MASK (0x3F)
#define MSM_FD_CONDT (0x08)
#define MSM_FD_CONDT_MIN_MASK (0x03)
#define MSM_FD_CONDT_MIN_SHIFT (0x00)
#define MSM_FD_CONDT_DIR_MAX (0x08)
#define MSM_FD_CONDT_DIR_SHIFT (0x02)
#define MSM_FD_START_X (0x0C)
#define MSM_FD_START_X_MASK (0x3FF)
#define MSM_FD_START_Y (0x10)
#define MSM_FD_START_Y_MASK (0x1FF)
#define MSM_FD_SIZE_X (0x14)
#define MSM_FD_SIZE_X_MASK (0x3FF)
#define MSM_FD_SIZE_Y (0x18)
#define MSM_FD_SIZE_Y_MASK (0x1FF)
#define MSM_FD_DHINT (0x1C)
#define MSM_FD_DHINT_MASK (0xF)
#define MSM_FD_IMAGE_ADDR (0x24)
#define MSM_FD_IMAGE_ADDR_ALIGN (0x8)
#define MSM_FD_WORK_ADDR (0x28)
#define MSM_FD_WORK_ADDR_ALIGN (0x8)
#define MSM_FD_IMAGE_SIZE (0x2C)
#define MSM_FD_IMAGE_SIZE_QVGA (0x0)
#define MSM_FD_IMAGE_SIZE_VGA (0x1)
#define MSM_FD_IMAGE_SIZE_WQVGA (0x2)
#define MSM_FD_IMAGE_SIZE_WVGA (0x3)
#define MSM_FD_LINE_BYTES (0x30)
#define MSM_FD_LINE_BYTES_MASK (0x1FFF)
#define MSM_FD_LINE_BYTES_ALIGN (0x8)
#define MSM_FD_RESULT_CENTER_X(x) (0x400 + (0x10 * (x)))
#define MSM_FD_RESULT_CENTER_Y(x) (0x404 + (0x10 * (x)))
#define MSM_FD_RESULT_CONF_SIZE(x) (0x408 + (0x10 * (x)))
#define MSM_FD_RESULT_SIZE_MASK (0x1FF)
#define MSM_FD_RESULT_SIZE_SHIFT (0x000)
#define MSM_FD_RESULT_CONF_MASK (0xF)
#define MSM_FD_RESULT_CONF_SHIFT (0x9)
#define MSM_FD_RESULT_ANGLE_POSE(x) (0x40C + (0x10 * (x)))
#define MSM_FD_RESULT_ANGLE_MASK (0x1FF)
#define MSM_FD_RESULT_ANGLE_SHIFT (0x000)
#define MSM_FD_RESULT_POSE_MASK (0x7)
#define MSM_FD_RESULT_POSE_SHIFT (0x9)
/* FD misc registers */
#define MSM_FD_MISC_HW_VERSION (0x00)
#define MSM_FD_MISC_SW_RESET (0x10)
#define MSM_FD_MISC_SW_RESET_SET (1 << 0)
#define MSM_FD_MISC_FIFO_STATUS (0x14)
#define MSM_FD_MISC_FIFO_STATUS_RFIFO_DCNT_MAST (0x1F)
#define MSM_FD_MISC_FIFO_STATUS_RFIFO_DCNT_SHIFT (0)
#define MSM_FD_MISC_FIFO_STATUS_RFIFO_FULL (1 << 13)
#define MSM_FD_MISC_FIFO_STATUS_RFIFO_EMPTY (1 << 14)
#define MSM_FD_MISC_FIFO_STATUS_WFIFO_DCNT_MAST (0x1F)
#define MSM_FD_MISC_FIFO_STATUS_WFIFO_DCNT_SHIFT (16)
#define MSM_FD_MISC_FIFO_STATUS_WFIFO_EMPTY (1 << 29)
#define MSM_FD_MISC_FIFO_STATUS_WFIFO_FULL (1 << 30)
#define MSM_FD_MISC_DATA_ENDIAN (0x18)
#define MSM_FD_MISC_DATA_ENDIAN_BYTE_SWAP_SET (1 << 0)
#define MSM_FD_MISC_VBIF_REQ_PRIO (0x20)
#define MSM_FD_MISC_VBIF_REQ_PRIO_MASK (0x3)
#define MSM_FD_MISC_VBIF_PRIO_LEVEL (0x24)
#define MSM_FD_MISC_VBIF_PRIO_LEVEL_MASK (0x3)
#define MSM_FD_MISC_VBIF_MMU_PDIRECT (0x28)
#define MSM_FD_MISC_VBIF_MMU_PDIRECT_INCREMENT (1 << 0)
#define MSM_FD_MISC_VBIF_IRQ_CLR (0x30)
#define MSM_FD_MISC_VBIF_IRQ_CLR_ALL (1 << 0)
#define MSM_FD_MISC_VBIF_DONE_STATUS (0x34)
#define MSM_FD_MISC_VBIF_DONE_STATUS_WRITE (1 << 0)
#define MSM_FD_MISC_VBIF_DONE_STATUS_READ (1 << 1)
#define MSM_FD_MISC_TEST_BUS_SEL (0x40)
#define MSM_FD_MISC_TEST_BUS_SEL_TEST_MODE_MASK (0xF)
#define MSM_FD_MISC_TEST_BUS_SEL_TEST_MODE_SHIFT (0)
#define MSM_FD_MISC_TEST_BUS_SEL_7_0_MASK (0x3)
#define MSM_FD_MISC_TEST_BUS_SEL_7_0_SHIFT (16)
#define MSM_FD_MISC_TEST_BUS_SEL_15_8_MASK (0x3)
#define MSM_FD_MISC_TEST_BUS_SEL_15_8_SHIFT (18)
#define MSM_FD_MISC_TEST_BUS_SEL_23_16_MASK (0x3)
#define MSM_FD_MISC_TEST_BUS_SEL_23_16_SHIFT (20)
#define MSM_FD_MISC_TEST_BUS_SEL_31_24_MASK (0x3)
#define MSM_FD_MISC_TEST_BUS_SEL_31_24_SHIFT (22)
#define MSM_FD_MISC_AHB_TEST_EN (0x44)
#define MSM_FD_MISC_AHB_TEST_EN_MASK (0x3)
#define MSM_FD_MISC_FD2VBIF_INT_TEST_SEL (0x48)
#define MSM_FD_MISC_FD2VBIF_INT_TEST_MASK (0xF)
#define MSM_FD_MISC_TEST_BUS (0x4C)
/* FD vbif registers */
#define MSM_FD_VBIF_CLKON (0x04)
#define MSM_FD_VBIF_IN_RD_LIM_CONF0 (0xB0)
#define MSM_FD_VBIF_IN_WR_LIM_CONF0 (0xC0)
#define MSM_FD_VBIF_OUT_RD_LIM_CONF0 (0xD0)
#define MSM_FD_VBIF_OUT_WR_LIM_CONF0 (0xD4)
#define MSM_FD_VBIF_DDR_OUT_MAX_BURST (0xD8)
#define MSM_FD_VBIF_ARB_CTL (0xF0)
#define MSM_FD_VBIF_OUT_AXI_AMEMTYPE_CONF0 (0x160)
#define MSM_FD_VBIF_OUT_AXI_AOOO_EN (0x178)
#define MSM_FD_VBIF_OUT_AXI_AOOO (0x17c)
#define MSM_FD_VBIF_ROUND_ROBIN_QOS_ARB (0x124)
#endif /* __MSM_FD_REGS_H__ */

17
include/media/msm_fd.h Normal file
View file

@ -0,0 +1,17 @@
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __MSM_FD__
#define __MSM_FD__
#include <uapi/media/msm_fd.h>
#endif /* __MSM_FD__ */

104
include/uapi/media/msm_fd.h Normal file
View file

@ -0,0 +1,104 @@
/* Copyright (c) 2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __UAPI_MSM_FD__
#define __UAPI_MSM_FD__
#include <linux/videodev2.h>
/*
* struct msm_fd_event - Structure contain event info.
* @buf_index: Buffer index.
* @frame_id: Frame id.
* @face_cnt: Detected faces.
*/
struct msm_fd_event {
__u32 buf_index;
__u32 frame_id;
__u32 face_cnt;
};
/*
* enum msm_fd_pose - Face pose.
*/
enum msm_fd_pose {
MSM_FD_POSE_FRONT,
MSM_FD_POSE_RIGHT_DIAGONAL,
MSM_FD_POSE_RIGHT,
MSM_FD_POSE_LEFT_DIAGONAL,
MSM_FD_POSE_LEFT,
};
/*
* struct msm_fd_face_data - Structure contain detected face data.
* @pose: refer to enum msm_fd_pose.
* @angle: Face angle
* @confidence: Face confidence level.
* @reserved: Reserved data for future use.
* @face: Face rectangle.
*/
struct msm_fd_face_data {
__u32 pose;
__u32 angle;
__u32 confidence;
__u32 reserved;
struct v4l2_rect face;
};
/*
* struct msm_fd_result - Structure contain detected faces result.
* @frame_id: Frame id of requested result.
* @face_cnt: Number of result faces, driver can modify this value (to smaller)
* @face_data: Pointer to array of face data structures.
* Array size should not be smaller then face_cnt.
*/
struct msm_fd_result {
__u32 frame_id;
__u32 face_cnt;
struct msm_fd_face_data __user *face_data;
};
#ifdef CONFIG_COMPAT
/*
* struct msm_fd_result32 - Compat structure contain detected faces result.
* @frame_id: Frame id of requested result.
* @face_cnt: Number of result faces, driver can modify this value (to smaller)
* @face_data: Pointer to array of face data structures.
* Array size should not be smaller then face_cnt.
*/
struct msm_fd_result32 {
__u32 frame_id;
__u32 face_cnt;
compat_uptr_t face_data;
};
/* MSM FD compat private ioctl ID */
#define VIDIOC_MSM_FD_GET_RESULT32 \
_IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_fd_result32)
#endif
/* MSM FD private ioctl ID */
#define VIDIOC_MSM_FD_GET_RESULT \
_IOWR('V', BASE_VIDIOC_PRIVATE, struct msm_fd_result)
/* MSM FD event ID */
#define MSM_EVENT_FD (V4L2_EVENT_PRIVATE_START)
/* MSM FD control ID's */
#define V4L2_CID_FD_SPEED (V4L2_CID_PRIVATE_BASE)
#define V4L2_CID_FD_FACE_ANGLE (V4L2_CID_PRIVATE_BASE + 1)
#define V4L2_CID_FD_MIN_FACE_SIZE (V4L2_CID_PRIVATE_BASE + 2)
#define V4L2_CID_FD_FACE_DIRECTION (V4L2_CID_PRIVATE_BASE + 3)
#define V4L2_CID_FD_DETECTION_THRESHOLD (V4L2_CID_PRIVATE_BASE + 4)
#define V4L2_CID_FD_WORK_MEMORY_SIZE (V4L2_CID_PRIVATE_BASE + 5)
#define V4L2_CID_FD_WORK_MEMORY_FD (V4L2_CID_PRIVATE_BASE + 6)
#endif /* __UAPI_MSM_FD__ */