aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3760-drm-amd-display-Add-variable-refresh-rate-parameters.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3760-drm-amd-display-Add-variable-refresh-rate-parameters.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3760-drm-amd-display-Add-variable-refresh-rate-parameters.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3760-drm-amd-display-Add-variable-refresh-rate-parameters.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3760-drm-amd-display-Add-variable-refresh-rate-parameters.patch
new file mode 100644
index 00000000..6feb2322
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3760-drm-amd-display-Add-variable-refresh-rate-parameters.patch
@@ -0,0 +1,108 @@
+From 0caf63c020bef27bdad869c2ce63b978111f118f Mon Sep 17 00:00:00 2001
+From: Anthony Koo <Anthony.Koo@amd.com>
+Date: Wed, 28 Feb 2018 11:37:51 -0500
+Subject: [PATCH 3760/4131] drm/amd/display: Add variable refresh rate
+ parameters to DC structures
+
+Time stamping will be part of surface, and will be updated when address is flipped.
+FreeSync parameters will be attached to stream, as it adjusts the timing dynamically.
+
+Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
+Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
+Acked-by: Harry Wentland <harry.wentland@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/dc.h | 2 ++
+ drivers/gpu/drm/amd/display/dc/dc_hw_types.h | 12 +++++++++++-
+ drivers/gpu/drm/amd/display/dc/dc_stream.h | 2 ++
+ drivers/gpu/drm/amd/display/dc/dc_types.h | 18 ++++++++++++++++++
+ 4 files changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
+index 3051a47..c45b413 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc.h
++++ b/drivers/gpu/drm/amd/display/dc/dc.h
+@@ -447,6 +447,7 @@ union surface_update_flags {
+
+ struct dc_plane_state {
+ struct dc_plane_address address;
++ struct dc_plane_flip_time time;
+ struct scaling_taps scaling_quality;
+ struct rect src_rect;
+ struct rect dst_rect;
+@@ -557,6 +558,7 @@ struct dc_transfer_func *dc_create_transfer_func(void);
+ */
+ struct dc_flip_addrs {
+ struct dc_plane_address address;
++ unsigned int flip_timestamp_in_us;
+ bool flip_immediate;
+ /* TODO: add flip duration for FreeSync */
+ };
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
+index e91ac68..b83a7dc 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
++++ b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
+@@ -692,8 +692,18 @@ struct crtc_trigger_info {
+ enum trigger_delay delay;
+ };
+
+-struct dc_crtc_timing {
++enum vrr_state {
++ VRR_STATE_OFF = 0,
++ VRR_STATE_VARIABLE,
++ VRR_STATE_FIXED,
++};
+
++struct dc_crtc_timing_adjust {
++ uint32_t v_total_min;
++ uint32_t v_total_max;
++};
++
++struct dc_crtc_timing {
+ uint32_t h_total;
+ uint32_t h_border_left;
+ uint32_t h_addressable;
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h b/drivers/gpu/drm/amd/display/dc/dc_stream.h
+index bafe388..13e5ac9 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
++++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
+@@ -48,6 +48,8 @@ struct dc_stream_status {
+ struct dc_stream_state {
+ struct dc_sink *sink;
+ struct dc_crtc_timing timing;
++ struct dc_crtc_timing_adjust timing_adjust;
++ struct vrr_params vrr_params;
+
+ struct rect src; /* composition area */
+ struct rect dst; /* stream addressable area */
+diff --git a/drivers/gpu/drm/amd/display/dc/dc_types.h b/drivers/gpu/drm/amd/display/dc/dc_types.h
+index 8811b6f..9441305 100644
+--- a/drivers/gpu/drm/amd/display/dc/dc_types.h
++++ b/drivers/gpu/drm/amd/display/dc/dc_types.h
+@@ -521,6 +521,24 @@ struct audio_info {
+ struct audio_mode modes[DC_MAX_AUDIO_DESC_COUNT];
+ };
+
++struct vrr_params {
++ enum vrr_state state;
++ uint32_t window_min;
++ uint32_t window_max;
++ uint32_t inserted_frame_duration_in_us;
++ uint32_t frames_to_insert;
++ uint32_t frame_counter;
++};
++
++#define DC_PLANE_UPDATE_TIMES_MAX 10
++
++struct dc_plane_flip_time {
++ unsigned int time_elapsed_in_us[DC_PLANE_UPDATE_TIMES_MAX];
++ unsigned int index;
++ unsigned int prev_update_time_in_us;
++};
++
++// Will combine with vrr_params at some point.
+ struct freesync_context {
+ bool supported;
+ bool enabled;
+--
+2.7.4
+