[4/5] drm/amd/dal: revert dc_flip_surface_addrs to directly flip address

Submitted by Harry Wentland on Nov. 25, 2016, 9:59 p.m.

Details

Message ID 20161125215941.29972-5-harry.wentland@amd.com
State New
Headers show
Series "dal patches for nov 23, 2016" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Harry Wentland Nov. 25, 2016, 9:59 p.m.
From: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>

Change-Id: I5f00cd4929f66700b9a2839d2a8eb9880e127b7e
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index 1e337e427d06..f7638f84421b 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -1558,13 +1558,24 @@  void dc_flip_surface_addrs(
 		struct dc_flip_addrs flip_addrs[],
 		uint32_t count)
 {
-	int i;
-	struct dc_surface_update updates[MAX_SURFACE_NUM] = { { 0 } };
+	struct core_dc *core_dc = DC_TO_CORE(dc);
+	int i, j;
+
 	for (i = 0; i < count; i++) {
-		updates[i].flip_addr = &flip_addrs[i];
-		updates[i].surface = surfaces[i];
+		struct core_surface *surface = DC_SURFACE_TO_CORE(surfaces[i]);
+
+		surface->public.address = flip_addrs[i].address;
+		surface->public.flip_immediate = flip_addrs[i].flip_immediate;
+
+		for (j = 0; j < core_dc->res_pool->pipe_count; j++) {
+			struct pipe_ctx *pipe_ctx = &core_dc->current_context->res_ctx.pipe_ctx[j];
+
+			if (pipe_ctx->surface != surface)
+				continue;
+
+			core_dc->hwss.update_plane_addr(core_dc, pipe_ctx);
+		}
 	}
-	dc_update_surfaces_for_target(dc, updates, count, NULL);
 }
 
 enum dc_irq_source dc_interrupt_to_irq_source(