forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/rcar-du/rcar_du_crtc.h
....@@ -1,14 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0+ */
12 /*
23 * rcar_du_crtc.h -- R-Car Display Unit CRTCs
34 *
45 * Copyright (C) 2013-2015 Renesas Electronics Corporation
56 *
67 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
128 */
139
1410 #ifndef __RCAR_DU_CRTC_H__
....@@ -18,8 +14,8 @@
1814 #include <linux/spinlock.h>
1915 #include <linux/wait.h>
2016
21
-#include <drm/drmP.h>
2217 #include <drm/drm_crtc.h>
18
+#include <drm/drm_writeback.h>
2319
2420 #include <media/vsp1.h>
2521
....@@ -29,30 +25,36 @@
2925 /**
3026 * struct rcar_du_crtc - the CRTC, representing a DU superposition processor
3127 * @crtc: base DRM CRTC
28
+ * @dev: the DU device
3229 * @clock: the CRTC functional clock
3330 * @extclock: external pixel dot clock (optional)
3431 * @mmio_offset: offset of the CRTC registers in the DU MMIO block
35
- * @index: CRTC software and hardware index
32
+ * @index: CRTC hardware index
3633 * @initialized: whether the CRTC has been initialized and clocks enabled
34
+ * @dsysr: cached value of the DSYSR register
3735 * @vblank_enable: whether vblank events are enabled on this CRTC
3836 * @event: event to post when the pending page flip completes
3937 * @flip_wait: wait queue used to signal page flip completion
4038 * @vblank_lock: protects vblank_wait and vblank_count
4139 * @vblank_wait: wait queue used to signal vertical blanking
4240 * @vblank_count: number of vertical blanking interrupts to wait for
43
- * @outputs: bitmask of the outputs (enum rcar_du_output) driven by this CRTC
4441 * @group: CRTC group this CRTC belongs to
42
+ * @cmm: CMM associated with this CRTC
4543 * @vsp: VSP feeding video to this CRTC
4644 * @vsp_pipe: index of the VSP pipeline feeding video to this CRTC
45
+ * @writeback: the writeback connector
4746 */
4847 struct rcar_du_crtc {
4948 struct drm_crtc crtc;
5049
50
+ struct rcar_du_device *dev;
5151 struct clk *clock;
5252 struct clk *extclock;
5353 unsigned int mmio_offset;
5454 unsigned int index;
5555 bool initialized;
56
+
57
+ u32 dsysr;
5658
5759 bool vblank_enable;
5860 struct drm_pending_vblank_event *event;
....@@ -62,24 +64,31 @@
6264 wait_queue_head_t vblank_wait;
6365 unsigned int vblank_count;
6466
65
- unsigned int outputs;
66
-
6767 struct rcar_du_group *group;
68
+ struct platform_device *cmm;
6869 struct rcar_du_vsp *vsp;
6970 unsigned int vsp_pipe;
71
+
72
+ const char *const *sources;
73
+ unsigned int sources_count;
74
+
75
+ struct drm_writeback_connector writeback;
7076 };
7177
72
-#define to_rcar_crtc(c) container_of(c, struct rcar_du_crtc, crtc)
78
+#define to_rcar_crtc(c) container_of(c, struct rcar_du_crtc, crtc)
79
+#define wb_to_rcar_crtc(c) container_of(c, struct rcar_du_crtc, writeback)
7380
7481 /**
7582 * struct rcar_du_crtc_state - Driver-specific CRTC state
7683 * @state: base DRM CRTC state
7784 * @crc: CRC computation configuration
85
+ * @outputs: bitmask of the outputs (enum rcar_du_output) driven by this CRTC
7886 */
7987 struct rcar_du_crtc_state {
8088 struct drm_crtc_state state;
8189
8290 struct vsp1_du_crc_config crc;
91
+ unsigned int outputs;
8392 };
8493
8594 #define to_rcar_crtc_state(s) container_of(s, struct rcar_du_crtc_state, state)
....@@ -97,11 +106,9 @@
97106
98107 int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int swindex,
99108 unsigned int hwindex);
100
-void rcar_du_crtc_suspend(struct rcar_du_crtc *rcrtc);
101
-void rcar_du_crtc_resume(struct rcar_du_crtc *rcrtc);
102109
103
-void rcar_du_crtc_route_output(struct drm_crtc *crtc,
104
- enum rcar_du_output output);
105110 void rcar_du_crtc_finish_page_flip(struct rcar_du_crtc *rcrtc);
106111
112
+void rcar_du_crtc_dsysr_clr_set(struct rcar_du_crtc *rcrtc, u32 clr, u32 set);
113
+
107114 #endif /* __RCAR_DU_CRTC_H__ */