Commit 5e1613e2 authored by Bayan Zabihiyan's avatar Bayan Zabihiyan Committed by Alex Deucher
Browse files

drm/amd/display: add Cursor Degamma logic for DCN2



[Why]
We need to have the ability to to tell us set degamma on the cursor.

[How]
Pass a flag down to register programming that tells us if the
current surface format needs cursor degamma.

Signed-off-by: default avatarBayan Zabihiyan <bayan.zabihiyan@amd.com>
Reviewed-by: default avatarKrunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent c0358809
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -516,7 +516,8 @@ union dc_cursor_attribute_flags {
		uint32_t INVERT_PIXEL_DATA:1;
		uint32_t ZERO_EXPANSION:1;
		uint32_t MIN_MAX_INVERT:1;
		uint32_t RESERVED:25;
		uint32_t ENABLE_CURSOR_DEGAMMA:1;
		uint32_t RESERVED:24;
	} bits;
	uint32_t value;
};
+2 −1
Original line number Diff line number Diff line
@@ -426,8 +426,9 @@ void dpp1_cnv_setup (

void dpp1_set_cursor_attributes(
		struct dpp *dpp_base,
		enum dc_cursor_color_format color_format)
		struct dc_cursor_attributes *cursor_attributes)
{
	enum dc_cursor_color_format color_format = cursor_attributes->color_format;
	struct dcn10_dpp *dpp = TO_DCN10_DPP(dpp_base);

	REG_UPDATE_2(CURSOR0_CONTROL,
+1 −1
Original line number Diff line number Diff line
@@ -1368,7 +1368,7 @@ enum dcn10_input_csc_select {

void dpp1_set_cursor_attributes(
		struct dpp *dpp_base,
		enum dc_cursor_color_format color_format);
		struct dc_cursor_attributes *cursor_attributes);

void dpp1_set_cursor_position(
		struct dpp *dpp_base,
+1 −1
Original line number Diff line number Diff line
@@ -2987,7 +2987,7 @@ static void dcn10_set_cursor_attribute(struct pipe_ctx *pipe_ctx)
	pipe_ctx->plane_res.hubp->funcs->set_cursor_attributes(
			pipe_ctx->plane_res.hubp, attributes);
	pipe_ctx->plane_res.dpp->funcs->set_cursor_attributes(
		pipe_ctx->plane_res.dpp, attributes->color_format);
		pipe_ctx->plane_res.dpp, attributes);
}

static void dcn10_set_cursor_sdr_white_level(struct pipe_ctx *pipe_ctx)
+7 −3
Original line number Diff line number Diff line
@@ -342,14 +342,18 @@ void dpp2_cnv_set_alpha_keyer(

void dpp2_set_cursor_attributes(
		struct dpp *dpp_base,
		enum dc_cursor_color_format color_format)
		struct dc_cursor_attributes *cursor_attributes)
{
	enum dc_cursor_color_format color_format = cursor_attributes->color_format;
	struct dcn20_dpp *dpp = TO_DCN20_DPP(dpp_base);
	int cur_rom_en = 0;

	if (color_format == CURSOR_MODE_COLOR_PRE_MULTIPLIED_ALPHA ||
		color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA)
		color_format == CURSOR_MODE_COLOR_UN_PRE_MULTIPLIED_ALPHA) {
		if (cursor_attributes->attribute_flags.bits.ENABLE_CURSOR_DEGAMMA) {
			cur_rom_en = 1;
		}
	}

	REG_UPDATE_3(CURSOR0_CONTROL,
			CUR0_MODE, color_format,
Loading