From: Harry Wentland <harry.wentland-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Charlene Liu <charlene.liu-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 10/32] drm/amd/display: add delay between panel pwr off to on.
Date: Tue, 3 Apr 2018 21:27:25 -0400 [thread overview]
Message-ID: <20180404012747.5651-11-harry.wentland@amd.com> (raw)
In-Reply-To: <20180404012747.5651-1-harry.wentland-5C7GfCeVMHo@public.gmane.org>
From: Charlene Liu <charlene.liu@amd.com>
As per eDP 1.4 spec, there must be at least 500ms delay
between eDP power off and on.
This change added time stamp when edp power off, which can
be used to calculate duration time when edp power on.
If duration less than 500ms, add a wait.
Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
.../drm/amd/display/amdgpu_dm/amdgpu_dm_services.c | 7 ++++++
drivers/gpu/drm/amd/display/dc/dc_link.h | 9 +++++++
.../amd/display/dc/dce110/dce110_hw_sequencer.c | 29 +++++++++++++++++++++-
drivers/gpu/drm/amd/display/dc/dm_services.h | 4 +++
4 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
index fe29125215b5..0229c7edb8ad 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_services.c
@@ -43,6 +43,13 @@ unsigned long long dm_get_timestamp(struct dc_context *ctx)
return timespec64_to_ns(&time);
}
+unsigned long long dm_get_elapse_time_in_ns(struct dc_context *ctx,
+ unsigned long long current_time_stamp,
+ unsigned long long last_time_stamp)
+{
+ return current_time_stamp - last_time_stamp;
+}
+
void dm_perf_trace_timestamp(const char *func_name, unsigned int line)
{
}
diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h
index fb4d9eafdc6e..eeff98741293 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_link.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_link.h
@@ -51,6 +51,14 @@ struct link_mst_stream_allocation_table {
struct link_mst_stream_allocation stream_allocations[MAX_CONTROLLER_NUM];
};
+struct time_stamp {
+ uint64_t edp_poweroff;
+ uint64_t edp_poweron;
+};
+
+struct link_trace {
+ struct time_stamp time_stamp;
+};
/*
* A link contains one or more sinks and their connected status.
* The currently active signal type (HDMI, DP-SST, DP-MST) is also reported.
@@ -114,6 +122,7 @@ struct dc_link {
struct dc_link_status link_status;
+ struct link_trace link_trace;
};
const struct dc_link_status *dc_link_get_status(const struct dc_link *dc_link);
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index e8df50f30e5b..db2d15dfb831 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -849,6 +849,28 @@ void hwss_edp_power_control(
if (power_up != is_panel_powered_on(hwseq)) {
/* Send VBIOS command to prompt eDP panel power */
+ if (power_up) {
+ unsigned long long current_ts = dm_get_timestamp(ctx);
+ unsigned long long duration_in_ms =
+ dm_get_elapse_time_in_ns(
+ ctx,
+ current_ts,
+ link->link_trace.time_stamp.edp_poweroff) / 1000000;
+ unsigned long long wait_time_ms = 0;
+
+ /* max 500ms from LCDVDD off to on */
+ if (link->link_trace.time_stamp.edp_poweroff == 0)
+ wait_time_ms = 500;
+ else if (duration_in_ms < 500)
+ wait_time_ms = 500 - duration_in_ms;
+
+ if (wait_time_ms) {
+ msleep(wait_time_ms);
+ dm_output_to_console("%s: wait %lld ms to power on eDP.\n",
+ __func__, wait_time_ms);
+ }
+
+ }
DC_LOG_HW_RESUME_S3(
"%s: Panel Power action: %s\n",
@@ -862,9 +884,14 @@ void hwss_edp_power_control(
cntl.coherent = false;
cntl.lanes_number = LANE_COUNT_FOUR;
cntl.hpd_sel = link->link_enc->hpd_source;
-
bp_result = link_transmitter_control(ctx->dc_bios, &cntl);
+ if (!power_up)
+ /*save driver power off time stamp*/
+ link->link_trace.time_stamp.edp_poweroff = dm_get_timestamp(ctx);
+ else
+ link->link_trace.time_stamp.edp_poweron = dm_get_timestamp(ctx);
+
if (bp_result != BP_RESULT_OK)
DC_LOG_ERROR(
"%s: Panel Power bp_result: %d\n",
diff --git a/drivers/gpu/drm/amd/display/dc/dm_services.h b/drivers/gpu/drm/amd/display/dc/dm_services.h
index 22e7ee7dcd26..8eafe1af8a5e 100644
--- a/drivers/gpu/drm/amd/display/dc/dm_services.h
+++ b/drivers/gpu/drm/amd/display/dc/dm_services.h
@@ -341,6 +341,10 @@ bool dm_dmcu_set_pipe(struct dc_context *ctx, unsigned int controller_id);
unsigned long long dm_get_timestamp(struct dc_context *ctx);
+unsigned long long dm_get_elapse_time_in_ns(struct dc_context *ctx,
+ unsigned long long current_time_stamp,
+ unsigned long long last_time_stamp);
+
/*
* performance tracing
*/
--
2.15.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev 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 ` Harry Wentland [this message]
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 ` [PATCH 23/32] drm/amd/display: Updated HDR Static Metadata to directly take info packet raw Harry Wentland
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-11-harry.wentland@amd.com \
--to=harry.wentland-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=charlene.liu-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox