Skip to contentSkip to conversation

DC Patches for Dec 7, 2016

PATCH In review Harry Wentland 3 participants 27 messages Dec 8, 2016 14 messages not in the archive

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

cover DC Patches for Dec 7, 2016

* bunch of warning fixes
* some bug fixes
* more display_clock cleanup

Andrey Grodzovsky (1):
drm/amd/display: Fix refcount over dc_sink.

Arindam Nath (1):
drm/amd/display: remove DM_NOT_IMPL messages

Ding Wang (1):
drm/amd/display: Temporarily blocking interlacing mode until it's
supported.

Dmytro Laktyushkin (2):
drm/amd/display: moving remaining functionality from gpu to dce_clocks drm/amd/display: fix up construction of scratch_val_ctx

Harry Wentland (3):
drm/amd/display: Fix bunch of warnings in DC drm/amd/display: Fix warning in freesync module drm/amd/display: Fix warning. Set MAX_SURFACES to 3

Tony Cheng (2):
drm/amd/display: fix indexing bug
drm/amd/display: avoid apply_clk_constraints for address update

Zeyu Fan (2):
drm/amd/display: Fix bugs causing Hawaii and Bonaire not light up. drm/amd/display: Fix hdmi not lighting up on Hawaii.

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  20 +-
 drivers/gpu/drm/amd/display/dc/Makefile            |   7 +-
 .../dc/bios/dce110/command_table_helper_dce110.c   |   2 +-
 .../dc/bios/dce112/command_table_helper_dce112.c   |   2 +-
 .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |   2 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  20 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |   5 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |   2 +-
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |   5 -
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 142 +++++++++--
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h    |  36 ++-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |   4 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |   2 -
 .../display/dc/dce110/dce110_timing_generator.c    |   4 +
 .../drm/amd/display/dc/dce110/dce110_transform_v.c |   3 +-
 drivers/gpu/drm/amd/display/dc/gpu/Makefile        |  21 --
 .../display/dc/gpu/dce112/display_clock_dce112.c   | 277 ---------------------
 .../display/dc/gpu/dce112/display_clock_dce112.h   |  79 ------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c | 127 ----------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h |  62 -----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   4 +-
 .../inc/hw/display_clock.h}                        |  27 +-
 .../drm/amd/display/modules/freesync/freesync.c    |   3 +
 23 files changed, 207 insertions(+), 649 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/Makefile
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h
 rename drivers/gpu/drm/amd/display/{include/display_clock_interface.h => dc/inc/hw/display_clock.h} (75%)
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): 20161208012624.8914-1-harry.wentland-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/12 drm/amd/display: Temporarily blocking interlacing mode until it's supported.

From: Ding Wang <[email protected]>

Change-Id Iaec8b8c429f9e9dfa1b1dd50a9f846de6cd15c26
---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dce110/dce110_timing_generator.c +4 -0
index 12a258763ef1..e70704d1ba87 100644
@@ -1117,6 +1117,10 @@ bool dce110_timing_generator_validate_timing(
 	if (timing->timing_3d_format != TIMING_3D_FORMAT_NONE)
 		return false;
 
+	/* Temporarily blocking interlacing mode until it's supported */
+	if (timing->flags.INTERLACE == 1)
+		return false;
+
 	/* Check maximum number of pixels supported by Timing Generator
 	 * (Currently will never fail, in order to fail needs display which
 	 * needs more than 8192 horizontal and
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/12 drm/amd/display: moving remaining functionality from gpu to dce_clocks

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Change-Id I2eaf2a49eb3ea492fc1960ef8018462f1a83a472
---
 drivers/gpu/drm/amd/display/dc/Makefile            |   7 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 181 ++++++++++++--
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h    |  36 ++-
 drivers/gpu/drm/amd/display/dc/gpu/Makefile        |  21 --
 .../display/dc/gpu/dce112/display_clock_dce112.c   | 277 ---------------------
 .../display/dc/gpu/dce112/display_clock_dce112.h   |  79 ------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c | 127 ----------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h |  62 -----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   2 +-
 .../inc/hw/display_clock.h}                        |  27 +-
 10 files changed, 206 insertions(+), 613 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/Makefile
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h
 rename drivers/gpu/drm/amd/display/{include/display_clock_interface.h => dc/inc/hw/display_clock.h} (75%)
drivers/gpu/drm/amd/display/dc/Makefile +3 -4
index 5fac034093e9..26e2b50e4954 100644
@@ -2,8 +2,7 @@
 # Makefile for Display Core (dc) component.
 #
 
-DC_LIBS = basics bios calcs dce \
-gpio gpu i2caux irq virtual
+DC_LIBS = basics bios calcs dce gpio i2caux irq virtual
 
 DC_LIBS += dce112
 DC_LIBS += dce110
@@ -14,8 +13,8 @@ AMD_DC = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/dc/,$(DC_LI
 
 include $(AMD_DC)
 
-DISPLAY_CORE = dc.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_target.o dc_sink.o dc_stream.o \
-dc_surface.o dc_link_hwss.o dc_link_dp.o dc_link_ddc.o dc_debug.o
+DISPLAY_CORE = dc.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_target.o dc_sink.o \
+dc_surface.o dc_link_hwss.o dc_link_dp.o dc_link_ddc.o dc_debug.o dc_stream.o
 
 AMD_DISPLAY_CORE = $(addprefix $(AMDDALPATH)/dc/core/,$(DISPLAY_CORE))
 
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +167 -14

288 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h +24 -12
index e3b23749f0a2..4ad6fe4c2841 100644
@@ -27,12 +27,7 @@
 #ifndef _DCE_CLOCKS_H_
 #define _DCE_CLOCKS_H_
 
-#include "display_clock_interface.h"
-#include "../gpu/divider_range.h"
-
-
-#define TO_DCE_CLOCKS(clocks)\
-	container_of(clocks, struct dce_disp_clk, base)
+#include "display_clock.h"
 
 #define CLK_COMMON_REG_LIST_DCE_BASE() \
 	.DPREFCLK_CNTL = mmDPREFCLK_CNTL, \
@@ -74,13 +69,30 @@ struct dce_disp_clk_registers {
 };
 
 /* Array identifiers and count for the divider ranges.*/
-enum divider_range_count {
+enum dce_divider_range_count {
 	DIVIDER_RANGE_01 = 0,
 	DIVIDER_RANGE_02,
 	DIVIDER_RANGE_03,
 	DIVIDER_RANGE_MAX /* == 3*/
 };
 
+enum dce_divider_error_types {
+	INVALID_DID = 0,
+	INVALID_DIVIDER = 1
+};
+
+struct dce_divider_range {
+	int div_range_start;
+	/* The end of this range of dividers.*/
+	int div_range_end;
+	/* The distance between each divider in this range.*/
+	int div_range_step;
+	/* The divider id for the lowest divider.*/
+	int did_min;
+	/* The divider id for the highest divider.*/
+	int did_max;
+};
+
 struct dce_disp_clk {
 	struct display_clock base;
 	const struct dce_disp_clk_registers *regs;
@@ -88,23 +100,23 @@ struct dce_disp_clk {
 	const struct dce_disp_clk_mask *clk_mask;
 
 	struct state_dependent_clocks max_clks_by_state[DM_PP_CLOCKS_MAX_STATES];
-	struct divider_range divider_ranges[DIVIDER_RANGE_MAX];
+	struct dce_divider_range divider_ranges[DIVIDER_RANGE_MAX];
 
 	bool use_max_disp_clk;
-	uint32_t dentist_vco_freq_khz;
+	int dentist_vco_freq_khz;
 
 	/* Cache the status of DFS-bypass feature*/
 	bool dfs_bypass_enabled;
 	/* Cache the display clock returned by VBIOS if DFS-bypass is enabled.
 	 * This is basically "Crystal Frequency In KHz" (XTALIN) frequency */
-	uint32_t dfs_bypass_disp_clk;
+	int dfs_bypass_disp_clk;
 
 	/* Flag for Enabled SS on GPU PLL */
 	bool ss_on_gpu_pll;
 	/* GPU PLL SS percentage (if down-spread enabled) */
-	uint32_t gpu_pll_ss_percentage;
+	int gpu_pll_ss_percentage;
 	/* GPU PLL SS percentage Divider (100 or 1000) */
-	uint32_t gpu_pll_ss_divider;
+	int gpu_pll_ss_divider;
 
 
 };
drivers/gpu/drm/amd/display/dc/gpu/Makefile deleted +0 -21
deleted file mode 100644
index 6ab4078405f2..000000000000
@@ -1,21 +0,0 @@
-#
-# Makefile for the 'gpu' sub-component of DAL.
-# It provides the control and status of HW adapter resources,
-# that are global for the ASIC and sharable between pipes.
-
-GPU = divider_range.o
-
-AMD_DAL_GPU = $(addprefix $(AMDDALPATH)/dc/gpu/,$(GPU))
-
-AMD_DISPLAY_FILES += $(AMD_DAL_GPU)
-
-###############################################################################
-# DCE 110 family
-###############################################################################
-
-GPU_DCE112 = display_clock_dce112.o
-
-AMD_DAL_GPU_DCE112 = $(addprefix $(AMDDALPATH)/dc/gpu/dce112/,$(GPU_DCE112))
-
-AMD_DISPLAY_FILES += $(AMD_DAL_GPU_DCE110) $(AMD_DAL_GPU_DCE112)
-
drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.c deleted +0 -277

277 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h deleted +0 -79

79 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/gpu/divider_range.c deleted +0 -127

127 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/gpu/divider_range.h deleted +0 -62

62 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
index f2eb8945d5c4..0418e3e02c7a 100644
@@ -188,7 +188,7 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx);
 void core_link_disable_stream(struct pipe_ctx *pipe_ctx);
 
 /********** DAL Core*********************/
-#include "display_clock_interface.h"
+#include "display_clock.h"
 #include "transform.h"
 
 struct resource_pool;
drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h renamed from drivers/gpu/drm/amd/display/include/display_clock_interface.h +11 -16
similarity index 75%
rename from drivers/gpu/drm/amd/display/include/display_clock_interface.h
rename to drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h
index 53a01381c638..e163f5818dd9 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-15 Advanced Micro Devices, Inc.
+ * Copyright 2012-16 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"),
@@ -23,44 +23,39 @@
  *
  */
 
-#ifndef __DISPLAY_CLOCK_INTERFACE_H__
-#define __DISPLAY_CLOCK_INTERFACE_H__
+#ifndef __DISPLAY_CLOCK_H__
+#define __DISPLAY_CLOCK_H__
 
 #include "dm_services_types.h"
-#include "hw_sequencer_types.h"
-#include "grph_object_defs.h"
-#include "signal_types.h"
 
 /* Structure containing all state-dependent clocks
  * (dependent on "enum clocks_state") */
 struct state_dependent_clocks {
-	uint32_t display_clk_khz;
-	uint32_t pixel_clk_khz;
+	int display_clk_khz;
+	int pixel_clk_khz;
 };
 
 struct display_clock {
 	struct dc_context *ctx;
 	const struct display_clock_funcs *funcs;
 
-	int min_display_clk_threshold_khz;
 	enum dm_pp_clocks_state max_clks_state;
 	enum dm_pp_clocks_state cur_min_clks_state;
 };
 
 struct display_clock_funcs {
-	void (*destroy)(struct display_clock **to_destroy);
 	void (*set_clock)(struct display_clock *disp_clk,
-		uint32_t requested_clock_khz);
+		int requested_clock_khz);
+
 	enum dm_pp_clocks_state (*get_required_clocks_state)(
 		struct display_clock *disp_clk,
 		struct state_dependent_clocks *req_clocks);
+
 	bool (*set_min_clocks_state)(struct display_clock *disp_clk,
 		enum dm_pp_clocks_state dm_pp_clocks_state);
-	uint32_t (*get_dp_ref_clk_frequency)(struct display_clock *disp_clk);
 
-};
-
-void dal_display_clock_destroy(struct display_clock **to_destroy);
+	int (*get_dp_ref_clk_frequency)(struct display_clock *disp_clk);
 
+};
 
-#endif /* __DISPLAY_CLOCK_INTERFACE_H__ */
+#endif /* __DISPLAY_CLOCK_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): 20161208012624.8914-3-harry.wentland-5C7GfCeVMHo@public.gmane.org

#5 lore raw

Re: [PATCH 02/12] drm/amd/display: moving remaining functionality from gpu to dce_clocks

Hey Harry,
I can't say much about the overall changes (DAL/DC is a large code base and I've no deep understanding of it), but I noticed a couple of things regarding readability, see below.
Harry Wentland wrote on 08.12.2016 02:26:

Quoted 93 lines

From: Dmytro Laktyushkin <[email protected]>

Change-Id I2eaf2a49eb3ea492fc1960ef8018462f1a83a472
---
 drivers/gpu/drm/amd/display/dc/Makefile            |   7 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 181 ++++++++++++--
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h    |  36 ++-
 drivers/gpu/drm/amd/display/dc/gpu/Makefile        |  21 --
 .../display/dc/gpu/dce112/display_clock_dce112.c   | 277 ---------------------
 .../display/dc/gpu/dce112/display_clock_dce112.h   |  79 ------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c | 127 ----------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h |  62 -----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   2 +-
 .../inc/hw/display_clock.h}                        |  27 +-
 10 files changed, 206 insertions(+), 613 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/Makefile
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h
 rename drivers/gpu/drm/amd/display/{include/display_clock_interface.h => dc/inc/hw/display_clock.h} (75%)
drivers/gpu/drm/amd/display/dc/Makefile +3 -4
index 5fac034093e9..26e2b50e4954 100644
@@ -2,8 +2,7 @@
 # Makefile for Display Core (dc) component.
 #
 
-DC_LIBS = basics bios calcs dce \
-gpio gpu i2caux irq virtual
+DC_LIBS = basics bios calcs dce gpio i2caux irq virtual
 
 DC_LIBS += dce112
 DC_LIBS += dce110
@@ -14,8 +13,8 @@ AMD_DC = $(addsuffix /Makefile, $(addprefix $(FULL_AMD_DISPLAY_PATH)/dc/,$(DC_LI
 
 include $(AMD_DC)
 
-DISPLAY_CORE = dc.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_target.o dc_sink.o dc_stream.o \
-dc_surface.o dc_link_hwss.o dc_link_dp.o dc_link_ddc.o dc_debug.o
+DISPLAY_CORE = dc.o dc_link.o dc_resource.o dc_hw_sequencer.o dc_target.o dc_sink.o \
+dc_surface.o dc_link_hwss.o dc_link_dp.o dc_link_ddc.o dc_debug.o dc_stream.o
 
 AMD_DISPLAY_CORE = $(addprefix $(AMDDALPATH)/dc/core/,$(DISPLAY_CORE))
 
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +28 -0
index 846754c16831..c2bd8dc7b4ad 100644
@@ -30,6 +30,8 @@
 #include "bios_parser_interface.h"
 #include "dc.h"
 
+#define TO_DCE_CLOCKS(clocks)\
+	container_of(clocks, struct dce_disp_clk, base)
 
 #define REG(reg) \
 	(clk_dce->regs->reg)
@@ -41,8 +43,45 @@
 #define CTX \
 	clk_dce->base.ctx
 
+/* Max clock values for each state indexed by "enum clocks_state": */
+static struct state_dependent_clocks dce80_max_clks_by_state[] = {
+/* ClocksStateInvalid - should not be used */
+{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
+/* ClocksStateUltraLow - not expected to be used for DCE 8.0 */
+{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
+/* ClocksStateLow */
+{ .display_clk_khz = 352000, .pixel_clk_khz = 330000},
+/* ClocksStateNominal */
+{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 },
+/* ClocksStatePerformance */
+{ .display_clk_khz = 600000, .pixel_clk_khz = 400000 } };
+
+static struct state_dependent_clocks dce110_max_clks_by_state[] = {
+/*ClocksStateInvalid - should not be used*/
+{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
+/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
+{ .display_clk_khz = 352000, .pixel_clk_khz = 330000 },
+/*ClocksStateLow*/
+{ .display_clk_khz = 352000, .pixel_clk_khz = 330000 },
+/*ClocksStateNominal*/
+{ .display_clk_khz = 467000, .pixel_clk_khz = 400000 },
+/*ClocksStatePerformance*/
+{ .display_clk_khz = 643000, .pixel_clk_khz = 400000 } };
+
+static struct state_dependent_clocks dce112_max_clks_by_state[] = {

drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c line 81

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +10 -0
+/*ClocksStateInvalid - should not be used*/
+{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
+/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
+{ .display_clk_khz = 389189, .pixel_clk_khz = 346672 },
+/*ClocksStateLow*/
+{ .display_clk_khz = 459000, .pixel_clk_khz = 400000 },
+/*ClocksStateNominal*/
+{ .display_clk_khz = 667000, .pixel_clk_khz = 600000 },
+/*ClocksStatePerformance*/
+{ .display_clk_khz = 1132000, .pixel_clk_khz = 600000 } };

Can these be aligned like a table? For example like:

static struct state_dependent_clocks dce112_max_clks_by_state[] = {
{ .display_clk_khz = 0, .pixel_clk_khz = 0 },

  { .display_clk_khz =  389189, .pixel_clk_khz = 346672 },
  { .display_clk_khz =  459000, .pixel_clk_khz = 400000 },
  { .display_clk_khz =  667000, .pixel_clk_khz = 600000 },

{ .display_clk_khz = 1132000, .pixel_clk_khz = 600000 },
};

Bonus points, if you make the alignment match across all of these structs. ;-)

Quoted 23 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +3 -3
 /* Starting point for each divider range.*/
-enum divider_range_start {
+enum dce_divider_range_start {
 	DIVIDER_RANGE_01_START = 200, /* 2.00*/
 	DIVIDER_RANGE_02_START = 1600, /* 16.00*/
 	DIVIDER_RANGE_03_START = 3200, /* 32.00*/
@@ -51,7 +90,7 @@ enum divider_range_start {
 
 /* Ranges for divider identifiers (Divider ID or DID)
  mmDENTIST_DISPCLK_CNTL.DENTIST_DISPCLK_WDIVIDER*/
-enum divider_id_register_setting {
+enum dce_divider_id_register_setting {
 	DIVIDER_RANGE_01_BASE_DIVIDER_ID = 0X08,
 	DIVIDER_RANGE_02_BASE_DIVIDER_ID = 0X40,
 	DIVIDER_RANGE_03_BASE_DIVIDER_ID = 0X60,
@@ -61,12 +100,112 @@ enum divider_id_register_setting {
 /* Step size between each divider within a range.
  Incrementing the DENTIST_DISPCLK_WDIVIDER by one
  will increment the divider by this much.*/
-enum divider_range_step_size {
+enum dce_divider_range_step_size {
 	DIVIDER_RANGE_01_STEP_SIZE = 25, /* 0.25*/
 	DIVIDER_RANGE_02_STEP_SIZE = 50, /* 0.50*/

drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c enum divider_id_register_setting { · line 115

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +7 -0
 	DIVIDER_RANGE_03_STEP_SIZE = 100 /* 1.00 */
 };
 
+static bool dce_divider_range_construct(
+	struct dce_divider_range *div_range,
+	int range_start,
+	int range_step,
+	int did_min,
+	int did_max)
+{

Is it guaranteed, that div_range is not a null pointer? This is a common question and applies to the functions below as well. I expected an
if(!div_range)

    return false;
Quoted 7 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +7 -0
+	div_range->div_range_start = range_start;
+	div_range->div_range_step = range_step;
+	div_range->did_min = did_min;
+	div_range->did_max = did_max;
+
+	if (div_range->div_range_step == 0) {
+		div_range->div_range_step = 1;

drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c enum divider_id_register_setting { · line 132

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +10 -0
+		/*div_range_step cannot be zero*/
+		BREAK_TO_DEBUGGER();
+	}
+	/* Calculate this based on the other inputs.*/
+	/* See DividerRange.h for explanation of */
+	/* the relationship between divider id (DID) and a divider.*/
+	/* Number of Divider IDs = (Maximum Divider ID - Minimum Divider ID)*/
+	/* Maximum divider identified in this range =
+	 * (Number of Divider IDs)*Step size between dividers
+	 *  + The start of this range.*/

I'd be nice if you used only one opening and one closing statement for the comment. You can always add a asterisk to the front:

/*
* Multi-line
* comment here
*/

It really took me a while to parse the comment – especially since there are sometimes spaces between the closing statement and sometimes not.

Quoted 119 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +81 -5
+	div_range->div_range_end = (did_max - did_min) * range_step
+		+ range_start;
+	return true;
+}
+
+static int dce_divider_range_calc_divider(
+	struct dce_divider_range *div_range,
+	int did)
+{
+	/* Is this DID within our range?*/
+	if ((did < div_range->did_min) || (did >= div_range->did_max))
+		return INVALID_DIVIDER;
+
+	return ((did - div_range->did_min) * div_range->div_range_step)
+			+ div_range->div_range_start;
+
+}
+
+static int dce_divider_range_calc_did(
+	struct dce_divider_range *div_range,
+	int div)
+{
+	int did;
+	/* Check before dividing.*/
+	if (div_range->div_range_step == 0) {
+		div_range->div_range_step = 1;
+		/*div_range_step cannot be zero*/
+		BREAK_TO_DEBUGGER();
+	}
+	/* Is this divider within our range?*/
+	if ((div < div_range->div_range_start)
+		|| (div >= div_range->div_range_end))
+		return INVALID_DID;
+/* did = (divider - range_start + (range_step-1)) / range_step) + did_min*/
+	did = div - div_range->div_range_start;
+	did += div_range->div_range_step - 1;
+	did /= div_range->div_range_step;
+	did += div_range->did_min;
+	return did;
+}
+
+static int dce_divider_range_get_divider(
+	struct dce_divider_range *div_range,
+	int ranges_num,
+	int did)
+{
+	int div = INVALID_DIVIDER;
+	int i;
+
+	for (i = 0; i < ranges_num; i++) {
+		/* Calculate divider with given divider ID*/
+		div = dce_divider_range_calc_divider(&div_range[i], did);
+		/* Found a valid return divider*/
+		if (div != INVALID_DIVIDER)
+			break;
+	}
+	return div;
+}
+
+static int dce_divider_range_get_did(
+	struct dce_divider_range *div_range,
+	int ranges_num,
+	int divider)
+{
+	int did = INVALID_DID;
+	int i;
+
+	for (i = 0; i < ranges_num; i++) {
+		/*  CalcDid returns InvalidDid if a divider ID isn't found*/
+		did = dce_divider_range_calc_did(&div_range[i], divider);
+		/* Found a valid return did*/
+		if (did != INVALID_DID)
+			break;
+	}
+	return did;
+}
 
 static uint32_t dce_clocks_get_dp_ref_freq(struct display_clock *clk)
 {
@@ -85,7 +224,7 @@ static uint32_t dce_clocks_get_dp_ref_freq(struct display_clock *clk)
 	REG_GET(DENTIST_DISPCLK_CNTL, DENTIST_DPREFCLK_WDIVIDER, &dprefclk_wdivider);
 
 	/* Convert DENTIST_DPREFCLK_WDIVIDERto actual divider*/
-	target_div = dal_divider_range_get_divider(
+	target_div = dce_divider_range_get_divider(
 			clk_dce->divider_ranges,
 			DIVIDER_RANGE_MAX,
 			dprefclk_wdivider);
@@ -183,7 +322,7 @@ static bool dce_clock_set_min_clocks_state(
 
 static void dce_set_clock(
 	struct display_clock *clk,
-	uint32_t requested_clk_khz)
+	int requested_clk_khz)
 {
 	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
 	struct bp_pixel_clock_parameters pxl_clk_params = { 0 };
@@ -245,7 +384,7 @@ static void dce_psr_wait_loop(
 
 static void dce_psr_set_clock(
 	struct display_clock *clk,
-	uint32_t requested_clk_khz)
+	int requested_clk_khz)
 {
 	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
 
@@ -253,9 +392,9 @@ static void dce_psr_set_clock(
 	dce_psr_wait_loop(clk_dce, requested_clk_khz);
 }
 
-static void polaris_set_clock(
+static void dce112_set_clock(
 	struct display_clock *clk,
-	uint32_t requested_clk_khz)
+	int requested_clk_khz)
 {
 	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
 	struct bp_set_dce_clock_parameters dce_clk_params;

drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c static void polaris_set_clock( · line 409

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +1 -1
@@ -267,7 +406,7 @@ static void polaris_set_clock(
 	/* Make sure requested clock isn't lower than minimum threshold*/
 	if (requested_clk_khz > 0)
 		requested_clk_khz = dm_max(requested_clk_khz,
-				clk_dce->dentist_vco_freq_khz / 64);
+				clk_dce->dentist_vco_freq_khz / 62);

Can you document why 62? Maybe a speaking #define would be best?

Cheers,
Kai

Quoted 826 lines
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +19 -5
 	dce_clk_params.target_clock_frequency = requested_clk_khz;
 	dce_clk_params.pll_id = CLOCK_SOURCE_ID_DFS;
@@ -284,7 +423,9 @@ static void polaris_set_clock(
 	/*VBIOS will determine DPREFCLK frequency, so we don't set it*/
 	dce_clk_params.target_clock_frequency = 0;
 	dce_clk_params.clock_type = DCECLOCK_TYPE_DPREFCLK;
-	dce_clk_params.flags.USE_GENLOCK_AS_SOURCE_FOR_DPREFCLK = 0;
+	dce_clk_params.flags.USE_GENLOCK_AS_SOURCE_FOR_DPREFCLK =
+			(dce_clk_params.pll_id ==
+					CLOCK_SOURCE_COMBO_DISPLAY_PLL0);
 
 	bp->funcs->set_dce_clock(bp, &dce_clk_params);
 }
@@ -386,7 +527,7 @@ static const struct display_clock_funcs dce112_funcs = {
 	.get_dp_ref_clk_frequency = dce_clocks_get_dp_ref_freq,
 	.get_required_clocks_state = dce_get_required_clocks_state,
 	.set_min_clocks_state = dce_clock_set_min_clocks_state,
-	.set_clock = polaris_set_clock
+	.set_clock = dce112_set_clock
 };
 
 static const struct display_clock_funcs dce110_funcs = {
@@ -429,19 +570,19 @@ static void dce_disp_clk_construct(
 	dce_clock_read_integrated_info(clk_dce);
 	dce_clock_read_ss_info(clk_dce);
 
-	dal_divider_range_construct(
+	dce_divider_range_construct(
 		&clk_dce->divider_ranges[DIVIDER_RANGE_01],
 		DIVIDER_RANGE_01_START,
 		DIVIDER_RANGE_01_STEP_SIZE,
 		DIVIDER_RANGE_01_BASE_DIVIDER_ID,
 		DIVIDER_RANGE_02_BASE_DIVIDER_ID);
-	dal_divider_range_construct(
+	dce_divider_range_construct(
 		&clk_dce->divider_ranges[DIVIDER_RANGE_02],
 		DIVIDER_RANGE_02_START,
 		DIVIDER_RANGE_02_STEP_SIZE,
 		DIVIDER_RANGE_02_BASE_DIVIDER_ID,
 		DIVIDER_RANGE_03_BASE_DIVIDER_ID);
-	dal_divider_range_construct(
+	dce_divider_range_construct(
 		&clk_dce->divider_ranges[DIVIDER_RANGE_03],
 		DIVIDER_RANGE_03_START,
 		DIVIDER_RANGE_03_STEP_SIZE,
@@ -462,6 +603,10 @@ struct display_clock *dce_disp_clk_create(
 		return NULL;
 	}
 
+	memcpy(clk_dce->max_clks_by_state,
+		dce80_max_clks_by_state,
+		sizeof(dce80_max_clks_by_state));
+
 	dce_disp_clk_construct(
 		clk_dce, ctx, regs, clk_shift, clk_mask);
 
@@ -481,6 +626,10 @@ struct display_clock *dce110_disp_clk_create(
 		return NULL;
 	}
 
+	memcpy(clk_dce->max_clks_by_state,
+		dce110_max_clks_by_state,
+		sizeof(dce110_max_clks_by_state));
+
 	dce_disp_clk_construct(
 		clk_dce, ctx, regs, clk_shift, clk_mask);
 
@@ -502,6 +651,10 @@ struct display_clock *dce112_disp_clk_create(
 		return NULL;
 	}
 
+	memcpy(clk_dce->max_clks_by_state,
+		dce112_max_clks_by_state,
+		sizeof(dce112_max_clks_by_state));
+
 	dce_disp_clk_construct(
 		clk_dce, ctx, regs, clk_shift, clk_mask);
 
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h +24 -12
index e3b23749f0a2..4ad6fe4c2841 100644
@@ -27,12 +27,7 @@
 #ifndef _DCE_CLOCKS_H_
 #define _DCE_CLOCKS_H_
 
-#include "display_clock_interface.h"
-#include "../gpu/divider_range.h"
-
-
-#define TO_DCE_CLOCKS(clocks)\
-	container_of(clocks, struct dce_disp_clk, base)
+#include "display_clock.h"
 
 #define CLK_COMMON_REG_LIST_DCE_BASE() \
 	.DPREFCLK_CNTL = mmDPREFCLK_CNTL, \
@@ -74,13 +69,30 @@ struct dce_disp_clk_registers {
 };
 
 /* Array identifiers and count for the divider ranges.*/
-enum divider_range_count {
+enum dce_divider_range_count {
 	DIVIDER_RANGE_01 = 0,
 	DIVIDER_RANGE_02,
 	DIVIDER_RANGE_03,
 	DIVIDER_RANGE_MAX /* == 3*/
 };
 
+enum dce_divider_error_types {
+	INVALID_DID = 0,
+	INVALID_DIVIDER = 1
+};
+
+struct dce_divider_range {
+	int div_range_start;
+	/* The end of this range of dividers.*/
+	int div_range_end;
+	/* The distance between each divider in this range.*/
+	int div_range_step;
+	/* The divider id for the lowest divider.*/
+	int did_min;
+	/* The divider id for the highest divider.*/
+	int did_max;
+};
+
 struct dce_disp_clk {
 	struct display_clock base;
 	const struct dce_disp_clk_registers *regs;
@@ -88,23 +100,23 @@ struct dce_disp_clk {
 	const struct dce_disp_clk_mask *clk_mask;
 
 	struct state_dependent_clocks max_clks_by_state[DM_PP_CLOCKS_MAX_STATES];
-	struct divider_range divider_ranges[DIVIDER_RANGE_MAX];
+	struct dce_divider_range divider_ranges[DIVIDER_RANGE_MAX];
 
 	bool use_max_disp_clk;
-	uint32_t dentist_vco_freq_khz;
+	int dentist_vco_freq_khz;
 
 	/* Cache the status of DFS-bypass feature*/
 	bool dfs_bypass_enabled;
 	/* Cache the display clock returned by VBIOS if DFS-bypass is enabled.
 	 * This is basically "Crystal Frequency In KHz" (XTALIN) frequency */
-	uint32_t dfs_bypass_disp_clk;
+	int dfs_bypass_disp_clk;
 
 	/* Flag for Enabled SS on GPU PLL */
 	bool ss_on_gpu_pll;
 	/* GPU PLL SS percentage (if down-spread enabled) */
-	uint32_t gpu_pll_ss_percentage;
+	int gpu_pll_ss_percentage;
 	/* GPU PLL SS percentage Divider (100 or 1000) */
-	uint32_t gpu_pll_ss_divider;
+	int gpu_pll_ss_divider;
 
 
 };
drivers/gpu/drm/amd/display/dc/gpu/Makefile deleted +0 -21
deleted file mode 100644
index 6ab4078405f2..000000000000
@@ -1,21 +0,0 @@
-#
-# Makefile for the 'gpu' sub-component of DAL.
-# It provides the control and status of HW adapter resources,
-# that are global for the ASIC and sharable between pipes.
-
-GPU = divider_range.o
-
-AMD_DAL_GPU = $(addprefix $(AMDDALPATH)/dc/gpu/,$(GPU))
-
-AMD_DISPLAY_FILES += $(AMD_DAL_GPU)
-
-###############################################################################
-# DCE 110 family
-###############################################################################
-
-GPU_DCE112 = display_clock_dce112.o
-
-AMD_DAL_GPU_DCE112 = $(addprefix $(AMDDALPATH)/dc/gpu/dce112/,$(GPU_DCE112))
-
-AMD_DISPLAY_FILES += $(AMD_DAL_GPU_DCE110) $(AMD_DAL_GPU_DCE112)
-
drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.c deleted +0 -277
deleted file mode 100644
index e0d67fb6c633..000000000000
@@ -1,277 +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
- *
- */
-
-#include "dm_services.h"
-
-#include "dce/dce_11_2_d.h"
-#include "dce/dce_11_2_sh_mask.h"
-
-#include "include/bios_parser_interface.h"
-#include "include/fixed32_32.h"
-#include "include/logger_interface.h"
-
-#include "../divider_range.h"
-
-#include "display_clock_dce112.h"
-
-#define FROM_DISPLAY_CLOCK(base) \
-	container_of(base, struct display_clock_dce112, disp_clk_base)
-
-static struct state_dependent_clocks max_clks_by_state[] = {
-/*ClocksStateInvalid - should not be used*/
-{ .display_clk_khz = 0, .pixel_clk_khz = 0 },
-/*ClocksStateUltraLow - currently by HW design team not supposed to be used*/
-{ .display_clk_khz = 389189, .pixel_clk_khz = 346672 },
-/*ClocksStateLow*/
-{ .display_clk_khz = 459000, .pixel_clk_khz = 400000 },
-/*ClocksStateNominal*/
-{ .display_clk_khz = 667000, .pixel_clk_khz = 600000 },
-/*ClocksStatePerformance*/
-{ .display_clk_khz = 1132000, .pixel_clk_khz = 600000 } };
-
-/* Ranges for divider identifiers (Divider ID or DID)
- mmDENTIST_DISPCLK_CNTL.DENTIST_DISPCLK_WDIVIDER*/
-enum divider_id_register_setting {
-	DIVIDER_RANGE_01_BASE_DIVIDER_ID = 0X08,
-	DIVIDER_RANGE_02_BASE_DIVIDER_ID = 0X40,
-	DIVIDER_RANGE_03_BASE_DIVIDER_ID = 0X60,
-	DIVIDER_RANGE_MAX_DIVIDER_ID = 0X80
-};
-
-/* Step size between each divider within a range.
- Incrementing the DENTIST_DISPCLK_WDIVIDER by one
- will increment the divider by this much.*/
-enum divider_range_step_size {
-	DIVIDER_RANGE_01_STEP_SIZE = 25, /* 0.25*/
-	DIVIDER_RANGE_02_STEP_SIZE = 50, /* 0.50*/
-	DIVIDER_RANGE_03_STEP_SIZE = 100 /* 1.00 */
-};
-
-static struct divider_range divider_ranges[DIVIDER_RANGE_MAX];
-
-
-void dispclk_dce112_destroy(struct display_clock **base)
-{
-	struct display_clock_dce112 *dc112;
-
-	dc112 = DCLCK112_FROM_BASE(*base);
-
-	dm_free(dc112);
-
-	*base = NULL;
-}
-
-static bool display_clock_integrated_info_construct(
-	struct display_clock_dce112 *disp_clk)
-{
-	struct integrated_info info;
-	uint32_t i;
-	struct display_clock *base = &disp_clk->disp_clk_base;
-
-	memset(&info, 0, sizeof(struct integrated_info));
-
-	disp_clk->dentist_vco_freq_khz = info.dentist_vco_freq;
-	if (disp_clk->dentist_vco_freq_khz == 0)
-		disp_clk->dentist_vco_freq_khz = 3600000;
-
-	base->min_display_clk_threshold_khz =
-		disp_clk->dentist_vco_freq_khz / 64;
-
-	/*update the maximum display clock for each power state*/
-	for (i = 0; i < NUMBER_OF_DISP_CLK_VOLTAGE; ++i) {
-		enum dm_pp_clocks_state clk_state = DM_PP_CLOCKS_STATE_INVALID;
-
-		switch (i) {
-		case 0:
-			clk_state = DM_PP_CLOCKS_STATE_ULTRA_LOW;
-			break;
-
-		case 1:
-			clk_state = DM_PP_CLOCKS_STATE_LOW;
-			break;
-
-		case 2:
-			clk_state = DM_PP_CLOCKS_STATE_NOMINAL;
-			break;
-
-		case 3:
-			clk_state = DM_PP_CLOCKS_STATE_PERFORMANCE;
-			break;
-
-		default:
-			clk_state = DM_PP_CLOCKS_STATE_INVALID;
-			break;
-		}
-
-		/*Do not allow bad VBIOS/SBIOS to override with invalid values,
-		 * check for > 100MHz*/
-		if (info.disp_clk_voltage[i].max_supported_clk >= 100000) {
-			(disp_clk->max_clks_by_state + clk_state)->
-					display_clk_khz =
-				info.disp_clk_voltage[i].max_supported_clk;
-		}
-	}
-
-	return true;
-}
-
-void dce112_set_clock(
-	struct display_clock *base,
-	uint32_t requested_clk_khz)
-{
-	struct bp_set_dce_clock_parameters dce_clk_params;
-	struct dc_bios *bp = base->ctx->dc_bios;
-
-	/* Prepare to program display clock*/
-	memset(&dce_clk_params, 0, sizeof(dce_clk_params));
-
-	/* Make sure requested clock isn't lower than minimum threshold*/
-	if (requested_clk_khz > 0)
-		requested_clk_khz = dm_max(requested_clk_khz,
-				base->min_display_clk_threshold_khz);
-
-	dce_clk_params.target_clock_frequency = requested_clk_khz;
-	dce_clk_params.pll_id = CLOCK_SOURCE_ID_DFS;
-	dce_clk_params.clock_type = DCECLOCK_TYPE_DISPLAY_CLOCK;
-
-	bp->funcs->set_dce_clock(bp, &dce_clk_params);
-
-	/* from power down, we need mark the clock state as ClocksStateNominal
-	 * from HWReset, so when resume we will call pplib voltage regulator.*/
-	if (requested_clk_khz == 0)
-		base->cur_min_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
-	/*Program DP ref Clock*/
-	/*VBIOS will determine DPREFCLK frequency, so we don't set it*/
-	dce_clk_params.target_clock_frequency = 0;
-	dce_clk_params.clock_type = DCECLOCK_TYPE_DPREFCLK;
-	dce_clk_params.flags.USE_GENLOCK_AS_SOURCE_FOR_DPREFCLK =
-			(dce_clk_params.pll_id ==
-					CLOCK_SOURCE_COMBO_DISPLAY_PLL0);
-
-	bp->funcs->set_dce_clock(bp, &dce_clk_params);
-}
-
-static const struct display_clock_funcs funcs = {
-	.destroy = dispclk_dce112_destroy,
-	.set_clock = dce112_set_clock,
-};
-
-bool dal_display_clock_dce112_construct(
-	struct display_clock_dce112 *dc112,
-	struct dc_context *ctx)
-{
-	struct display_clock *dc_base = &dc112->disp_clk_base;
-
-	dc_base->ctx = ctx;
-	dc_base->min_display_clk_threshold_khz = 0;
-
-	dc_base->cur_min_clks_state = DM_PP_CLOCKS_STATE_INVALID;
-
-	dc_base->funcs = &funcs;
-
-	dc112->dfs_bypass_disp_clk = 0;
-
-	if (!display_clock_integrated_info_construct(dc112))
-		dm_logger_write(dc_base->ctx->logger, LOG_WARNING,
-			"Cannot obtain VBIOS integrated info\n");
-
-	dc112->gpu_pll_ss_percentage = 0;
-	dc112->gpu_pll_ss_divider = 1000;
-	dc112->ss_on_gpu_pll = false;
-
-/* Initially set max clocks state to nominal.  This should be updated by
- * via a pplib call to DAL IRI eventually calling a
- * DisplayEngineClock_dce112::StoreMaxClocksState().  This call will come in
- * on PPLIB init. This is from DCE5x. in case HW wants to use mixed method.*/
-	dc_base->max_clks_state = DM_PP_CLOCKS_STATE_NOMINAL;
-
-	dc112->disp_clk_base.min_display_clk_threshold_khz =
-			(dc112->dentist_vco_freq_khz / 62);
-
-	dal_divider_range_construct(
-		&divider_ranges[DIVIDER_RANGE_01],
-		DIVIDER_RANGE_01_START,
-		DIVIDER_RANGE_01_STEP_SIZE,
-		DIVIDER_RANGE_01_BASE_DIVIDER_ID,
-		DIVIDER_RANGE_02_BASE_DIVIDER_ID);
-	dal_divider_range_construct(
-		&divider_ranges[DIVIDER_RANGE_02],
-		DIVIDER_RANGE_02_START,
-		DIVIDER_RANGE_02_STEP_SIZE,
-		DIVIDER_RANGE_02_BASE_DIVIDER_ID,
-		DIVIDER_RANGE_03_BASE_DIVIDER_ID);
-	dal_divider_range_construct(
-		&divider_ranges[DIVIDER_RANGE_03],
-		DIVIDER_RANGE_03_START,
-		DIVIDER_RANGE_03_STEP_SIZE,
-		DIVIDER_RANGE_03_BASE_DIVIDER_ID,
-		DIVIDER_RANGE_MAX_DIVIDER_ID);
-
-	{
-		uint32_t ss_info_num =
-			ctx->dc_bios->funcs->
-			get_ss_entry_number(ctx->dc_bios, AS_SIGNAL_TYPE_GPU_PLL);
-
-		if (ss_info_num) {
-			struct spread_spectrum_info info;
-			bool result;
-
-			memset(&info, 0, sizeof(info));
-
-			result =
-					(BP_RESULT_OK == ctx->dc_bios->funcs->
-					get_spread_spectrum_info(ctx->dc_bios,
-					AS_SIGNAL_TYPE_GPU_PLL, 0, &info)) ? true : false;
-
-
-			/* Based on VBIOS, VBIOS will keep entry for GPU PLL SS
-			 * even if SS not enabled and in that case
-			 * SSInfo.spreadSpectrumPercentage !=0 would be sign
-			 * that SS is enabled
-			 */
-			if (result && info.spread_spectrum_percentage != 0) {
-				dc112->ss_on_gpu_pll = true;
-				dc112->gpu_pll_ss_divider =
-					info.spread_percentage_divider;
-
-				if (info.type.CENTER_MODE == 0) {
-					/* Currently for DP Reference clock we
-					 * need only SS percentage for
-					 * downspread */
-					dc112->gpu_pll_ss_percentage =
-						info.spread_spectrum_percentage;
-				}
-			}
-
-		}
-	}
-
-	dc112->use_max_disp_clk = true;
-	dc112->max_clks_by_state = max_clks_by_state;
-
-	return true;
-}
-
drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h deleted +0 -79
deleted file mode 100644
index 0743c514a60f..000000000000
@@ -1,79 +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_DISPLAY_CLOCK_DCE112_H__
-#define __DAL_DISPLAY_CLOCK_DCE112_H__
-
-#include "display_clock_interface.h"
-
-struct display_clock_dce112 {
-	struct display_clock disp_clk_base;
-	bool use_max_disp_clk;
-	uint32_t dentist_vco_freq_khz;
-	/* Cache the status of DFS-bypass feature*/
-	bool dfs_bypass_enabled;
-	/* GPU PLL SS percentage (if down-spread enabled) */
-	uint32_t gpu_pll_ss_percentage;
-	/* GPU PLL SS percentage Divider (100 or 1000) */
-	uint32_t gpu_pll_ss_divider;
-	/* Flag for Enabled SS on GPU PLL */
-	bool ss_on_gpu_pll;
-	/* Cache the display clock returned by VBIOS if DFS-bypass is enabled.
-	 * This is basically "Crystal Frequency In KHz" (XTALIN) frequency */
-	uint32_t dfs_bypass_disp_clk;
-	struct state_dependent_clocks *max_clks_by_state;
-
-};
-
-#define DCLCK112_FROM_BASE(dc_base) \
-	container_of(dc_base, struct display_clock_dce112, disp_clk_base)
-
-/* Array identifiers and count for the divider ranges.*/
-enum divider_range_count {
-	DIVIDER_RANGE_01 = 0,
-	DIVIDER_RANGE_02,
-	DIVIDER_RANGE_03,
-	DIVIDER_RANGE_MAX /* == 3*/
-};
-
-/* Starting point for each divider range.*/
-enum divider_range_start {
-	DIVIDER_RANGE_01_START = 200, /* 2.00*/
-	DIVIDER_RANGE_02_START = 1600, /* 16.00*/
-	DIVIDER_RANGE_03_START = 3200, /* 32.00*/
-	DIVIDER_RANGE_SCALE_FACTOR = 100 /* Results are scaled up by 100.*/
-};
-
-bool dal_display_clock_dce112_construct(
-	struct display_clock_dce112 *dc112,
-	struct dc_context *ctx);
-
-void dispclk_dce112_destroy(struct display_clock **base);
-
-void dce112_set_clock(
-	struct display_clock *base,
-	uint32_t requested_clk_khz);
-
-
-#endif /* __DAL_DISPLAY_CLOCK_DCE112_H__ */
drivers/gpu/drm/amd/display/dc/gpu/divider_range.c deleted +0 -127
deleted file mode 100644
index 59d44004411b..000000000000
@@ -1,127 +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
- *
- */
-#include "dm_services.h"
-#include "divider_range.h"
-
-bool dal_divider_range_construct(
-	struct divider_range *div_range,
-	uint32_t range_start,
-	uint32_t range_step,
-	uint32_t did_min,
-	uint32_t did_max)
-{
-	div_range->div_range_start = range_start;
-	div_range->div_range_step = range_step;
-	div_range->did_min = did_min;
-	div_range->did_max = did_max;
-
-	if (div_range->div_range_step == 0) {
-		div_range->div_range_step = 1;
-		/*div_range_step cannot be zero*/
-		BREAK_TO_DEBUGGER();
-	}
-	/* Calculate this based on the other inputs.*/
-	/* See DividerRange.h for explanation of */
-	/* the relationship between divider id (DID) and a divider.*/
-	/* Number of Divider IDs = (Maximum Divider ID - Minimum Divider ID)*/
-	/* Maximum divider identified in this range =
-	 * (Number of Divider IDs)*Step size between dividers
-	 *  + The start of this range.*/
-	div_range->div_range_end = (did_max - did_min) * range_step
-		+ range_start;
-	return true;
-}
-
-static uint32_t dal_divider_range_calc_divider(
-	struct divider_range *div_range,
-	uint32_t did)
-{
-	/* Is this DID within our range?*/
-	if ((did < div_range->did_min) || (did >= div_range->did_max))
-		return INVALID_DIVIDER;
-
-	return ((did - div_range->did_min) * div_range->div_range_step)
-			+ div_range->div_range_start;
-
-}
-
-static uint32_t dal_divider_range_calc_did(
-	struct divider_range *div_range,
-	uint32_t div)
-{
-	uint32_t did;
-	/* Check before dividing.*/
-	if (div_range->div_range_step == 0) {
-		div_range->div_range_step = 1;
-		/*div_range_step cannot be zero*/
-		BREAK_TO_DEBUGGER();
-	}
-	/* Is this divider within our range?*/
-	if ((div < div_range->div_range_start)
-		|| (div >= div_range->div_range_end))
-		return INVALID_DID;
-/* did = (divider - range_start + (range_step-1)) / range_step) + did_min*/
-	did = div - div_range->div_range_start;
-	did += div_range->div_range_step - 1;
-	did /= div_range->div_range_step;
-	did += div_range->did_min;
-	return did;
-}
-
-uint32_t dal_divider_range_get_divider(
-	struct divider_range *div_range,
-	uint32_t ranges_num,
-	uint32_t did)
-{
-	uint32_t div = INVALID_DIVIDER;
-	uint32_t i;
-
-	for (i = 0; i < ranges_num; i++) {
-		/* Calculate divider with given divider ID*/
-		div = dal_divider_range_calc_divider(&div_range[i], did);
-		/* Found a valid return divider*/
-		if (div != INVALID_DIVIDER)
-			break;
-	}
-	return div;
-}
-uint32_t dal_divider_range_get_did(
-	struct divider_range *div_range,
-	uint32_t ranges_num,
-	uint32_t divider)
-{
-	uint32_t did = INVALID_DID;
-	uint32_t i;
-
-	for (i = 0; i < ranges_num; i++) {
-		/*  CalcDid returns InvalidDid if a divider ID isn't found*/
-		did = dal_divider_range_calc_did(&div_range[i], divider);
-		/* Found a valid return did*/
-		if (did != INVALID_DID)
-			break;
-	}
-	return did;
-}
-
drivers/gpu/drm/amd/display/dc/gpu/divider_range.h deleted +0 -62
deleted file mode 100644
index e53522f652cc..000000000000
@@ -1,62 +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_DIVIDER_RANGE_H__
-#define __DAL_DIVIDER_RANGE_H__
-
-enum divider_error_types {
-	INVALID_DID = 0,
-	INVALID_DIVIDER = 1
-};
-
-struct divider_range {
-	uint32_t div_range_start;
-	/* The end of this range of dividers.*/
-	uint32_t div_range_end;
-	/* The distance between each divider in this range.*/
-	uint32_t div_range_step;
-	/* The divider id for the lowest divider.*/
-	uint32_t did_min;
-	/* The divider id for the highest divider.*/
-	uint32_t did_max;
-};
-
-bool dal_divider_range_construct(
-	struct divider_range *div_range,
-	uint32_t range_start,
-	uint32_t range_step,
-	uint32_t did_min,
-	uint32_t did_max);
-
-uint32_t dal_divider_range_get_divider(
-	struct divider_range *div_range,
-	uint32_t ranges_num,
-	uint32_t did);
-uint32_t dal_divider_range_get_did(
-	struct divider_range *div_range,
-	uint32_t ranges_num,
-	uint32_t divider);
-
-#endif /* __DAL_DIVIDER_RANGE_H__ */
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
index f2eb8945d5c4..0418e3e02c7a 100644
@@ -188,7 +188,7 @@ void core_link_enable_stream(struct pipe_ctx *pipe_ctx);
 void core_link_disable_stream(struct pipe_ctx *pipe_ctx);
 
 /********** DAL Core*********************/
-#include "display_clock_interface.h"
+#include "display_clock.h"
 #include "transform.h"
 
 struct resource_pool;
drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h renamed from drivers/gpu/drm/amd/display/include/display_clock_interface.h +8 -12
similarity index 75%
rename from drivers/gpu/drm/amd/display/include/display_clock_interface.h
rename to drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h
index 53a01381c638..e163f5818dd9 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-15 Advanced Micro Devices, Inc.
+ * Copyright 2012-16 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"),
@@ -23,44 +23,39 @@
  *
  */
 
-#ifndef __DISPLAY_CLOCK_INTERFACE_H__
-#define __DISPLAY_CLOCK_INTERFACE_H__
+#ifndef __DISPLAY_CLOCK_H__
+#define __DISPLAY_CLOCK_H__
 
 #include "dm_services_types.h"
-#include "hw_sequencer_types.h"
-#include "grph_object_defs.h"
-#include "signal_types.h"
 
 /* Structure containing all state-dependent clocks
  * (dependent on "enum clocks_state") */
 struct state_dependent_clocks {
-	uint32_t display_clk_khz;
-	uint32_t pixel_clk_khz;
+	int display_clk_khz;
+	int pixel_clk_khz;
 };
 
 struct display_clock {
 	struct dc_context *ctx;
 	const struct display_clock_funcs *funcs;
 
-	int min_display_clk_threshold_khz;
 	enum dm_pp_clocks_state max_clks_state;
 	enum dm_pp_clocks_state cur_min_clks_state;
 };
 
 struct display_clock_funcs {
-	void (*destroy)(struct display_clock **to_destroy);
 	void (*set_clock)(struct display_clock *disp_clk,
-		uint32_t requested_clock_khz);
+		int requested_clock_khz);
+
 	enum dm_pp_clocks_state (*get_required_clocks_state)(
 		struct display_clock *disp_clk,
 		struct state_dependent_clocks *req_clocks);
+
 	bool (*set_min_clocks_state)(struct display_clock *disp_clk,
 		enum dm_pp_clocks_state dm_pp_clocks_state);
-	uint32_t (*get_dp_ref_clk_frequency)(struct display_clock *disp_clk);

drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h line 61

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/inc/hw/display_clock.h renamed from drivers/gpu/drm/amd/display/include/display_clock_interface.h +3 -4
 
-};
-
-void dal_display_clock_destroy(struct display_clock **to_destroy);
+	int (*get_dp_ref_clk_frequency)(struct display_clock *disp_clk);
 
+};
 
-#endif /* __DISPLAY_CLOCK_INTERFACE_H__ */
+#endif /* __DISPLAY_CLOCK_H__ */

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

#6 lore raw

PATCH 3/12 drm/amd/display: Fix bugs causing Hawaii and Bonaire not light up.

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

Change-Id If4055105c7007399d29389343e304dd4fff3aa2f
---
 .../gpu/drm/amd/display/dc/bios/dce110/command_table_helper_dce110.c    | 2 +-
 .../gpu/drm/amd/display/dc/bios/dce112/command_table_helper_dce112.c    | 2 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/dce110/command_table_helper_dce110.c +1 -1
index dff82dd11721..8049320e8b03 100644
@@ -186,7 +186,7 @@ static uint8_t dig_encoder_sel_to_atom(enum engine_id id)
 		break;
 	}
 
-	return atom_dig_encoder_sel;
+	return 0;
 }
 
 static bool clock_source_id_to_atom(
drivers/gpu/drm/amd/display/dc/bios/dce112/command_table_helper_dce112.c +1 -1
index 8b72aa588b86..48e59963dad4 100644
@@ -183,7 +183,7 @@ static uint8_t dig_encoder_sel_to_atom(enum engine_id id)
 		break;
 	}
 
-	return atom_dig_encoder_sel;
+	return 0;
 }
 
 static bool clock_source_id_to_atom(
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +1 -1
index 86e55d028cbf..cfdb6a7d042b 100644
@@ -1281,7 +1281,7 @@ void dce110_link_encoder_enable_dp_output(
 	configure_encoder(enc110, link_settings);
 
 	cntl.action = TRANSMITTER_CONTROL_ENABLE;
-	cntl.engine_id = ENGINE_ID_UNKNOWN;
+	cntl.engine_id = enc->preferred_engine;
 	cntl.transmitter = enc110->base.transmitter;
 	cntl.pll_id = clock_source;
 	cntl.signal = SIGNAL_TYPE_DISPLAY_PORT;
Signature · 6 lines
2.9.3

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

PATCH 4/12 drm/amd/display: remove DM_NOT_IMPL messages

In reply to a message not in the archive

From: Arindam Nath <[email protected]>

Some functions like dm_bandwidth_update are placeholders for future implementations. Right now, they simply print messages like "DM_NOT_IMPL: dm_bandwidth_update". This message even though informational, sometimes can create some confusion for users.

Since these functions are only skeletons for future, we simply remove the rather un-unecessary messages from these functions.

Change-Id I6e5fdcaff4cd91e1b905d7aa4b0cd47a44685a79
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -7
index a4a6269b9b6b..70d6e4168b31 100644
@@ -54,10 +54,6 @@
 
 #include "modules/inc/mod_freesync.h"
 
-/* Debug facilities */
-#define AMDGPU_DM_NOT_IMPL(fmt, ...) \
-	DRM_INFO("DM_NOT_IMPL: " fmt, ##__VA_ARGS__)
-
 /*
  * dm_vblank_get_counter
  *
@@ -1277,20 +1273,18 @@ void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm)
  */
 static void dm_bandwidth_update(struct amdgpu_device *adev)
 {
-	AMDGPU_DM_NOT_IMPL("%s\n", __func__);
+	/* TODO: implement later */
 }
 
 static void dm_set_backlight_level(struct amdgpu_encoder *amdgpu_encoder,
 				     u8 level)
 {
 	/* TODO: translate amdgpu_encoder to display_index and call DAL */
-	AMDGPU_DM_NOT_IMPL("%s\n", __func__);
 }
 
 static u8 dm_get_backlight_level(struct amdgpu_encoder *amdgpu_encoder)
 {
 	/* TODO: translate amdgpu_encoder to display_index and call DAL */
-	AMDGPU_DM_NOT_IMPL("%s\n", __func__);
 	return 0;
 }
 
Signature · 6 lines
2.9.3

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

PATCH 5/12 drm/amd/display: Fix bunch of warnings in DC

In reply to a message not in the archive

Some of those are potential bugs

Change-Id I53b2c663e18b57013e1b891fc2ecf1fb2d7d3a08
---
 .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  5 +--
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  5 ---
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 43 +---------------------
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  2 -
 .../drm/amd/display/dc/dce110/dce110_transform_v.c |  3 +-
 6 files changed, 6 insertions(+), 54 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +1 -1
index 0b2bb3992f1a..3b0710ef4716 100644
@@ -1709,7 +1709,7 @@ static void calculate_bandwidth(
 			else {
 				data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level]));
 				if (bw_ltn(data->adjusted_data_buffer_size[k], bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), (bw_add(vbios->blackout_duration, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])))))) {
-					data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));
+					data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[data->y_clk_level][data->sclk_level]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));
 				}
 			}
 		}
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -3
index bd53d27e5414..f552b0468186 100644
@@ -1834,11 +1834,10 @@ void resource_build_info_frame(struct pipe_ctx *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);
-	}
-
-	else if (dc_is_dp_signal(signal))
+	} 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);
+	}
 
 	translate_info_frame(&info_frame,
 			&pipe_ctx->encoder_info_frame);
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +0 -5
index 80ac5d9efa71..3d1c32122d69 100644
@@ -465,7 +465,6 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
 		struct pll_settings *pll_settings,
 		struct pixel_clk_params *pix_clk_params)
 {
-	uint32_t addr = 0;
 	uint32_t value = 0;
 	uint32_t field = 0;
 	uint32_t pll_calc_error = MAX_PLL_CALC_ERROR;
@@ -731,8 +730,6 @@ static void dce110_program_pixel_clk_resync(
 		enum signal_type signal_type,
 		enum dc_color_depth colordepth)
 {
-	uint32_t value = 0;
-
 	REG_UPDATE(RESYNC_CNTL,
 			DCCG_DEEP_COLOR_CNTL1, 0);
 	/*
@@ -772,8 +769,6 @@ static void dce112_program_pixel_clk_resync(
 		enum dc_color_depth colordepth,
 		bool enable_ycbcr420)
 {
-	uint32_t value = 0;
-
 	REG_UPDATE(PIXCLK_RESYNC_CNTL,
 			PHYPLLA_DCCG_DEEP_COLOR_CNTL, 0);
 	/*
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +1 -42

55 lines not on this page · raw message

drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +0 -2
index f47b6617f662..bbf4d97cb980 100644
@@ -83,8 +83,6 @@ static bool setup_scaling_configuration(
 	struct dce_transform *xfm_dce,
 	const struct scaler_data *data)
 {
-	struct dc_context *ctx = xfm_dce->base.ctx;
-
 	if (data->taps.h_taps + data->taps.v_taps <= 2) {
 		/* Set bypass */
 		REG_UPDATE_2(SCL_MODE, SCL_MODE, 0, SCL_PSCL_EN, 0);
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +2 -1
index 7d8cf7a58f46..feb5f3c29804 100644
@@ -621,7 +621,8 @@ static void dce110_xfmv_set_pixel_storage_depth(
 	const struct bit_depth_reduction_params *bit_depth_params)
 {
 	struct dce_transform *xfm_dce = TO_DCE_TRANSFORM(xfm);
-	int pixel_depth, expan_mode;
+	int pixel_depth = 0;
+	int expan_mode = 0;
 	uint32_t reg_data = 0;
 
 	switch (depth) {
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): 20161208012624.8914-6-harry.wentland-5C7GfCeVMHo@public.gmane.org

#10 lore raw

Re: [PATCH 05/12] drm/amd/display: Fix bunch of warnings in DC

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 1 line

Some of those are potential bugs

Are they related? If not: maybe split the changes up?

Quoted 3 lines
Change-Id I53b2c663e18b57013e1b891fc2ecf1fb2d7d3a08

It'd be nice to see these reviews on list... (applies to all patches here)

Quoted 15 lines
---
 .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  5 +--
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  5 ---
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 43 +---------------------
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  2 -
 .../drm/amd/display/dc/dce110/dce110_transform_v.c |  3 +-
 6 files changed, 6 insertions(+), 54 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
index 0b2bb3992f1a..3b0710ef4716 100644

drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c static void calculate_bandwidth( · line 1712

Quoted 5 lines
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +1 -1
@@ -1709,7 +1709,7 @@ static void calculate_bandwidth(
 			else {
 				data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level]));
 				if (bw_ltn(data->adjusted_data_buffer_size[k], bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), (bw_add(vbios->blackout_duration, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])))))) {
-					data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));
+					data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[data->y_clk_level][data->sclk_level]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));

Uhg, can this be wrapped/split up somehow? Seeing the changes is nigh impossible and I suspect it might even be impossible for you to check internally.

A nice comment above giving the formula and maybe some reasoning would also be nice, that way somebody from the outside has at least a chance to check if the code does what it's supposed to do.

Cheers,
Kai

Quoted 131 lines
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
 				}
 			}
 		}
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -3
index bd53d27e5414..f552b0468186 100644
@@ -1834,11 +1834,10 @@ void resource_build_info_frame(struct pipe_ctx *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);
-	}
-
-	else if (dc_is_dp_signal(signal))
+	} 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);
+	}
 
 	translate_info_frame(&info_frame,
 			&pipe_ctx->encoder_info_frame);
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +0 -5
index 80ac5d9efa71..3d1c32122d69 100644
@@ -465,7 +465,6 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
 		struct pll_settings *pll_settings,
 		struct pixel_clk_params *pix_clk_params)
 {
-	uint32_t addr = 0;
 	uint32_t value = 0;
 	uint32_t field = 0;
 	uint32_t pll_calc_error = MAX_PLL_CALC_ERROR;
@@ -731,8 +730,6 @@ static void dce110_program_pixel_clk_resync(
 		enum signal_type signal_type,
 		enum dc_color_depth colordepth)
 {
-	uint32_t value = 0;
-
 	REG_UPDATE(RESYNC_CNTL,
 			DCCG_DEEP_COLOR_CNTL1, 0);
 	/*
@@ -772,8 +769,6 @@ static void dce112_program_pixel_clk_resync(
 		enum dc_color_depth colordepth,
 		bool enable_ycbcr420)
 {
-	uint32_t value = 0;
-
 	REG_UPDATE(PIXCLK_RESYNC_CNTL,
 			PHYPLLA_DCCG_DEEP_COLOR_CNTL, 0);
 	/*
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +1 -42
index c2bd8dc7b4ad..262612061c68 100644
@@ -148,29 +148,6 @@ static int dce_divider_range_calc_divider(
 
 }
 
-static int dce_divider_range_calc_did(
-	struct dce_divider_range *div_range,
-	int div)
-{
-	int did;
-	/* Check before dividing.*/
-	if (div_range->div_range_step == 0) {
-		div_range->div_range_step = 1;
-		/*div_range_step cannot be zero*/
-		BREAK_TO_DEBUGGER();
-	}
-	/* Is this divider within our range?*/
-	if ((div < div_range->div_range_start)
-		|| (div >= div_range->div_range_end))
-		return INVALID_DID;
-/* did = (divider - range_start + (range_step-1)) / range_step) + did_min*/
-	did = div - div_range->div_range_start;
-	did += div_range->div_range_step - 1;
-	did /= div_range->div_range_step;
-	did += div_range->did_min;
-	return did;
-}
-
 static int dce_divider_range_get_divider(
 	struct dce_divider_range *div_range,
 	int ranges_num,
@@ -189,25 +166,7 @@ static int dce_divider_range_get_divider(
 	return div;
 }
 
-static int dce_divider_range_get_did(
-	struct dce_divider_range *div_range,
-	int ranges_num,
-	int divider)
-{
-	int did = INVALID_DID;
-	int i;
-
-	for (i = 0; i < ranges_num; i++) {
-		/*  CalcDid returns InvalidDid if a divider ID isn't found*/
-		did = dce_divider_range_calc_did(&div_range[i], divider);
-		/* Found a valid return did*/
-		if (did != INVALID_DID)
-			break;
-	}
-	return did;
-}
-
-static uint32_t dce_clocks_get_dp_ref_freq(struct display_clock *clk)
+static int dce_clocks_get_dp_ref_freq(struct display_clock *clk)
 {
 	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
 	int dprefclk_wdivider;
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +0 -2
index f47b6617f662..bbf4d97cb980 100644
@@ -83,8 +83,6 @@ static bool setup_scaling_configuration(
 	struct dce_transform *xfm_dce,
 	const struct scaler_data *data)
 {
-	struct dc_context *ctx = xfm_dce->base.ctx;
-
 	if (data->taps.h_taps + data->taps.v_taps <= 2) {
 		/* Set bypass */
 		REG_UPDATE_2(SCL_MODE, SCL_MODE, 0, SCL_PSCL_EN, 0);
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +0 -0
index 7d8cf7a58f46..feb5f3c29804 100644

drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c static void dce110_xfmv_set_pixel_storage_depth( · line 628

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +2 -1
@@ -621,7 +621,8 @@ static void dce110_xfmv_set_pixel_storage_depth(
 	const struct bit_depth_reduction_params *bit_depth_params)
 {
 	struct dce_transform *xfm_dce = TO_DCE_TRANSFORM(xfm);
-	int pixel_depth, expan_mode;
+	int pixel_depth = 0;
+	int expan_mode = 0;
 	uint32_t reg_data = 0;
 
 	switch (depth) {

_______________________________________________
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): 9f4c678e-4598-3ac1-73c8-038183bc30e2-1ZKVMVCtJ2dx9oSEVPI0kiST3g8Odh+X@public.gmane.org

#12 lore raw

Re: [PATCH 05/12] drm/amd/display: Fix bunch of warnings in DC

Quoted 10 lines · Kai Wasserbäch

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 1 line

Some of those are potential bugs

Are they related? If not: maybe split the changes up?

Quoted 3 lines
Change-Id I53b2c663e18b57013e1b891fc2ecf1fb2d7d3a08

It'd be nice to see these reviews on list... (applies to all patches here)

These patches currently start out in our internal tree with a whole lot of stuff that we can't open up, like new IP, so unfortunately can't be done in a public forum. I pull the r-b from our internal review system for reference when I prepare the patches for public review.

Quoted 10 lines
Quoted 10 lines
---
  .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |  2 +-
  drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  5 +--
  .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  5 ---
  drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 43 +---------------------
  drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  2 -
  .../drm/amd/display/dc/dce110/dce110_transform_v.c |  3 +-
  6 files changed, 6 insertions(+), 54 deletions(-)
Quoted 12 lines

drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c static void calculate_bandwidth( · line 1712

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +1 -1
index 0b2bb3992f1a..3b0710ef4716 100644
@@ -1709,7 +1709,7 @@ static void calculate_bandwidth(
  			else {
  				data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level]));
  				if (bw_ltn(data->adjusted_data_buffer_size[k], bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), (bw_add(vbios->blackout_duration, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])))))) {
-					data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));
+					data->blackout_recovery_time = bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[data->y_clk_level][data->sclk_level]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));

Uhg, can this be wrapped/split up somehow? Seeing the changes is nigh impossible and I suspect it might even be impossible for you to check internally.

I believe this comes straight from some complicated code HW gives us and we use directly. I'll see if we can somehow make this more readable or at least add a comment, as you mention below.

Quoted 146 lines

A nice comment above giving the formula and maybe some reasoning would also be nice, that way somebody from the outside has at least a chance to check if the code does what it's supposed to do.

Cheers,
Kai

Quoted 138 lines
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
  				}
  			}
  		}
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -3
index bd53d27e5414..f552b0468186 100644
@@ -1834,11 +1834,10 @@ void resource_build_info_frame(struct pipe_ctx *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);
-	}
-
-	else if (dc_is_dp_signal(signal))
+	} 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);
+	}
 
  	translate_info_frame(&info_frame,
  			&pipe_ctx->encoder_info_frame);
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +0 -5
index 80ac5d9efa71..3d1c32122d69 100644
@@ -465,7 +465,6 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
  		struct pll_settings *pll_settings,
  		struct pixel_clk_params *pix_clk_params)
  {
-	uint32_t addr = 0;
  	uint32_t value = 0;
  	uint32_t field = 0;
  	uint32_t pll_calc_error = MAX_PLL_CALC_ERROR;
@@ -731,8 +730,6 @@ static void dce110_program_pixel_clk_resync(
  		enum signal_type signal_type,
  		enum dc_color_depth colordepth)
  {
-	uint32_t value = 0;
-
  	REG_UPDATE(RESYNC_CNTL,
  			DCCG_DEEP_COLOR_CNTL1, 0);
  	/*
@@ -772,8 +769,6 @@ static void dce112_program_pixel_clk_resync(
  		enum dc_color_depth colordepth,
  		bool enable_ycbcr420)
  {
-	uint32_t value = 0;
-
  	REG_UPDATE(PIXCLK_RESYNC_CNTL,
  			PHYPLLA_DCCG_DEEP_COLOR_CNTL, 0);
  	/*
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +1 -42
index c2bd8dc7b4ad..262612061c68 100644
@@ -148,29 +148,6 @@ static int dce_divider_range_calc_divider(
 
  }
 
-static int dce_divider_range_calc_did(
-	struct dce_divider_range *div_range,
-	int div)
-{
-	int did;
-	/* Check before dividing.*/
-	if (div_range->div_range_step == 0) {
-		div_range->div_range_step = 1;
-		/*div_range_step cannot be zero*/
-		BREAK_TO_DEBUGGER();
-	}
-	/* Is this divider within our range?*/
-	if ((div < div_range->div_range_start)
-		|| (div >= div_range->div_range_end))
-		return INVALID_DID;
-/* did = (divider - range_start + (range_step-1)) / range_step) + did_min*/
-	did = div - div_range->div_range_start;
-	did += div_range->div_range_step - 1;
-	did /= div_range->div_range_step;
-	did += div_range->did_min;
-	return did;
-}
-
  static int dce_divider_range_get_divider(
  	struct dce_divider_range *div_range,
  	int ranges_num,
@@ -189,25 +166,7 @@ static int dce_divider_range_get_divider(
  	return div;
  }
 
-static int dce_divider_range_get_did(
-	struct dce_divider_range *div_range,
-	int ranges_num,
-	int divider)
-{
-	int did = INVALID_DID;
-	int i;
-
-	for (i = 0; i < ranges_num; i++) {
-		/*  CalcDid returns InvalidDid if a divider ID isn't found*/
-		did = dce_divider_range_calc_did(&div_range[i], divider);
-		/* Found a valid return did*/
-		if (did != INVALID_DID)
-			break;
-	}
-	return did;
-}
-
-static uint32_t dce_clocks_get_dp_ref_freq(struct display_clock *clk)
+static int dce_clocks_get_dp_ref_freq(struct display_clock *clk)
  {
  	struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
  	int dprefclk_wdivider;
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +0 -2
index f47b6617f662..bbf4d97cb980 100644
@@ -83,8 +83,6 @@ static bool setup_scaling_configuration(
  	struct dce_transform *xfm_dce,
  	const struct scaler_data *data)
  {
-	struct dc_context *ctx = xfm_dce->base.ctx;
-
  	if (data->taps.h_taps + data->taps.v_taps <= 2) {
  		/* Set bypass */
  		REG_UPDATE_2(SCL_MODE, SCL_MODE, 0, SCL_PSCL_EN, 0);
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +2 -1
index 7d8cf7a58f46..feb5f3c29804 100644
@@ -621,7 +621,8 @@ static void dce110_xfmv_set_pixel_storage_depth(
  	const struct bit_depth_reduction_params *bit_depth_params)
  {
  	struct dce_transform *xfm_dce = TO_DCE_TRANSFORM(xfm);
-	int pixel_depth, expan_mode;
+	int pixel_depth = 0;
+	int expan_mode = 0;
  	uint32_t reg_data = 0;
 
Quoted 2 lines

drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c static void dce110_xfmv_set_pixel_storage_depth( · line 628

Quoted 2 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +0 -0
  	switch (depth) {

_______________________________________________
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): 9a6bc7fb-225a-c693-5a6c-3420d64d51d9-5C7GfCeVMHo@public.gmane.org

#14 lore raw

Re: [PATCH 05/12] drm/amd/display: Fix bunch of warnings in DC

Harry Wentland wrote on 08.12.2016 17:36:

Quoted 9 lines · Kai Wasserbäch
Quoted 6 lines

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 1 line

Some of those are potential bugs

Are they related? If not: maybe split the changes up?

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Change-Id I53b2c663e18b57013e1b891fc2ecf1fb2d7d3a08

It'd be nice to see these reviews on list... (applies to all patches here)

These patches currently start out in our internal tree with a whole lot of stuff that we can't open up, like new IP, so unfortunately can't be done in a public forum. I pull the r-b from our internal review system for reference when I prepare the patches for public review.

Hm, not nice, but not my place to tell you to change this. That's Dave's and Linus' job. ;-)

Quoted 62 lines
Quoted 54 lines
Quoted 54 lines
---
  .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |  2 +-
  drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  5 +--
  .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  5 ---
  drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 43 +---------------------
  drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  2 -
  .../drm/amd/display/dc/dce110/dce110_transform_v.c |  3 +-
  6 files changed, 6 insertions(+), 54 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
index 0b2bb3992f1a..3b0710ef4716 100644
@@ -1709,7 +1709,7 @@ static void calculate_bandwidth(
              else {
                  data->blackout_recovery_time =
 bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed(2),
 vbios->mcifwrmc_urgent_latency),
 data->mcifwr_burst_time[data->y_clk_level][data->sclk_level]));
                  if (bw_ltn(data->adjusted_data_buffer_size[k],
 bw_mul(bw_div(bw_mul(data->display_bandwidth[k],

data->useful_bytes_per_request[k]), data->bytes_per_request[k]), (bw_add(vbios->blackout_duration, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])))))) {
- data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));
+ data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[data->y_clk_level][data->sclk_level]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]),

Quoted 8 lines
Quoted 6 lines

data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));

Uhg, can this be wrapped/split up somehow? Seeing the changes is nigh impossible and I suspect it might even be impossible for you to check internally.

Quoted 3 lines

I believe this comes straight from some complicated code HW gives us and we use directly. I'll see if we can somehow make this more readable or at least add a comment, as you mention below.

That would be really appreciated. I mean, I'm in no way able to review DAL/Display thoroughly (huge code base I'm not familiar with and where I might easily miss interactions), but this is just not reviewable/verifiable at all for any person outside your inner circle.

Thanks,
Kai

Quoted 154 lines
Quoted 141 lines

A nice comment above giving the formula and maybe some reasoning would also be nice, that way somebody from the outside has at least a chance to check if the code does what it's supposed to do.

Cheers,
Kai

Quoted 133 lines
                  }
              }
          }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -3
index bd53d27e5414..f552b0468186 100644
@@ -1834,11 +1834,10 @@ void resource_build_info_frame(struct pipe_ctx
 *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);
-    }
-
-    else if (dc_is_dp_signal(signal))
+    } 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);
+    }
        translate_info_frame(&info_frame,
              &pipe_ctx->encoder_info_frame);
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +0 -5
index 80ac5d9efa71..3d1c32122d69 100644
@@ -465,7 +465,6 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
          struct pll_settings *pll_settings,
          struct pixel_clk_params *pix_clk_params)
  {
-    uint32_t addr = 0;
      uint32_t value = 0;
      uint32_t field = 0;
      uint32_t pll_calc_error = MAX_PLL_CALC_ERROR;
@@ -731,8 +730,6 @@ static void dce110_program_pixel_clk_resync(
          enum signal_type signal_type,
          enum dc_color_depth colordepth)
  {
-    uint32_t value = 0;
-
      REG_UPDATE(RESYNC_CNTL,
              DCCG_DEEP_COLOR_CNTL1, 0);
      /*
@@ -772,8 +769,6 @@ static void dce112_program_pixel_clk_resync(
          enum dc_color_depth colordepth,
          bool enable_ycbcr420)
  {
-    uint32_t value = 0;
-
      REG_UPDATE(PIXCLK_RESYNC_CNTL,
              PHYPLLA_DCCG_DEEP_COLOR_CNTL, 0);
      /*
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +1 -40
index c2bd8dc7b4ad..262612061c68 100644
@@ -148,29 +148,6 @@ static int dce_divider_range_calc_divider(
    }
  -static int dce_divider_range_calc_did(
-    struct dce_divider_range *div_range,
-    int div)
-{
-    int did;
-    /* Check before dividing.*/
-    if (div_range->div_range_step == 0) {
-        div_range->div_range_step = 1;
-        /*div_range_step cannot be zero*/
-        BREAK_TO_DEBUGGER();
-    }
-    /* Is this divider within our range?*/
-    if ((div < div_range->div_range_start)
-        || (div >= div_range->div_range_end))
-        return INVALID_DID;
-/* did = (divider - range_start + (range_step-1)) / range_step) + did_min*/
-    did = div - div_range->div_range_start;
-    did += div_range->div_range_step - 1;
-    did /= div_range->div_range_step;
-    did += div_range->did_min;
-    return did;
-}
-
  static int dce_divider_range_get_divider(
      struct dce_divider_range *div_range,
      int ranges_num,
@@ -189,25 +166,7 @@ static int dce_divider_range_get_divider(
      return div;
  }
  -static int dce_divider_range_get_did(
-    struct dce_divider_range *div_range,
-    int ranges_num,
-    int divider)
-{
-    int did = INVALID_DID;
-    int i;
-
-    for (i = 0; i < ranges_num; i++) {
-        /*  CalcDid returns InvalidDid if a divider ID isn't found*/
-        did = dce_divider_range_calc_did(&div_range[i], divider);
-        /* Found a valid return did*/
-        if (did != INVALID_DID)
-            break;
-    }
-    return did;
-}
-
-static uint32_t dce_clocks_get_dp_ref_freq(struct display_clock *clk)
+static int dce_clocks_get_dp_ref_freq(struct display_clock *clk)
  {
      struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
      int dprefclk_wdivider;
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +0 -2
index f47b6617f662..bbf4d97cb980 100644
@@ -83,8 +83,6 @@ static bool setup_scaling_configuration(
      struct dce_transform *xfm_dce,
      const struct scaler_data *data)
  {
-    struct dc_context *ctx = xfm_dce->base.ctx;
-
      if (data->taps.h_taps + data->taps.v_taps <= 2) {
          /* Set bypass */
          REG_UPDATE_2(SCL_MODE, SCL_MODE, 0, SCL_PSCL_EN, 0);
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +0 -0
index 7d8cf7a58f46..feb5f3c29804 100644
@@ -621,7 +621,8 @@ static void dce110_xfmv_set_pixel_storage_depth(
      const struct bit_depth_reduction_params *bit_depth_params)
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c static void dce110_xfmv_set_pixel_storage_depth(

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +2 -1
  {
      struct dce_transform *xfm_dce = TO_DCE_TRANSFORM(xfm);
-    int pixel_depth, expan_mode;
+    int pixel_depth = 0;
+    int expan_mode = 0;
      uint32_t reg_data = 0;
        switch (depth) {
 

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

Signature · 3 lines
Kai Wasserbäch (Kai Wasserbaech)

E-Mail: [email protected]

_______________________________________________
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): e78be440-a0eb-4a96-7f71-317a6a5ce862-1ZKVMVCtJ2dx9oSEVPI0kiST3g8Odh+X@public.gmane.org

#16 lore raw

Re: [PATCH 05/12] drm/amd/display: Fix bunch of warnings in DC

Quoted 82 lines · Kai Wasserbäch

Harry Wentland wrote on 08.12.2016 17:36:

Quoted 8 lines · Kai Wasserbäch
Quoted 6 lines

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 1 line

Some of those are potential bugs

Are they related? If not: maybe split the changes up?

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Change-Id I53b2c663e18b57013e1b891fc2ecf1fb2d7d3a08

It'd be nice to see these reviews on list... (applies to all patches here)

These patches currently start out in our internal tree with a whole lot of stuff that we can't open up, like new IP, so unfortunately can't be done in a public forum. I pull the r-b from our internal review system for reference when I prepare the patches for public review.

Hm, not nice, but not my place to tell you to change this. That's Dave's and Linus' job. ;-)

Quoted 62 lines
Quoted 62 lines
Quoted 52 lines
---
   .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |  2 +-
   drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  5 +--
   .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  5 ---
   drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 43 +---------------------
   drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  2 -
   .../drm/amd/display/dc/dce110/dce110_transform_v.c |  3 +-
   6 files changed, 6 insertions(+), 54 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
index 0b2bb3992f1a..3b0710ef4716 100644
@@ -1709,7 +1709,7 @@ static void calculate_bandwidth(
               else {
                   data->blackout_recovery_time =
 bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed(2),
 vbios->mcifwrmc_urgent_latency),
 data->mcifwr_burst_time[data->y_clk_level][data->sclk_level]));
                   if (bw_ltn(data->adjusted_data_buffer_size[k],
 bw_mul(bw_div(bw_mul(data->display_bandwidth[k],

data->useful_bytes_per_request[k]), data->bytes_per_request[k]), (bw_add(vbios->blackout_duration, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])))))) {
- data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));
+ data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[data->y_clk_level][data->sclk_level]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])),

Quoted 8 lines

data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));

Uhg, can this be wrapped/split up somehow? Seeing the changes is nigh impossible and I suspect it might even be impossible for you to check internally.

Quoted 7 lines
Quoted 3 lines

I believe this comes straight from some complicated code HW gives us and we use directly. I'll see if we can somehow make this more readable or at least add a comment, as you mention below.

That would be really appreciated. I mean, I'm in no way able to review DAL/Display thoroughly (huge code base I'm not familiar with and where I might easily miss interactions), but this is just not reviewable/verifiable at all for any person outside your inner circle.

I followed up with Tony, who's been working with HW guys to get them to share this code with us. Unfortunately there isn't much we can do in the way of changing this code.

Harry

Quoted 156 lines

Thanks,
Kai

Quoted 153 lines
Quoted 141 lines

A nice comment above giving the formula and maybe some reasoning would also be nice, that way somebody from the outside has at least a chance to check if the code does what it's supposed to do.

Cheers,
Kai

Quoted 133 lines
                   }
               }
           }
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -3
index bd53d27e5414..f552b0468186 100644
@@ -1834,11 +1834,10 @@ void resource_build_info_frame(struct pipe_ctx
 *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);
-    }
-
-    else if (dc_is_dp_signal(signal))
+    } 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);
+    }
         translate_info_frame(&info_frame,
               &pipe_ctx->encoder_info_frame);
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +0 -5
index 80ac5d9efa71..3d1c32122d69 100644
@@ -465,7 +465,6 @@ static uint32_t dce110_get_pix_clk_dividers_helper (
           struct pll_settings *pll_settings,
           struct pixel_clk_params *pix_clk_params)
   {
-    uint32_t addr = 0;
       uint32_t value = 0;
       uint32_t field = 0;
       uint32_t pll_calc_error = MAX_PLL_CALC_ERROR;
@@ -731,8 +730,6 @@ static void dce110_program_pixel_clk_resync(
           enum signal_type signal_type,
           enum dc_color_depth colordepth)
   {
-    uint32_t value = 0;
-
       REG_UPDATE(RESYNC_CNTL,
               DCCG_DEEP_COLOR_CNTL1, 0);
       /*
@@ -772,8 +769,6 @@ static void dce112_program_pixel_clk_resync(
           enum dc_color_depth colordepth,
           bool enable_ycbcr420)
   {
-    uint32_t value = 0;
-
       REG_UPDATE(PIXCLK_RESYNC_CNTL,
               PHYPLLA_DCCG_DEEP_COLOR_CNTL, 0);
       /*
drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c +1 -40
index c2bd8dc7b4ad..262612061c68 100644
@@ -148,29 +148,6 @@ static int dce_divider_range_calc_divider(
     }
   -static int dce_divider_range_calc_did(
-    struct dce_divider_range *div_range,
-    int div)
-{
-    int did;
-    /* Check before dividing.*/
-    if (div_range->div_range_step == 0) {
-        div_range->div_range_step = 1;
-        /*div_range_step cannot be zero*/
-        BREAK_TO_DEBUGGER();
-    }
-    /* Is this divider within our range?*/
-    if ((div < div_range->div_range_start)
-        || (div >= div_range->div_range_end))
-        return INVALID_DID;
-/* did = (divider - range_start + (range_step-1)) / range_step) + did_min*/
-    did = div - div_range->div_range_start;
-    did += div_range->div_range_step - 1;
-    did /= div_range->div_range_step;
-    did += div_range->did_min;
-    return did;
-}
-
   static int dce_divider_range_get_divider(
       struct dce_divider_range *div_range,
       int ranges_num,
@@ -189,25 +166,7 @@ static int dce_divider_range_get_divider(
       return div;
   }
   -static int dce_divider_range_get_did(
-    struct dce_divider_range *div_range,
-    int ranges_num,
-    int divider)
-{
-    int did = INVALID_DID;
-    int i;
-
-    for (i = 0; i < ranges_num; i++) {
-        /*  CalcDid returns InvalidDid if a divider ID isn't found*/
-        did = dce_divider_range_calc_did(&div_range[i], divider);
-        /* Found a valid return did*/
-        if (did != INVALID_DID)
-            break;
-    }
-    return did;
-}
-
-static uint32_t dce_clocks_get_dp_ref_freq(struct display_clock *clk)
+static int dce_clocks_get_dp_ref_freq(struct display_clock *clk)
   {
       struct dce_disp_clk *clk_dce = TO_DCE_CLOCKS(clk);
       int dprefclk_wdivider;
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +0 -2
index f47b6617f662..bbf4d97cb980 100644
@@ -83,8 +83,6 @@ static bool setup_scaling_configuration(
       struct dce_transform *xfm_dce,
       const struct scaler_data *data)
   {
-    struct dc_context *ctx = xfm_dce->base.ctx;
-
       if (data->taps.h_taps + data->taps.v_taps <= 2) {
           /* Set bypass */
           REG_UPDATE_2(SCL_MODE, SCL_MODE, 0, SCL_PSCL_EN, 0);
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +0 -0
index 7d8cf7a58f46..feb5f3c29804 100644
@@ -621,7 +621,8 @@ static void dce110_xfmv_set_pixel_storage_depth(
       const struct bit_depth_reduction_params *bit_depth_params)
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c static void dce110_xfmv_set_pixel_storage_depth( · line 628

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_transform_v.c +2 -1
   {
       struct dce_transform *xfm_dce = TO_DCE_TRANSFORM(xfm);
-    int pixel_depth, expan_mode;
+    int pixel_depth = 0;
+    int expan_mode = 0;
       uint32_t reg_data = 0;
         switch (depth) {
 

_______________________________________________
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

A message that is not in the archive (sent off-list or not yet received): bf41a889-5d85-2646-76c7-801453175dab-5C7GfCeVMHo@public.gmane.org

#18 lore raw

Re: [PATCH 05/12] drm/amd/display: Fix bunch of warnings in DC

Harry Wentland wrote on 08.12.2016 19:58:

Quoted 87 lines · Kai Wasserbäch
Quoted 86 lines

Harry Wentland wrote on 08.12.2016 17:36:

Quoted 7 lines · Kai Wasserbäch
Quoted 6 lines

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 1 line

Some of those are potential bugs

Are they related? If not: maybe split the changes up?

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
Change-Id I53b2c663e18b57013e1b891fc2ecf1fb2d7d3a08

It'd be nice to see these reviews on list... (applies to all patches here)

These patches currently start out in our internal tree with a whole lot of stuff that we can't open up, like new IP, so unfortunately can't be done in a public forum. I pull the r-b from our internal review system for reference when I prepare the patches for public review.

Hm, not nice, but not my place to tell you to change this. That's Dave's and Linus' job. ;-)

Quoted 67 lines
Quoted 56 lines
Quoted 56 lines
---
   .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |  2 +-
   drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  5 +--
   .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  5 ---
   drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 43
+---------------------
   drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  2 -
   .../drm/amd/display/dc/dce110/dce110_transform_v.c |  3 +-
   6 files changed, 6 insertions(+), 54 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
index 0b2bb3992f1a..3b0710ef4716 100644
@@ -1709,7 +1709,7 @@ static void calculate_bandwidth(
               else {
                   data->blackout_recovery_time =
 bw_max2(data->blackout_recovery_time, bw_add(bw_mul(bw_int_to_fixed(2),
 vbios->mcifwrmc_urgent_latency),
 data->mcifwr_burst_time[data->y_clk_level][data->sclk_level]));
                   if (bw_ltn(data->adjusted_data_buffer_size[k],
 bw_mul(bw_div(bw_mul(data->display_bandwidth[k],

data->useful_bytes_per_request[k]), data->bytes_per_request[k]), (bw_add(vbios->blackout_duration, bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])))))) {
- data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))), (bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));
+ data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration), bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_int_to_fixed(2), vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[data->y_clk_level][data->sclk_level]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), data->adjusted_data_buffer_size[k]))),

Quoted 8 lines
Quoted 5 lines

(bw_sub(bw_div(bw_mul(bw_mul(data->dispclk, bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data->latency_hiding_lines[k]), bw_div(bw_mul(data->display_bandwidth[k], data->useful_bytes_per_request[k]), data->bytes_per_request[k])))));

Uhg, can this be wrapped/split up somehow? Seeing the changes is nigh impossible
and I suspect it might even be impossible for you to check internally.

I believe this comes straight from some complicated code HW gives us and we use directly. I'll see if we can somehow make this more readable or at least add a comment, as you mention below.

Quoted 7 lines
Quoted 4 lines

That would be really appreciated. I mean, I'm in no way able to review DAL/Display thoroughly (huge code base I'm not familiar with and where I might easily miss interactions), but this is just not reviewable/verifiable at all for any person outside your inner circle.

I followed up with Tony, who's been working with HW guys to get them to share this code with us. Unfortunately there isn't much we can do in the way of changing this code.

That's rather unfortunate, that not even reformatting into an easier to read format is possible (though I do not really understand why, beyond "it takes work"); maybe the comment showing the formula in an easier to read form can be done then?

Cheers,
Kai

P.S.: Did you see my comments on patch 2? That contained the null pointer deref (if I didn't misread something).

_______________________________________________
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): 89a8a4f0-0ea7-cb5a-f6cc-efdb5f8e195f-1ZKVMVCtJ2dx9oSEVPI0kiST3g8Odh+X@public.gmane.org

#20 lore raw

RE: [PATCH 05/12] drm/amd/display: Fix bunch of warnings in DC

Quoted 122 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Kai Wasserbäch
Sent: Thursday, December 08, 2016 2:52 PM
To: Wentland, Harry; [email protected]; Cheng, Tony
Subject: Re: [PATCH 05/12] drm/amd/display: Fix bunch of warnings in DC

Harry Wentland wrote on 08.12.2016 19:58:

Quoted 6 lines · Kai Wasserbäch
Quoted 5 lines

Harry Wentland wrote on 08.12.2016 17:36:

Quoted 4 lines · Kai Wasserbäch
Quoted 3 lines

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 1 line

Some of those are potential bugs

Are they related? If not: maybe split the changes up?

Quoted 3 lines
Change-Id I53b2c663e18b57013e1b891fc2ecf1fb2d7d3a08

It'd be nice to see these reviews on list... (applies to all patches here)

These patches currently start out in our internal tree with a whole lot of

stuff

Quoted 1 line
Quoted 1 line
Quoted 1 line

that we can't open up, like new IP, so unfortunately can't be done in a

public

Quoted 1 line
Quoted 1 line
Quoted 1 line

forum. I pull the r-b from our internal review system for reference when

I

Quoted 15 lines
Quoted 15 lines
Quoted 1 line

prepare the patches for public review.

Hm, not nice, but not my place to tell you to change this. That's Dave's and Linus' job. ;-)

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
---
   .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |  2 +-
   drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |  5 +--
   .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |  5 ---
   drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 43
+---------------------
   drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |  2 -
   .../drm/amd/display/dc/dce110/dce110_transform_v.c |  3 +-
   6 files changed, 6 insertions(+), 54 deletions(-)
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c static void calculate_bandwidth( · line 1711

Quoted 9 lines
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
index 0b2bb3992f1a..3b0710ef4716 100644
@@ -1709,7 +1709,7 @@ static void calculate_bandwidth(
               else {
                   data->blackout_recovery_time =
 bw_max2(data->blackout_recovery_time,

bw_add(bw_mul(bw_int_to_fixed(2),

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c +0 -0
 vbios->mcifwrmc_urgent_latency),
 data->mcifwr_burst_time[data->y_clk_level][data->sclk_level]));
                   if (bw_ltn(data->adjusted_data_buffer_size[k],
 bw_mul(bw_div(bw_mul(data->display_bandwidth[k],

data->useful_bytes_per_request[k]), data->bytes_per_request[k]), (bw_add(vbios->blackout_duration,

bw_add(bw_mul(bw_int_to_fixed(2),

Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

vbios->mcifwrmc_urgent_latency), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])))))) {
- data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time, bw_div((bw_add(bw_mul(bw_div(bw_mul(data-

display_bandwidth[k],

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration),

bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_i nt_to_fixed(2),

Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[i][j]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data-

latency_hiding_lines[k]),

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

data->adjusted_data_buffer_size[k]))),
(bw_sub(bw_div(bw_mul(bw_mul(data->dispclk,
bw_int_to_fixed(data->bytes_per_pixel[k])),
data->lines_interleaved_in_mem_access[k]), data-

Quoted 11 lines

latency_hiding_lines[k]),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

bw_div(bw_mul(data->display_bandwidth[k], data-

useful_bytes_per_request[k]),

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

data->bytes_per_request[k])))));
+ data->blackout_recovery_time =
bw_max2(data->blackout_recovery_time,
bw_div((bw_add(bw_mul(bw_div(bw_mul(data-

display_bandwidth[k],

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

data->useful_bytes_per_request[k]), data->bytes_per_request[k]), vbios->blackout_duration),

bw_sub(bw_div(bw_mul(bw_mul(bw_mul((bw_add(bw_add(bw_mul(bw_i nt_to_fixed(2),

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

vbios->mcifwrmc_urgent_latency), data->dmif_burst_time[data->y_clk_level][data->sclk_level]), data->mcifwr_burst_time[data->y_clk_level][data->sclk_level])), data->dispclk), bw_int_to_fixed(data->bytes_per_pixel[k])), data->lines_interleaved_in_mem_access[k]), data-

Quoted 10 lines

latency_hiding_lines[k]),

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

data->adjusted_data_buffer_size[k]))),
(bw_sub(bw_div(bw_mul(bw_mul(data->dispclk,
bw_int_to_fixed(data->bytes_per_pixel[k])),
data->lines_interleaved_in_mem_access[k]), data-

latency_hiding_lines[k]),

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

bw_div(bw_mul(data->display_bandwidth[k], data-

useful_bytes_per_request[k]),

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

data->bytes_per_request[k])))));

Uhg, can this be wrapped/split up somehow? Seeing the changes is

nigh

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

impossible
and I suspect it might even be impossible for you to check internally.

I believe this comes straight from some complicated code HW gives us

and we use

Quoted 1 line
Quoted 1 line
Quoted 1 line

directly. I'll see if we can somehow make this more readable or at least

add a

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

comment, as you mention below.

That would be really appreciated. I mean, I'm in no way able to review DAL/Display thoroughly (huge code base I'm not familiar with and where I

might

Quoted 3 lines
Quoted 2 lines

easily miss interactions), but this is just not reviewable/verifiable at all for any person outside your inner circle.

I followed up with Tony, who's been working with HW guys to get them to

share

Quoted 8 lines
Quoted 2 lines

this code with us. Unfortunately there isn't much we can do in the way of changing this code.

That's rather unfortunate, that not even reformatting into an easier to read format is possible (though I do not really understand why, beyond "it takes work"); maybe the comment showing the formula in an easier to read form can be
done then?

IIRC, this code is machine generated by the hw team. We've been down this road with them before. Unfortunately, it hasn't been a high enough priority for them to get around to it. We don't really have insight into it at the moment to know how much work it would be.

Alex

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

#21 lore raw

PATCH 6/12 drm/amd/display: Fix warning in freesync module

In reply to a message not in the archive
Change-Id I225866bf260b0fd5cf4aabcadb3381d3b3ed6e93
---
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/modules/freesync/freesync.c +3 -0
index eb912baa0169..8892e8bec7c3 100644
@@ -746,6 +746,9 @@ void mod_freesync_update_state(struct mod_freesync *mod_freesync,
 				freesync_program_required = true;
 			}
 			break;
+		case FREESYNC_STATE_NONE:
+			/* handle here to avoid warning */
+			break;
 		}
 	}
 
Signature · 6 lines
2.9.3

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

PATCH 7/12 drm/amd/display: Fix warning. Set MAX_SURFACES to 3

In reply to a message not in the archive

Currently we never use more than 2 surfaces in all use cases. This avoids pushing dc_commit_surfaces_to_target beyond a stacksize of 1024.

Change-Id I3db9562a99057810c5fda5c388ce83f6e5a899ed
---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index 6bb3aeb53261..5f608009b794 100644
@@ -34,7 +34,7 @@
 #include "link_service_types.h"
 
 #define MAX_TARGETS 6
-#define MAX_SURFACES 6
+#define MAX_SURFACES 3
 #define MAX_SINKS_PER_LINK 4
 
 /*******************************************************************************
Signature · 6 lines
2.9.3

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

PATCH 8/12 drm/amd/display: Fix hdmi not lighting up on Hawaii.

In reply to a message not in the archive

From: Zeyu Fan <[email protected]>

Change-Id I3d24ab89a2195d4f1bf85fe0451ba71a7e54e702
---
 drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce/dce_link_encoder.c +1 -1
index cfdb6a7d042b..c73d6054cdda 100644
@@ -1233,7 +1233,7 @@ void dce110_link_encoder_enable_tmds_output(
 	/* Enable the PHY */
 
 	cntl.action = TRANSMITTER_CONTROL_ENABLE;
-	cntl.engine_id = ENGINE_ID_UNKNOWN;
+	cntl.engine_id = enc->preferred_engine;
 	cntl.transmitter = enc110->base.transmitter;
 	cntl.pll_id = clock_source;
 	if (hdmi) {
Signature · 6 lines
2.9.3

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

PATCH 9/12 drm/amd/display: fix indexing bug

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- is_new_pipe_surface should be addressed with pipe idx, not surface idx

Change-Id I330c616c2ec91064dec2d32470c43f1abac21818
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -3
index a3c5def507a9..70b7673993b2 100644
@@ -1334,7 +1334,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 	struct core_dc *core_dc = DC_TO_CORE(dc);
 	struct validate_context *context = core_dc->temp_flip_context;
 	int i, j;
-	bool is_new_pipe_surface[MAX_SURFACES];
+	bool is_new_pipe_surface[MAX_PIPES];
 	const struct dc_surface *new_surfaces[MAX_SURFACES] = { 0 };
 
 	update_surface_trace(dc, updates, surface_count);
@@ -1353,7 +1353,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 				&context->res_ctx.pipe_ctx[cur_pipe->bottom_pipe->pipe_idx];
 	}
 
-	for (j = 0; j < MAX_SURFACES; j++)
+	for (j = 0; j < MAX_PIPES; j++)
 		is_new_pipe_surface[j] = true;
 
 	for (i = 0 ; i < surface_count; i++) {
@@ -1364,7 +1364,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[j];
 
 			if (surface == pipe_ctx->surface)
-				is_new_pipe_surface[i] = false;
+				is_new_pipe_surface[j] = false;
 		}
 	}
 
Signature · 6 lines
2.9.3

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

PATCH 10/12 drm/amd/display: avoid apply_clk_constraints for address update

In reply to a message not in the archive

From: Tony Cheng <[email protected]>

- dc_update_surfaces_for_target get called in ISR but apply_clk_constraints allocates memory

Change-Id I9f4b7b6ca4af27c35c007e3af95111081a77d242
---
 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 70b7673993b2..522ef7047564 100644
@@ -1336,6 +1336,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 	int i, j;
 	bool is_new_pipe_surface[MAX_PIPES];
 	const struct dc_surface *new_surfaces[MAX_SURFACES] = { 0 };
+	bool need_apply_clk_constraints = false;
 
 	update_surface_trace(dc, updates, surface_count);
 
@@ -1405,6 +1406,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 
 			if (updates[i].plane_info || updates[i].scaling_info
 					|| is_new_pipe_surface[j]) {
+				need_apply_clk_constraints = true;
 
 				if (updates[i].plane_info) {
 					surface->public.color_space =
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): 20161208012624.8914-11-harry.wentland-5C7GfCeVMHo@public.gmane.org

#27 lore raw

Re: [PATCH 10/12] drm/amd/display: avoid apply_clk_constraints for address update

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 25 lines

From: Tony Cheng <[email protected]>

- dc_update_surfaces_for_target get called in ISR but apply_clk_constraints allocates memory

Change-Id I9f4b7b6ca4af27c35c007e3af95111081a77d242
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
index 70b7673993b2..522ef7047564 100644
@@ -1336,6 +1336,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 	int i, j;
 	bool is_new_pipe_surface[MAX_PIPES];
 	const struct dc_surface *new_surfaces[MAX_SURFACES] = { 0 };
+	bool need_apply_clk_constraints = false;
 
 	update_surface_trace(dc, updates, surface_count);
 

drivers/gpu/drm/amd/display/dc/core/dc.c void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda · line 1409

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -1405,6 +1406,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 
 			if (updates[i].plane_info || updates[i].scaling_info
 					|| is_new_pipe_surface[j]) {
+				need_apply_clk_constraints = true;

Where is this variable used? I grepped through the tree at
<https://cgit.freedesktop.org/~agd5f/linux/tree/drivers/gpu/drm/amd?h=amd-staging-4.7>,
but couldn't find it anywhere and it doesn't get passed anywhere from here. Or are there patches missing in Alex' tree?

Cheers,
Kai

drivers/gpu/drm/amd/display/dc/core/dc.c void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
 				if (updates[i].plane_info) {
 					surface->public.color_space =
 

_______________________________________________
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): 3b1b2891-1d61-3592-af23-c8a7034a7d05-1ZKVMVCtJ2dx9oSEVPI0kiST3g8Odh+X@public.gmane.org

#29 lore raw

Re: [PATCH 10/12] drm/amd/display: avoid apply_clk_constraints for address update

Alex's tree isn't fully in sync yet.

This is currently only used by code for unreleased ASICs, so the public code won't use it (yet).

Harry

Quoted 37 lines · Kai Wasserbäch

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 25 lines

From: Tony Cheng <[email protected]>

- dc_update_surfaces_for_target get called in ISR but apply_clk_constraints allocates memory

Change-Id I9f4b7b6ca4af27c35c007e3af95111081a77d242
---
  drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
index 70b7673993b2..522ef7047564 100644
@@ -1336,6 +1336,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
  	int i, j;
  	bool is_new_pipe_surface[MAX_PIPES];
  	const struct dc_surface *new_surfaces[MAX_SURFACES] = { 0 };
+	bool need_apply_clk_constraints = false;
 
  	update_surface_trace(dc, updates, surface_count);
 

drivers/gpu/drm/amd/display/dc/core/dc.c void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda · line 1409

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
@@ -1405,6 +1406,7 @@ void dc_update_surfaces_for_target(struct dc *dc, struct dc_surface_update *upda
 
  			if (updates[i].plane_info || updates[i].scaling_info
  					|| is_new_pipe_surface[j]) {
+				need_apply_clk_constraints = true;

Where is this variable used? I grepped through the tree at
<https://cgit.freedesktop.org/~agd5f/linux/tree/drivers/gpu/drm/amd?h=amd-staging-4.7>,
but couldn't find it anywhere and it doesn't get passed anywhere from here. Or are there patches missing in Alex' tree?

Quoted 6 lines

Cheers,
Kai

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
  				if (updates[i].plane_info) {
  					surface->public.color_space =
 

_______________________________________________
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): 6d3c6747-e68e-2891-c304-90b9d76d3c9a-5C7GfCeVMHo@public.gmane.org

#31 lore raw

Re: [PATCH 10/12] drm/amd/display: avoid apply_clk_constraints for address update

Harry Wentland wrote on 08.12.2016 17:47:

Quoted 4 lines

Alex's tree isn't fully in sync yet.

This is currently only used by code for unreleased ASICs, so the public code won't use it (yet).

ok, though that seems turned around. Why not squash this into the enablement series for the as of yet unreleased ASICs ("uGPU" from the other thread, I assume?)

Cheers,
Kai

Quoted 51 lines · Kai Wasserbäch
Quoted 36 lines

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 29 lines

From: Tony Cheng <[email protected]>

- dc_update_surfaces_for_target get called in ISR but apply_clk_constraints allocates memory

Change-Id I9f4b7b6ca4af27c35c007e3af95111081a77d242
---
  drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -0
index 70b7673993b2..522ef7047564 100644
@@ -1336,6 +1336,7 @@ void dc_update_surfaces_for_target(struct dc *dc,

struct dc_surface_update *upda

      int i, j;
      bool is_new_pipe_surface[MAX_PIPES];
      const struct dc_surface *new_surfaces[MAX_SURFACES] = { 0 };
+    bool need_apply_clk_constraints = false;
        update_surface_trace(dc, updates, surface_count);
  @@ -1405,6 +1406,7 @@ void dc_update_surfaces_for_target(struct dc *dc,
struct dc_surface_update *upda
                if (updates[i].plane_info || updates[i].scaling_info
                      || is_new_pipe_surface[j]) {
Quoted 1 line

+ need_apply_clk_constraints = true;

Where is this variable used? I grepped through the tree at
<https://cgit.freedesktop.org/~agd5f/linux/tree/drivers/gpu/drm/amd?h=amd-staging-4.7>,

Quoted 9 lines

but couldn't find it anywhere and it doesn't get passed anywhere from here. Or are there patches missing in Alex' tree?

Cheers,
Kai

Quoted 3 lines
                  if (updates[i].plane_info) {
                      surface->public.color_space =

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

Signature · 3 lines
Kai Wasserbäch (Kai Wasserbaech)

E-Mail: [email protected]

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

#32 lore raw

PATCH 11/12 drm/amd/display: Fix refcount over dc_sink.

In reply to a message not in the archive

From: Andrey Grodzovsky <[email protected]>

Retain a dc_sink pointer until a new physical pointer arrives in case of new display connected.

Change-Id If0a7ebab865f3486f82a5e54c8b77b9a0a10e739
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +11 -1
index 70d6e4168b31..164beac7d521 100644
@@ -745,9 +745,17 @@ void amdgpu_dm_update_connector_after_detect(
 		mutex_lock(&dev->mode_config.mutex);
 
 		if (sink) {
-			if (aconnector->dc_sink)
+			if (aconnector->dc_sink) {
 				amdgpu_dm_remove_sink_from_freesync_module(
 								connector);
+				/* retain and release bellow are used for
+				 * bump up refcount for sink because the link don't point
+				 * to it anymore after disconnect so on next crtc to connector
+				 * reshuffle by UMD we will get into unwanted dc_sink release
+				 */
+				if (aconnector->dc_sink != aconnector->dc_em_sink)
+					dc_sink_release(aconnector->dc_sink);
+			}
 			aconnector->dc_sink = sink;
 			amdgpu_dm_add_sink_to_freesync_module(
 						connector, aconnector->edid);
@@ -755,6 +763,8 @@ void amdgpu_dm_update_connector_after_detect(
 			amdgpu_dm_remove_sink_from_freesync_module(connector);
 			if (!aconnector->dc_sink)
 				aconnector->dc_sink = aconnector->dc_em_sink;
+			else if (aconnector->dc_sink != aconnector->dc_em_sink)
+				dc_sink_retain(aconnector->dc_sink);
 		}
 
 		mutex_unlock(&dev->mode_config.mutex);
Signature · 6 lines
2.9.3

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

PATCH 12/12 drm/amd/display: fix up construction of scratch_val_ctx

In reply to a message not in the archive

From: Dmytro Laktyushkin <[email protected]>

Change-Id Id293fdf8c6939698b7d879fda99c6535c865ab71
---
 drivers/gpu/drm/amd/display/dc/core/dc.c        | 12 ++++++------
 drivers/gpu/drm/amd/display/dc/inc/core_types.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -6
index 522ef7047564..8e1d695fcb77 100644
@@ -450,11 +450,6 @@ static void destruct(struct core_dc *dc)
 {
 	resource_validate_ctx_destruct(dc->current_context);
 
-	dm_free(dc->temp_flip_context);
-	dc->temp_flip_context = NULL;
-	dm_free(dc->scratch_val_ctx);
-	dc->scratch_val_ctx = NULL;
-
 	destroy_links(dc);
 
 	dc_destroy_resource_pool(dc);
@@ -473,6 +468,10 @@ static void destruct(struct core_dc *dc)
 
 	dm_free(dc->current_context);
 	dc->current_context = NULL;
+	dm_free(dc->temp_flip_context);
+	dc->temp_flip_context = NULL;
+	dm_free(dc->scratch_val_ctx);
+	dc->scratch_val_ctx = NULL;
 
 	dm_free(dc->ctx);
 	dc->ctx = NULL;
@@ -492,7 +491,7 @@ static bool construct(struct core_dc *dc,
 
 	dc->current_context = dm_alloc(sizeof(*dc->current_context));
 	dc->temp_flip_context = dm_alloc(sizeof(*dc->temp_flip_context));
-	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->temp_flip_context));
+	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->scratch_val_ctx));
 
 	if (!dc->current_context || !dc->temp_flip_context) {
 		dm_error("%s: failed to create validate ctx\n", __func__);
@@ -1220,6 +1219,7 @@ bool dc_pre_update_surfaces_to_target(
 			goto unexpected_fail;
 		}
 		resource_validate_ctx_destruct(context);
+		ASSERT(core_dc->scratch_val_ctx == temp_context);
 		core_dc->scratch_val_ctx = context;
 		context = temp_context;
 	}
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
index 0418e3e02c7a..3cf9bfb6decd 100644
@@ -312,7 +312,7 @@ struct validate_context {
 
 	/* The output from BW and WM calculations. */
 	struct bw_calcs_output bw_results;
-	/* Note: this is a big structure, do *not* put on stack! */
+	/* Note: these are big structures, do *not* put on stack! */
 	struct dm_pp_display_configuration pp_display_cfg;
 };
 
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): 20161208012624.8914-13-harry.wentland-5C7GfCeVMHo@public.gmane.org

#35 lore raw

Re: [PATCH 12/12] drm/amd/display: fix up construction of scratch_val_ctx

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 26 lines

From: Dmytro Laktyushkin <[email protected]>

Change-Id Id293fdf8c6939698b7d879fda99c6535c865ab71
---
 drivers/gpu/drm/amd/display/dc/core/dc.c        | 12 ++++++------
 drivers/gpu/drm/amd/display/dc/inc/core_types.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -5
index 522ef7047564..8e1d695fcb77 100644
@@ -450,11 +450,6 @@ static void destruct(struct core_dc *dc)
 {
 	resource_validate_ctx_destruct(dc->current_context);
 
-	dm_free(dc->temp_flip_context);
-	dc->temp_flip_context = NULL;
-	dm_free(dc->scratch_val_ctx);
-	dc->scratch_val_ctx = NULL;
-
 	destroy_links(dc);
 
 	dc_destroy_resource_pool(dc);

drivers/gpu/drm/amd/display/dc/core/dc.c static void destruct(struct core_dc *dc) · line 474

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -0
@@ -473,6 +468,10 @@ static void destruct(struct core_dc *dc)
 
 	dm_free(dc->current_context);
 	dc->current_context = NULL;
+	dm_free(dc->temp_flip_context);
+	dc->temp_flip_context = NULL;
+	dm_free(dc->scratch_val_ctx);
+	dc->scratch_val_ctx = NULL;

Was this hunk supposed to be in another patch? This touches the destructor, while the subject only talks about construction.

Cheers,
Kai

Quoted 25 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
 	dm_free(dc->ctx);
 	dc->ctx = NULL;
@@ -492,7 +491,7 @@ static bool construct(struct core_dc *dc,
 
 	dc->current_context = dm_alloc(sizeof(*dc->current_context));
 	dc->temp_flip_context = dm_alloc(sizeof(*dc->temp_flip_context));
-	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->temp_flip_context));
+	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->scratch_val_ctx));
 
 	if (!dc->current_context || !dc->temp_flip_context) {
 		dm_error("%s: failed to create validate ctx\n", __func__);
@@ -1220,6 +1219,7 @@ bool dc_pre_update_surfaces_to_target(
 			goto unexpected_fail;
 		}
 		resource_validate_ctx_destruct(context);
+		ASSERT(core_dc->scratch_val_ctx == temp_context);
 		core_dc->scratch_val_ctx = context;
 		context = temp_context;
 	}
drivers/gpu/drm/amd/display/dc/inc/core_types.h +0 -0
index 0418e3e02c7a..3cf9bfb6decd 100644

drivers/gpu/drm/amd/display/dc/inc/core_types.h struct validate_context { · line 318

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
@@ -312,7 +312,7 @@ struct validate_context {
 
 	/* The output from BW and WM calculations. */
 	struct bw_calcs_output bw_results;
-	/* Note: this is a big structure, do *not* put on stack! */
+	/* Note: these are big structures, do *not* put on stack! */
 	struct dm_pp_display_configuration pp_display_cfg;
 };
 

_______________________________________________
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): e77e204f-007d-37b2-0e44-683b0db0bb20-1ZKVMVCtJ2dx9oSEVPI0kiST3g8Odh+X@public.gmane.org

#37 lore raw

Re: [PATCH 12/12] drm/amd/display: fix up construction of scratch_val_ctx

Quoted 30 lines · Kai Wasserbäch

[Please CC me on all replies, I'm not subscribed to the list.]

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 27 lines

From: Dmytro Laktyushkin <[email protected]>

Change-Id Id293fdf8c6939698b7d879fda99c6535c865ab71
---
  drivers/gpu/drm/amd/display/dc/core/dc.c        | 12 ++++++------
  drivers/gpu/drm/amd/display/dc/inc/core_types.h |  2 +-
  2 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -5
index 522ef7047564..8e1d695fcb77 100644
@@ -450,11 +450,6 @@ static void destruct(struct core_dc *dc)
  {
  	resource_validate_ctx_destruct(dc->current_context);
 
-	dm_free(dc->temp_flip_context);
-	dc->temp_flip_context = NULL;
-	dm_free(dc->scratch_val_ctx);
-	dc->scratch_val_ctx = NULL;
-
  	destroy_links(dc);
 
  	dc_destroy_resource_pool(dc);
@@ -473,6 +468,10 @@ static void destruct(struct core_dc *dc)
 
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/core/dc.c static void destruct(struct core_dc *dc) · line 474

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -0
  	dm_free(dc->current_context);
  	dc->current_context = NULL;
+	dm_free(dc->temp_flip_context);
+	dc->temp_flip_context = NULL;
+	dm_free(dc->scratch_val_ctx);
+	dc->scratch_val_ctx = NULL;

Was this hunk supposed to be in another patch? This touches the destructor, while the subject only talks about construction.

My bad. I cleaned up the commit title missed the destructor part. These should be in the same patch but the title should probably reflect that.

Harry

Quoted 29 lines

Cheers,
Kai

Quoted 25 lines
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
  	dm_free(dc->ctx);
  	dc->ctx = NULL;
@@ -492,7 +491,7 @@ static bool construct(struct core_dc *dc,
 
  	dc->current_context = dm_alloc(sizeof(*dc->current_context));
  	dc->temp_flip_context = dm_alloc(sizeof(*dc->temp_flip_context));
-	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->temp_flip_context));
+	dc->scratch_val_ctx = dm_alloc(sizeof(*dc->scratch_val_ctx));
 
  	if (!dc->current_context || !dc->temp_flip_context) {
  		dm_error("%s: failed to create validate ctx\n", __func__);
@@ -1220,6 +1219,7 @@ bool dc_pre_update_surfaces_to_target(
  			goto unexpected_fail;
  		}
  		resource_validate_ctx_destruct(context);
+		ASSERT(core_dc->scratch_val_ctx == temp_context);
  		core_dc->scratch_val_ctx = context;
  		context = temp_context;
  	}
drivers/gpu/drm/amd/display/dc/inc/core_types.h +0 -0
index 0418e3e02c7a..3cf9bfb6decd 100644
@@ -312,7 +312,7 @@ struct validate_context {
 
Quoted 8 lines

drivers/gpu/drm/amd/display/dc/inc/core_types.h struct validate_context { · line 318

Quoted 8 lines
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
  	/* The output from BW and WM calculations. */
  	struct bw_calcs_output bw_results;
-	/* Note: this is a big structure, do *not* put on stack! */
+	/* Note: these are big structures, do *not* put on stack! */
  	struct dm_pp_display_configuration pp_display_cfg;
  };
 

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

#38 lore raw
In reply to a message not in the archive

[Please CC me on all replies, I'm not subscribed to the list.]

Dear Harry,
I've sent a couple of questions/suggestions/notes on patches 2, 5, 10 and 12. Since I'm not familiar with the module these comments are mostly stylistic/understanding. But there's also a null pointer dereference question in there. ;-)
Apart from that I was wondering, if there is any recent tree containing all of DAL/Display? The latest version I've seen is
<https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-4.7>, but that doesn't seem to be based on a more recent 4.9/4.10? Is there a rebased version available somewhere?

Thanks,
Kai

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 62 lines

* bunch of warning fixes
* some bug fixes
* more display_clock cleanup

Andrey Grodzovsky (1):
drm/amd/display: Fix refcount over dc_sink.

Arindam Nath (1):
drm/amd/display: remove DM_NOT_IMPL messages

Ding Wang (1):
drm/amd/display: Temporarily blocking interlacing mode until it's
supported.

Dmytro Laktyushkin (2):
drm/amd/display: moving remaining functionality from gpu to dce_clocks drm/amd/display: fix up construction of scratch_val_ctx

Harry Wentland (3):
drm/amd/display: Fix bunch of warnings in DC drm/amd/display: Fix warning in freesync module drm/amd/display: Fix warning. Set MAX_SURFACES to 3

Tony Cheng (2):
drm/amd/display: fix indexing bug
drm/amd/display: avoid apply_clk_constraints for address update

Zeyu Fan (2):
drm/amd/display: Fix bugs causing Hawaii and Bonaire not light up. drm/amd/display: Fix hdmi not lighting up on Hawaii.

 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  20 +-
 drivers/gpu/drm/amd/display/dc/Makefile            |   7 +-
 .../dc/bios/dce110/command_table_helper_dce110.c   |   2 +-
 .../dc/bios/dce112/command_table_helper_dce112.c   |   2 +-
 .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |   2 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  20 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |   5 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |   2 +-
 .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |   5 -
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 142 +++++++++--
 drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h    |  36 ++-
 .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |   4 +-
 drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |   2 -
 .../display/dc/dce110/dce110_timing_generator.c    |   4 +
 .../drm/amd/display/dc/dce110/dce110_transform_v.c |   3 +-
 drivers/gpu/drm/amd/display/dc/gpu/Makefile        |  21 --
 .../display/dc/gpu/dce112/display_clock_dce112.c   | 277 ---------------------
 .../display/dc/gpu/dce112/display_clock_dce112.h   |  79 ------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c | 127 ----------
 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h |  62 -----
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   4 +-
 .../inc/hw/display_clock.h}                        |  27 +-
 .../drm/amd/display/modules/freesync/freesync.c    |   3 +
 23 files changed, 207 insertions(+), 649 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/Makefile
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c
 delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h
 rename drivers/gpu/drm/amd/display/{include/display_clock_interface.h => dc/inc/hw/display_clock.h} (75%)
Signature · 3 lines
Kai Wasserbäch (Kai Wasserbaech)

E-Mail: [email protected]

_______________________________________________
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): 537b4136-c619-248a-150c-a12fcae920e0-1ZKVMVCtJ2dx9oSEVPI0kiST3g8Odh+X@public.gmane.org

#40 lore raw

Hi Kai,

thanks for your comments.

we're currently still developing on Alex's amd-staging-4.7 tree. I haven't had a chance to apply DC to a more recent kernel but hope to do so at some point in the not-to-distant future.

Best regards,
Harry

Quoted 13 lines · Kai Wasserbäch

[Please CC me on all replies, I'm not subscribed to the list.]

Dear Harry,
I've sent a couple of questions/suggestions/notes on patches 2, 5, 10 and 12. Since I'm not familiar with the module these comments are mostly stylistic/understanding. But there's also a null pointer dereference question in there. ;-)
Apart from that I was wondering, if there is any recent tree containing all of DAL/Display? The latest version I've seen is
<https://cgit.freedesktop.org/~agd5f/linux/log/?h=amd-staging-4.7>, but that doesn't seem to be based on a more recent 4.9/4.10? Is there a rebased version available somewhere?

Quoted 67 lines

Thanks,
Kai

Harry Wentland wrote on 08.12.2016 02:26:

Quoted 62 lines

* bunch of warning fixes
* some bug fixes
* more display_clock cleanup

Andrey Grodzovsky (1):
drm/amd/display: Fix refcount over dc_sink.

Arindam Nath (1):
drm/amd/display: remove DM_NOT_IMPL messages

Ding Wang (1):
drm/amd/display: Temporarily blocking interlacing mode until it's
supported.

Dmytro Laktyushkin (2):
drm/amd/display: moving remaining functionality from gpu to dce_clocks drm/amd/display: fix up construction of scratch_val_ctx

Harry Wentland (3):
drm/amd/display: Fix bunch of warnings in DC drm/amd/display: Fix warning in freesync module drm/amd/display: Fix warning. Set MAX_SURFACES to 3

Tony Cheng (2):
drm/amd/display: fix indexing bug
drm/amd/display: avoid apply_clk_constraints for address update

Zeyu Fan (2):
drm/amd/display: Fix bugs causing Hawaii and Bonaire not light up. drm/amd/display: Fix hdmi not lighting up on Hawaii.

  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c  |  20 +-
  drivers/gpu/drm/amd/display/dc/Makefile            |   7 +-
  .../dc/bios/dce110/command_table_helper_dce110.c   |   2 +-
  .../dc/bios/dce112/command_table_helper_dce112.c   |   2 +-
  .../gpu/drm/amd/display/dc/calcs/bandwidth_calcs.c |   2 +-
  drivers/gpu/drm/amd/display/dc/core/dc.c           |  20 +-
  drivers/gpu/drm/amd/display/dc/core/dc_resource.c  |   5 +-
  drivers/gpu/drm/amd/display/dc/dc.h                |   2 +-
  .../gpu/drm/amd/display/dc/dce/dce_clock_source.c  |   5 -
  drivers/gpu/drm/amd/display/dc/dce/dce_clocks.c    | 142 +++++++++--
  drivers/gpu/drm/amd/display/dc/dce/dce_clocks.h    |  36 ++-
  .../gpu/drm/amd/display/dc/dce/dce_link_encoder.c  |   4 +-
  drivers/gpu/drm/amd/display/dc/dce/dce_transform.c |   2 -
  .../display/dc/dce110/dce110_timing_generator.c    |   4 +
  .../drm/amd/display/dc/dce110/dce110_transform_v.c |   3 +-
  drivers/gpu/drm/amd/display/dc/gpu/Makefile        |  21 --
  .../display/dc/gpu/dce112/display_clock_dce112.c   | 277 ---------------------
  .../display/dc/gpu/dce112/display_clock_dce112.h   |  79 ------
  drivers/gpu/drm/amd/display/dc/gpu/divider_range.c | 127 ----------
  drivers/gpu/drm/amd/display/dc/gpu/divider_range.h |  62 -----
  drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   4 +-
  .../inc/hw/display_clock.h}                        |  27 +-
  .../drm/amd/display/modules/freesync/freesync.c    |   3 +
  23 files changed, 207 insertions(+), 649 deletions(-)

delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/Makefile
delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.c delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/dce112/display_clock_dce112.h delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.c
delete mode 100644 drivers/gpu/drm/amd/display/dc/gpu/divider_range.h
rename drivers/gpu/drm/amd/display/{include/display_clock_interface.h => dc/inc/hw/display_clock.h} (75%)

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