Skip to contentSkip to conversation

dal patches for nov 23, 2016

PATCH New Harry Wentland 1 participant 6 messages Nov 25, 2016 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover dal patches for nov 23, 2016

* remove some dead code
* bunch of minor fixes

Dmytro Laktyushkin (3):
drm/amd/dal: remove dc_clock_generator (dead code) drm/amd/dal: refactor and fix lb memory size setting drm/amd/dal: revert dc_flip_surface_addrs to directly flip address

Tony Cheng (1):
drm/amd/dal: enhance debug print in REG_WAIT

Yongqiang Sun (1):
drm/amd/dal: Temporary fix DP hot plug crash.

 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c      | 12 ++++
 .../gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c    |  2 +
 drivers/gpu/drm/amd/dal/dc/core/dc.c               | 21 +++++--
 drivers/gpu/drm/amd/dal/dc/dc_helper.c             |  2 +-
 drivers/gpu/drm/amd/dal/dc/dce/dce_transform.c     | 24 ++++----
 drivers/gpu/drm/amd/dal/dc/dce/dce_transform.h     |  4 +-
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    |  1 -
 .../gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c |  6 +-
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    |  2 +-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c  |  1 -
 drivers/gpu/drm/amd/dal/dc/gpu/Makefile            |  2 +-
 .../gpu/drm/amd/dal/dc/gpu/dc_clock_generator.c    | 71 ----------------------
 .../gpu/drm/amd/dal/dc/gpu/dc_clock_generator.h    | 54 ----------------
 drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h      |  4 --
 .../amd/dal/include/dc_clock_generator_interface.h | 68 ---------------------
 15 files changed, 50 insertions(+), 224 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dc_clock_generator.c
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dc_clock_generator.h
 delete mode 100644 drivers/gpu/drm/amd/dal/include/dc_clock_generator_interface.h
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20161125215941.29972-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/5 drm/amd/dal: Temporary fix DP hot plug crash.

From: Yongqiang Sun <[email protected]>

Change-Id Ic4347e0c772f074fb9efdcff42b3aa42bda1e5ad
---
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c       | 12 ++++++++++++
 drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c |  2 ++
 2 files changed, 14 insertions(+)
drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm.c +12 -0
index 9a65b978d07a..b798b7a2231b 100644
@@ -828,6 +828,7 @@ static void handle_hpd_irq(void *param)
 	/* In case of failure or MST no need to update connector status or notify the OS
 	 * since (for MST case) MST does this in it's own context.
 	 */
+	mutex_lock(&aconnector->hpd_lock);
 	if (dc_link_detect(aconnector->dc_link, false)) {
 		amdgpu_dm_update_connector_after_detect(aconnector);
 
@@ -839,6 +840,7 @@ static void handle_hpd_irq(void *param)
 		if (aconnector->base.force == DRM_FORCE_UNSPECIFIED)
 			drm_kms_helper_hotplug_event(dev);
 	}
+	mutex_unlock(&aconnector->hpd_lock);
 
 }
 
@@ -929,6 +931,13 @@ static void handle_hpd_rx_irq(void *param)
 	const struct dc_link *dc_link = aconnector->dc_link;
 	bool is_mst_root_connector = aconnector->mst_mgr.mst_state;
 
+	/* TODO:Temporary add mutex to protect hpd interrupt not have a gpio
+	 * conflict, after implement i2c helper, this mutex should be
+	 * retired.
+	 */
+	if (aconnector->dc_link->type != dc_connection_mst_branch)
+		mutex_lock(&aconnector->hpd_lock);
+
 	if (dc_link_handle_hpd_rx_irq(aconnector->dc_link) &&
 			!is_mst_root_connector) {
 		/* Downstream Port status changed. */
@@ -946,6 +955,9 @@ static void handle_hpd_rx_irq(void *param)
 	if ((dc_link->cur_link_settings.lane_count != LANE_COUNT_UNKNOWN) ||
 				(dc_link->type == dc_connection_mst_branch))
 		dm_handle_hpd_rx_irq(aconnector);
+
+	if (aconnector->dc_link->type != dc_connection_mst_branch)
+		mutex_unlock(&aconnector->hpd_lock);
 }
 
 static void register_hpd_handlers(struct amdgpu_device *adev)
drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c +2 -0
index fba2bd74f669..e73c658cdfec 100644
@@ -2041,6 +2041,8 @@ void amdgpu_dm_connector_init_helper(
 	aconnector->base.dpms = DRM_MODE_DPMS_OFF;
 	aconnector->hpd.hpd = AMDGPU_HPD_NONE; /* not used */
 
+	mutex_init(&aconnector->hpd_lock);
+
 	/*configure suport HPD hot plug connector_>polled default value is 0
 	 * which means HPD hot plug not supported*/
 	switch (connector_type) {
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 2/5 drm/amd/dal: remove dc_clock_generator (dead code)

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

---
 drivers/gpu/drm/amd/dal/dc/gpu/Makefile            |  2 +-
 .../gpu/drm/amd/dal/dc/gpu/dc_clock_generator.c    | 71 ----------------------
 .../gpu/drm/amd/dal/dc/gpu/dc_clock_generator.h    | 54 ----------------
 .../amd/dal/include/dc_clock_generator_interface.h | 68 ---------------------
 4 files changed, 1 insertion(+), 194 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dc_clock_generator.c
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/gpu/dc_clock_generator.h
 delete mode 100644 drivers/gpu/drm/amd/dal/include/dc_clock_generator_interface.h
drivers/gpu/drm/amd/dal/dc/gpu/Makefile +1 -1
index ec2ef4994ade..51805c36c5f5 100644
@@ -3,7 +3,7 @@
 # It provides the control and status of HW adapter resources,
 # that are global for the ASIC and sharable between pipes.
 
-GPU = dc_clock_generator.o display_clock.o divider_range.o
+GPU = display_clock.o divider_range.o
 
 AMD_DAL_GPU = $(addprefix $(AMDDALPATH)/dc/gpu/,$(GPU))
 
drivers/gpu/drm/amd/dal/dc/gpu/dc_clock_generator.c deleted +0 -71

71 lines not on this page · raw message

drivers/gpu/drm/amd/dal/dc/gpu/dc_clock_generator.h deleted +0 -54

54 lines not on this page · raw message

drivers/gpu/drm/amd/dal/include/dc_clock_generator_interface.h deleted +0 -68

68 lines not on this page · raw message

Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 3/5 drm/amd/dal: refactor and fix lb memory size setting

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

- Underlay was missing default lb memory size
- Unify num_of_entries and memory size

Change-Id I521ec6532dba4de55491c4fb164a44bf93250698
---
 drivers/gpu/drm/amd/dal/dc/dce/dce_transform.c     | 24 ++++++++++------------
 drivers/gpu/drm/amd/dal/dc/dce/dce_transform.h     |  4 +++-
 .../gpu/drm/amd/dal/dc/dce100/dce100_resource.c    |  1 -
 .../gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c |  6 +++---
 .../gpu/drm/amd/dal/dc/dce112/dce112_resource.c    |  2 +-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c  |  1 -
 drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h      |  4 ----
 7 files changed, 18 insertions(+), 24 deletions(-)
drivers/gpu/drm/amd/dal/dc/dce/dce_transform.c +11 -13
index 4659deadcc15..f47b6617f662 100644
@@ -285,7 +285,7 @@ static void dce_transform_set_scaler(
 	/*Use all three pieces of memory always*/
 	REG_SET_2(LB_MEMORY_CTRL, 0,
 			LB_MEMORY_CONFIG, 0,
-			LB_MEMORY_SIZE, xfm_dce->base.lb_memory_size);
+			LB_MEMORY_SIZE, xfm_dce->lb_memory_size);
 
 	/* 1. Program overscan */
 	program_overscan(xfm_dce, data);
@@ -649,7 +649,7 @@ static void program_bit_depth_reduction(
 }
 
 static int dce_transform_get_max_num_of_supported_lines(
-	struct transform *xfm,
+	struct dce_transform *xfm_dce,
 	enum lb_pixel_depth depth,
 	int pixel_width)
 {
@@ -663,23 +663,23 @@ static int dce_transform_get_max_num_of_supported_lines(
 	 * across multiple entries. */
 	switch (depth) {
 	case LB_PIXEL_DEPTH_18BPP:
-		pixels_per_entries = xfm->lb_bits_per_entry / 18;
+		pixels_per_entries = xfm_dce->lb_bits_per_entry / 18;
 		break;
 
 	case LB_PIXEL_DEPTH_24BPP:
-		pixels_per_entries = xfm->lb_bits_per_entry / 24;
+		pixels_per_entries = xfm_dce->lb_bits_per_entry / 24;
 		break;
 
 	case LB_PIXEL_DEPTH_30BPP:
-		pixels_per_entries = xfm->lb_bits_per_entry / 30;
+		pixels_per_entries = xfm_dce->lb_bits_per_entry / 30;
 		break;
 
 	case LB_PIXEL_DEPTH_36BPP:
-		pixels_per_entries = xfm->lb_bits_per_entry / 36;
+		pixels_per_entries = xfm_dce->lb_bits_per_entry / 36;
 		break;
 
 	default:
-		dm_logger_write(xfm->ctx->logger, LOG_WARNING,
+		dm_logger_write(xfm_dce->base.ctx->logger, LOG_WARNING,
 			"%s: Invalid LB pixel depth",
 			__func__);
 		BREAK_TO_DEBUGGER();
@@ -690,7 +690,7 @@ static int dce_transform_get_max_num_of_supported_lines(
 
 	max_pixels_supports =
 			pixels_per_entries *
-			xfm->lb_total_entries_num;
+			xfm_dce->lb_memory_size;
 
 	return (max_pixels_supports / pixel_width);
 }
@@ -899,7 +899,7 @@ bool dce_transform_get_optimal_number_of_taps(
 		pixel_width = scl_data->recout.width;
 
 	max_num_of_lines = dce_transform_get_max_num_of_supported_lines(
-		xfm,
+		xfm_dce,
 		scl_data->lb_params.depth,
 		pixel_width);
 
@@ -995,10 +995,8 @@ bool dce_transform_construct(
 			LB_PIXEL_DEPTH_24BPP |
 			LB_PIXEL_DEPTH_30BPP;
 
-	xfm_dce->base.lb_bits_per_entry = LB_BITS_PER_ENTRY;
-	xfm_dce->base.lb_total_entries_num = LB_TOTAL_NUMBER_OF_ENTRIES;
-
-	xfm_dce->base.lb_memory_size = 0x6B0; /*1712*/
+	xfm_dce->lb_bits_per_entry = LB_BITS_PER_ENTRY;
+	xfm_dce->lb_memory_size = LB_TOTAL_NUMBER_OF_ENTRIES; /*0x6B0*/
 
 	return true;
 }
drivers/gpu/drm/amd/dal/dc/dce/dce_transform.h +3 -1
index b793ddda4783..897645e2889f 100644
@@ -291,7 +291,9 @@ struct dce_transform {
 	const uint16_t *filter_h;
 	const uint16_t *filter_v_c;
 	const uint16_t *filter_h_c;
-	uint32_t lb_pixel_depth_supported;
+	int lb_pixel_depth_supported;
+	int lb_memory_size;
+	int lb_bits_per_entry;
 	bool prescaler_on;
 };
 
drivers/gpu/drm/amd/dal/dc/dce100/dce100_resource.c +0 -1
index 08e0ca11a48d..fafc976e5209 100644
@@ -541,7 +541,6 @@ static struct transform *dce100_transform_create(
 
 	if (dce_transform_construct(transform, ctx, inst,
 			&xfm_regs[inst], &xfm_shift, &xfm_mask)) {
-		transform->base.lb_memory_size = 0x6B0; /*1712*/
 		return &transform->base;
 	}
 
drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.c +3 -3
index 4f2aa7722961..7d8cf7a58f46 100644
@@ -503,7 +503,7 @@ static bool dce110_xfmv_power_up_line_buffer(struct transform *xfm)
 	/*Use all three pieces of memory always*/
 	set_reg_field_value(value, 0, LBV_MEMORY_CTRL, LB_MEMORY_CONFIG);
 	/*hard coded number DCE11 1712(0x6B0) Partitions: 720/960/1712*/
-	set_reg_field_value(value, xfm_dce->base.lb_memory_size, LBV_MEMORY_CTRL,
+	set_reg_field_value(value, xfm_dce->lb_memory_size, LBV_MEMORY_CTRL,
 			LB_MEMORY_SIZE);
 
 	dm_write_reg(xfm_dce->base.ctx, mmLBV_MEMORY_CTRL, value);
@@ -697,8 +697,8 @@ bool dce110_transform_v_construct(
 			LB_PIXEL_DEPTH_30BPP;
 
 	xfm_dce->prescaler_on = true;
-	xfm_dce->base.lb_bits_per_entry = LB_BITS_PER_ENTRY;
-	xfm_dce->base.lb_total_entries_num = LB_TOTAL_NUMBER_OF_ENTRIES;
+	xfm_dce->lb_bits_per_entry = LB_BITS_PER_ENTRY;
+	xfm_dce->lb_memory_size = LB_TOTAL_NUMBER_OF_ENTRIES; /*0x6B0*/
 
 	return true;
 }
drivers/gpu/drm/amd/dal/dc/dce112/dce112_resource.c +1 -1
index a9991aa28666..c0d7ecc89374 100644
@@ -555,7 +555,7 @@ static struct transform *dce112_transform_create(
 
 	if (dce_transform_construct(transform, ctx, inst,
 			&xfm_regs[inst], &xfm_shift, &xfm_mask)) {
-		transform->base.lb_memory_size = 0x1404; /*5124*/
+		transform->lb_memory_size = 0x1404; /*5124*/
 		return &transform->base;
 	}
 
drivers/gpu/drm/amd/dal/dc/dce80/dce80_resource.c +0 -1
index 738201b15722..7dc0e9f6165e 100644
@@ -524,7 +524,6 @@ static struct transform *dce80_transform_create(
 	if (dce_transform_construct(transform, ctx, inst,
 			&xfm_regs[inst], &xfm_shift, &xfm_mask)) {
 		transform->prescaler_on = false;
-		transform->base.lb_memory_size = 0x6B0; /*1712*/
 		return &transform->base;
 	}
 
drivers/gpu/drm/amd/dal/dc/inc/hw/transform.h +0 -4
index 7f88272f8290..ef743b70b3e9 100644
@@ -37,10 +37,6 @@ struct transform {
 	const struct transform_funcs *funcs;
 	struct dc_context *ctx;
 	int inst;
-
-	int lb_total_entries_num;
-	int lb_bits_per_entry;
-	unsigned int lb_memory_size;
 };
 
 /* Colorimetry */
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

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

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Change-Id I5f00cd4929f66700b9a2839d2a8eb9880e127b7e
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/dal/dc/core/dc.c +16 -5
index 1e337e427d06..f7638f84421b 100644
@@ -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(
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

PATCH 5/5 drm/amd/dal: enhance debug print in REG_WAIT

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id I4bc28dd8df15337693e311e0255b4f0cfeb22909
---
 drivers/gpu/drm/amd/dal/dc/dc_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/dal/dc/dc_helper.c +1 -1
index 22b72f0bcbbc..3a80b0c08ae4 100644
@@ -138,7 +138,7 @@ uint32_t generic_reg_wait(const struct dc_context *ctx,
 			return reg_val;
 	}
 
-	DC_ERR("REG_WAIT timeout %dus * %d tries - ",
+	DC_ERR("REG_WAIT timeout %dus * %d tries - %s",
 			delay_between_poll_us, time_out_num_tries, func_name);
 	return reg_val;
 }
Signature · 6 lines
2.10.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx