Lines Matching refs:sr_data

69 	struct drm_self_refresh_data *sr_data = container_of(  in drm_self_refresh_helper_entry_work()  local
72 struct drm_crtc *crtc = sr_data->crtc; in drm_self_refresh_helper_entry_work()
155 struct drm_self_refresh_data *sr_data = crtc->self_refresh_data; in drm_self_refresh_helper_update_avg_times() local
163 time = &sr_data->entry_avg_ms; in drm_self_refresh_helper_update_avg_times()
165 time = &sr_data->exit_avg_ms; in drm_self_refresh_helper_update_avg_times()
167 mutex_lock(&sr_data->avg_mutex); in drm_self_refresh_helper_update_avg_times()
169 mutex_unlock(&sr_data->avg_mutex); in drm_self_refresh_helper_update_avg_times()
204 struct drm_self_refresh_data *sr_data; in drm_self_refresh_helper_alter_state() local
211 sr_data = crtc->self_refresh_data; in drm_self_refresh_helper_alter_state()
212 if (!sr_data) in drm_self_refresh_helper_alter_state()
215 mutex_lock(&sr_data->avg_mutex); in drm_self_refresh_helper_alter_state()
216 delay = (ewma_psr_time_read(&sr_data->entry_avg_ms) + in drm_self_refresh_helper_alter_state()
217 ewma_psr_time_read(&sr_data->exit_avg_ms)) * 2; in drm_self_refresh_helper_alter_state()
218 mutex_unlock(&sr_data->avg_mutex); in drm_self_refresh_helper_alter_state()
220 mod_delayed_work(system_wq, &sr_data->entry_work, in drm_self_refresh_helper_alter_state()
234 struct drm_self_refresh_data *sr_data = crtc->self_refresh_data; in drm_self_refresh_helper_init() local
237 if (WARN_ON(sr_data)) in drm_self_refresh_helper_init()
240 sr_data = kzalloc(sizeof(*sr_data), GFP_KERNEL); in drm_self_refresh_helper_init()
241 if (!sr_data) in drm_self_refresh_helper_init()
244 INIT_DELAYED_WORK(&sr_data->entry_work, in drm_self_refresh_helper_init()
246 sr_data->crtc = crtc; in drm_self_refresh_helper_init()
247 mutex_init(&sr_data->avg_mutex); in drm_self_refresh_helper_init()
248 ewma_psr_time_init(&sr_data->entry_avg_ms); in drm_self_refresh_helper_init()
249 ewma_psr_time_init(&sr_data->exit_avg_ms); in drm_self_refresh_helper_init()
256 ewma_psr_time_add(&sr_data->entry_avg_ms, SELF_REFRESH_AVG_SEED_MS); in drm_self_refresh_helper_init()
257 ewma_psr_time_add(&sr_data->exit_avg_ms, SELF_REFRESH_AVG_SEED_MS); in drm_self_refresh_helper_init()
259 crtc->self_refresh_data = sr_data; in drm_self_refresh_helper_init()
270 struct drm_self_refresh_data *sr_data = crtc->self_refresh_data; in drm_self_refresh_helper_cleanup() local
273 if (!sr_data) in drm_self_refresh_helper_cleanup()
278 cancel_delayed_work_sync(&sr_data->entry_work); in drm_self_refresh_helper_cleanup()
279 kfree(sr_data); in drm_self_refresh_helper_cleanup()