AMD-GFX Archive on 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: Anthony Koo <Anthony.Koo-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 23/32] drm/amd/display: Updated HDR Static Metadata to directly take info packet raw
Date: Tue, 3 Apr 2018 21:27:38 -0400	[thread overview]
Message-ID: <20180404012747.5651-24-harry.wentland@amd.com> (raw)
In-Reply-To: <20180404012747.5651-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>

From: Anthony Koo <Anthony.Koo@amd.com>

Updated HDR Static Metadata to directly take info packet raw

Updating Infopacket does not require Passive

Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c          |  3 -
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 91 +----------------------
 drivers/gpu/drm/amd/display/dc/dc_stream.h        |  4 +-
 3 files changed, 5 insertions(+), 93 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 5c7fa0412da1..292667197a30 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1195,9 +1195,6 @@ static enum surface_update_type check_update_surfaces_for_stream(
 		if (stream_update->out_transfer_func)
 			return UPDATE_TYPE_FULL;
 
-		if (stream_update->hdr_static_metadata)
-			return UPDATE_TYPE_FULL;
-
 		if (stream_update->abm_level)
 			return UPDATE_TYPE_FULL;
 	}
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 b57c5404d9bc..569c3ac2af07 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -2209,97 +2209,12 @@ static void set_hdr_static_info_packet(
 		struct dc_info_packet *info_packet,
 		struct dc_stream_state *stream)
 {
-	uint16_t i = 0;
-	enum signal_type signal = stream->signal;
-	uint32_t data;
+	/* HDR Static Metadata info packet for HDR10 */
 
-	if (!stream->hdr_static_metadata.hdr_supported)
+	if (!stream->hdr_static_metadata.valid)
 		return;
 
-	if (dc_is_hdmi_signal(signal)) {
-		info_packet->valid = true;
-
-		info_packet->hb0 = 0x87;
-		info_packet->hb1 = 0x01;
-		info_packet->hb2 = 0x1A;
-		i = 1;
-	} else if (dc_is_dp_signal(signal)) {
-		info_packet->valid = true;
-
-		info_packet->hb0 = 0x00;
-		info_packet->hb1 = 0x87;
-		info_packet->hb2 = 0x1D;
-		info_packet->hb3 = (0x13 << 2);
-		i = 2;
-	}
-
-	data = stream->hdr_static_metadata.is_hdr;
-	info_packet->sb[i++] = data ? 0x02 : 0x00;
-	info_packet->sb[i++] = 0x00;
-
-	data = stream->hdr_static_metadata.chromaticity_green_x / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.chromaticity_green_y / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.chromaticity_blue_x / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.chromaticity_blue_y / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.chromaticity_red_x / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.chromaticity_red_y / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.chromaticity_white_point_x / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.chromaticity_white_point_y / 2;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.max_luminance;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.min_luminance;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.maximum_content_light_level;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	data = stream->hdr_static_metadata.maximum_frame_average_light_level;
-	info_packet->sb[i++] = data & 0xFF;
-	info_packet->sb[i++] = (data & 0xFF00) >> 8;
-
-	if (dc_is_hdmi_signal(signal)) {
-		uint32_t checksum = 0;
-
-		checksum += info_packet->hb0;
-		checksum += info_packet->hb1;
-		checksum += info_packet->hb2;
-
-		for (i = 1; i <= info_packet->hb2; i++)
-			checksum += info_packet->sb[i];
-
-		info_packet->sb[0] = 0x100 - checksum;
-	} else if (dc_is_dp_signal(signal)) {
-		info_packet->sb[0] = 0x01;
-		info_packet->sb[1] = 0x1A;
-	}
+	*info_packet = stream->hdr_static_metadata;
 }
 
 static void set_vsc_info_packet(
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index ca437e1412f6..f90c5785a502 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -64,7 +64,7 @@ struct dc_stream_state {
 
 	struct audio_info audio_info;
 
-	struct dc_hdr_static_metadata hdr_static_metadata;
+	struct dc_info_packet hdr_static_metadata;
 	struct dc_transfer_func *out_transfer_func;
 	struct colorspace_transform gamut_remap_matrix;
 	struct csc_transform csc_color_matrix;
@@ -119,8 +119,8 @@ struct dc_stream_update {
 	struct rect src;
 	struct rect dst;
 	struct dc_transfer_func *out_transfer_func;
-	struct dc_hdr_static_metadata *hdr_static_metadata;
 	enum color_transfer_func color_output_tf;
+	struct dc_info_packet *hdr_static_metadata;
 	unsigned int *abm_level;
 	unsigned long long *periodic_fn_vsync_delta;
 	struct dc_crtc_timing_adjust *adjust;
-- 
2.15.1

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

  parent reply	other threads:[~2018-04-04  1:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04  1:27 [PATCH 00/32] DC Patches Apr 3, 2018 Harry Wentland
     [not found] ` <20180404012747.5651-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-04-04  1:27   ` [PATCH 01/32] drm/amd/display: Only register backlight device if embedded panel connected Harry Wentland
2018-04-04  1:27   ` [PATCH 02/32] drm/amd/display: Don't register backlight on connector_destroy Harry Wentland
2018-04-04  1:27   ` [PATCH 03/32] drm/amd/display: Program v_total_min/max after v_total_cntl Harry Wentland
2018-04-04  1:27   ` [PATCH 04/32] drm/amd/display: Set ignore_msa_timing_param Harry Wentland
2018-04-04  1:27   ` [PATCH 05/32] drm/amd/display: Non-HDMI DP active dongle should not support YUV pixel format Harry Wentland
2018-04-04  1:27   ` [PATCH 06/32] drm/amd/display: Fix potential access beyond end of array in CM Harry Wentland
2018-04-04  1:27   ` [PATCH 07/32] drm/amd/display: Add Dynamic debug prints Harry Wentland
2018-04-04  1:27   ` [PATCH 08/32] drm/amd/display: Add vmax/min_sel prints to dcn10_log_hw_state Harry Wentland
2018-04-04  1:27   ` [PATCH 09/32] drm/amd/display: Implement dm_get_timestamp Harry Wentland
2018-04-04  1:27   ` [PATCH 10/32] drm/amd/display: add delay between panel pwr off to on Harry Wentland
2018-04-04  1:27   ` [PATCH 11/32] drm/amd/display: Set all update flags when we have full update Harry Wentland
2018-04-04  1:27   ` [PATCH 12/32] drm/amd/display: Refactor FreeSync module Harry Wentland
2018-04-04  1:27   ` [PATCH 13/32] drm/amd/display: Refactor stream encoder for HW review Harry Wentland
2018-04-04  1:27   ` [PATCH 14/32] drm/amd/display: remove unused enum Harry Wentland
2018-04-04  1:27   ` [PATCH 15/32] drm/amd/display: fix link bw calculation for 422 and 420 encoding Harry Wentland
2018-04-04  1:27   ` [PATCH 16/32] drm/amd/display: Fill calcs date from stream src/dst if available Harry Wentland
2018-04-04  1:27   ` [PATCH 17/32] drm/amd/display: Change disable backlight ramp change threshold from 0 to maximum value Harry Wentland
2018-04-04  1:27   ` [PATCH 18/32] drm/amd/display: Update scaler v_active data if interlaced Harry Wentland
2018-04-04  1:27   ` [PATCH 19/32] drm/amd/display: Make DCN stream encoder shareable Harry Wentland
2018-04-04  1:27   ` [PATCH 20/32] drm/amd/display: csc updates require FULL update Harry Wentland
2018-04-04  1:27   ` [PATCH 21/32] drm/amd/display: Fix FBC text console corruption Harry Wentland
2018-04-04  1:27   ` [PATCH 22/32] drm/amd/display: dal 3.1.41 Harry Wentland
2018-04-04  1:27   ` Harry Wentland [this message]
2018-04-04  1:27   ` [PATCH 24/32] drm/amd/display: Get rid of unused input_tf Harry Wentland
2018-04-04  1:27   ` [PATCH 25/32] drm/amd/display: Remove unused fields Harry Wentland
2018-04-04  1:27   ` [PATCH 26/32] drm/amd/display: Do not use os types Harry Wentland
2018-04-04  1:27   ` [PATCH 27/32] drm/amd/display: csc_transform to dc_csc_transform Harry Wentland
2018-04-04  1:27   ` [PATCH 28/32] drm/amd/display: Refactor color module Harry Wentland
2018-04-04  1:27   ` [PATCH 29/32] drm/amd/display: move color_transfer_func to color mod Harry Wentland
2018-04-04  1:27   ` [PATCH 30/32] drm/amd/display: Fix structure initialization of hdmi_info_packet Harry Wentland
2018-04-04  1:27   ` [PATCH 31/32] drm/amd/display: Have DC manage its own allocation of gamma Harry Wentland
2018-04-04  1:27   ` [PATCH 32/32] drm/amd/display: Fix dim display on DCE11 Harry Wentland
     [not found]     ` <20180404012747.5651-33-harry.wentland-5C7GfCeVMHo@public.gmane.org>
2018-04-04  7:18       ` Michel Dänzer
2018-04-04 15:17       ` Deucher, Alexander
     [not found]         ` <BN6PR12MB18095513D4EAE9751423B742F7A40-/b2+HYfkarSEx6ez0IUAagdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-04-06 20:18           ` Leo Li

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=20180404012747.5651-24-harry.wentland@amd.com \
    --to=harry.wentland-5c7gfcevmho@public.gmane.org \
    --cc=Anthony.Koo-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox