Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / drivers / media / platform / vsp1 / vsp1_drm.h
blobe85ad4366fbb712c160754305ca9800bca262536
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3 * vsp1_drm.h -- R-Car VSP1 DRM/KMS Interface
5 * Copyright (C) 2015 Renesas Electronics Corporation
7 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
8 */
9 #ifndef __VSP1_DRM_H__
10 #define __VSP1_DRM_H__
12 #include <linux/mutex.h>
13 #include <linux/videodev2.h>
14 #include <linux/wait.h>
16 #include <media/vsp1.h>
18 #include "vsp1_pipe.h"
20 /**
21 * vsp1_drm_pipeline - State for the API exposed to the DRM driver
22 * @pipe: the VSP1 pipeline used for display
23 * @width: output display width
24 * @height: output display height
25 * @force_brx_release: when set, release the BRx during the next reconfiguration
26 * @wait_queue: wait queue to wait for BRx release completion
27 * @uif: UIF entity if available for the pipeline
28 * @crc: CRC computation configuration
29 * @du_complete: frame completion callback for the DU driver (optional)
30 * @du_private: data to be passed to the du_complete callback
32 struct vsp1_drm_pipeline {
33 struct vsp1_pipeline pipe;
35 unsigned int width;
36 unsigned int height;
38 bool force_brx_release;
39 wait_queue_head_t wait_queue;
41 struct vsp1_entity *uif;
42 struct vsp1_du_crc_config crc;
44 /* Frame synchronisation */
45 void (*du_complete)(void *data, unsigned int status, u32 crc);
46 void *du_private;
49 /**
50 * vsp1_drm - State for the API exposed to the DRM driver
51 * @pipe: the VSP1 DRM pipeline used for display
52 * @lock: protects the BRU and BRS allocation
53 * @inputs: source crop rectangle, destination compose rectangle and z-order
54 * position for every input (indexed by RPF index)
56 struct vsp1_drm {
57 struct vsp1_drm_pipeline pipe[VSP1_MAX_LIF];
58 struct mutex lock;
60 struct {
61 struct v4l2_rect crop;
62 struct v4l2_rect compose;
63 unsigned int zpos;
64 } inputs[VSP1_MAX_RPF];
67 static inline struct vsp1_drm_pipeline *
68 to_vsp1_drm_pipeline(struct vsp1_pipeline *pipe)
70 return container_of(pipe, struct vsp1_drm_pipeline, pipe);
73 int vsp1_drm_init(struct vsp1_device *vsp1);
74 void vsp1_drm_cleanup(struct vsp1_device *vsp1);
76 #endif /* __VSP1_DRM_H__ */