// SPDX-License-Identifier: GPL-2.0+ /* * vsp1_pipe.c -- R-Car VSP1 Pipeline * * Copyright (C) 2013-2015 Renesas Electronics Corporation * * Contact: Laurent Pinchart ([email protected]) */ #include <linux/delay.h> #include <linux/list.h> #include <linux/sched.h> #include <linux/wait.h> #include <media/media-entity.h> #include <media/v4l2-subdev.h> #include "vsp1.h" #include "vsp1_brx.h" #include "vsp1_dl.h" #include "vsp1_entity.h" #include "vsp1_hgo.h" #include "vsp1_hgt.h" #include "vsp1_pipe.h" #include "vsp1_rwpf.h" #include "vsp1_uds.h" /* ----------------------------------------------------------------------------- * Helper Functions */ static const struct vsp1_format_info vsp1_video_formats[] = …; /** * vsp1_get_format_info - Retrieve format information for a 4CC * @vsp1: the VSP1 device * @fourcc: the format 4CC * * Return a pointer to the format information structure corresponding to the * given V4L2 format 4CC, or NULL if no corresponding format can be found. */ const struct vsp1_format_info *vsp1_get_format_info(struct vsp1_device *vsp1, u32 fourcc) { … } /* ----------------------------------------------------------------------------- * Pipeline Management */ void vsp1_pipeline_reset(struct vsp1_pipeline *pipe) { … } void vsp1_pipeline_init(struct vsp1_pipeline *pipe) { … } void __vsp1_pipeline_dump(struct _ddebug *dbg, struct vsp1_pipeline *pipe, const char *msg) { … } /* Must be called with the pipe irqlock held. */ void vsp1_pipeline_run(struct vsp1_pipeline *pipe) { … } bool vsp1_pipeline_stopped(struct vsp1_pipeline *pipe) { … } int vsp1_pipeline_stop(struct vsp1_pipeline *pipe) { … } bool vsp1_pipeline_ready(struct vsp1_pipeline *pipe) { … } void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe) { … } /* * Propagate the alpha value through the pipeline. * * As the UDS has restricted scaling capabilities when the alpha component needs * to be scaled, we disable alpha scaling when the UDS input has a fixed alpha * value. The UDS then outputs a fixed alpha value which needs to be programmed * from the input RPF alpha. */ void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe, struct vsp1_dl_body *dlb, unsigned int alpha) { … } /* ----------------------------------------------------------------------------- * VSP1 Partition Algorithm support */ /* * Propagate the partition calculations through the pipeline * * Work backwards through the pipe, allowing each entity to update the partition * parameters based on its configuration, and the entity connected to its * source. Each entity must produce the partition required for the previous * entity in the pipeline. */ static void vsp1_pipeline_propagate_partition(struct vsp1_pipeline *pipe, struct vsp1_partition *partition, unsigned int index, struct v4l2_rect *window) { … } /* * vsp1_pipeline_calculate_partition - Calculate pipeline configuration for a * partition * * @pipe: the pipeline * @partition: partition that will hold the calculated values * @div_size: pre-determined maximum partition division size * @index: partition index */ void vsp1_pipeline_calculate_partition(struct vsp1_pipeline *pipe, struct vsp1_partition *partition, unsigned int div_size, unsigned int index) { … }