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

Harry Wentland harry.wentland at amd.com
Wed Nov 30 19:20:09 UTC 2016


From: Amy Zhang <Amy.Zhang at amd.com>

Change-Id: If5c2282838810d8ed250345aa43dada900dd1caa
Signed-off-by: Amy Zhang <Amy.Zhang at amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at 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(-)

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;
 };
 
 /*
-- 
2.9.3



More information about the amd-gfx mailing list