Skip to contentSkip to conversation

DC Patches Jan 23, 2017

PATCH In review Harry Wentland 2 participants 27 messages Jan 23, 2017 2 messages not in the archive

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

cover DC Patches Jan 23, 2017

* Use VBLANK instead of VUPDATE for VBLANK notification
* Cleanup pflip code a bit more
* Bunch of bug fixes all over the place
* Removing some more dead code

Amy Zhang (3):
drm/amd/display: Output Transfer Function Regamma Refactor drm/amd/display: Set default degamma to sRGB instead of bypass drm/amd/display: HDR Enablement For Applications

Andrey Grodzovsky (4):
drm/amd/display: Use pflip prepare and submit parts (v2) drm/amd/display: Add interrupt entries for VBLANK isr. drm/amd/display: Register on VLBLANK ISR. drm/amd/display: Clean index in irq init loop

Anthony Koo (1):
drm/amd/display: Disable Modules at Runtime

Dmytro Laktyushkin (2):
drm/amd/display: Remove meta_pitch drm/amd/display: add missing dcc update on flip call

Hersen Wu (1):
drm/amd/display: No audio output heard from DP panel

Leon Elazar (2):
drm/amd/display: Fixing some fallout from dc_target removal drm/amd/display: Add missing MI masks

Tony Cheng (10):
drm/amd/display: mode change without breaking unaffected streams drm/amd/display: assert if mask is 0 in set_reg_field_value_ex drm/amd/display: remove un-used defines and dead code drm/amd/display: remove hw_crtc_timing drm/amd/display: remove hw_info_frame drm/amd/display: remove SIGNAL_TYPE_WIRELESS drm/amd/display: remove dead code
drm/amd/display: remove calculate_adjustments in conversion.h drm/amd/display: refactor clk_resync to avoid assertion drm/amd/display: rename BGRA8888 to ABGR8888

Yongqiang Sun (1):
drm/amd/display: Null check clock source.

Zeyu Fan (1):
drm/amd/display: Fix missing conditions in hw sequencer.

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |   10 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h  |    2 +-
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c  |    2 +-
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c    |   96 +-
 drivers/gpu/drm/amd/display/dc/basics/conversion.c |  118 --
 drivers/gpu/drm/amd/display/dc/basics/conversion.h |   10 -
 drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c |    9 +
 .../gpu/drm/amd/display/dc/basics/log_helpers.c    |    1 -
 .../gpu/drm/amd/display/dc/basics/signal_types.c   |   38 +-
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  |   76 -
 .../gpu/drm/amd/display/dc/bios/command_table.c    |  169 ---
 .../gpu/drm/amd/display/dc/bios/command_table.h    |   10 -
 drivers/gpu/drm/amd/display/dc/calcs/Makefile      |    2 +-
 .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |    4 +-
 drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c | 1481 --------------------
 drivers/gpu/drm/amd/display/dc/core/dc.c           |   23 +-
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c     |    8 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      |    4 -
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |    2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |    3 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  142 +-
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |    6 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |   11 +-
 drivers/gpu/drm/amd/display/dc/dc_bios_types.h     |    6 -
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h       |   12 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_audio.h     |    4 +-
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |   57 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c     |    2 +-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |    1 -
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c |    4 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h |    2 +
 drivers/gpu/drm/amd/display/dc/dce/dce_opp.c       |    7 +
 .../drm/amd/display/dc/dce/dce_stream_encoder.c    |    2 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  530 ++++++-
 .../drm/amd/display/dc/dce110/dce110_mem_input_v.c |    2 +-
 .../amd/display/dc/dce110/dce110_opp_regamma_v.c   |    7 +
 .../gpu/drm/amd/display/dc/dce110/dce110_opp_v.c   |    6 +-
 .../gpu/drm/amd/display/dc/dce110/dce110_opp_v.h   |    4 +
 .../drm/amd/display/dc/dce110/dce110_resource.c    |   17 +-
 drivers/gpu/drm/amd/display/dc/dm_services.h       |    1 +
 drivers/gpu/drm/amd/display/dc/inc/core_status.h   |    2 +
 drivers/gpu/drm/amd/display/dc/inc/gamma_calcs.h   |   20 -
 drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h  |    1 -
 .../gpu/drm/amd/display/dc/inc/hw/link_encoder.h   |    1 -
 drivers/gpu/drm/amd/display/dc/inc/hw/opp.h        |    3 +-
 .../gpu/drm/amd/display/dc/inc/hw/stream_encoder.h |    2 +-
 drivers/gpu/drm/amd/display/dc/inc/hw/transform.h  |   11 +
 .../amd/display/dc/irq/dce110/irq_service_dce110.c |   42 +
 .../amd/display/dc/irq/dce80/irq_service_dce80.c   |   22 +
 drivers/gpu/drm/amd/display/dc/irq_types.h         |    8 +
 .../display/include/asic_capability_interface.h    |   55 -
 .../amd/display/include/asic_capability_types.h    |  116 --
 .../drm/amd/display/include/bios_parser_types.h    |   28 -
 .../drm/amd/display/include/ddc_service_types.h    |    7 -
 drivers/gpu/drm/amd/display/include/fixed31_32.h   |    8 +
 .../drm/amd/display/include/hw_sequencer_types.h   |   63 -
 .../gpu/drm/amd/display/include/irq_interface.h    |   31 -
 .../drm/amd/display/include/link_service_types.h   |   75 -
 drivers/gpu/drm/amd/display/include/signal_types.h |    7 -
 .../drm/amd/display/modules/freesync/freesync.c    |   94 +-
 .../gpu/drm/amd/display/modules/inc/mod_freesync.h |    7 -
 61 files changed, 938 insertions(+), 2556 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/inc/gamma_calcs.h
 delete mode 100644 drivers/gpu/drm/amd/display/include/asic_capability_interface.h
 delete mode 100644 drivers/gpu/drm/amd/display/include/asic_capability_types.h
 delete mode 100644 drivers/gpu/drm/amd/display/include/irq_interface.h
Signature · 6 lines
2.9.3

_______________________________________________
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): 20170123143613.15441-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/25 drm/amd/display: Null check clock source.

From: Yongqiang Sun <[email protected]>

Change-Id Ifcec8c22d0df9434a470e2abc1bc77f503d9c0f7
---
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c +2 -1
index 55d96656e54b..b0ac94d673c4 100644
@@ -74,7 +74,8 @@ void dp_enable_link_phy(
 		if (pipes[i].stream != NULL &&
 			pipes[i].stream->sink != NULL &&
 			pipes[i].stream->sink->link == link) {
-			if (pipes[i].clock_source->id != CLOCK_SOURCE_ID_DP_DTO) {
+			if (pipes[i].clock_source != NULL &&
+					pipes[i].clock_source->id != CLOCK_SOURCE_ID_DP_DTO) {
 				pipes[i].clock_source = dp_cs;
 				pipes[i].pix_clk_params.requested_pix_clk =
 						pipes[i].stream->public.timing.pix_clk_khz;
Signature · 6 lines
2.9.3

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

PATCH 2/25 drm/amd/display: Output Transfer Function Regamma Refactor

In reply to a message not in the archive

From: Amy Zhang <[email protected]>

- Create translation function to translate logical format to hw format
- Refactor to use transfer function in dc instead of input gamma

Change-Id If7ea756ea206c3776ab328f3b351ce546ae080a0
---
 drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c |    9 +
 drivers/gpu/drm/amd/display/dc/calcs/Makefile      |    2 +-
 drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c | 1481 --------------------
 drivers/gpu/drm/amd/display/dc/core/dc.c           |   10 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |   11 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  440 +++++-
 drivers/gpu/drm/amd/display/dc/inc/gamma_calcs.h   |   20 -
 drivers/gpu/drm/amd/display/dc/inc/hw/opp.h        |    2 -
 drivers/gpu/drm/amd/display/include/fixed31_32.h   |    8 +
 9 files changed, 466 insertions(+), 1517 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/inc/gamma_calcs.h
drivers/gpu/drm/amd/display/dc/basics/fixpt31_32.c +9 -0
index 5a6e46843502..546ed67c6f83 100644
@@ -246,6 +246,15 @@ struct fixed31_32 dal_fixed31_32_add(
 	return res;
 }
 
+struct fixed31_32 dal_fixed31_32_add_int(
+	struct fixed31_32 arg1,
+	int32_t arg2)
+{
+	return dal_fixed31_32_add(
+		arg1,
+		dal_fixed31_32_from_int(arg2));
+}
+
 struct fixed31_32 dal_fixed31_32_sub_int(
 	struct fixed31_32 arg1,
 	int32_t arg2)
drivers/gpu/drm/amd/display/dc/calcs/Makefile +1 -1
index 4001933e7808..4bb08aea6a03 100644
@@ -3,7 +3,7 @@
 # It calculates Bandwidth and Watermarks values for HW programming
 #
 
-BW_CALCS = bandwidth_calcs.o bw_fixed.o gamma_calcs.o
+BW_CALCS = bandwidth_calcs.o bw_fixed.o
 
 AMD_DAL_BW_CALCS = $(addprefix $(AMDDALPATH)/dc/calcs/,$(BW_CALCS))
 
drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c deleted +0 -1481

1,481 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/core/dc.c +5 -5
index 7d4299b9ee1f..948f82a56472 100644
@@ -1519,23 +1519,23 @@ void dc_update_surfaces_for_stream(struct dc *dc, struct dc_surface_update *upda
 			if (dc->debug.disable_color_module)
 				continue;  /* skip below color updates */
 
-			if (updates[i].hdr_static_metadata) {
-				resource_build_info_frame(pipe_ctx);
-				core_dc->hwss.update_info_frame(pipe_ctx);
-			}
 			if (is_new_pipe_surface[j] ||
 					updates[i].in_transfer_func)
 				core_dc->hwss.set_input_transfer_func(
 						pipe_ctx, pipe_ctx->surface);
 
 			if (is_new_pipe_surface[j] ||
-					updates[i].gamma ||
 					updates[i].out_transfer_func)
 				core_dc->hwss.set_output_transfer_func(
 						pipe_ctx,
 						pipe_ctx->surface,
 						pipe_ctx->stream);
 
+			if (updates[i].hdr_static_metadata) {
+				resource_build_info_frame(pipe_ctx);
+				core_dc->hwss.update_info_frame(pipe_ctx);
+			}
+
 		}
 		if (apply_ctx) {
 			core_dc->hwss.apply_ctx_for_surface(core_dc, surface, context);
drivers/gpu/drm/amd/display/dc/dc.h +7 -4
index b814e7b76bbc..f53b41339951 100644
@@ -213,11 +213,14 @@ enum dc_transfer_func_type {
 };
 
 struct dc_transfer_func_distributed_points {
-	uint16_t red[TRANSFER_FUNC_POINTS];
-	uint16_t green[TRANSFER_FUNC_POINTS];
-	uint16_t blue[TRANSFER_FUNC_POINTS];
+	struct fixed31_32 red[TRANSFER_FUNC_POINTS];
+	struct fixed31_32 green[TRANSFER_FUNC_POINTS];
+	struct fixed31_32 blue[TRANSFER_FUNC_POINTS];
+
 	uint16_t end_exponent;
-	uint16_t x_point_at_y1;
+	uint16_t x_point_at_y1_red;
+	uint16_t x_point_at_y1_green;
+	uint16_t x_point_at_y1_blue;
 };
 
 enum dc_transfer_func_predefined {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +436 -4

459 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/gamma_calcs.h deleted +0 -20
deleted file mode 100644
index 0712268856c2..000000000000
@@ -1,20 +0,0 @@
-/*
- * gamma_calcs.h
- *
- *  Created on: Feb 9, 2016
- *      Author: yonsun
- */
-
-#ifndef DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_GAMMA_CALCS_H_
-#define DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_GAMMA_CALCS_H_
-
-#include "opp.h"
-#include "core_types.h"
-#include "dc.h"
-
-bool calculate_regamma_params(struct pwl_params *params,
-		const struct core_gamma *ramp,
-		const struct core_surface *surface,
-		const struct core_stream *stream);
-
-#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_GAMMA_CALCS_H_ */
drivers/gpu/drm/amd/display/dc/inc/hw/opp.h +0 -2
index a1f31a4410a3..bef5e2cacbe3 100644
@@ -138,9 +138,7 @@ struct custom_float_value {
 
 struct hw_x_point {
 	uint32_t custom_float_x;
-	uint32_t custom_float_x_adjusted;
 	struct fixed31_32 x;
-	struct fixed31_32 adjusted_x;
 	struct fixed31_32 regamma_y_red;
 	struct fixed31_32 regamma_y_green;
 	struct fixed31_32 regamma_y_blue;
drivers/gpu/drm/amd/display/include/fixed31_32.h +8 -0
index c28de167250f..5a4364dfd2f7 100644
@@ -192,6 +192,14 @@ struct fixed31_32 dal_fixed31_32_add(
 
 /*
  * @brief
+ * result = arg1 + arg2
+ */
+struct fixed31_32 dal_fixed31_32_add_int(
+	struct fixed31_32 arg1,
+	int32_t arg2);
+
+/*
+ * @brief
  * result = arg1 - arg2
  */
 struct fixed31_32 dal_fixed31_32_sub_int(
Signature · 6 lines
2.9.3

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

PATCH 3/25 drm/amd/display: Disable Modules at Runtime

In reply to a message not in the archive

From: Anthony Koo <[email protected]>

Add NULL check in modules

Change-Id I3e668c93b16795c539ac790638694c2b4c4dab28
---
 .../drm/amd/display/modules/freesync/freesync.c    | 94 +++++++++++++++-------
 .../gpu/drm/amd/display/modules/inc/mod_freesync.h |  7 --
 2 files changed, 65 insertions(+), 36 deletions(-)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +65 -29
index 6f4d169f4e4e..e0703c588e47 100644
@@ -205,11 +205,16 @@ static unsigned int map_index_from_stream(struct core_freesync *core_freesync,
 bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
 		const struct dc_stream *stream, struct mod_freesync_caps *caps)
 {
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
-	struct core_stream *core_stream =
-			DC_STREAM_TO_CORE(stream);
-	struct core_dc *core_dc = DC_TO_CORE(core_freesync->dc);
+	struct core_stream *core_stream = NULL;
+	struct core_dc *core_dc = NULL;
+	struct core_freesync *core_freesync = NULL;
+
+	if (mod_freesync == NULL)
+		return false;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
+	core_stream = DC_STREAM_TO_CORE(stream);
+	core_dc = DC_TO_CORE(core_freesync->dc);
 
 	int persistent_freesync_enable = 0;
 	struct persistent_data_flag flag;
@@ -270,11 +275,16 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
 bool mod_freesync_remove_stream(struct mod_freesync *mod_freesync,
 		const struct dc_stream *stream)
 {
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
-
 	int i = 0;
-	unsigned int index = map_index_from_stream(core_freesync, stream);
+	struct core_freesync *core_freesync = NULL;
+	unsigned int index = 0;
+
+	if (mod_freesync == NULL)
+		return false;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
+	index = map_index_from_stream(core_freesync, stream);
+
 	dc_stream_release(core_freesync->map[index].stream);
 	core_freesync->map[index].stream = NULL;
 	/* To remove this entity, shift everything after down */
@@ -621,11 +631,14 @@ static void set_static_ramp_variables(struct core_freesync *core_freesync,
 void mod_freesync_handle_v_update(struct mod_freesync *mod_freesync,
 		const struct dc_stream **streams, int num_streams)
 {
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
-
 	unsigned int index, v_total = 0;
 	struct freesync_state *state;
+	struct core_freesync *core_freesync = NULL;
+
+	if (mod_freesync == NULL)
+		return;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
 
 	if (core_freesync->num_entities == 0)
 		return;
@@ -691,11 +704,15 @@ void mod_freesync_update_state(struct mod_freesync *mod_freesync,
 		const struct dc_stream **streams, int num_streams,
 		struct mod_freesync_params *freesync_params)
 {
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
 	bool freesync_program_required = false;
 	unsigned int stream_index;
 	struct freesync_state *state;
+	struct core_freesync *core_freesync = NULL;
+
+	if (mod_freesync == NULL)
+		return;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
 
 	if (core_freesync->num_entities == 0)
 		return;
@@ -762,10 +779,14 @@ bool mod_freesync_get_state(struct mod_freesync *mod_freesync,
 		const struct dc_stream *stream,
 		struct mod_freesync_params *freesync_params)
 {
-	struct core_freesync *core_freesync =
-				MOD_FREESYNC_TO_CORE(mod_freesync);
+	unsigned int index = NULL;
+	struct core_freesync *core_freesync = NULL;
 
-	unsigned int index = map_index_from_stream(core_freesync, stream);
+	if (mod_freesync == NULL)
+		return false;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
+	index = map_index_from_stream(core_freesync, stream);
 
 	if (core_freesync->map[index].state.fullscreen) {
 		freesync_params->state = FREESYNC_STATE_FULLSCREEN;
@@ -794,13 +815,17 @@ bool mod_freesync_set_user_enable(struct mod_freesync *mod_freesync,
 		const struct dc_stream **streams, int num_streams,
 		struct mod_freesync_user_enable *user_enable)
 {
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
-	struct core_dc *core_dc = DC_TO_CORE(core_freesync->dc);
-
 	unsigned int stream_index, map_index;
 	int persistent_data = 0;
 	struct persistent_data_flag flag;
+	struct core_dc *core_dc = NULL;
+	struct core_freesync *core_freesync = NULL;
+
+	if (mod_freesync == NULL)
+		return false;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
+	core_dc = DC_TO_CORE(core_freesync->dc);
 
 	flag.save_per_edid = true;
 	flag.save_per_link = false;
@@ -842,10 +867,14 @@ bool mod_freesync_get_user_enable(struct mod_freesync *mod_freesync,
 		const struct dc_stream *stream,
 		struct mod_freesync_user_enable *user_enable)
 {
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
+	unsigned int index = 0;
+	struct core_freesync *core_freesync = NULL;
 
-	unsigned int index = map_index_from_stream(core_freesync, stream);
+	if (mod_freesync == NULL)
+		return false;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
+	index = map_index_from_stream(core_freesync, stream);
 
 	*user_enable = core_freesync->map[index].user_enable;
 
@@ -855,12 +884,15 @@ bool mod_freesync_get_user_enable(struct mod_freesync *mod_freesync,
 void mod_freesync_notify_mode_change(struct mod_freesync *mod_freesync,
 		const struct dc_stream **streams, int num_streams)
 {
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
-
 	unsigned int stream_index, map_index;
 	unsigned min_frame_duration_in_ns, max_frame_duration_in_ns;
 	struct freesync_state *state;
+	struct core_freesync *core_freesync = NULL;
+
+	if (mod_freesync == NULL)
+		return;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
 
 	for (stream_index = 0; stream_index < num_streams; stream_index++) {
 
@@ -1121,8 +1153,12 @@ void mod_freesync_pre_update_plane_addresses(struct mod_freesync *mod_freesync,
 		unsigned int curr_time_stamp_in_us)
 {
 	unsigned int stream_index, map_index, last_render_time_in_us = 0;
-	struct core_freesync *core_freesync =
-			MOD_FREESYNC_TO_CORE(mod_freesync);
+	struct core_freesync *core_freesync = NULL;
+
+	if (mod_freesync == NULL)
+		return;
+
+	core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync);
 
 	for (stream_index = 0; stream_index < num_streams; stream_index++) {
 
drivers/gpu/drm/amd/display/modules/inc/mod_freesync.h +0 -7
index 7abfe34dc2d9..783ff2ef3bee 100644
@@ -110,13 +110,6 @@ bool mod_freesync_remove_stream(struct mod_freesync *mod_freesync,
 		const struct dc_stream *stream);
 
 /*
- * Build additional parameters for dc_stream when creating stream for
- * sink to support freesync
- */
-void mod_freesync_update_stream(struct mod_freesync *mod_freesync,
-		struct dc_stream *stream);
-
-/*
  * Update the freesync state flags for each display and program
  * freesync accordingly
  */
Signature · 6 lines
2.9.3

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

PATCH 4/25 drm/amd/display: Fixing some fallout from dc_target removal

In reply to a message not in the archive

From: Leon Elazar <[email protected]>

Also avoid allocating memory dce110_set_output_transfer_func if not needed

Change-Id Ica29ab36d1bb47451550e2f6ee0cdf8617c44a48
---
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |  6 +++--
 drivers/gpu/drm/amd/display/dc/dce/dce_opp.c       |  7 +++++
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 30 +++++-----------------
 .../amd/display/dc/dce110/dce110_opp_regamma_v.c   |  7 +++++
 .../gpu/drm/amd/display/dc/dce110/dce110_opp_v.c   |  6 ++++-
 .../gpu/drm/amd/display/dc/dce110/dce110_opp_v.h   |  4 +++
 .../drm/amd/display/dc/dce110/dce110_resource.c    | 17 +++++++++---
 drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h  |  1 -
 drivers/gpu/drm/amd/display/dc/inc/hw/opp.h        |  1 +
 9 files changed, 49 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +4 -2
index bc1f387d1992..47816c5ee0e0 100644
@@ -192,7 +192,8 @@ bool dc_stream_set_cursor_attributes(
 	for (i = 0; i < MAX_PIPES; i++) {
 		struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
 
-		if (pipe_ctx->stream == stream) {
+		if ((pipe_ctx->stream == stream) &&
+			(pipe_ctx->ipp != NULL)) {
 			struct input_pixel_processor *ipp = pipe_ctx->ipp;
 
 			if (ipp->funcs->ipp_cursor_set_attributes(
@@ -231,7 +232,8 @@ bool dc_stream_set_cursor_position(
 	for (i = 0; i < MAX_PIPES; i++) {
 		struct pipe_ctx *pipe_ctx = &res_ctx->pipe_ctx[i];
 
-		if (pipe_ctx->stream == stream) {
+		if ((pipe_ctx->stream == stream) &&
+				(pipe_ctx->ipp != NULL)) {
 			struct input_pixel_processor *ipp = pipe_ctx->ipp;
 			struct dc_cursor_mi_param param = {
 				.pixel_clk_khz = dc_stream->timing.pix_clk_khz,
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c +7 -0
index 167f523df657..061de9e8249d 100644
@@ -973,6 +973,10 @@ bool dce110_opp_construct(struct dce110_opp *opp110,
 
 	opp110->base.inst = inst;
 
+	opp110->base.regamma_params = dm_alloc(sizeof(struct pwl_params));
+	if (opp110->base.regamma_params == NULL)
+		return false;
+
 	opp110->regs = regs;
 	opp110->opp_shift = opp_shift;
 	opp110->opp_mask = opp_mask;
@@ -982,6 +986,9 @@ bool dce110_opp_construct(struct dce110_opp *opp110,
 
 void dce110_opp_destroy(struct output_pixel_processor **opp)
 {
+	dm_free((*opp)->regamma_params);
+	(*opp)->regamma_params = NULL;
+
 	dm_free(FROM_DCE11_OPP(*opp));
 	*opp = NULL;
 }
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +7 -23
index 6e70cf7b99ef..1a9ba127b781 100644
@@ -721,43 +721,27 @@ static bool dce110_set_output_transfer_func(
 	const struct core_stream *stream)
 {
 	struct output_pixel_processor *opp = pipe_ctx->opp;
-	const struct core_gamma *ramp = NULL;
-	struct pwl_params *regamma_params;
-	bool result = false;
-
-	if (surface->public.gamma_correction)
-		ramp = DC_GAMMA_TO_CORE(surface->public.gamma_correction);
-
-	regamma_params = dm_alloc(sizeof(struct pwl_params));
-	if (regamma_params == NULL)
-		goto regamma_alloc_fail;
-
-	regamma_params->hw_points_num = GAMMA_HW_POINTS_NUM;
 
 	opp->funcs->opp_power_on_regamma_lut(opp, true);
+	opp->regamma_params->hw_points_num = GAMMA_HW_POINTS_NUM;
 
 	if (stream->public.out_transfer_func &&
-			stream->public.out_transfer_func->type ==
+		stream->public.out_transfer_func->type ==
 			TF_TYPE_PREDEFINED &&
-			stream->public.out_transfer_func->tf ==
+		stream->public.out_transfer_func->tf ==
 			TRANSFER_FUNCTION_SRGB) {
 		opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_SRGB);
 	} else if (dce110_translate_regamma_to_hw_format(
-			stream->public.out_transfer_func, regamma_params)) {
-		opp->funcs->opp_program_regamma_pwl(opp, regamma_params);
-		opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_USER);
+				stream->public.out_transfer_func, opp->regamma_params)) {
+			opp->funcs->opp_program_regamma_pwl(opp, opp->regamma_params);
+			opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_USER);
 	} else {
 		opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_BYPASS);
 	}
 
 	opp->funcs->opp_power_on_regamma_lut(opp, false);
 
-	result = true;
-
-	dm_free(regamma_params);
-
-regamma_alloc_fail:
-	return result;
+	return true;
 }
 
 static enum dc_status bios_parser_crtc_source_select(
drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_regamma_v.c +7 -0
index 8164aa6bcb00..876445f14c85 100644
@@ -548,3 +548,10 @@ void dce110_opp_power_on_regamma_lut_v(
 
 	dm_write_reg(opp->ctx, mmDCFEV_MEM_PWR_CTRL, value);
 }
+
+void dce110_opp_set_regamma_mode_v(
+	struct output_pixel_processor *opp,
+	enum opp_regamma mode)
+{
+	// TODO: need to implement the function
+}
drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c +5 -1
index 0a9b384303d0..95b3d2eb8428 100644
@@ -42,7 +42,7 @@ static const struct opp_funcs funcs = {
 		.opp_set_csc_default = dce110_opp_v_set_csc_default,
 		.opp_set_csc_adjustment = dce110_opp_v_set_csc_adjustment,
 		.opp_set_dyn_expansion = dce110_opp_set_dyn_expansion,
-		.opp_set_regamma_mode = dce110_opp_set_regamma_mode,
+		.opp_set_regamma_mode = dce110_opp_set_regamma_mode_v,
 		.opp_destroy = dce110_opp_destroy,
 		.opp_program_fmt = dce110_opp_program_fmt,
 		.opp_program_bit_depth_reduction =
@@ -56,6 +56,10 @@ bool dce110_opp_v_construct(struct dce110_opp *opp110,
 
 	opp110->base.ctx = ctx;
 
+	opp110->base.regamma_params = dm_alloc(sizeof(struct pwl_params));
+	if (opp110->base.regamma_params == NULL)
+		return false;
+
 	return true;
 }
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.h +4 -0
index ac5937786ce3..cb26c515d30f 100644
@@ -49,4 +49,8 @@ void dce110_opp_power_on_regamma_lut_v(
 	struct output_pixel_processor *opp,
 	bool power_on);
 
+void dce110_opp_set_regamma_mode_v(
+	struct output_pixel_processor *opp,
+	enum opp_regamma mode);
+
 #endif /* __DC_OPP_DCE110_V_H__ */
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +14 -3
index cfbb4ef21f8b..82cddb6425a0 100644
@@ -1114,14 +1114,22 @@ static const struct resource_funcs dce110_res_pool_funcs = {
 			dce110_resource_build_bit_depth_reduction_params
 };
 
-static void underlay_create(struct dc_context *ctx, struct resource_pool *pool)
+static bool underlay_create(struct dc_context *ctx, struct resource_pool *pool)
 {
 	struct dce110_timing_generator *dce110_tgv = dm_alloc(sizeof (*dce110_tgv));
 	struct dce_transform *dce110_xfmv = dm_alloc(sizeof (*dce110_xfmv));
 	struct dce110_mem_input *dce110_miv = dm_alloc(sizeof (*dce110_miv));
 	struct dce110_opp *dce110_oppv = dm_alloc(sizeof (*dce110_oppv));
 
-	dce110_opp_v_construct(dce110_oppv, ctx);
+	if ((dce110_tgv == NULL) ||
+		(dce110_xfmv == NULL) ||
+		(dce110_miv == NULL) ||
+		(dce110_oppv == NULL))
+			return false;
+
+	if (!dce110_opp_v_construct(dce110_oppv, ctx))
+		return false;
+
 	dce110_timing_generator_v_construct(dce110_tgv, ctx);
 	dce110_mem_input_v_construct(dce110_miv, ctx);
 	dce110_transform_v_construct(dce110_xfmv, ctx);
@@ -1135,6 +1143,8 @@ static void underlay_create(struct dc_context *ctx, struct resource_pool *pool)
 	/* update the public caps to indicate an underlay is available */
 	ctx->dc->caps.max_slave_planes = 1;
 	ctx->dc->caps.max_slave_planes = 1;
+
+	return true;
 }
 
 static void bw_calcs_data_update_from_pplib(struct core_dc *dc)
@@ -1334,7 +1344,8 @@ static bool construct(
 		}
 	}
 
-	underlay_create(ctx, &pool->base);
+	if (!underlay_create(ctx, &pool->base))
+		goto res_create_fail;
 
 	if (!resource_construct(num_virtual_links, dc, &pool->base,
 			&res_create_funcs))
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +0 -1
index 3b0e616f7066..b8735b27e9bc 100644
@@ -65,7 +65,6 @@ struct pwl_result_data {
 };
 
 struct pwl_params {
-	uint32_t *data;
 	struct gamma_curve arr_curve_points[16];
 	struct curve_points arr_points[3];
 	struct pwl_result_data rgb_resulted[256 + 3];
drivers/gpu/drm/amd/display/dc/inc/hw/opp.h +1 -0
index bef5e2cacbe3..a10c4e296960 100644
@@ -202,6 +202,7 @@ enum opp_regamma {
 struct output_pixel_processor {
 	struct dc_context *ctx;
 	uint32_t inst;
+	struct pwl_params *regamma_params;
 	const struct opp_funcs *funcs;
 };
 
Signature · 6 lines
2.9.3

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

PATCH 5/25 drm/amd/display: No audio output heard from DP panel

In reply to a message not in the archive

From: Hersen Wu <[email protected]>

Change-Id I36ffd7bb121067d85d43ab90c9abf62981d50ed7
---
 drivers/gpu/drm/amd/display/dc/dce/dce_audio.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_audio.h +2 -2
index bf97cd8c8221..c244887ba15e 100644
@@ -50,8 +50,8 @@
 		SF(DCCG_AUDIO_DTO_SOURCE, DCCG_AUDIO_DTO_SEL, mask_sh),\
 		SF(DCCG_AUDIO_DTO0_MODULE, DCCG_AUDIO_DTO0_MODULE, mask_sh),\
 		SF(DCCG_AUDIO_DTO0_PHASE, DCCG_AUDIO_DTO0_PHASE, mask_sh),\
-		SF(DCCG_AUDIO_DTO0_MODULE, DCCG_AUDIO_DTO0_MODULE, mask_sh),\
-		SF(DCCG_AUDIO_DTO0_PHASE, DCCG_AUDIO_DTO0_PHASE, mask_sh),\
+		SF(DCCG_AUDIO_DTO1_MODULE, DCCG_AUDIO_DTO1_MODULE, mask_sh),\
+		SF(DCCG_AUDIO_DTO1_PHASE, DCCG_AUDIO_DTO1_PHASE, mask_sh),\
 		SF(AZALIA_F0_CODEC_FUNCTION_PARAMETER_SUPPORTED_SIZE_RATES, AUDIO_RATE_CAPABILITIES, mask_sh),\
 		SF(AZALIA_F0_CODEC_FUNCTION_PARAMETER_POWER_STATES, CLKSTOP, mask_sh),\
 		SF(AZALIA_F0_CODEC_FUNCTION_PARAMETER_POWER_STATES, EPSS, mask_sh)
Signature · 6 lines
2.9.3

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

PATCH 6/25 drm/amd/display: Use pflip prepare and submit parts (v2)

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Use new functions so flip failures can be gracefully handled

v2:
Avoid -EINVAL returned from amdgpu_crtc_prepare_flip in some error cases, it is not allowed according to expected return values for atomic_commit hook.

Change-Id Ie04af6f0c56ee822ddb9f24fb77f367b4e31c620
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c    | 96 +++++++++++++++++++---
 1 file changed, 83 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c +83 -13
index d1a11d93af7a..a26749854ec7 100644
@@ -1647,6 +1647,7 @@ static void clear_unrelated_fields(struct drm_plane_state *state)
 static bool page_flip_needed(
 	const struct drm_plane_state *new_state,
 	const struct drm_plane_state *old_state,
+	struct drm_pending_vblank_event *event,
 	bool commit_surface_required)
 {
 	struct drm_plane_state old_state_tmp;
@@ -1676,7 +1677,7 @@ static bool page_flip_needed(
 	old_state_tmp = *old_state;
 	new_state_tmp = *new_state;
 
-	if (!new_state->crtc->state->event)
+	if (!event)
 		return false;
 
 	amdgpu_fb_old = to_amdgpu_framebuffer(old_state->fb);
@@ -2485,17 +2486,21 @@ int amdgpu_dm_atomic_commit(
 	struct amdgpu_device *adev = dev->dev_private;
 	struct amdgpu_display_manager *dm = &adev->dm;
 	struct drm_plane *plane;
+	struct drm_plane_state *new_plane_state;
 	struct drm_plane_state *old_plane_state;
 	uint32_t i;
 	int32_t ret = 0;
 	uint32_t commit_streams_count = 0;
 	uint32_t new_crtcs_count = 0;
+	uint32_t flip_crtcs_count = 0;
 	struct drm_crtc *crtc;
 	struct drm_crtc_state *old_crtc_state;
-
 	const struct dc_stream *commit_streams[MAX_STREAMS];
 	struct amdgpu_crtc *new_crtcs[MAX_STREAMS];
 	const struct dc_stream *new_stream;
+	struct drm_crtc *flip_crtcs[MAX_STREAMS];
+	struct amdgpu_flip_work *work[MAX_STREAMS] = {0};
+	struct amdgpu_bo *new_abo[MAX_STREAMS] = {0};
 
 	/* In this step all new fb would be pinned */
 
@@ -2511,6 +2516,61 @@ int amdgpu_dm_atomic_commit(
 			return ret;
 	}
 
+	/* Page flip if needed */
+	for_each_plane_in_state(state, plane, new_plane_state, i) {
+		struct drm_plane_state *old_plane_state = plane->state;
+		struct drm_crtc *crtc = new_plane_state->crtc;
+		struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
+		struct drm_framebuffer *fb = new_plane_state->fb;
+		struct drm_crtc_state *crtc_state;
+
+		if (!fb || !crtc)
+			continue;
+
+		crtc_state = drm_atomic_get_crtc_state(state, crtc);
+
+		if (!crtc_state->planes_changed || !crtc_state->active)
+			continue;
+
+		if (page_flip_needed(
+				new_plane_state,
+				old_plane_state,
+				crtc_state->event,
+				false)) {
+			ret = amdgpu_crtc_prepare_flip(crtc,
+							fb,
+							crtc_state->event,
+							acrtc->flip_flags,
+							drm_crtc_vblank_count(crtc),
+							&work[flip_crtcs_count],
+							&new_abo[flip_crtcs_count]);
+
+			if (ret) {
+				/* According to atomic_commit hook API, EINVAL is not allowed */
+				if (unlikely(ret == -EINVAL))
+					ret = -ENOMEM;
+
+				DRM_ERROR("Atomic commit: Flip for  crtc id %d: [%p], "
+									"failed, errno = %d\n",
+									acrtc->crtc_id,
+									acrtc,
+									ret);
+				/* cleanup all flip configurations which
+				 * succeeded in this commit
+				 */
+				for (i = 0; i < flip_crtcs_count; i++)
+					amdgpu_crtc_cleanup_flip_ctx(
+							work[i],
+							new_abo[i]);
+
+				return ret;
+			}
+
+			flip_crtcs[flip_crtcs_count] = crtc;
+			flip_crtcs_count++;
+		}
+	}
+
 	/*
 	 * This is the point of no return - everything below never fails except
 	 * when the hw goes bonghits. Which means we can commit the new state on
@@ -2699,7 +2759,10 @@ int amdgpu_dm_atomic_commit(
 		 * 1. This commit is not a page flip.
 		 * 2. This commit is a page flip, and streams are created.
 		 */
-		if (!page_flip_needed(plane_state, old_plane_state, true) ||
+		if (!page_flip_needed(
+				plane_state,
+				old_plane_state,
+				crtc->state->event, true) ||
 				action == DM_COMMIT_ACTION_DPMS_ON ||
 				action == DM_COMMIT_ACTION_SET) {
 			list_for_each_entry(connector,
@@ -2755,7 +2818,8 @@ int amdgpu_dm_atomic_commit(
 
 	}
 
-	/* Page flip if needed */
+	/* Do actual flip */
+	flip_crtcs_count = 0;
 	for_each_plane_in_state(state, plane, old_plane_state, i) {
 		struct drm_plane_state *plane_state = plane->state;
 		struct drm_crtc *crtc = plane_state->crtc;
@@ -2766,16 +2830,19 @@ int amdgpu_dm_atomic_commit(
 			!crtc->state->active)
 			continue;
 
-		if (page_flip_needed(plane_state, old_plane_state, false)) {
-			ret = amdgpu_crtc_page_flip_target(crtc,
-							   fb,
-							   crtc->state->event,
-							   acrtc->flip_flags,
-							   drm_crtc_vblank_count(crtc));
+		if (page_flip_needed(
+				plane_state,
+				old_plane_state,
+				crtc->state->event,
+				false)) {
+				amdgpu_crtc_submit_flip(
+							crtc,
+						    fb,
+						    work[flip_crtcs_count],
+						    new_abo[i]);
+				 flip_crtcs_count++;
 			/*clean up the flags for next usage*/
 			acrtc->flip_flags = 0;
-			if (ret)
-				return ret;
 		}
 	}
 
@@ -3127,6 +3194,8 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 			struct drm_connector *connector;
 			struct dm_connector_state *dm_state = NULL;
 			enum dm_commit_action action;
+			struct drm_crtc_state *crtc_state;
+
 
 			if (!fb || !crtc || crtc_set[i] != crtc ||
 				!crtc->state->planes_changed || !crtc->state->active)
@@ -3138,8 +3207,9 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 			 * 1. This commit is not a page flip.
 			 * 2. This commit is a page flip, and streams are created.
 			 */
+			crtc_state = drm_atomic_get_crtc_state(state, crtc);
 			if (!page_flip_needed(plane_state, old_plane_state,
-					      true) ||
+					crtc_state->event, true) ||
 					action == DM_COMMIT_ACTION_DPMS_ON ||
 					action == DM_COMMIT_ACTION_SET) {
 				struct dc_surface *surface;
Signature · 6 lines
2.9.3

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

PATCH 7/25 drm/amd/display: mode change without breaking unaffected streams

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- include clock constraint logic in validate
- in dc_commit_streams, include surfaces of unaffected streams

Change-Id I43488ffa9002bd00740a4edb39c362b0257bdb11
---
 drivers/gpu/drm/amd/display/dc/core/dc.c          | 11 +++++++++--
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c |  2 +-
 drivers/gpu/drm/amd/display/dc/inc/core_status.h  |  2 ++
 3 files changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +9 -2
index 948f82a56472..9deddc8ee2d1 100644
@@ -1007,7 +1007,7 @@ bool dc_commit_streams(
 	struct dc_bios *dcb = core_dc->ctx->dc_bios;
 	enum dc_status result = DC_ERROR_UNEXPECTED;
 	struct validate_context *context;
-	struct dc_validation_set set[MAX_STREAMS];
+	struct dc_validation_set set[MAX_STREAMS] = { 0 };
 	int i, j, k;
 
 	if (false == streams_changed(core_dc, streams, stream_count))
@@ -1018,13 +1018,20 @@ bool dc_commit_streams(
 
 	for (i = 0; i < stream_count; i++) {
 		const struct dc_stream *stream = streams[i];
+		const struct dc_stream_status *status = dc_stream_get_status(stream);
+		int j;
 
 		dc_stream_log(stream,
 				core_dc->ctx->logger,
 				LOG_DC);
 
 		set[i].stream = stream;
-		set[i].surface_count = 0;
+
+		if (status) {
+			set[i].surface_count = status->surface_count;
+			for (j = 0; j < status->surface_count; j++)
+				set[i].surfaces[j] = status->surfaces[j];
+		}
 
 	}
 
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
index 1f87b948678b..6037ee25598c 100644
@@ -585,7 +585,7 @@ enum dc_status resource_build_scaling_params_for_context(
 			if (!resource_build_scaling_params(
 				&context->res_ctx.pipe_ctx[i].surface->public,
 				&context->res_ctx.pipe_ctx[i]))
-				return DC_FAIL_BANDWIDTH_VALIDATE;
+				return DC_FAIL_SCALING;
 	}
 
 	return DC_OK;
drivers/gpu/drm/amd/display/dc/inc/core_status.h +2 -0
index 32a2cc712000..147eb7cac701 100644
@@ -40,6 +40,8 @@ enum dc_status {
 	DC_EXCEED_DONGLE_MAX_CLK,
 	DC_SURFACE_PIXEL_FORMAT_UNSUPPORTED,
 	DC_FAIL_BANDWIDTH_VALIDATE, /* BW and Watermark validation */
+	DC_FAIL_SCALING,
+	DC_FAIL_CLK_CONSTRAINT,
 
 	DC_ERROR_UNEXPECTED = -1
 };
Signature · 6 lines
2.9.3

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

PATCH 8/25 drm/amd/display: assert if mask is 0 in set_reg_field_value_ex

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- mask = 0 means something is wrong in caller and no register field will be updated

Change-Id Ib30c28ca30f574c703cd3b6acc42e5a401a9aff0
---
 drivers/gpu/drm/amd/display/dc/dm_services.h | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dm_services.h +1 -0
index 11a0abfd3418..052a43af1bd3 100644
@@ -165,6 +165,7 @@ static inline uint32_t set_reg_field_value_ex(
 	uint32_t mask,
 	uint8_t shift)
 {
+	ASSERT(mask != 0);
 	return (reg_value & ~mask) | (mask & (value << shift));
 }
 
Signature · 6 lines
2.9.3

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

PATCH 9/25 drm/amd/display: remove un-used defines and dead code

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id Ib32be9d265062d862557568b19160d7a866bb454
---
 .../gpu/drm/amd/display/dc/basics/signal_types.c   |  35 -------
 .../gpu/drm/amd/display/dc/bios/command_table.c    |  55 ----------
 .../gpu/drm/amd/display/dc/bios/command_table.h    |   3 -
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      |   1 -
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |   2 +-
 .../display/include/asic_capability_interface.h    |  55 ----------
 .../amd/display/include/asic_capability_types.h    | 116 ---------------------
 .../drm/amd/display/include/bios_parser_types.h    |   8 --
 .../drm/amd/display/include/ddc_service_types.h    |   7 --
 .../gpu/drm/amd/display/include/irq_interface.h    |  31 ------
 .../drm/amd/display/include/link_service_types.h   |  75 -------------
 drivers/gpu/drm/amd/display/include/signal_types.h |   3 -
 12 files changed, 1 insertion(+), 390 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/include/asic_capability_interface.h
 delete mode 100644 drivers/gpu/drm/amd/display/include/asic_capability_types.h
 delete mode 100644 drivers/gpu/drm/amd/display/include/irq_interface.h
drivers/gpu/drm/amd/display/dc/basics/signal_types.c +0 -35
index 44447e07803a..247487c3db71 100644
@@ -44,23 +44,6 @@ bool dc_is_dp_signal(enum signal_type signal)
 		signal == SIGNAL_TYPE_DISPLAY_PORT_MST);
 }
 
-bool dc_is_dp_external_signal(enum signal_type signal)
-{
-	return (signal == SIGNAL_TYPE_DISPLAY_PORT ||
-		signal == SIGNAL_TYPE_DISPLAY_PORT_MST);
-}
-
-bool dc_is_analog_signal(enum signal_type signal)
-{
-	switch (signal) {
-	case SIGNAL_TYPE_RGB:
-		return true;
-	break;
-	default:
-		return false;
-	}
-}
-
 bool dc_is_embedded_signal(enum signal_type signal)
 {
 	return (signal == SIGNAL_TYPE_EDP || signal == SIGNAL_TYPE_LVDS);
@@ -96,21 +79,3 @@ bool dc_is_audio_capable_signal(enum signal_type signal)
 		signal == SIGNAL_TYPE_WIRELESS);
 }
 
-/*
- * @brief
- * Returns whether the signal is compatible
- * with other digital encoder signal types.
- * This is true for DVI, LVDS, and HDMI signal types.
- */
-bool dc_is_digital_encoder_compatible_signal(enum signal_type signal)
-{
-	switch (signal) {
-	case SIGNAL_TYPE_DVI_SINGLE_LINK:
-	case SIGNAL_TYPE_DVI_DUAL_LINK:
-	case SIGNAL_TYPE_HDMI_TYPE_A:
-	case SIGNAL_TYPE_LVDS:
-		return true;
-	default:
-		return false;
-	}
-}
drivers/gpu/drm/amd/display/dc/bios/command_table.c +0 -55

73 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/bios/command_table.h +0 -3
index e1cd21b6e968..b8e6ef06c0c7 100644
@@ -75,9 +75,6 @@ struct cmd_tbl {
 	enum bp_result (*set_crtc_timing)(
 		struct bios_parser *bp,
 		struct bp_hw_crtc_timing_parameters *bp_params);
-	enum bp_result (*set_crtc_overscan)(
-		struct bios_parser *bp,
-		struct bp_hw_crtc_overscan_parameters *bp_params);
 	enum bp_result (*select_crtc_source)(
 		struct bios_parser *bp,
 		struct bp_crtc_source_select *bp_params);
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -1
index b0f316344e86..62cfc5cbe773 100644
@@ -38,7 +38,6 @@
 #include "hw_sequencer.h"
 #include "resource.h"
 #include "fixed31_32.h"
-#include "include/asic_capability_interface.h"
 #include "dpcd_defs.h"
 
 #include "dce/dce_11_0_d.h"
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +1 -1
index 3d5871dfc8e6..bc0667d55cf0 100644
@@ -1922,7 +1922,7 @@ static void get_active_converter_info(
 		break;
 	}
 
-	if (link->dpcd_caps.dpcd_rev.raw >= DCS_DPCD_REV_11) {
+	if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_11) {
 		uint8_t det_caps[4];
 		union dwnstream_port_caps_byte0 *port_caps =
 			(union dwnstream_port_caps_byte0 *)det_caps;
drivers/gpu/drm/amd/display/include/asic_capability_interface.h deleted +0 -55

55 lines not on this page · raw message

drivers/gpu/drm/amd/display/include/asic_capability_types.h deleted +0 -116

116 lines not on this page · raw message

drivers/gpu/drm/amd/display/include/bios_parser_types.h +0 -8
index 9ab9065735f7..7de4fa5a0726 100644
@@ -190,14 +190,6 @@ struct bp_hw_crtc_timing_parameters {
 	} flags;
 };
 
-struct bp_hw_crtc_overscan_parameters {
-	enum controller_id controller_id;
-	uint32_t h_overscan_left;
-	uint32_t h_overscan_right;
-	uint32_t v_overscan_top;
-	uint32_t v_overscan_bottom;
-};
-
 struct bp_adjust_pixel_clock_parameters {
 	/* Input: Signal Type - to be converted to Encoder mode */
 	enum signal_type signal_type;
drivers/gpu/drm/amd/display/include/ddc_service_types.h +0 -7
index 0a6ba91e3eba..effe03b8f418 100644
@@ -52,12 +52,6 @@ enum ddc_service_type {
 	DDC_SERVICE_TYPE_DISPLAY_PORT_MST,
 };
 
-enum dcs_dpcd_revision {
-	DCS_DPCD_REV_10 = 0x10,
-	DCS_DPCD_REV_11 = 0x11,
-	DCS_DPCD_REV_12 = 0x12
-};
-
 /**
  * display sink capability
  */
@@ -97,7 +91,6 @@ struct display_sink_capability {
 	uint32_t dp_link_rate;
 	uint32_t dp_link_spead;
 
-	enum dcs_dpcd_revision dpcd_revision;
 	/* If dongle_type == DISPLAY_DONGLE_DP_HDMI_CONVERTER,
 	indicates 'Frame Sequential-to-lllFrame Pack' conversion capability.*/
 	bool is_dp_hdmi_s3d_converter;
drivers/gpu/drm/amd/display/include/irq_interface.h deleted +0 -31
deleted file mode 100644
index 077ded3fbedd..000000000000
@@ -1,31 +0,0 @@
-/*
- * Copyright 2012-15 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: AMD
- *
- */
-
-#ifndef __DAL_IRQ_INTERFACE_H__
-#define __DAL_IRQ_INTERFACE_H__
-
-#include "gpio_types.h"
-
-#endif
drivers/gpu/drm/amd/display/include/link_service_types.h +0 -75

98 lines not on this page · raw message

drivers/gpu/drm/amd/display/include/signal_types.h +0 -3
index a50f7ed74a33..d87f84a56fcc 100644
@@ -47,13 +47,10 @@ enum signal_type {
 bool dc_is_hdmi_signal(enum signal_type signal);
 bool dc_is_dp_sst_signal(enum signal_type signal);
 bool dc_is_dp_signal(enum signal_type signal);
-bool dc_is_dp_external_signal(enum signal_type signal);
-bool dc_is_analog_signal(enum signal_type signal);
 bool dc_is_embedded_signal(enum signal_type signal);
 bool dc_is_dvi_signal(enum signal_type signal);
 bool dc_is_dvi_single_link_signal(enum signal_type signal);
 bool dc_is_dual_link_signal(enum signal_type signal);
 bool dc_is_audio_capable_signal(enum signal_type signal);
-bool dc_is_digital_encoder_compatible_signal(enum signal_type signal);
 
 #endif
Signature · 6 lines
2.9.3

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

PATCH 10/25 drm/amd/display: remove hw_crtc_timing

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id Id5c632c474a1643825c0bedbaf8be9c12bb36dca
---
 .../drm/amd/display/dc/dce/dce_stream_encoder.c    |  2 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  2 +-
 .../gpu/drm/amd/display/dc/inc/hw/stream_encoder.h |  2 +-
 .../drm/amd/display/include/hw_sequencer_types.h   | 40 ----------------------
 4 files changed, 3 insertions(+), 43 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +1 -1
index c510e95eb948..7e6661bda970 100644
@@ -681,7 +681,7 @@ static void dce110_stream_encoder_dp_unblank(
 
 		uint64_t m_vid_l = n_vid;
 
-		m_vid_l *= param->crtc_timing.pixel_clock;
+		m_vid_l *= param->pixel_clk_khz;
 		m_vid_l = div_u64(m_vid_l,
 			param->link_settings.link_rate
 				* LINK_RATE_REF_FREQ_IN_KHZ);
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
index 1a9ba127b781..b51668e3bb52 100644
@@ -886,7 +886,7 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,
 	struct encoder_unblank_param params = { { 0 } };
 
 	/* only 3 items below are used by unblank */
-	params.crtc_timing.pixel_clock =
+	params.pixel_clk_khz =
 		pipe_ctx->stream->public.timing.pix_clk_khz;
 	params.link_settings.link_rate = link_settings->link_rate;
 	pipe_ctx->stream_enc->funcs->dp_unblank(pipe_ctx->stream_enc, &params);
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +1 -1
index cb369af29d69..674bebfe3bd2 100644
@@ -36,8 +36,8 @@ struct encoder_info_frame {
 };
 
 struct encoder_unblank_param {
-	struct hw_crtc_timing crtc_timing;
 	struct dc_link_settings link_settings;
+	unsigned int pixel_clk_khz;
 };
 
 struct encoder_set_dp_phy_pattern_param {
drivers/gpu/drm/amd/display/include/hw_sequencer_types.h +0 -40
index 6bbca1b4d736..f99a03266149 100644
@@ -40,46 +40,6 @@ struct drr_params {
 	uint32_t vertical_total_max;
 };
 
-/* CRTC timing structure */
-struct hw_crtc_timing {
-	uint32_t h_total;
-	uint32_t h_addressable;
-	uint32_t h_overscan_left;
-	uint32_t h_overscan_right;
-	uint32_t h_sync_start;
-	uint32_t h_sync_width;
-
-	uint32_t v_total;
-	uint32_t v_addressable;
-	uint32_t v_overscan_top;
-	uint32_t v_overscan_bottom;
-	uint32_t v_sync_start;
-	uint32_t v_sync_width;
-
-	/* in KHz */
-	uint32_t pixel_clock;
-
-	struct {
-		uint32_t INTERLACED:1;
-		uint32_t DOUBLESCAN:1;
-		uint32_t PIXEL_REPETITION:4; /* 1...10 */
-		uint32_t HSYNC_POSITIVE_POLARITY:1;
-		uint32_t VSYNC_POSITIVE_POLARITY:1;
-		/* frame should be packed for 3D
-		 * (currently this refers to HDMI 1.4a FramePacking format */
-		uint32_t HORZ_COUNT_BY_TWO:1;
-		uint32_t PACK_3D_FRAME:1;
-		/* 0 - left eye polarity, 1 - right eye polarity */
-		uint32_t RIGHT_EYE_3D_POLARITY:1;
-		/* DVI-DL High-Color mode */
-		uint32_t HIGH_COLOR_DL_MODE:1;
-		uint32_t Y_ONLY:1;
-		/* HDMI 2.0 - Support scrambling for TMDS character
-		 * rates less than or equal to 340Mcsc */
-		uint32_t LTE_340MCSC_SCRAMBLE:1;
-	} flags;
-};
-
 /* TODO hw_info_frame and hw_info_packet structures are same as in encoder
  * merge it*/
 struct hw_info_packet {
Signature · 6 lines
2.9.3

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

PATCH 11/25 drm/amd/display: remove hw_info_frame

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- construct using encoder_info_frame directly

Change-Id I95a2cdb6cdeaccea8c87c9c3ff6be9673ba65afe
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 124 +++++++--------------
 .../drm/amd/display/include/hw_sequencer_types.h   |  23 ----
 2 files changed, 40 insertions(+), 107 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +40 -84
index 6037ee25598c..fe79a2890247 100644
@@ -1211,70 +1211,27 @@ void validate_guaranteed_copy_streams(
 	}
 }
 
-static void translate_info_frame(const struct hw_info_frame *hw_info_frame,
-	struct encoder_info_frame *encoder_info_frame)
+static void patch_gamut_packet_checksum(
+		struct encoder_info_packet *gamut_packet)
 {
-	memset(
-		encoder_info_frame, 0, sizeof(struct encoder_info_frame));
-
 	/* For gamut we recalc checksum */
-	if (hw_info_frame->gamut_packet.valid) {
+	if (gamut_packet->valid) {
 		uint8_t chk_sum = 0;
 		uint8_t *ptr;
 		uint8_t i;
 
-		memmove(
-						&encoder_info_frame->gamut,
-						&hw_info_frame->gamut_packet,
-						sizeof(struct hw_info_packet));
-
 		/*start of the Gamut data. */
-		ptr = &encoder_info_frame->gamut.sb[3];
+		ptr = &gamut_packet->sb[3];
 
-		for (i = 0; i <= encoder_info_frame->gamut.sb[1]; i++)
+		for (i = 0; i <= gamut_packet->sb[1]; i++)
 			chk_sum += ptr[i];
 
-		encoder_info_frame->gamut.sb[2] = (uint8_t) (0x100 - chk_sum);
-	}
-
-	if (hw_info_frame->avi_info_packet.valid) {
-		memmove(
-						&encoder_info_frame->avi,
-						&hw_info_frame->avi_info_packet,
-						sizeof(struct hw_info_packet));
-	}
-
-	if (hw_info_frame->vendor_info_packet.valid) {
-		memmove(
-						&encoder_info_frame->vendor,
-						&hw_info_frame->vendor_info_packet,
-						sizeof(struct hw_info_packet));
-	}
-
-	if (hw_info_frame->spd_packet.valid) {
-		memmove(
-						&encoder_info_frame->spd,
-						&hw_info_frame->spd_packet,
-						sizeof(struct hw_info_packet));
-	}
-
-	if (hw_info_frame->vsc_packet.valid) {
-		memmove(
-						&encoder_info_frame->vsc,
-						&hw_info_frame->vsc_packet,
-						sizeof(struct hw_info_packet));
-	}
-
-	if (hw_info_frame->hdrsmd_packet.valid) {
-		memmove(
-						&encoder_info_frame->hdrsmd,
-						&hw_info_frame->hdrsmd_packet,
-						sizeof(struct hw_info_packet));
+		gamut_packet->sb[2] = (uint8_t) (0x100 - chk_sum);
 	}
 }
 
 static void set_avi_info_frame(
-	struct hw_info_packet *info_packet,
+		struct encoder_info_packet *info_packet,
 		struct pipe_ctx *pipe_ctx)
 {
 	struct core_stream *stream = pipe_ctx->stream;
@@ -1288,9 +1245,6 @@ static void set_avi_info_frame(
 	uint8_t *check_sum = NULL;
 	uint8_t byte_index = 0;
 
-	if (info_packet == NULL)
-		return;
-
 	color_space = pipe_ctx->stream->public.output_color_space;
 
 	/* Initialize header */
@@ -1458,8 +1412,9 @@ static void set_avi_info_frame(
 	info_packet->valid = true;
 }
 
-static void set_vendor_info_packet(struct core_stream *stream,
-		struct hw_info_packet *info_packet)
+static void set_vendor_info_packet(
+		struct encoder_info_packet *info_packet,
+		struct core_stream *stream)
 {
 	uint32_t length = 0;
 	bool hdmi_vic_mode = false;
@@ -1467,9 +1422,6 @@ static void set_vendor_info_packet(struct core_stream *stream,
 	uint32_t i = 0;
 	enum dc_timing_3d_format format;
 
-	ASSERT_CRITICAL(stream != NULL);
-	ASSERT_CRITICAL(info_packet != NULL);
-
 	format = stream->public.timing.timing_3d_format;
 
 	/* Can be different depending on packet content */
@@ -1567,8 +1519,9 @@ static void set_vendor_info_packet(struct core_stream *stream,
 	info_packet->valid = true;
 }
 
-static void set_spd_info_packet(struct core_stream *stream,
-		struct hw_info_packet *info_packet)
+static void set_spd_info_packet(
+		struct encoder_info_packet *info_packet,
+		struct core_stream *stream)
 {
 	/* SPD info packet for FreeSync */
 
@@ -1688,9 +1641,9 @@ static void set_spd_info_packet(struct core_stream *stream,
 }
 
 static void set_hdr_static_info_packet(
+		struct encoder_info_packet *info_packet,
 		struct core_surface *surface,
-		struct core_stream *stream,
-		struct hw_info_packet *info_packet)
+		struct core_stream *stream)
 {
 	uint16_t i = 0;
 	enum signal_type signal = stream->signal;
@@ -1791,8 +1744,9 @@ static void set_hdr_static_info_packet(
 	}
 }
 
-static void set_vsc_info_packet(struct core_stream *stream,
-		struct hw_info_packet *info_packet)
+static void set_vsc_info_packet(
+		struct encoder_info_packet *info_packet,
+		struct core_stream *stream)
 {
 	unsigned int vscPacketRevision = 0;
 	unsigned int i;
@@ -1894,36 +1848,38 @@ struct clock_source *dc_resource_find_first_free_pll(
 void resource_build_info_frame(struct pipe_ctx *pipe_ctx)
 {
 	enum signal_type signal = SIGNAL_TYPE_NONE;
-	struct hw_info_frame info_frame = { { 0 } };
+	struct encoder_info_frame *info = &pipe_ctx->encoder_info_frame;
 
 	/* default all packets to invalid */
-	info_frame.avi_info_packet.valid = false;
-	info_frame.gamut_packet.valid = false;
-	info_frame.vendor_info_packet.valid = false;
-	info_frame.spd_packet.valid = false;
-	info_frame.vsc_packet.valid = false;
-	info_frame.hdrsmd_packet.valid = false;
+	info->avi.valid = false;
+	info->gamut.valid = false;
+	info->vendor.valid = false;
+	info->hdrsmd.valid = false;
+	info->vsc.valid = false;
 
 	signal = pipe_ctx->stream->signal;
 
 	/* HDMi and DP have different info packets*/
 	if (dc_is_hdmi_signal(signal)) {
-		set_avi_info_frame(
-			&info_frame.avi_info_packet, pipe_ctx);
-		set_vendor_info_packet(
-			pipe_ctx->stream, &info_frame.vendor_info_packet);
-		set_spd_info_packet(pipe_ctx->stream, &info_frame.spd_packet);
-		set_hdr_static_info_packet(pipe_ctx->surface,
-				pipe_ctx->stream, &info_frame.hdrsmd_packet);
+		set_avi_info_frame(&info->avi, pipe_ctx);
+
+		set_vendor_info_packet(&info->vendor, pipe_ctx->stream);
+
+		set_spd_info_packet(&info->spd, pipe_ctx->stream);
+
+		set_hdr_static_info_packet(&info->hdrsmd,
+				pipe_ctx->surface, pipe_ctx->stream);
+
 	} else if (dc_is_dp_signal(signal)) {
-		set_vsc_info_packet(pipe_ctx->stream, &info_frame.vsc_packet);
-		set_spd_info_packet(pipe_ctx->stream, &info_frame.spd_packet);
-		set_hdr_static_info_packet(pipe_ctx->surface,
-				pipe_ctx->stream, &info_frame.hdrsmd_packet);
+		set_vsc_info_packet(&info->vsc, pipe_ctx->stream);
+
+		set_spd_info_packet(&info->spd, pipe_ctx->stream);
+
+		set_hdr_static_info_packet(&info->hdrsmd,
+				pipe_ctx->surface, pipe_ctx->stream);
 	}
 
-	translate_info_frame(&info_frame,
-			&pipe_ctx->encoder_info_frame);
+	patch_gamut_packet_checksum(&info->gamut);
 }
 
 enum dc_status resource_map_clock_resources(
drivers/gpu/drm/amd/display/include/hw_sequencer_types.h +0 -23
index f99a03266149..6f0475c25566 100644
@@ -40,27 +40,4 @@ struct drr_params {
 	uint32_t vertical_total_max;
 };
 
-/* TODO hw_info_frame and hw_info_packet structures are same as in encoder
- * merge it*/
-struct hw_info_packet {
-	bool valid;
-	uint8_t hb0;
-	uint8_t hb1;
-	uint8_t hb2;
-	uint8_t hb3;
-	uint8_t sb[32];
-};
-
-struct hw_info_frame {
-	/* Auxiliary Video Information */
-	struct hw_info_packet avi_info_packet;
-	struct hw_info_packet gamut_packet;
-	struct hw_info_packet vendor_info_packet;
-	/* Source Product Description */
-	struct hw_info_packet spd_packet;
-	/* Video Stream Configuration */
-	struct hw_info_packet vsc_packet;
-	struct hw_info_packet hdrsmd_packet;
-};
-
 #endif
Signature · 6 lines
2.9.3

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

PATCH 12/25 drm/amd/display: remove SIGNAL_TYPE_WIRELESS

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id I67199dfb44db442aee25ebc73dea50e5c935bb84
---
 drivers/gpu/drm/amd/display/dc/basics/log_helpers.c   | 1 -
 drivers/gpu/drm/amd/display/dc/basics/signal_types.c  | 3 +--
 drivers/gpu/drm/amd/display/dc/core/dc_link.c         | 3 ---
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 1 -
 drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h  | 1 -
 drivers/gpu/drm/amd/display/include/signal_types.h    | 4 ----
 6 files changed, 1 insertion(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/basics/log_helpers.c +0 -1
index 61f36a7f322b..c4eddee8de1b 100644
@@ -44,7 +44,6 @@ static const struct dc_signal_type_info signal_type_info_tbl[] = {
 		{SIGNAL_TYPE_DISPLAY_PORT,     "DP"},
 		{SIGNAL_TYPE_DISPLAY_PORT_MST, "MST"},
 		{SIGNAL_TYPE_EDP,              "eDP"},
-		{SIGNAL_TYPE_WIRELESS,         "Wireless"},
 		{SIGNAL_TYPE_VIRTUAL,          "Virtual"}
 };
 
drivers/gpu/drm/amd/display/dc/basics/signal_types.c +1 -2
index 247487c3db71..534c803e7091 100644
@@ -75,7 +75,6 @@ bool dc_is_audio_capable_signal(enum signal_type signal)
 {
 	return (signal == SIGNAL_TYPE_DISPLAY_PORT ||
 		signal == SIGNAL_TYPE_DISPLAY_PORT_MST ||
-		dc_is_hdmi_signal(signal) ||
-		signal == SIGNAL_TYPE_WIRELESS);
+		dc_is_hdmi_signal(signal));
 }
 
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -3
index 62cfc5cbe773..f4f46d4f0cf0 100644
@@ -1051,9 +1051,6 @@ static bool construct(
 		if (link->device_tag.dev_id.device_type == DEVICE_TYPE_LCD
 			&& link->public.connector_signal == SIGNAL_TYPE_RGB)
 			continue;
-		if (link->device_tag.dev_id.device_type == DEVICE_TYPE_WIRELESS
-			&& link->public.connector_signal != SIGNAL_TYPE_WIRELESS)
-			continue;
 		break;
 	}
 
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +0 -1
index 930ae1377ab6..e9d1a54bffd3 100644
@@ -941,7 +941,6 @@ bool dce110_link_encoder_construct(
 
 	enc110->base.hpd_source = init_data->hpd_source;
 	enc110->base.connector = init_data->connector;
-	enc110->base.input_signals = SIGNAL_TYPE_ALL;
 
 	enc110->base.preferred_engine = ENGINE_ID_UNKNOWN;
 
drivers/gpu/drm/amd/display/dc/inc/hw/link_encoder.h +0 -1
index 49c4b6587456..ac4010b9c638 100644
@@ -186,7 +186,6 @@ struct link_encoder {
 	struct dc_context *ctx;
 	struct graphics_object_id id;
 	struct graphics_object_id connector;
-	uint32_t input_signals;
 	uint32_t output_signals;
 	enum engine_id preferred_engine;
 	struct encoder_feature_support features;
drivers/gpu/drm/amd/display/include/signal_types.h +0 -4
index d87f84a56fcc..1a2ca53c68cd 100644
@@ -36,11 +36,7 @@ enum signal_type {
 	SIGNAL_TYPE_DISPLAY_PORT	= (1 << 5),
 	SIGNAL_TYPE_DISPLAY_PORT_MST	= (1 << 6),
 	SIGNAL_TYPE_EDP			= (1 << 7),
-	SIGNAL_TYPE_WIRELESS		= (1 << 8),	/* Wireless Display */
 	SIGNAL_TYPE_VIRTUAL		= (1 << 9),	/* Virtual Display */
-
-	SIGNAL_TYPE_COUNT		= 10,
-	SIGNAL_TYPE_ALL			= (1 << SIGNAL_TYPE_COUNT) - 1
 };
 
 /* help functions for signal types manipulation */
Signature · 6 lines
2.9.3

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

PATCH 13/25 drm/amd/display: remove dead code

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

Change-Id I8d7266d9542132b2a4406eb7591a75769998e984
---
 drivers/gpu/drm/amd/display/dc/bios/bios_parser.c  |  76 --------------
 .../gpu/drm/amd/display/dc/bios/command_table.c    | 114 ---------------------
 .../gpu/drm/amd/display/dc/bios/command_table.h    |   7 --
 drivers/gpu/drm/amd/display/dc/dc_bios_types.h     |   6 --
 .../drm/amd/display/include/bios_parser_types.h    |  20 ----
 5 files changed, 223 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser.c +0 -76
index ebd2e419f8f2..656c39ac0256 100644
@@ -545,80 +545,6 @@ static enum bp_result bios_parser_get_hpd_info(struct dc_bios *dcb,
 	return BP_RESULT_NORECORD;
 }
 
-static uint32_t bios_parser_get_gpio_record(
-	struct dc_bios *dcb,
-	struct graphics_object_id id,
-	struct bp_gpio_cntl_info *gpio_record,
-	uint32_t record_size)
-{
-	struct bios_parser *bp = BP_FROM_DCB(dcb);
-	ATOM_COMMON_RECORD_HEADER *header = NULL;
-	ATOM_OBJECT_GPIO_CNTL_RECORD *record = NULL;
-	ATOM_OBJECT *object = get_bios_object(bp, id);
-	uint32_t offset;
-	uint32_t pins_number;
-	uint32_t i;
-
-	if (!object)
-		return 0;
-
-	/* Initialise offset */
-	offset = le16_to_cpu(object->usRecordOffset)
-			+ bp->object_info_tbl_offset;
-
-	for (;;) {
-		/* Get record header */
-		header = GET_IMAGE(ATOM_COMMON_RECORD_HEADER, offset);
-		if (!header || header->ucRecordType == LAST_RECORD_TYPE ||
-			!header->ucRecordSize)
-			break;
-
-		/* If this is gpio control record - stop. We found the record */
-		if (header->ucRecordType == ATOM_OBJECT_GPIO_CNTL_RECORD_TYPE
-			&& header->ucRecordSize
-				>= sizeof(ATOM_OBJECT_GPIO_CNTL_RECORD)) {
-			record = (ATOM_OBJECT_GPIO_CNTL_RECORD *) header;
-			break;
-		}
-
-		/* Advance to next record */
-		offset += header->ucRecordSize;
-	}
-
-	/* If we did not find a record - return */
-	if (!record)
-		return 0;
-
-	/* Extract gpio IDs from bios record (make sure we do not exceed passed
-	 *  array size) */
-	pins_number = (record->ucNumberOfPins < record_size ?
-			record->ucNumberOfPins : record_size);
-	for (i = 0; i < pins_number; i++) {
-		uint8_t output_state = ((record->asGpio[i].ucGPIO_PinState
-			& GPIO_PIN_OUTPUT_STATE_MASK)
-			>> GPIO_PIN_OUTPUT_STATE_SHIFT);
-		gpio_record[i].id = record->asGpio[i].ucGPIOID;
-
-		switch (output_state) {
-		case GPIO_PIN_STATE_ACTIVE_LOW:
-			gpio_record[i].state =
-				GPIO_PIN_OUTPUT_STATE_ACTIVE_LOW;
-			break;
-
-		case GPIO_PIN_STATE_ACTIVE_HIGH:
-			gpio_record[i].state =
-				GPIO_PIN_OUTPUT_STATE_ACTIVE_HIGH;
-			break;
-
-		default:
-			BREAK_TO_DEBUGGER(); /* Invalid Pin Output State */
-			break;
-		}
-	}
-
-	return pins_number;
-}
-
 enum bp_result bios_parser_get_device_tag_record(
 	struct bios_parser *bp,
 	ATOM_OBJECT *object,
@@ -4064,8 +3990,6 @@ static const struct dc_vbios_funcs vbios_funcs = {
 
 	.get_dst_number = bios_parser_get_dst_number,
 
-	.get_gpio_record = bios_parser_get_gpio_record,
-
 	.get_src_obj = bios_parser_get_src_obj,
 
 	.get_dst_obj = bios_parser_get_dst_obj,
drivers/gpu/drm/amd/display/dc/bios/command_table.c +0 -114

147 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/bios/command_table.h +0 -7
index b8e6ef06c0c7..94f3d43a7471 100644
@@ -68,10 +68,6 @@ struct cmd_tbl {
 	enum bp_result (*dac2_output_control)(
 		struct bios_parser *bp,
 		bool enable);
-	enum bp_result (*blank_crtc)(
-		struct bios_parser *bp,
-		struct bp_blank_crtc_parameters *bp_params,
-		bool blank);
 	enum bp_result (*set_crtc_timing)(
 		struct bios_parser *bp,
 		struct bp_hw_crtc_timing_parameters *bp_params);
@@ -89,9 +85,6 @@ struct cmd_tbl {
 	enum bp_result (*program_clock)(
 		struct bios_parser *bp,
 		struct bp_pixel_clock_parameters *bp_params);
-	enum bp_result (*compute_memore_engine_pll)(
-		struct bios_parser *bp,
-		struct bp_display_clock_parameters *bp_params);
 	enum bp_result (*external_encoder_control)(
 			struct bios_parser *bp,
 			struct bp_external_encoder_control *cntl);
drivers/gpu/drm/amd/display/dc/dc_bios_types.h +0 -6
index 790c5bd51cb9..6e1291d5f51d 100644
@@ -51,12 +51,6 @@ struct dc_vbios_funcs {
 		struct dc_bios *bios,
 		struct graphics_object_id id);
 
-	uint32_t (*get_gpio_record)(
-		struct dc_bios *dcb,
-		struct graphics_object_id id,
-		struct bp_gpio_cntl_info *gpio_record,
-		uint32_t record_size);
-
 	enum bp_result (*get_src_obj)(
 		struct dc_bios *bios,
 		struct graphics_object_id object_id, uint32_t index,
drivers/gpu/drm/amd/display/include/bios_parser_types.h +0 -20
index 7de4fa5a0726..0840f69cde99 100644
@@ -156,13 +156,6 @@ struct bp_transmitter_control {
 	bool single_pll_mode;
 };
 
-struct bp_blank_crtc_parameters {
-	enum controller_id controller_id;
-	uint32_t black_color_rcr;
-	uint32_t black_color_gy;
-	uint32_t black_color_bcb;
-};
-
 struct bp_hw_crtc_timing_parameters {
 	enum controller_id controller_id;
 	/* horizontal part */
@@ -252,14 +245,6 @@ struct bp_pixel_clock_parameters {
 	} flags;
 };
 
-struct bp_display_clock_parameters {
-	uint32_t target_display_clock; /* KHz */
-	/* Actual Display Clock set due to clock divider granularity KHz */
-	uint32_t actual_display_clock;
-	/* Actual Post Divider ID used to generate the actual clock */
-	uint32_t actual_post_divider_id;
-};
-
 enum bp_dce_clock_type {
 	DCECLOCK_TYPE_DISPLAY_CLOCK = 0,
 	DCECLOCK_TYPE_DPREFCLK      = 1
@@ -322,9 +307,4 @@ struct bp_encoder_cap_info {
 	uint32_t RESERVED:30;
 };
 
-struct bp_gpio_cntl_info {
-	uint32_t id;
-	enum gpio_pin_output_state state;
-};
-
 #endif /*__DAL_BIOS_PARSER_TYPES_H__ */
Signature · 6 lines
2.9.3

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

PATCH 14/25 drm/amd/display: remove calculate_adjustments in conversion.h

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- these are moved to color module

Change-Id I2131991772553893b91ba9b927d20306e846141b
---
 drivers/gpu/drm/amd/display/dc/basics/conversion.c | 118 ---------------------
 drivers/gpu/drm/amd/display/dc/basics/conversion.h |  10 --
 2 files changed, 128 deletions(-)
drivers/gpu/drm/amd/display/dc/basics/conversion.c +0 -118
index 5682fea2080d..a2e22ae12adb 100644
@@ -103,124 +103,6 @@ void convert_float_matrix(
 	}
 }
 
-static void calculate_adjustments_common(
-	const struct fixed31_32 *ideal_matrix,
-	const struct dc_csc_adjustments *adjustments,
-	struct fixed31_32 *matrix)
-{
-	const struct fixed31_32 sin_hue =
-		dal_fixed31_32_sin(adjustments->hue);
-	const struct fixed31_32 cos_hue =
-		dal_fixed31_32_cos(adjustments->hue);
-
-	const struct fixed31_32 multiplier =
-		dal_fixed31_32_mul(
-			adjustments->contrast,
-			adjustments->saturation);
-
-	matrix[0] = dal_fixed31_32_mul(
-		ideal_matrix[0],
-		adjustments->contrast);
-
-	matrix[1] = dal_fixed31_32_mul(
-		ideal_matrix[1],
-		adjustments->contrast);
-
-	matrix[2] = dal_fixed31_32_mul(
-		ideal_matrix[2],
-		adjustments->contrast);
-
-	matrix[4] = dal_fixed31_32_mul(
-		multiplier,
-		dal_fixed31_32_add(
-			dal_fixed31_32_mul(
-				ideal_matrix[8],
-				sin_hue),
-			dal_fixed31_32_mul(
-				ideal_matrix[4],
-				cos_hue)));
-
-	matrix[5] = dal_fixed31_32_mul(
-		multiplier,
-		dal_fixed31_32_add(
-			dal_fixed31_32_mul(
-				ideal_matrix[9],
-				sin_hue),
-			dal_fixed31_32_mul(
-				ideal_matrix[5],
-				cos_hue)));
-
-	matrix[6] = dal_fixed31_32_mul(
-		multiplier,
-		dal_fixed31_32_add(
-			dal_fixed31_32_mul(
-				ideal_matrix[10],
-				sin_hue),
-			dal_fixed31_32_mul(
-				ideal_matrix[6],
-				cos_hue)));
-
-	matrix[7] = ideal_matrix[7];
-
-	matrix[8] = dal_fixed31_32_mul(
-		multiplier,
-		dal_fixed31_32_sub(
-			dal_fixed31_32_mul(
-				ideal_matrix[8],
-				cos_hue),
-			dal_fixed31_32_mul(
-				ideal_matrix[4],
-				sin_hue)));
-
-	matrix[9] = dal_fixed31_32_mul(
-		multiplier,
-		dal_fixed31_32_sub(
-			dal_fixed31_32_mul(
-				ideal_matrix[9],
-				cos_hue),
-			dal_fixed31_32_mul(
-				ideal_matrix[5],
-				sin_hue)));
-
-	matrix[10] = dal_fixed31_32_mul(
-		multiplier,
-		dal_fixed31_32_sub(
-			dal_fixed31_32_mul(
-				ideal_matrix[10],
-				cos_hue),
-			dal_fixed31_32_mul(
-				ideal_matrix[6],
-				sin_hue)));
-
-	matrix[11] = ideal_matrix[11];
-}
-
-void calculate_adjustments(
-	const struct fixed31_32 *ideal_matrix,
-	const struct dc_csc_adjustments *adjustments,
-	struct fixed31_32 *matrix)
-{
-	calculate_adjustments_common(ideal_matrix, adjustments, matrix);
-
-	matrix[3] = dal_fixed31_32_add(
-		ideal_matrix[3],
-		dal_fixed31_32_mul(
-			adjustments->brightness,
-			dal_fixed31_32_from_fraction(86, 100)));
-}
-
-void calculate_adjustments_y_only(
-	const struct fixed31_32 *ideal_matrix,
-	const struct dc_csc_adjustments *adjustments,
-	struct fixed31_32 *matrix)
-{
-	calculate_adjustments_common(ideal_matrix, adjustments, matrix);
-
-	matrix[3] = dal_fixed31_32_add(
-		ideal_matrix[3],
-		adjustments->brightness);
-}
-
 unsigned int log_2(unsigned int num)
 {
 	unsigned int result = 0;
drivers/gpu/drm/amd/display/dc/basics/conversion.h +0 -10
index b7fe431a7952..189325f68cfd 100644
@@ -38,16 +38,6 @@ void convert_float_matrix(
 	struct fixed31_32 *flt,
 	uint32_t buffer_size);
 
-void calculate_adjustments(
-	const struct fixed31_32 *ideal_matrix,
-	const struct dc_csc_adjustments *adjustments,
-	struct fixed31_32 *matrix);
-
-void calculate_adjustments_y_only(
-	const struct fixed31_32 *ideal_matrix,
-	const struct dc_csc_adjustments *adjustments,
-	struct fixed31_32 *matrix);
-
 unsigned int log_2(unsigned int num);
 
 #endif
Signature · 6 lines
2.9.3

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

PATCH 15/25 drm/amd/display: Set default degamma to sRGB instead of bypass

In reply to a message not in the archive

From: Amy Zhang <[email protected]>

Change-Id I572a114be92e8d1e92780793ffdc0644c805c36e
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
index b51668e3bb52..ee393a168c84 100644
@@ -255,7 +255,7 @@ static bool dce110_set_input_transfer_func(
 	if (tf == NULL) {
 		/* Default case if no input transfer function specified */
 		ipp->funcs->ipp_set_degamma(ipp,
-				IPP_DEGAMMA_MODE_BYPASS);
+				IPP_DEGAMMA_MODE_HW_sRGB);
 	} else if (tf->public.type == TF_TYPE_PREDEFINED) {
 		switch (tf->public.tf) {
 		case TRANSFER_FUNCTION_SRGB:
Signature · 6 lines
2.9.3

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

PATCH 16/25 drm/amd/display: HDR Enablement For Applications

In reply to a message not in the archive

From: Amy Zhang <[email protected]>

- Made sure dest color space is updated in stream and info frame
- Optimized segment distribution algorithm for regamma mapping

Change-Id Ia9bb4e56719e23a9827080194d89f715ee5fde29
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 14 ++++
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h       |  6 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 94 ++++++++++++++++++----
 drivers/gpu/drm/amd/display/dc/inc/hw/transform.h  | 11 +++
 4 files changed, 107 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +14 -0
index fe79a2890247..8b41c7708562 100644
@@ -1310,6 +1310,20 @@ static void set_avi_info_frame(
 		info_frame.avi_info_packet.info_packet_hdmi.bits.C0_C1 =
 				COLORIMETRY_NO_DATA;
 
+	if (color_space == COLOR_SPACE_2020_RGB_FULLRANGE ||
+		color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE ||
+		color_space == COLOR_SPACE_2020_YCBCR) {
+		info_frame.avi_info_packet.info_packet_hdmi.bits.EC0_EC2 =
+				COLORIMETRYEX_BT2020RGBYCBCR;
+		info_frame.avi_info_packet.info_packet_hdmi.bits.C0_C1 =
+				COLORIMETRY_EXTENDED;
+	} else if (color_space == COLOR_SPACE_ADOBERGB) {
+		info_frame.avi_info_packet.info_packet_hdmi.bits.EC0_EC2 =
+				COLORIMETRYEX_ADOBERGB;
+		info_frame.avi_info_packet.info_packet_hdmi.bits.C0_C1 =
+				COLORIMETRY_EXTENDED;
+	}
+
 	/* TODO: un-hardcode aspect ratio */
 	aspect = stream->public.timing.aspect_ratio;
 
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +5 -1
index 00958bdbb417..a17e7bc96f9e 100644
@@ -444,7 +444,11 @@ enum dc_color_space {
 	COLOR_SPACE_YCBCR601,
 	COLOR_SPACE_YCBCR709,
 	COLOR_SPACE_YCBCR601_LIMITED,
-	COLOR_SPACE_YCBCR709_LIMITED
+	COLOR_SPACE_YCBCR709_LIMITED,
+	COLOR_SPACE_2020_RGB_FULLRANGE,
+	COLOR_SPACE_2020_RGB_LIMITEDRANGE,
+	COLOR_SPACE_2020_YCBCR,
+	COLOR_SPACE_ADOBERGB,
 };
 
 enum dc_quantization_range {
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +77 -17

127 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/hw/transform.h +11 -0
index ef743b70b3e9..a510d3fe48ec 100644
@@ -47,6 +47,17 @@ enum colorimetry {
 	COLORIMETRY_EXTENDED = 3
 };
 
+enum colorimetry_ext {
+	COLORIMETRYEX_XVYCC601 = 0,
+	COLORIMETRYEX_XVYCC709 = 1,
+	COLORIMETRYEX_SYCC601 = 2,
+	COLORIMETRYEX_ADOBEYCC601 = 3,
+	COLORIMETRYEX_ADOBERGB = 4,
+	COLORIMETRYEX_BT2020YCC = 5,
+	COLORIMETRYEX_BT2020RGBYCBCR = 6,
+	COLORIMETRYEX_RESERVED = 7
+};
+
 enum active_format_info {
 	ACTIVE_FORMAT_NO_DATA = 0,
 	ACTIVE_FORMAT_VALID = 1
Signature · 6 lines
2.9.3

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

PATCH 17/25 drm/amd/display: refactor clk_resync to avoid assertion

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- not all DCE has PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE bit defined.

Change-Id I4bf25deb134637c713ac5ee1eac786bafdc9eb4a
---
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  | 57 ++++++++++++----------
 1 file changed, 30 insertions(+), 27 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +30 -27
index a38172bdcb5e..78f43274a03a 100644
@@ -767,41 +767,44 @@ static void dce112_program_pixel_clk_resync(
 		enum dc_color_depth colordepth,
 		bool enable_ycbcr420)
 {
-	REG_UPDATE(PIXCLK_RESYNC_CNTL,
-			PHYPLLA_DCCG_DEEP_COLOR_CNTL, 0);
+	uint32_t deep_color_cntl = 0;
+	uint32_t double_rate_enable = 0;
+
 	/*
 	 24 bit mode: TMDS clock = 1.0 x pixel clock  (1:1)
 	 30 bit mode: TMDS clock = 1.25 x pixel clock (5:4)
 	 36 bit mode: TMDS clock = 1.5 x pixel clock  (3:2)
 	 48 bit mode: TMDS clock = 2 x pixel clock    (2:1)
 	 */
-	if (signal_type != SIGNAL_TYPE_HDMI_TYPE_A)
-		return;
+	if (signal_type == SIGNAL_TYPE_HDMI_TYPE_A) {
+		double_rate_enable = enable_ycbcr420 ? 1 : 0;
 
-	switch (colordepth) {
-	case COLOR_DEPTH_888:
-		REG_UPDATE_2(PIXCLK_RESYNC_CNTL,
-				PHYPLLA_DCCG_DEEP_COLOR_CNTL, 0,
-				PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE, enable_ycbcr420);
-		break;
-	case COLOR_DEPTH_101010:
-		REG_UPDATE_2(PIXCLK_RESYNC_CNTL,
-				PHYPLLA_DCCG_DEEP_COLOR_CNTL, 1,
-				PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE, enable_ycbcr420);
-		break;
-	case COLOR_DEPTH_121212:
-		REG_UPDATE_2(PIXCLK_RESYNC_CNTL,
-				PHYPLLA_DCCG_DEEP_COLOR_CNTL, 2,
-				PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE, enable_ycbcr420);
-		break;
-	case COLOR_DEPTH_161616:
-		REG_UPDATE_2(PIXCLK_RESYNC_CNTL,
-				PHYPLLA_DCCG_DEEP_COLOR_CNTL, 3,
-				PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE, enable_ycbcr420);
-		break;
-	default:
-		break;
+		switch (colordepth) {
+		case COLOR_DEPTH_888:
+			deep_color_cntl = 0;
+			break;
+		case COLOR_DEPTH_101010:
+			deep_color_cntl = 1;
+			break;
+		case COLOR_DEPTH_121212:
+			deep_color_cntl = 2;
+			break;
+		case COLOR_DEPTH_161616:
+			deep_color_cntl = 3;
+			break;
+		default:
+			break;
+		}
 	}
+
+	if (clk_src->cs_mask->PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE)
+		REG_UPDATE_2(PIXCLK_RESYNC_CNTL,
+				PHYPLLA_DCCG_DEEP_COLOR_CNTL, deep_color_cntl,
+				PHYPLLA_PIXCLK_DOUBLE_RATE_ENABLE, double_rate_enable);
+	else
+		REG_UPDATE(PIXCLK_RESYNC_CNTL,
+				PHYPLLA_DCCG_DEEP_COLOR_CNTL, deep_color_cntl);
+
 }
 
 static bool dce110_program_pix_clk(
Signature · 6 lines
2.9.3

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

PATCH 18/25 drm/amd/display: Remove meta_pitch

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Change-Id I2e7e1531259f1d58c2d4dc02817f0ad6e8104f19
---
 drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 8 ++------
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h   | 4 ----
 2 files changed, 2 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +2 -6
index 78b8e0c5b4e7..959c3f372e73 100644
@@ -94,14 +94,12 @@ void pre_surface_trace(
 				"surface->plane_size.grph.surface_size.y = %d;\n"
 				"surface->plane_size.grph.surface_size.width = %d;\n"
 				"surface->plane_size.grph.surface_size.height = %d;\n"
-				"surface->plane_size.grph.surface_pitch = %d;\n"
-				"surface->plane_size.grph.meta_pitch = %d;\n",
+				"surface->plane_size.grph.surface_pitch = %d;\n",
 				surface->plane_size.grph.surface_size.x,
 				surface->plane_size.grph.surface_size.y,
 				surface->plane_size.grph.surface_size.width,
 				surface->plane_size.grph.surface_size.height,
-				surface->plane_size.grph.surface_pitch,
-				surface->plane_size.grph.meta_pitch);
+				surface->plane_size.grph.surface_pitch);
 
 
 		SURFACE_TRACE(
@@ -176,7 +174,6 @@ void update_surface_trace(
 			SURFACE_TRACE(
 					"plane_info->color_space = %d;\n"
 					"plane_info->format = %d;\n"
-					"plane_info->plane_size.grph.meta_pitch = %d;\n"
 					"plane_info->plane_size.grph.surface_pitch = %d;\n"
 					"plane_info->plane_size.grph.surface_size.height = %d;\n"
 					"plane_info->plane_size.grph.surface_size.width = %d;\n"
@@ -185,7 +182,6 @@ void update_surface_trace(
 					"plane_info->rotation = %d;\n",
 					update->plane_info->color_space,
 					update->plane_info->format,
-					update->plane_info->plane_size.grph.meta_pitch,
 					update->plane_info->plane_size.grph.surface_pitch,
 					update->plane_info->plane_size.grph.surface_size.height,
 					update->plane_info->plane_size.grph.surface_size.width,
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +0 -4
index a17e7bc96f9e..5c1b2f833fe2 100644
@@ -123,8 +123,6 @@ union plane_size {
 		 * is 32 pixel aligned.
 		 */
 		uint32_t surface_pitch;
-
-		uint32_t meta_pitch;
 	} grph;
 
 	struct {
@@ -134,7 +132,6 @@ union plane_size {
 		 * 32 pixel aligned.
 		 */
 		uint32_t luma_pitch;
-		uint32_t meta_luma_pitch;
 
 		struct rect chroma_size;
 		/* Graphic surface pitch in pixels.
@@ -142,7 +139,6 @@ union plane_size {
 		 * 32 pixel aligned.
 		 */
 		uint32_t chroma_pitch;
-		uint32_t meta_chroma_pitch;
 	} video;
 };
 
Signature · 6 lines
2.9.3

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

PATCH 19/25 drm/amd/display: rename BGRA8888 to ABGR8888

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

DC actually support ABGR8888 instead of BGRA8888 (R/B swap rather than endian swap) , rename to avoid confusion

Change-Id Ib0e30df605268b2d4567dd21e3e6a9db48471f92
---
 drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c      | 4 ++--
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c           | 2 +-
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h                | 2 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c          | 4 ++--
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 2 +-
 drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c  | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +2 -2
index 54388c0e29e0..946379852b2a 100644
@@ -2530,7 +2530,7 @@ static void populate_initial_data(
 			data->bytes_per_pixel[num_displays + 4] = 2;
 			break;
 		case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
-		case SURFACE_PIXEL_FORMAT_GRPH_BGRA8888:
+		case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
 		case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010:
 		case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010:
 		case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010_XR_BIAS:
@@ -2626,7 +2626,7 @@ static void populate_initial_data(
 				data->bytes_per_pixel[num_displays + 4] = 2;
 				break;
 			case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
-			case SURFACE_PIXEL_FORMAT_GRPH_BGRA8888:
+			case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
 			case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010:
 			case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010:
 			case SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010_XR_BIAS:
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +1 -1
index 8b41c7708562..ee1c3b029394 100644
@@ -341,7 +341,7 @@ static enum pixel_format convert_pixel_format_to_dalsurface(
 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
 		dal_pixel_format = PIXEL_FORMAT_ARGB8888;
 		break;
-	case SURFACE_PIXEL_FORMAT_GRPH_BGRA8888:
+	case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
 		dal_pixel_format = PIXEL_FORMAT_ARGB8888;
 		break;
 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010:
drivers/gpu/drm/amd/display/dc/dc_hw_types.h +1 -1
index 5c1b2f833fe2..53c73de75da9 100644
@@ -174,7 +174,7 @@ enum surface_pixel_format {
 	/*32 bpp*/
 	SURFACE_PIXEL_FORMAT_GRPH_ARGB8888,
 	/*32 bpp swaped*/
-	SURFACE_PIXEL_FORMAT_GRPH_BGRA8888,
+	SURFACE_PIXEL_FORMAT_GRPH_ABGR8888,
 
 	SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010,
 	/*swaped*/
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +2 -2
index 130935fffba3..e14a21cedfd5 100644
@@ -302,7 +302,7 @@ static void program_grph_pixel_format(
 	uint32_t grph_depth, grph_format;
 	uint32_t sign = 0, floating = 0;
 
-	if (format == SURFACE_PIXEL_FORMAT_GRPH_BGRA8888 ||
+	if (format == SURFACE_PIXEL_FORMAT_GRPH_ABGR8888 ||
 			/*todo: doesn't look like we handle BGRA here,
 			 *  should problem swap endian*/
 		format == SURFACE_PIXEL_FORMAT_GRPH_ABGR2101010 ||
@@ -331,7 +331,7 @@ static void program_grph_pixel_format(
 		grph_format = 1;
 		break;
 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
-	case SURFACE_PIXEL_FORMAT_GRPH_BGRA8888:
+	case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
 		grph_depth = 2;
 		grph_format = 0;
 		break;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +1 -1
index e9fd83e9af79..6dbfc570b8c6 100644
@@ -214,7 +214,7 @@ static void build_prescale_params(struct ipp_prescale_params *prescale_params,
 
 	switch (surface->public.format) {
 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
-	case SURFACE_PIXEL_FORMAT_GRPH_BGRA8888:
+	case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
 		prescale_params->scale = 0x2020;
 		break;
 	case SURFACE_PIXEL_FORMAT_GRPH_ARGB2101010:
drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c +1 -1
index b12506adcba4..aac47955e9bf 100644
@@ -405,7 +405,7 @@ static void program_pixel_format(
 			grph_format = 1;
 			break;
 		case SURFACE_PIXEL_FORMAT_GRPH_ARGB8888:
-		case SURFACE_PIXEL_FORMAT_GRPH_BGRA8888:
+		case SURFACE_PIXEL_FORMAT_GRPH_ABGR8888:
 			grph_depth = 2;
 			grph_format = 0;
 			break;
Signature · 6 lines
2.9.3

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

PATCH 20/25 drm/amd/display: Fix missing conditions in hw sequencer.

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

Change-Id I621c2356319229c5e455d2fd6ccbedc4a74077ae
---
 drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dce_hwseq.c +1 -1
index cd9a371ae237..0eee135bfa54 100644
@@ -160,7 +160,7 @@ void dce_crtc_switch_to_clk_src(struct dce_hwseq *hws,
 		struct clock_source *clk_src,
 		unsigned int tg_inst)
 {
-	if (clk_src->id == CLOCK_SOURCE_ID_DP_DTO) {
+	if (clk_src->id == CLOCK_SOURCE_ID_DP_DTO || clk_src->dp_clk_src) {
 		REG_UPDATE(PIXEL_RATE_CNTL[tg_inst],
 				DP_DTO0_ENABLE, 1);
 
Signature · 6 lines
2.9.3

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

PATCH 21/25 drm/amd/display: Add missing MI masks

In reply to a message not in the archive

From: Leon Elazar <[email protected]>

This will fix the memory Input programing with MST tiled display. This Fix should fix connectivity problems with MST tiled Display

Change-Id I2cf36a325a44edd4198e30f9fc801208399e1a83
---
 drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h +2 -0
index f90d586656ef..ec053c241901 100644
@@ -92,6 +92,8 @@ struct dce_mem_input_registers {
 	.field_name = blk_name ## reg_name ## __ ## field_name ## post_fix
 
 #define MI_GFX8_TILE_MASK_SH_LIST(mask_sh, blk)\
+	SFB(blk, GRPH_CONTROL, GRPH_NUM_BANKS, mask_sh),\
+	SFB(blk, GRPH_CONTROL, GRPH_BANK_WIDTH, mask_sh),\
 	SFB(blk, GRPH_CONTROL, GRPH_BANK_HEIGHT, mask_sh),\
 	SFB(blk, GRPH_CONTROL, GRPH_MACRO_TILE_ASPECT, mask_sh),\
 	SFB(blk, GRPH_CONTROL, GRPH_TILE_SPLIT, mask_sh),\
Signature · 6 lines
2.9.3

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

PATCH 22/25 drm/amd/display: Add interrupt entries for VBLANK isr.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Change-Id Ia59c22ea5a78d5eecca6c62c7f50e651f29ef5f7
---
 .../amd/display/dc/irq/dce110/irq_service_dce110.c | 42 ++++++++++++++++++++++
 .../amd/display/dc/irq/dce80/irq_service_dce80.c   | 22 ++++++++++++
 drivers/gpu/drm/amd/display/dc/irq_types.h         |  8 +++++
 3 files changed, 72 insertions(+)
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +42 -0
index f3eda1b4eebf..4c7c85d45518 100644
@@ -33,6 +33,13 @@
 #include "dce/dce_11_0_sh_mask.h"
 #include "ivsrcid/ivsrcid_vislands30.h"
 
+#define VISLANDS30_IV_SRCID_D1_VBLANK                        1
+#define VISLANDS30_IV_SRCID_D2_VBLANK                        2
+#define VISLANDS30_IV_SRCID_D3_VBLANK                        3
+#define VISLANDS30_IV_SRCID_D4_VBLANK                        4
+#define VISLANDS30_IV_SRCID_D5_VBLANK                        5
+#define VISLANDS30_IV_SRCID_D6_VBLANK                        6
+
 static bool hpd_ack(
 	struct irq_service *irq_service,
 	const struct irq_source_info *info)
@@ -139,6 +146,22 @@ static const struct irq_source_info_funcs vblank_irq_info_funcs = {
 		.funcs = &vblank_irq_info_funcs\
 	}
 
+#define vblank_int_entry(reg_num)\
+	[DC_IRQ_SOURCE_VBLANK1 + reg_num] = {\
+		.enable_reg = mmLB ## reg_num ## _LB_INTERRUPT_MASK,\
+		.enable_mask =\
+			LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+		.enable_value = {\
+			LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+			~LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK},\
+		.ack_reg = mmLB ## reg_num ## _LB_VBLANK_STATUS,\
+		.ack_mask =\
+		LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+		.ack_value =\
+		LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+		.funcs = &vblank_irq_info_funcs\
+	}
+
 #define dummy_irq_entry() \
 	{\
 		.funcs = &dummy_irq_info_funcs\
@@ -264,6 +287,13 @@ irq_source_info_dce110[DAL_IRQ_SOURCES_NUMBER] = {
 	vupdate_int_entry(3),
 	vupdate_int_entry(4),
 	vupdate_int_entry(5),
+	vblank_int_entry(0),
+	vblank_int_entry(1),
+	vblank_int_entry(2),
+	vblank_int_entry(3),
+	vblank_int_entry(4),
+	vblank_int_entry(5),
+
 };
 
 enum dc_irq_source to_dal_irq_source_dce110(
@@ -272,6 +302,18 @@ enum dc_irq_source to_dal_irq_source_dce110(
 		uint32_t ext_id)
 {
 	switch (src_id) {
+	case VISLANDS30_IV_SRCID_D1_VBLANK:
+		return DC_IRQ_SOURCE_VBLANK1;
+	case VISLANDS30_IV_SRCID_D2_VBLANK:
+		return DC_IRQ_SOURCE_VBLANK2;
+	case VISLANDS30_IV_SRCID_D3_VBLANK:
+		return DC_IRQ_SOURCE_VBLANK3;
+	case VISLANDS30_IV_SRCID_D4_VBLANK:
+		return DC_IRQ_SOURCE_VBLANK4;
+	case VISLANDS30_IV_SRCID_D5_VBLANK:
+		return DC_IRQ_SOURCE_VBLANK5;
+	case VISLANDS30_IV_SRCID_D6_VBLANK:
+		return DC_IRQ_SOURCE_VBLANK6;
 	case VISLANDS30_IV_SRCID_D1_V_UPDATE_INT:
 		return DC_IRQ_SOURCE_VUPDATE1;
 	case VISLANDS30_IV_SRCID_D2_V_UPDATE_INT:
drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c +22 -0
index 8b4f45389783..dd09d2b6d4a7 100644
@@ -143,6 +143,22 @@ static const struct irq_source_info_funcs vblank_irq_info_funcs = {
 		.funcs = &vblank_irq_info_funcs\
 	}
 
+#define vblank_int_entry(reg_num)\
+	[DC_IRQ_SOURCE_VBLANK1 + reg_num] = {\
+		.enable_reg = mmLB ## reg_num ## _LB_INTERRUPT_MASK,\
+		.enable_mask =\
+			LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+		.enable_value = {\
+			LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+			~LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK},\
+		.ack_reg = mmLB ## reg_num ## _LB_VBLANK_STATUS,\
+		.ack_mask =\
+		LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+		.ack_value =\
+		LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+		.funcs = &vblank_irq_info_funcs\
+	}
+
 #define dummy_irq_entry() \
 	{\
 		.funcs = &dummy_irq_info_funcs\
@@ -246,6 +262,12 @@ irq_source_info_dce80[DAL_IRQ_SOURCES_NUMBER] = {
 	vupdate_int_entry(3),
 	vupdate_int_entry(4),
 	vupdate_int_entry(5),
+	vblank_int_entry(0),
+	vblank_int_entry(1),
+	vblank_int_entry(2),
+	vblank_int_entry(3),
+	vblank_int_entry(4),
+	vblank_int_entry(5),
 };
 
 static const struct irq_service_funcs irq_service_funcs_dce80 = {
drivers/gpu/drm/amd/display/dc/irq_types.h +8 -0
index e4b4b99a86fc..a506c2e939f5 100644
@@ -128,6 +128,13 @@ enum dc_irq_source {
 	DC_IRQ_SOURCE_VUPDATE5,
 	DC_IRQ_SOURCE_VUPDATE6,
 
+	DC_IRQ_SOURCE_VBLANK1,
+	DC_IRQ_SOURCE_VBLANK2,
+	DC_IRQ_SOURCE_VBLANK3,
+	DC_IRQ_SOURCE_VBLANK4,
+	DC_IRQ_SOURCE_VBLANK5,
+	DC_IRQ_SOURCE_VBLANK6,
+
 	DAL_IRQ_SOURCES_NUMBER
 };
 
@@ -135,6 +142,7 @@ enum irq_type
 {
 	IRQ_TYPE_PFLIP = DC_IRQ_SOURCE_PFLIP1,
 	IRQ_TYPE_VUPDATE = DC_IRQ_SOURCE_VUPDATE1,
+	IRQ_TYPE_VBLANK = DC_IRQ_SOURCE_VBLANK1,
 };
 
 #define DAL_VALID_IRQ_SRC_NUM(src) \
Signature · 6 lines
2.9.3

_______________________________________________
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): 20170123143613.15441-23-harry.wentland-5C7GfCeVMHo@public.gmane.org

#25 lore raw

Re: [PATCH 22/25] drm/amd/display: Add interrupt entries for VBLANK isr.

Quoted 17 lines · Harry Wentland

From: Andrey Grodzovsky <[email protected]>

Change-Id Ia59c22ea5a78d5eecca6c62c7f50e651f29ef5f7
---
 .../amd/display/dc/irq/dce110/irq_service_dce110.c | 42 ++++++++++++++++++++++
 .../amd/display/dc/irq/dce80/irq_service_dce80.c   | 22 ++++++++++++
 drivers/gpu/drm/amd/display/dc/irq_types.h         |  8 +++++
 3 files changed, 72 insertions(+)
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +0 -0
index f3eda1b4eebf..4c7c85d45518 100644

drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c line 42

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +7 -0
@@ -33,6 +33,13 @@
 #include "dce/dce_11_0_sh_mask.h"
 #include "ivsrcid/ivsrcid_vislands30.h"
 
+#define VISLANDS30_IV_SRCID_D1_VBLANK                        1
+#define VISLANDS30_IV_SRCID_D2_VBLANK                        2
+#define VISLANDS30_IV_SRCID_D3_VBLANK                        3
+#define VISLANDS30_IV_SRCID_D4_VBLANK                        4
+#define VISLANDS30_IV_SRCID_D5_VBLANK                        5
+#define VISLANDS30_IV_SRCID_D6_VBLANK                        6
+

Add these to ivsrcid/ivsrcid_vislands30.h instead of this file? or maybe drop ivsrcid/ivsrcid_vislands30.h if we don't need it?

Alex

Quoted 128 lines
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +35 -0
 static bool hpd_ack(
        struct irq_service *irq_service,
        const struct irq_source_info *info)
@@ -139,6 +146,22 @@ static const struct irq_source_info_funcs vblank_irq_info_funcs = {
                .funcs = &vblank_irq_info_funcs\
        }
 
+#define vblank_int_entry(reg_num)\
+       [DC_IRQ_SOURCE_VBLANK1 + reg_num] = {\
+               .enable_reg = mmLB ## reg_num ## _LB_INTERRUPT_MASK,\
+               .enable_mask =\
+                       LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+               .enable_value = {\
+                       LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+                       ~LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK},\
+               .ack_reg = mmLB ## reg_num ## _LB_VBLANK_STATUS,\
+               .ack_mask =\
+               LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+               .ack_value =\
+               LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+               .funcs = &vblank_irq_info_funcs\
+       }
+
 #define dummy_irq_entry() \
        {\
                .funcs = &dummy_irq_info_funcs\
@@ -264,6 +287,13 @@ irq_source_info_dce110[DAL_IRQ_SOURCES_NUMBER] = {
        vupdate_int_entry(3),
        vupdate_int_entry(4),
        vupdate_int_entry(5),
+       vblank_int_entry(0),
+       vblank_int_entry(1),
+       vblank_int_entry(2),
+       vblank_int_entry(3),
+       vblank_int_entry(4),
+       vblank_int_entry(5),
+
 };
 
 enum dc_irq_source to_dal_irq_source_dce110(
@@ -272,6 +302,18 @@ enum dc_irq_source to_dal_irq_source_dce110(
                uint32_t ext_id)
 {
        switch (src_id) {
+       case VISLANDS30_IV_SRCID_D1_VBLANK:
+               return DC_IRQ_SOURCE_VBLANK1;
+       case VISLANDS30_IV_SRCID_D2_VBLANK:
+               return DC_IRQ_SOURCE_VBLANK2;
+       case VISLANDS30_IV_SRCID_D3_VBLANK:
+               return DC_IRQ_SOURCE_VBLANK3;
+       case VISLANDS30_IV_SRCID_D4_VBLANK:
+               return DC_IRQ_SOURCE_VBLANK4;
+       case VISLANDS30_IV_SRCID_D5_VBLANK:
+               return DC_IRQ_SOURCE_VBLANK5;
+       case VISLANDS30_IV_SRCID_D6_VBLANK:
+               return DC_IRQ_SOURCE_VBLANK6;
        case VISLANDS30_IV_SRCID_D1_V_UPDATE_INT:
                return DC_IRQ_SOURCE_VUPDATE1;
        case VISLANDS30_IV_SRCID_D2_V_UPDATE_INT:
drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c +22 -0
index 8b4f45389783..dd09d2b6d4a7 100644
@@ -143,6 +143,22 @@ static const struct irq_source_info_funcs vblank_irq_info_funcs = {
                .funcs = &vblank_irq_info_funcs\
        }
 
+#define vblank_int_entry(reg_num)\
+       [DC_IRQ_SOURCE_VBLANK1 + reg_num] = {\
+               .enable_reg = mmLB ## reg_num ## _LB_INTERRUPT_MASK,\
+               .enable_mask =\
+                       LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+               .enable_value = {\
+                       LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK,\
+                       ~LB_INTERRUPT_MASK__VBLANK_INTERRUPT_MASK_MASK},\
+               .ack_reg = mmLB ## reg_num ## _LB_VBLANK_STATUS,\
+               .ack_mask =\
+               LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+               .ack_value =\
+               LB_VBLANK_STATUS__VBLANK_ACK_MASK,\
+               .funcs = &vblank_irq_info_funcs\
+       }
+
 #define dummy_irq_entry() \
        {\
                .funcs = &dummy_irq_info_funcs\
@@ -246,6 +262,12 @@ irq_source_info_dce80[DAL_IRQ_SOURCES_NUMBER] = {
        vupdate_int_entry(3),
        vupdate_int_entry(4),
        vupdate_int_entry(5),
+       vblank_int_entry(0),
+       vblank_int_entry(1),
+       vblank_int_entry(2),
+       vblank_int_entry(3),
+       vblank_int_entry(4),
+       vblank_int_entry(5),
 };
 
 static const struct irq_service_funcs irq_service_funcs_dce80 = {
drivers/gpu/drm/amd/display/dc/irq_types.h +8 -1
index e4b4b99a86fc..a506c2e939f5 100644
@@ -128,6 +128,13 @@ enum dc_irq_source {
        DC_IRQ_SOURCE_VUPDATE5,
        DC_IRQ_SOURCE_VUPDATE6,
 
+       DC_IRQ_SOURCE_VBLANK1,
+       DC_IRQ_SOURCE_VBLANK2,
+       DC_IRQ_SOURCE_VBLANK3,
+       DC_IRQ_SOURCE_VBLANK4,
+       DC_IRQ_SOURCE_VBLANK5,
+       DC_IRQ_SOURCE_VBLANK6,
+
        DAL_IRQ_SOURCES_NUMBER
 };
 
@@ -135,6 +142,7 @@ enum irq_type
 {
        IRQ_TYPE_PFLIP = DC_IRQ_SOURCE_PFLIP1,
        IRQ_TYPE_VUPDATE = DC_IRQ_SOURCE_VUPDATE1,
+       IRQ_TYPE_VBLANK = DC_IRQ_SOURCE_VBLANK1,
 };
 
 #define DAL_VALID_IRQ_SRC_NUM(src) \
--

2.9.3

Quoted 4 lines

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

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

#26 lore raw

PATCH 23/25 drm/amd/display: Register on VLBLANK ISR.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Switch from VUPDATE to VBLANK.

Change-Id I8652e01091efe91c3c7ad71004d170af412da9f5
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c     | 13 +++++++------
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h     |  2 +-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c |  2 +-
 3 files changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -6
index be8fad24cedb..a33e339991ec 100644
@@ -207,7 +207,7 @@ static void dm_crtc_high_irq(void *interrupt_params)
 	uint8_t crtc_index = 0;
 	struct amdgpu_crtc *acrtc;
 
-	acrtc = get_crtc_by_otg_inst(adev, irq_params->irq_src - IRQ_TYPE_VUPDATE);
+	acrtc = get_crtc_by_otg_inst(adev, irq_params->irq_src - IRQ_TYPE_VBLANK);
 
 	if (acrtc)
 		crtc_index = acrtc->crtc_id;
@@ -1032,9 +1032,10 @@ static int dce110_register_irq_handlers(struct amdgpu_device *adev)
 	 *    amdgpu_dm_irq_handler() will re-direct the interrupt to DC
 	 *    for acknowledging and handling. */
 
-	for (i = VISLANDS30_IV_SRCID_D1_V_UPDATE_INT;
-			i <= VISLANDS30_IV_SRCID_D6_V_UPDATE_INT; i += 2) {
-		r = amdgpu_irq_add_id(adev, i, &adev->crtc_irq);
+	/* Use VBLANK interrupt */
+	for (i = 0; i < adev->mode_info.num_crtc; i++) {
+		r = amdgpu_irq_add_id(adev, i+1, &adev->crtc_irq);
+
 		if (r) {
 			DRM_ERROR("Failed to add crtc irq id!\n");
 			return r;
@@ -1042,9 +1043,9 @@ static int dce110_register_irq_handlers(struct amdgpu_device *adev)
 
 		int_params.int_context = INTERRUPT_HIGH_IRQ_CONTEXT;
 		int_params.irq_source =
-			dc_interrupt_to_irq_source(dc, i, 0);
+			dc_interrupt_to_irq_source(dc, i+1, 0);
 
-		c_irq_params = &adev->dm.vupdate_params[int_params.irq_source - DC_IRQ_SOURCE_VUPDATE1];
+		c_irq_params = &adev->dm.vblank_params[int_params.irq_source - DC_IRQ_SOURCE_VBLANK1];
 
 		c_irq_params->adev = adev;
 		c_irq_params->irq_src = int_params.irq_source;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +1 -1
index 1b54566f5da1..d6ebba012e15 100644
@@ -105,7 +105,7 @@ struct amdgpu_display_manager {
 	pflip_params[DC_IRQ_SOURCE_PFLIP_LAST - DC_IRQ_SOURCE_PFLIP_FIRST + 1];
 
 	struct common_irq_params
-	vupdate_params[DC_IRQ_SOURCE_VUPDATE6 - DC_IRQ_SOURCE_VUPDATE1 + 1];
+	vblank_params[DC_IRQ_SOURCE_VBLANK6 - DC_IRQ_SOURCE_VBLANK1 + 1];
 
 	/* this spin lock synchronizes access to 'irq_handler_list_table' */
 	spinlock_t irq_handler_list_table_lock;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +1 -1
index ff755a9752da..2d2972e232b6 100644
@@ -736,7 +736,7 @@ static int amdgpu_dm_set_crtc_irq_state(struct amdgpu_device *adev,
 		source,
 		crtc_id,
 		state,
-		IRQ_TYPE_VUPDATE,
+		IRQ_TYPE_VBLANK,
 		__func__);
 }
 
Signature · 6 lines
2.9.3

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

PATCH 24/25 drm/amd/display: Clean index in irq init loop

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Change-Id Iaf1b717863c59810657e66835468628acf3aee4c
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -3
index a33e339991ec..f066e2207b5e 100644
@@ -1033,8 +1033,8 @@ static int dce110_register_irq_handlers(struct amdgpu_device *adev)
 	 *    for acknowledging and handling. */
 
 	/* Use VBLANK interrupt */
-	for (i = 0; i < adev->mode_info.num_crtc; i++) {
-		r = amdgpu_irq_add_id(adev, i+1, &adev->crtc_irq);
+	for (i = 1; i <= adev->mode_info.num_crtc; i++) {
+		r = amdgpu_irq_add_id(adev, i, &adev->crtc_irq);
 
 		if (r) {
 			DRM_ERROR("Failed to add crtc irq id!\n");
@@ -1043,7 +1043,7 @@ static int dce110_register_irq_handlers(struct amdgpu_device *adev)
 
 		int_params.int_context = INTERRUPT_HIGH_IRQ_CONTEXT;
 		int_params.irq_source =
-			dc_interrupt_to_irq_source(dc, i+1, 0);
+			dc_interrupt_to_irq_source(dc, i, 0);
 
 		c_irq_params = &adev->dm.vblank_params[int_params.irq_source - DC_IRQ_SOURCE_VBLANK1];
 
@@ -1054,6 +1054,7 @@ static int dce110_register_irq_handlers(struct amdgpu_device *adev)
 				dm_crtc_high_irq, c_irq_params);
 	}
 
+	/* Use GRPH_PFLIP interrupt */
 	for (i = VISLANDS30_IV_SRCID_D1_GRPH_PFLIP;
 			i <= VISLANDS30_IV_SRCID_D6_GRPH_PFLIP; i += 2) {
 		r = amdgpu_irq_add_id(adev, i, &adev->pageflip_irq);
Signature · 6 lines
2.9.3

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

PATCH 25/25 drm/amd/display: add missing dcc update on flip call

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Change-Id I4eb19bf87e3cee5fb51f572fc866f2e641021884
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -0
index 9deddc8ee2d1..f9b7fc85d71a 100644
@@ -1429,6 +1429,8 @@ void dc_update_surfaces_for_stream(struct dc *dc, struct dc_surface_update *upda
 						updates[i].plane_info->tiling_info;
 					surface->public.visible =
 						updates[i].plane_info->visible;
+					surface->public.dcc =
+						updates[i].plane_info->dcc;
 				}
 
 				if (updates[i].scaling_info) {
Signature · 6 lines
2.9.3

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