drivers/staging/media/atomisp/pci/ia_css_dvs.h

Source file repositories/reference/linux-study-clean/drivers/staging/media/atomisp/pci/ia_css_dvs.h

File Facts

System
Linux kernel
Corpus path
drivers/staging/media/atomisp/pci/ia_css_dvs.h
Extension
.h
Size
10228 bytes
Lines
294
Domain
Driver Families
Bucket
drivers/staging
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ia_css_isp_dvs_statistics {
	ia_css_ptr hor_proj;
	ia_css_ptr ver_proj;
	u32   hor_size;
	u32   ver_size;
	u32   exp_id;   /** see ia_css_event_public.h for more detail */
	ia_css_ptr data_ptr; /* base pointer containing all memory */
	u32   size;     /* size of allocated memory in data_ptr */
};

/* Structure that holds SKC DVS statistics in the ISP internal
 * format. Use ia_css_dvs_statistics_get() to translate this to
 * the format used on the host.
 * */
struct ia_css_isp_skc_dvs_statistics;

#define SIZE_OF_IA_CSS_ISP_DVS_STATISTICS_STRUCT			\
	((3 * SIZE_OF_IA_CSS_PTR) +					\
	 (4 * sizeof(uint32_t)))

static_assert(sizeof(struct ia_css_isp_dvs_statistics) == SIZE_OF_IA_CSS_ISP_DVS_STATISTICS_STRUCT);

/* Map with host-side pointers to ISP-format statistics.
 * These pointers can either be copies of ISP data or memory mapped
 * ISP pointers.
 * All of the data behind these pointers is allocatd contiguously, the
 * allocated pointer is stored in the data_ptr field. The other fields
 * point into this one block of data.
 */
struct ia_css_isp_dvs_statistics_map {
	void    *data_ptr;
	s32 *hor_proj;
	s32 *ver_proj;
	u32 size;		 /* total size in bytes */
	u32 data_allocated; /* indicate whether data was allocated */
};

union ia_css_dvs_statistics_isp {
	struct ia_css_isp_dvs_statistics *p_dvs_statistics_isp;
	struct ia_css_isp_skc_dvs_statistics *p_skc_dvs_statistics_isp;
};

union ia_css_dvs_statistics_host {
	struct ia_css_dvs_statistics *p_dvs_statistics_host;
	struct ia_css_dvs2_statistics *p_dvs2_statistics_host;
	struct ia_css_skc_dvs_statistics *p_skc_dvs_statistics_host;
};

/* @brief Copy DVS statistics from an ISP buffer to a host buffer.
 * @param[in]	host_stats Host buffer
 * @param[in]	isp_stats ISP buffer
 * @return	error value if temporary memory cannot be allocated
 *
 * This may include a translation step as well depending
 * on the ISP version.
 * Always use this function, never copy the buffer directly.
 * Note that this function uses the mem_load function from the CSS
 * environment struct.
 * In certain environments this may be slow. In those cases it is
 * advised to map the ISP memory into a host-side pointer and use
 * the ia_css_translate_dvs_statistics() function instead.
 */
int
ia_css_get_dvs_statistics(struct ia_css_dvs_statistics *host_stats,
			  const struct ia_css_isp_dvs_statistics *isp_stats);

/* @brief Translate DVS statistics from ISP format to host format
 * @param[in]	host_stats Host buffer
 * @param[in]	isp_stats ISP buffer
 * @return	None
 *
 * This function translates the dvs statistics from the ISP-internal
 * format to the format used by the DVS library on the CPU.
 * This function takes a host-side pointer as input. This can either
 * point to a copy of the data or be a memory mapped pointer to the
 * ISP memory pages.
 */
void
ia_css_translate_dvs_statistics(
    struct ia_css_dvs_statistics *host_stats,
    const struct ia_css_isp_dvs_statistics_map *isp_stats);

/* @brief Copy DVS 2.0 statistics from an ISP buffer to a host buffer.
 * @param[in]	host_stats Host buffer
 * @param[in]	isp_stats ISP buffer
 * @return	error value if temporary memory cannot be allocated
 *
 * This may include a translation step as well depending
 * on the ISP version.
 * Always use this function, never copy the buffer directly.

Annotation

Implementation Notes