diff options
Diffstat (limited to 'drivers/gpu/drm/amd/display')
10 files changed, 106 insertions, 30 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h index 5fd1b6b44577..2d7755e2b6c3 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -137,6 +137,13 @@ struct vblank_control_work {  	bool enable;  }; +/** + * struct idle_workqueue - Work data for periodic action in idle + * @work: Kernel work data for the work event + * @dm: amdgpu display manager device + * @enable: true if idle worker is enabled + * @running: true if idle worker is running + */  struct idle_workqueue {  	struct work_struct work;  	struct amdgpu_display_manager *dm; @@ -502,6 +509,12 @@ struct amdgpu_display_manager {  	 * Deferred work for vblank control events.  	 */  	struct workqueue_struct *vblank_control_workqueue; + +	/** +	 * @idle_workqueue: +	 * +	 * Periodic work for idle events. +	 */  	struct idle_workqueue *idle_workqueue;  	struct drm_atomic_state *cached_state; @@ -587,7 +600,9 @@ struct amdgpu_display_manager {  	 */  	struct mutex dpia_aux_lock; -	/* +	/** +	 * @bb_from_dmub: +	 *  	 * Bounding box data read from dmub during early initialization for DCN4+  	 */  	struct dml2_soc_bb *bb_from_dmub; diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c index 067f6555cfdf..ccbb15f1638c 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c @@ -143,7 +143,8 @@ const struct dc_plane_status *dc_plane_get_status(  		if (pipe_ctx->plane_state != plane_state)  			continue; -		pipe_ctx->plane_state->status.is_flip_pending = false; +		if (pipe_ctx->plane_state) +			pipe_ctx->plane_state->status.is_flip_pending = false;  		break;  	} diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_standalone_libraries/lib_float_math.c b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_standalone_libraries/lib_float_math.c index defe13436a2c..e73579f1a88e 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_standalone_libraries/lib_float_math.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_standalone_libraries/lib_float_math.c @@ -64,8 +64,6 @@ double math_ceil(const double arg)  double math_ceil2(const double arg, const double significance)  { -	ASSERT(significance != 0); -  	return ((int)(arg / significance + 0.99999)) * significance;  } diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h index 9ac7fc717a92..0150f2581ee4 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/dpp.h @@ -147,16 +147,28 @@ struct cnv_color_keyer_params {  	int color_keyer_blue_high;  }; -/* new for dcn2: set the 8bit alpha values based on the 2 bit alpha - *ALPHA_2BIT_LUT. ALPHA_2BIT_LUT0   default: 0b00000000 - *ALPHA_2BIT_LUT. ALPHA_2BIT_LUT1   default: 0b01010101 - *ALPHA_2BIT_LUT. ALPHA_2BIT_LUT2   default: 0b10101010 - *ALPHA_2BIT_LUT. ALPHA_2BIT_LUT3   default: 0b11111111 +/** + * struct cnv_alpha_2bit_lut - Set the 8bit alpha values based on the 2 bit alpha   */  struct cnv_alpha_2bit_lut { +	/** +	* @lut0: ALPHA_2BIT_LUT. ALPHA_2BIT_LUT0. Default: 0b00000000 +	*/  	int lut0; + +	/** +	 * @lut1: ALPHA_2BIT_LUT. ALPHA_2BIT_LUT1. Default: 0b01010101 +	 */  	int lut1; + +	/** +	 * @lut2: ALPHA_2BIT_LUT. ALPHA_2BIT_LUT2. Default: 0b10101010 +	 */  	int lut2; + +	/** +	 * @lut3: ALPHA_2BIT_LUT. ALPHA_2BIT_LUT3. Default: 0b11111111 +	 */  	int lut3;  }; diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h b/drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h index 40a9b3471208..3a89cc0cffc1 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h @@ -1039,6 +1039,20 @@ struct mpc_funcs {  	*/  	void (*program_lut_mode)(struct mpc *mpc, const enum MCM_LUT_ID id, const enum MCM_LUT_XABLE xable,  			bool lut_bank_a, int mpcc_id); +	/** +	* @program_3dlut_size: +	* +	* Program 3D LUT size. +	* +	* Parameters: +	* - [in/out] mpc - MPC context. +	* - [in] is_17x17x17 - is 3dlut 17x17x17 +	* - [in] mpcc_id +	* +	* Return: +	* +	* void +	*/  	void (*program_3dlut_size)(struct mpc *mpc, bool is_17x17x17, int mpcc_id);  }; diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h index 127fb1a51654..747679cb4944 100644 --- a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h +++ b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h @@ -205,9 +205,24 @@ struct gamma_coefficients {  	struct fixed31_32 user_brightness;  }; +/** + * struct pwl_float_data - Fixed point RGB color + */  struct pwl_float_data { +	/** +	 * @r: Component Red. +	 */  	struct fixed31_32 r; + +	/** +	 * @g: Component Green. +	 */ +  	struct fixed31_32 g; + +	/** +	 * @b: Component Blue. +	 */  	struct fixed31_32 b;  }; diff --git a/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c b/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c index 50459d7a0f85..b76737b7b9e4 100644 --- a/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c +++ b/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c @@ -26,6 +26,16 @@  #include "core_types.h"  #include "link_enc_cfg.h" +/** + * DOC: overview + * + * Display Input Output (DIO), is the display input and output unit in DCN. It + * includes output encoders to support different display output, like + * DisplayPort, HDMI, DVI interface, and others. It also includes the control + * and status channels for these interfaces. + */ + +  void set_dio_throttled_vcp_size(struct pipe_ctx *pipe_ctx,  		struct fixed31_32 throttled_vcp_size)  { @@ -254,12 +264,31 @@ static const struct link_hwss dio_link_hwss = {  	},  }; +/** + * can_use_dio_link_hwss - Check if the link_hwss is accessible + * + * @link: Reference a link struct containing one or more sinks and the + *	  connective status. + * @link_res: Mappable hardware resource used to enable a link. + * + * Returns: + * Return true if the link encoder is accessible from link. + */  bool can_use_dio_link_hwss(const struct dc_link *link,  		const struct link_resource *link_res)  {  	return link->link_enc != NULL;  } +/** + * get_dio_link_hwss - Return link_hwss reference + * + * This function behaves like a get function to return the link_hwss populated + * in the link_hwss_dio.c file. + * + * Returns: + * Return the reference to the filled struct of link_hwss. + */  const struct link_hwss *get_dio_link_hwss(void)  {  	return &dio_link_hwss; diff --git a/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h b/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h index a1f72fe378ee..45f0e091fcb0 100644 --- a/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h +++ b/drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.h @@ -23,15 +23,6 @@   *   */ -/** - * DOC: overview - * - * Display Input Output (DIO), is the display input and output unit in DCN. It - * includes output encoders to support different display output, like - * DisplayPort, HDMI, DVI interface, and others. It also includes the control - * and status channels for these interfaces. - */ -  #ifndef __LINK_HWSS_DIO_H__  #define __LINK_HWSS_DIO_H__ diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c index 336488c0574e..94427875bcdd 100644 --- a/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c +++ b/drivers/gpu/drm/amd/display/dc/optc/dcn10/dcn10_optc.c @@ -945,19 +945,10 @@ void optc1_set_drr(  				OTG_FORCE_LOCK_ON_EVENT, 0,  				OTG_SET_V_TOTAL_MIN_MASK_EN, 0,  				OTG_SET_V_TOTAL_MIN_MASK, 0); - -		// Setup manual flow control for EOF via TRIG_A -		optc->funcs->setup_manual_trigger(optc); - -	} else { -		REG_UPDATE_4(OTG_V_TOTAL_CONTROL, -				OTG_SET_V_TOTAL_MIN_MASK, 0, -				OTG_V_TOTAL_MIN_SEL, 0, -				OTG_V_TOTAL_MAX_SEL, 0, -				OTG_FORCE_LOCK_ON_EVENT, 0); - -		optc->funcs->set_vtotal_min_max(optc, 0, 0);  	} + +	// Setup manual flow control for EOF via TRIG_A +	optc->funcs->setup_manual_trigger(optc);  }  void optc1_set_vtotal_min_max(struct timing_generator *optc, int vtotal_min, int vtotal_max) diff --git a/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c b/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c index 43417cff2c9b..b4694985a40a 100644 --- a/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c +++ b/drivers/gpu/drm/amd/display/dc/optc/dcn20/dcn20_optc.c @@ -453,6 +453,16 @@ void optc2_setup_manual_trigger(struct timing_generator *optc)  {  	struct optc *optc1 = DCN10TG_FROM_TG(optc); +	/* Set the min/max selectors unconditionally so that +	 * DMCUB fw may change OTG timings when necessary +	 * TODO: Remove the w/a after fixing the issue in DMCUB firmware +	 */ +	REG_UPDATE_4(OTG_V_TOTAL_CONTROL, +				 OTG_V_TOTAL_MIN_SEL, 1, +				 OTG_V_TOTAL_MAX_SEL, 1, +				 OTG_FORCE_LOCK_ON_EVENT, 0, +				 OTG_SET_V_TOTAL_MIN_MASK, (1 << 1)); /* TRIGA */ +  	REG_SET_8(OTG_TRIGA_CNTL, 0,  			OTG_TRIGA_SOURCE_SELECT, 21,  			OTG_TRIGA_SOURCE_PIPE_SELECT, optc->inst,  |