summaryrefslogtreecommitdiff
path: root/samsung
diff options
context:
space:
mode:
authorWiwit Rifa'i <wiwitrifai@google.com>2022-12-06 17:14:41 +0800
committerWiwit Rifa'i <wiwitrifai@google.com>2023-01-18 04:37:00 +0000
commit21df0d78c5a5812c05f817b65936cc08469945eb (patch)
tree6ede96a4546929ee66c672b6c292863e7f1a9e3f /samsung
parent0d2b139ff9751a500e39f7f9fc7d6c539aff834f (diff)
downloaddisplay-21df0d78c5a5812c05f817b65936cc08469945eb.tar.gz
drm: samsung: limit max_disp_freq for concurrent writeback
When concurrent writeback is enabled, writeback instant off may occur if the outfifo for writeback is full meanwhile the outfifo for LCD is not full yet. This issue could be solved by increasing outfifo size for writeback and decreasing outfifo size for LCD, but it might cause higher chance to underrun during normal cases. So, to avoid it, we can also limit max_disp_freq only when concurrent writeback is enabled. Bug: 232887601 Test: VtsHalGraphicsComposer3_TargetTest Change-Id: I3e663d9cf50f3b31df848fe7546a4bd17235b95f Signed-off-by: Wiwit Rifa'i <wiwitrifai@google.com>
Diffstat (limited to 'samsung')
-rw-r--r--samsung/exynos_drm_bts.c10
-rw-r--r--samsung/exynos_drm_decon.c7
-rw-r--r--samsung/exynos_drm_decon.h1
3 files changed, 18 insertions, 0 deletions
diff --git a/samsung/exynos_drm_bts.c b/samsung/exynos_drm_bts.c
index 8bed570..7fc453a 100644
--- a/samsung/exynos_drm_bts.c
+++ b/samsung/exynos_drm_bts.c
@@ -882,6 +882,16 @@ static void dpu_bts_update_resources(struct decon_device *decon, bool shadow_upd
DPU_DEBUG_BTS(" peak = %u, rt = %u, read = %u, write = %u\n",
bw.peak, bw.rt, bw.read, bw.write);
+ /* When concurrent writeback is enabled, writeback instant off may occur if the outfifo
+ * for writeback is full meanwhile the outfifo for LCD is not full yet.
+ * We can limit max_disp_freq to avoid it when concurrent writeback is enabled.
+ * Currently, the issue only occurs when all layers are solid color layers (read = 0).
+ */
+ if ((decon->bts.max_dfs_lv_for_wb > 0) && (bw.read == 0) && (bw.write > 0)) {
+ decon->bts.max_disp_freq =
+ min(decon->bts.max_disp_freq, decon->bts.max_dfs_lv_for_wb);
+ }
+
if (shadow_updated) {
/* after DECON h/w configs are updated to shadow SFR */
if (decon->bts.total_bw < decon->bts.prev_total_bw ||
diff --git a/samsung/exynos_drm_decon.c b/samsung/exynos_drm_decon.c
index f5f1e23..74adb9e 100644
--- a/samsung/exynos_drm_decon.c
+++ b/samsung/exynos_drm_decon.c
@@ -1843,6 +1843,13 @@ static int decon_parse_dt(struct decon_device *decon, struct device_node *np)
decon_info(decon, "\n");
}
+ if (of_property_read_u32(np, "max_dfs_lv_for_wb", &decon->bts.max_dfs_lv_for_wb)) {
+ decon->bts.max_dfs_lv_for_wb = 0;
+ decon_debug(decon, "max_dfs_lv_for_wb is not defined in DT.\n");
+ } else {
+ decon_debug(decon, "max_dfs_lv_for_wb(%u)\n", decon->bts.max_dfs_lv_for_wb);
+ }
+
decon->dpp_cnt = of_count_phandle_with_args(np, "dpps", NULL);
for (i = 0; i < decon->dpp_cnt; ++i) {
dpp_np = of_parse_phandle(np, "dpps", i);
diff --git a/samsung/exynos_drm_decon.h b/samsung/exynos_drm_decon.h
index e9f3fa1..69f707d 100644
--- a/samsung/exynos_drm_decon.h
+++ b/samsung/exynos_drm_decon.h
@@ -155,6 +155,7 @@ struct dpu_bts {
u32 afbc_yuv_rt_util_pct;
u32 dfs_lv_cnt;
u32 dfs_lv_khz[BTS_DFS_MAX];
+ u32 max_dfs_lv_for_wb;
u32 vbp;
u32 vfp;
u32 vsa;