Commit 428ac7ce authored by Brendan Steve Leder's avatar Brendan Steve Leder Committed by Alex Deucher
Browse files

drm/amd/display: Add custom segmentation support



[WHY]
Add support for uneven segmentation size

[HOW]
Currently width + x_start is automatically calculated using
slice index + dividing stream into equally sized segments.
Add override variables for dst_rect width and x

Reviewed-by: default avatarSamson Tam <samson.tam@amd.com>
Signed-off-by: default avatarBrendan Steve Leder <BrendanSteve.Leder@amd.com>
Signed-off-by: default avatarAlex Hung <alex.hung@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent f9487703
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -196,7 +196,12 @@ static struct spl_rect calculate_mpc_slice_in_timing_active(
	int epimo = mpc_slice_count - plane_clip_rec->width % mpc_slice_count - 1;
	struct spl_rect mpc_rec;

	if (use_recout_width_aligned) {
	if (spl_in->basic_in.custom_width != 0) {
		mpc_rec.width = spl_in->basic_in.custom_width;
		mpc_rec.x = spl_in->basic_in.custom_x;
		mpc_rec.height = plane_clip_rec->height;
		mpc_rec.y = plane_clip_rec->y;
	} else if (use_recout_width_aligned) {
		mpc_rec.width = recout_width_align;
		if ((mpc_rec.width * (mpc_slice_idx + 1)) > plane_clip_rec->width) {
			mpc_rec.width = plane_clip_rec->width % recout_width_align;
@@ -219,7 +224,7 @@ static struct spl_rect calculate_mpc_slice_in_timing_active(
	/* extra pixels in the division remainder need to go to pipes after
	 * the extra pixel index minus one(epimo) defined here as:
	 */
	if (mpc_slice_idx > epimo) {
	if (mpc_slice_idx > epimo && spl_in->basic_in.custom_width == 0) {
		mpc_rec.x += mpc_slice_idx - epimo - 1;
		mpc_rec.width += 1;
	}
+2 −0
Original line number Diff line number Diff line
@@ -460,6 +460,8 @@ struct basic_in {
	enum spl_color_space color_space;	//	Color Space
	unsigned int max_luminance;	//	Max Luminance TODO: Is determined in dc_hw_sequencer.c is_sdr
	bool film_grain_applied;	//	Film Grain Applied // TODO: To check from where to get this?
	int custom_width; // Width for non-standard segmentation - used when != 0
	int custom_x;     // Start x for non-standard segmentation - used when custom_width != 0
};

// Basic output information