All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Tony Cheng <tony.cheng-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 11/25] drm/amd/display: remove hw_info_frame
Date: Mon, 23 Jan 2017 09:35:59 -0500	[thread overview]
Message-ID: <20170123143613.15441-12-harry.wentland@amd.com> (raw)
In-Reply-To: <20170123143613.15441-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>

From: Tony Cheng <tony.cheng@amd.com>

- construct using encoder_info_frame directly

Change-Id: I95a2cdb6cdeaccea8c87c9c3ff6be9673ba65afe
Signed-off-by: Tony Cheng <tony.cheng@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 124 +++++++--------------
 .../drm/amd/display/include/hw_sequencer_types.h   |  23 ----
 2 files changed, 40 insertions(+), 107 deletions(-)

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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-01-23 14:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 14:35 [PATCH 00/25] DC Patches Jan 23, 2017 Harry Wentland
     [not found] ` <20170123143613.15441-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2017-01-23 14:35   ` [PATCH 01/25] drm/amd/display: Null check clock source Harry Wentland
2017-01-23 14:35   ` [PATCH 02/25] drm/amd/display: Output Transfer Function Regamma Refactor Harry Wentland
2017-01-23 14:35   ` [PATCH 03/25] drm/amd/display: Disable Modules at Runtime Harry Wentland
2017-01-23 14:35   ` [PATCH 04/25] drm/amd/display: Fixing some fallout from dc_target removal Harry Wentland
2017-01-23 14:35   ` [PATCH 05/25] drm/amd/display: No audio output heard from DP panel Harry Wentland
2017-01-23 14:35   ` [PATCH 06/25] drm/amd/display: Use pflip prepare and submit parts (v2) Harry Wentland
2017-01-23 14:35   ` [PATCH 07/25] drm/amd/display: mode change without breaking unaffected streams Harry Wentland
2017-01-23 14:35   ` [PATCH 08/25] drm/amd/display: assert if mask is 0 in set_reg_field_value_ex Harry Wentland
2017-01-23 14:35   ` [PATCH 09/25] drm/amd/display: remove un-used defines and dead code Harry Wentland
2017-01-23 14:35   ` [PATCH 10/25] drm/amd/display: remove hw_crtc_timing Harry Wentland
2017-01-23 14:35   ` Harry Wentland [this message]
2017-01-23 14:36   ` [PATCH 12/25] drm/amd/display: remove SIGNAL_TYPE_WIRELESS Harry Wentland
2017-01-23 14:36   ` [PATCH 13/25] drm/amd/display: remove dead code Harry Wentland
2017-01-23 14:36   ` [PATCH 14/25] drm/amd/display: remove calculate_adjustments in conversion.h Harry Wentland
2017-01-23 14:36   ` [PATCH 15/25] drm/amd/display: Set default degamma to sRGB instead of bypass Harry Wentland
2017-01-23 14:36   ` [PATCH 16/25] drm/amd/display: HDR Enablement For Applications Harry Wentland
2017-01-23 14:36   ` [PATCH 17/25] drm/amd/display: refactor clk_resync to avoid assertion Harry Wentland
2017-01-23 14:36   ` [PATCH 18/25] drm/amd/display: Remove meta_pitch Harry Wentland
2017-01-23 14:36   ` [PATCH 19/25] drm/amd/display: rename BGRA8888 to ABGR8888 Harry Wentland
2017-01-23 14:36   ` [PATCH 20/25] drm/amd/display: Fix missing conditions in hw sequencer Harry Wentland
2017-01-23 14:36   ` [PATCH 21/25] drm/amd/display: Add missing MI masks Harry Wentland
2017-01-23 14:36   ` [PATCH 22/25] drm/amd/display: Add interrupt entries for VBLANK isr Harry Wentland
     [not found]     ` <20170123143613.15441-23-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2017-01-23 17:43       ` Alex Deucher
2017-01-23 14:36   ` [PATCH 23/25] drm/amd/display: Register on VLBLANK ISR Harry Wentland
2017-01-23 14:36   ` [PATCH 24/25] drm/amd/display: Clean index in irq init loop Harry Wentland
2017-01-23 14:36   ` [PATCH 25/25] drm/amd/display: add missing dcc update on flip call Harry Wentland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170123143613.15441-12-harry.wentland@amd.com \
    --to=harry.wentland-5c7gfcevmho@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=tony.cheng-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.