hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/gpu/drm/rockchip/ebc-dev/tcon/ebc_tcon.c
....@@ -163,37 +163,23 @@
163163
164164 static int tcon_enable(struct ebc_tcon *tcon, struct ebc_panel *panel)
165165 {
166
- u32 width, height, vir_width, vir_height;
167
-
168166 clk_prepare_enable(tcon->hclk);
169167 clk_prepare_enable(tcon->dclk);
170168 pm_runtime_get_sync(tcon->dev);
171169
172
- if (panel->rearrange) {
173
- width = panel->width * 2;
174
- height = panel->height / 2;
175
- vir_width = panel->vir_width * 2;
176
- vir_height = panel->vir_height / 2;
177
- } else {
178
- width = panel->width;
179
- height = panel->height;
180
- vir_width = panel->vir_width;
181
- vir_height = panel->vir_height;
182
- }
183
-
184170 /* panel timing and win info config */
185171 tcon_write(tcon, EBC_DSP_HTIMING0,
186
- DSP_HTOTAL(panel->lsl + panel->lbl + panel->ldl + panel->lel) | DSP_HS_END(panel->lsl));
172
+ DSP_HTOTAL(panel->lsl + panel->lbl + panel->ldl + panel->lel) | DSP_HS_END(panel->lsl + 2));
187173 tcon_write(tcon, EBC_DSP_HTIMING1,
188174 DSP_HACT_END(panel->lsl + panel->lbl + panel->ldl) | DSP_HACT_ST(panel->lsl + panel->lbl - 1));
189175 tcon_write(tcon, EBC_DSP_VTIMING0,
190176 DSP_VTOTAL(panel->fsl + panel->fbl + panel->fdl + panel->fel) | DSP_VS_END(panel->fsl));
191177 tcon_write(tcon, EBC_DSP_VTIMING1,
192178 DSP_VACT_END(panel->fsl + panel->fbl + panel->fdl) | DSP_VACT_ST(panel->fsl + panel->fbl));
193
- tcon_write(tcon, EBC_DSP_ACT_INFO, DSP_HEIGHT(height) | DSP_WIDTH(width));
194
- tcon_write(tcon, EBC_WIN_VIR, WIN_VIR_HEIGHT(vir_height) | WIN_VIR_WIDTH(vir_width));
195
- tcon_write(tcon, EBC_WIN_ACT, WIN_ACT_HEIGHT(height) | WIN_ACT_WIDTH(width));
196
- tcon_write(tcon, EBC_WIN_DSP, WIN_DSP_HEIGHT(height) | WIN_DSP_WIDTH(width));
179
+ tcon_write(tcon, EBC_DSP_ACT_INFO, DSP_HEIGHT(panel->height) | DSP_WIDTH(panel->width));
180
+ tcon_write(tcon, EBC_WIN_VIR, WIN_VIR_HEIGHT(panel->vir_height) | WIN_VIR_WIDTH(panel->vir_width));
181
+ tcon_write(tcon, EBC_WIN_ACT, WIN_ACT_HEIGHT(panel->height) | WIN_ACT_WIDTH(panel->width));
182
+ tcon_write(tcon, EBC_WIN_DSP, WIN_DSP_HEIGHT(panel->height) | WIN_DSP_WIDTH(panel->width));
197183 tcon_write(tcon, EBC_WIN_DSP_ST, WIN_DSP_YST(panel->fsl + panel->fbl) | WIN_DSP_XST(panel->lsl + panel->lbl));
198184
199185 /* win2 fifo is 512x128, win fifo is 256x128, we set fifo almost value (fifo_size - 16)
....@@ -223,7 +209,7 @@
223209 | EPD_SDSHR(1));
224210 tcon_write(tcon, EBC_DSP_START, DSP_SDCE_WIDTH(panel->ldl) | SW_BURST_CTRL);
225211 tcon_write(tcon, EBC_DSP_CTRL,
226
- DSP_SWAP_MODE(panel->panel_16bit ? 2 : 3) | DSP_VCOM_MODE(1) | DSP_SDCLK_DIV(0));
212
+ DSP_SWAP_MODE(panel->panel_16bit ? 2 : 3) | DSP_VCOM_MODE(1) | DSP_SDCLK_DIV(panel->panel_16bit ? 7 : 3));
227213 tcon_cfg_done(tcon);
228214
229215 enable_irq(tcon->irq);
....@@ -307,7 +293,7 @@
307293 intr_status = tcon_read(tcon, EBC_INT_STATUS);
308294
309295 if (intr_status & DSP_END_INT) {
310
- tcon_update_bits(tcon, EBC_INT_STATUS, DSP_END_INT_CLR | LINE_FLAG_INT_CLR, DSP_END_INT_CLR | LINE_FLAG_INT_CLR);
296
+ tcon_update_bits(tcon, EBC_INT_STATUS, DSP_END_INT_CLR, DSP_END_INT_CLR);
311297
312298 if (tcon->dsp_end_callback)
313299 tcon->dsp_end_callback();