From 72c399117909b8bec796de1fc99e34f2b6609031 Mon Sep 17 00:00:00 2001 From: Arian Date: Sat, 22 Oct 2022 20:15:15 +0200 Subject: [PATCH] techpack: display: Notify on fps change events Change-Id: Idea8ae6ae4a2edd02188bb78140585b61a99bd9f --- include/drm/mi_disp_notifier.h | 2 ++ techpack/display/msm/dsi/dsi_display.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/drm/mi_disp_notifier.h b/include/drm/mi_disp_notifier.h index 03eed6890660..48242e7d0872 100644 --- a/include/drm/mi_disp_notifier.h +++ b/include/drm/mi_disp_notifier.h @@ -22,6 +22,8 @@ #define MI_DISP_DPMS_EVENT 0x01 /* A hardware display power mode state early change occurred */ #define MI_DISP_DPMS_EARLY_EVENT 0x02 +/* A hardware display mode state after fps changed */ +#define MI_DISP_FPS_CHANGE_EVENT 0xF628 enum { /* panel: power on */ diff --git a/techpack/display/msm/dsi/dsi_display.c b/techpack/display/msm/dsi/dsi_display.c index c941f593fdaa..12d66134cc97 100644 --- a/techpack/display/msm/dsi/dsi_display.c +++ b/techpack/display/msm/dsi/dsi_display.c @@ -7584,6 +7584,8 @@ int dsi_display_set_mode(struct dsi_display *display, int rc = 0; struct dsi_display_mode adj_mode; struct dsi_mode_info timing; + struct mi_disp_notifier notify_data; + int fps; if (!display || !mode || !display->panel) { DSI_ERR("Invalid params\n"); @@ -7628,6 +7630,10 @@ int dsi_display_set_mode(struct dsi_display *display, timing.h_active, timing.v_active, timing.refresh_rate); if (display->panel->cur_mode->timing.refresh_rate != timing.refresh_rate) { + fps = timing.refresh_rate; + notify_data.data = &fps; + notify_data.disp_id = mi_get_disp_id(display); + mi_disp_notifier_call_chain(MI_DISP_FPS_CHANGE_EVENT, ¬ify_data); sysfs_notify(&display->dev->kobj, NULL, "dynamic_fps"); }