[3/7] drm/amd/dal: Track windowed_fullscreen state in freesync module

Submitted by Harry Wentland on Nov. 30, 2016, 7:20 p.m.

Details

Message ID 20161130192013.11043-4-harry.wentland@amd.com
State New
Headers show
Series "dal patches for nov 30, 2016" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Harry Wentland Nov. 30, 2016, 7:20 p.m.
From: Amy Zhang <Amy.Zhang@amd.com>

Change-Id: If5c2282838810d8ed250345aa43dada900dd1caa
Signed-off-by: Amy Zhang <Amy.Zhang@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/modules/freesync/freesync.c | 7 ++++++-
 drivers/gpu/drm/amd/dal/modules/inc/mod_freesync.h  | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/dal/modules/freesync/freesync.c b/drivers/gpu/drm/amd/dal/modules/freesync/freesync.c
index 12a2dc50307a..eb912baa0169 100644
--- a/drivers/gpu/drm/amd/dal/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/dal/modules/freesync/freesync.c
@@ -82,6 +82,7 @@  struct freesync_state {
 	bool video;
 
 	unsigned int nominal_refresh_rate_in_micro_hz;
+	bool windowed_fullscreen;
 
 	struct time_cache time;
 
@@ -710,6 +711,8 @@  void mod_freesync_update_state(struct mod_freesync *mod_freesync,
 		case FREESYNC_STATE_FULLSCREEN:
 			state->fullscreen = freesync_params->enable;
 			freesync_program_required = true;
+			state->windowed_fullscreen =
+					freesync_params->windowed_fullscreen;
 			break;
 		case FREESYNC_STATE_STATIC_SCREEN:
 			/* Static screen ramp is only enabled for embedded
@@ -770,8 +773,10 @@  bool mod_freesync_get_state(struct mod_freesync *mod_freesync,
 	} else if (core_freesync->map[index].state.video) {
 		freesync_params->state = FREESYNC_STATE_VIDEO;
 		freesync_params->enable = true;
-	} else
+	} else {
+		freesync_params->state = FREESYNC_STATE_NONE;
 		freesync_params->enable = false;
+	}
 
 	freesync_params->update_duration_in_ns =
 		core_freesync->map[index].state.time.update_duration_in_ns;
diff --git a/drivers/gpu/drm/amd/dal/modules/inc/mod_freesync.h b/drivers/gpu/drm/amd/dal/modules/inc/mod_freesync.h
index 947619342d08..7abfe34dc2d9 100644
--- a/drivers/gpu/drm/amd/dal/modules/inc/mod_freesync.h
+++ b/drivers/gpu/drm/amd/dal/modules/inc/mod_freesync.h
@@ -64,6 +64,7 @@  struct mod_freesync {
 };
 
 enum mod_freesync_state {
+	FREESYNC_STATE_NONE,
 	FREESYNC_STATE_FULLSCREEN,
 	FREESYNC_STATE_STATIC_SCREEN,
 	FREESYNC_STATE_VIDEO
@@ -93,6 +94,7 @@  struct mod_freesync_params {
 	enum mod_freesync_state state;
 	bool enable;
 	unsigned int update_duration_in_ns;
+	bool windowed_fullscreen;
 };
 
 /*