[PATCH 12/12] drm/amd/display: create scratch_val_ctx as temp w/a

Harry Wentland harry.wentland at amd.com
Tue Dec 6 18:35:38 UTC 2016


From: Dmytro Laktyushkin <Dmytro.Laktyushkin at amd.com>

Change-Id: I361779eff9f07723308793fcf31e9ddcc528298d
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin at amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c     | 5 ++++-
 drivers/gpu/drm/amd/display/dc/inc/core_dc.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 70dc70685471..a3c5def507a9 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -452,6 +452,8 @@ static void destruct(struct core_dc *dc)
 
 	dm_free(dc->temp_flip_context);
 	dc->temp_flip_context = NULL;
+	dm_free(dc->scratch_val_ctx);
+	dc->scratch_val_ctx = NULL;
 
 	destroy_links(dc);
 
@@ -490,6 +492,7 @@ static bool construct(struct core_dc *dc,
 
 	dc->current_context = dm_alloc(sizeof(*dc->current_context));
 	dc->temp_flip_context = dm_alloc(sizeof(*dc->temp_flip_context));
+	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->temp_flip_context));
 
 	if (!dc->current_context || !dc->temp_flip_context) {
 		dm_error("%s: failed to create validate ctx\n", __func__);
@@ -1217,7 +1220,7 @@ bool dc_pre_update_surfaces_to_target(
 			goto unexpected_fail;
 		}
 		resource_validate_ctx_destruct(context);
-		dm_free(context);
+		core_dc->scratch_val_ctx = context;
 		context = temp_context;
 	}
 
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_dc.h b/drivers/gpu/drm/amd/display/dc/inc/core_dc.h
index 7d6dc8ea75ab..b5a5207a4df0 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_dc.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_dc.h
@@ -24,6 +24,7 @@ struct core_dc {
 	/* TODO: determine max number of targets*/
 	struct validate_context *current_context;
 	struct validate_context *temp_flip_context;
+	struct validate_context *scratch_val_ctx;
 	struct resource_pool *res_pool;
 
 	/*Power State*/
-- 
2.9.3



More information about the amd-gfx mailing list