techpack: display: Notify on fps change events

Change-Id: Idea8ae6ae4a2edd02188bb78140585b61a99bd9f
This commit is contained in:
Arian 2022-10-22 20:15:15 +02:00 committed by Giovanni Ricca
parent 76703a3aa9
commit 72c3991179
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View File

@ -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 */

View File

@ -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, &notify_data);
sysfs_notify(&display->dev->kobj, NULL, "dynamic_fps");
}