@@ -67,17 +67,21 @@ index 111111111111..222222222222 100644
67
67
#include <linux/component.h>
68
68
#include <linux/delay.h>
69
69
#include <linux/iopoll.h>
70
- @@ -212,6 +214,10 @@ struct vop2 {
70
+ @@ -214,11 +214,13 @@ struct vop2 {
71
+ */
72
+ unsigned int enable_count;
71
73
struct clk *hclk;
72
74
struct clk *aclk;
73
75
struct clk *pclk;
74
- + // [CC:] hack to support additional display modes
76
+ - struct clk *pll_hdmiphy0;
75
77
+ struct clk *hdmi0_phy_pll;
76
78
+ /* list_head of internal clk */
77
79
+ struct list_head clk_list_head;
78
80
79
81
/* optional internal rgb encoder */
80
82
struct rockchip_rgb *rgb;
83
+
84
+ /* must be put at the end of the struct */
81
85
@@ -220,6 +226,19 @@ struct vop2 {
82
86
struct vop2_win win[];
83
87
};
@@ -266,7 +270,9 @@ index 111111111111..222222222222 100644
266
270
267
271
drm_dbg(vop2->drm, "Update mode to %dx%d%s%d, type: %d for vp%d\n",
268
272
hdisplay, vdisplay, mode->flags & DRM_MODE_FLAG_INTERLACE ? "i" : "p",
269
- @@ -2044,11 +2193,38 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc,
273
+ @@ -2238,15 +2240,43 @@ static void vop2_crtc_atomic_enable(struct drm_crtc *crtc,
274
+
275
+ vop2_vp_write(vp, RK3568_VP_DSP_VTOTAL_VS_END, vtotal << 16 | vsync_len);
270
276
271
277
if (mode->flags & DRM_MODE_FLAG_DBLCLK) {
272
278
dsp_ctrl |= RK3568_VP_DSP_CTRL__CORE_DCLK_DIV;
@@ -303,9 +309,12 @@ index 111111111111..222222222222 100644
303
309
+ }
304
310
+ }
305
311
+
306
- clk_set_rate(vp->dclk, clock);
307
-
308
- vop2_post_config(crtc);
312
+ +
313
+ /*
314
+ * Switch to HDMI PHY PLL as DCLK source for display modes up
315
+ * to 4K@60Hz, if available, otherwise keep using the system CRU.
316
+ */
317
+ if (vop2->pll_hdmiphy0 && clock <= VOP2_MAX_DCLK_RATE) {
309
318
@@ -2504,7 +2680,43 @@ static void vop2_crtc_atomic_flush(struct drm_crtc *crtc,
310
319
spin_unlock_irq(&crtc->dev->event_lock);
311
320
}
0 commit comments