drivers/media/platform/renesas/vsp1/vsp1_entity.h

Source file repositories/reference/linux-study-clean/drivers/media/platform/renesas/vsp1/vsp1_entity.h

File Facts

System
Linux kernel
Corpus path
drivers/media/platform/renesas/vsp1/vsp1_entity.h
Extension
.h
Size
6248 bytes
Lines
201
Domain
Driver Families
Bucket
drivers/media
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 vsp1_route {
	enum vsp1_entity_type type;
	unsigned int index;
	unsigned int reg;
	unsigned int inputs[VSP1_ENTITY_MAX_INPUTS];
	unsigned int output;
};

/**
 * struct vsp1_entity_operations - Entity operations
 * @destroy:	Destroy the entity.
 * @configure_stream:	Setup the hardware parameters for the stream which do
 *			not vary between frames (pipeline, formats). Note that
 *			the vsp1_dl_list argument is only valid for display
 *			pipeline and will be NULL for mem-to-mem pipelines.
 * @configure_frame:	Configure the runtime parameters for each frame.
 * @configure_partition: Configure partition specific parameters.
 * @max_width:	Return the max supported width of data that the entity can
 *		process in a single operation.
 * @partition:	Process the partition construction based on this entity's
 *		configuration.
 */
struct vsp1_entity_operations {
	void (*destroy)(struct vsp1_entity *entity);
	void (*configure_stream)(struct vsp1_entity *entity,
				 struct v4l2_subdev_state *state,
				 struct vsp1_pipeline *pipe,
				 struct vsp1_dl_list *dl,
				 struct vsp1_dl_body *dlb);
	void (*configure_frame)(struct vsp1_entity *entity,
				struct vsp1_pipeline *pipe,
				struct vsp1_dl_list *dl,
				struct vsp1_dl_body *dlb);
	void (*configure_partition)(struct vsp1_entity *entity,
				    struct vsp1_pipeline *pipe,
				    const struct vsp1_partition *partition,
				    struct vsp1_dl_list *dl,
				    struct vsp1_dl_body *dlb);
	unsigned int (*max_width)(struct vsp1_entity *entity,
				  struct v4l2_subdev_state *state,
				  struct vsp1_pipeline *pipe);
	void (*partition)(struct vsp1_entity *entity,
			  struct v4l2_subdev_state *state,
			  struct vsp1_pipeline *pipe,
			  struct vsp1_partition *partition,
			  unsigned int index,
			  struct v4l2_rect *window);
};

struct vsp1_entity {
	struct vsp1_device *vsp1;

	const struct vsp1_entity_operations *ops;

	enum vsp1_entity_type type;
	unsigned int index;
	const struct vsp1_route *route;

	const u32 *codes;
	unsigned int num_codes;
	unsigned int min_width;
	unsigned int min_height;
	unsigned int max_width;
	unsigned int max_height;

	struct vsp1_pipeline *pipe;

	struct list_head list_dev;
	struct list_head list_pipe;

	struct media_pad *pads;
	unsigned int source_pad;

	struct vsp1_entity **sources;
	struct vsp1_entity *sink;
	unsigned int sink_pad;

	struct v4l2_subdev subdev;
	struct v4l2_subdev_state *state;

	struct mutex lock;	/* Protects the state */
};

static inline struct vsp1_entity *to_vsp1_entity(struct v4l2_subdev *subdev)
{
	return container_of(subdev, struct vsp1_entity, subdev);
}

extern const struct v4l2_subdev_core_ops vsp1_entity_core_ops;

Annotation

Implementation Notes