brintos

brintos / linux-shallow public Read only

0
0
Text · 2.1 KiB · 3fd95b5 Raw
79 lines · c
1/* SPDX-License-Identifier: GPL-2.0+ */2/*3 * vsp1_drm.h  --  R-Car VSP1 DRM/KMS Interface4 *5 * Copyright (C) 2015 Renesas Electronics Corporation6 *7 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)8 */9#ifndef __VSP1_DRM_H__10#define __VSP1_DRM_H__11 12#include <linux/mutex.h>13#include <linux/videodev2.h>14#include <linux/wait.h>15 16#include <media/vsp1.h>17 18#include "vsp1_pipe.h"19 20/**21 * struct vsp1_drm_pipeline - State for the API exposed to the DRM driver22 * @pipe: the VSP1 pipeline used for display23 * @partition: the pre-calculated partition used by the pipeline24 * @width: output display width25 * @height: output display height26 * @force_brx_release: when set, release the BRx during the next reconfiguration27 * @wait_queue: wait queue to wait for BRx release completion28 * @uif: UIF entity if available for the pipeline29 * @crc: CRC computation configuration30 * @du_complete: frame completion callback for the DU driver (optional)31 * @du_private: data to be passed to the du_complete callback32 */33struct vsp1_drm_pipeline {34	struct vsp1_pipeline pipe;35	struct vsp1_partition partition;36 37	unsigned int width;38	unsigned int height;39 40	bool force_brx_release;41	wait_queue_head_t wait_queue;42 43	struct vsp1_entity *uif;44	struct vsp1_du_crc_config crc;45 46	/* Frame synchronisation */47	void (*du_complete)(void *data, unsigned int status, u32 crc);48	void *du_private;49};50 51/**52 * struct vsp1_drm - State for the API exposed to the DRM driver53 * @pipe: the VSP1 DRM pipeline used for display54 * @lock: protects the BRU and BRS allocation55 * @inputs: source crop rectangle, destination compose rectangle and z-order56 *	position for every input (indexed by RPF index)57 */58struct vsp1_drm {59	struct vsp1_drm_pipeline pipe[VSP1_MAX_LIF];60	struct mutex lock;61 62	struct {63		struct v4l2_rect crop;64		struct v4l2_rect compose;65		unsigned int zpos;66	} inputs[VSP1_MAX_RPF];67};68 69static inline struct vsp1_drm_pipeline *70to_vsp1_drm_pipeline(struct vsp1_pipeline *pipe)71{72	return container_of(pipe, struct vsp1_drm_pipeline, pipe);73}74 75int vsp1_drm_init(struct vsp1_device *vsp1);76void vsp1_drm_cleanup(struct vsp1_device *vsp1);77 78#endif /* __VSP1_DRM_H__ */79