Loading drivers/gpu/drm/msm/dsi-staging/dsi_display.c +47 −0 Original line number Diff line number Diff line Loading @@ -5186,6 +5186,53 @@ int dsi_display_get_modes(struct dsi_display *display, return rc; } int dsi_display_get_panel_vfp(void *dsi_display, int h_active, int v_active) { int i, rc = 0; u32 count, refresh_rate = 0; struct dsi_dfps_capabilities dfps_caps; struct dsi_display *display = (struct dsi_display *)dsi_display; if (!display) return -EINVAL; rc = dsi_display_get_mode_count(display, &count); if (rc) return rc; mutex_lock(&display->display_lock); if (display->panel && display->panel->cur_mode) refresh_rate = display->panel->cur_mode->timing.refresh_rate; dsi_panel_get_dfps_caps(display->panel, &dfps_caps); if (dfps_caps.dfps_support) refresh_rate = dfps_caps.max_refresh_rate; if (!refresh_rate) { mutex_unlock(&display->display_lock); pr_err("Null Refresh Rate\n"); return -EINVAL; } h_active *= display->ctrl_count; for (i = 0; i < count; i++) { struct dsi_display_mode *m = &display->modes[i]; if (m && v_active == m->timing.v_active && h_active == m->timing.h_active && refresh_rate == m->timing.refresh_rate) { rc = m->timing.v_front_porch; break; } } mutex_unlock(&display->display_lock); return rc; } int dsi_display_find_mode(struct dsi_display *display, const struct dsi_display_mode *cmp, struct dsi_display_mode **out_mode) Loading drivers/gpu/drm/msm/dsi-staging/dsi_display.h +10 −0 Original line number Diff line number Diff line Loading @@ -647,4 +647,14 @@ enum dsi_pixel_format dsi_display_get_dst_format(void *display); * Return: Zero on Success */ int dsi_display_cont_splash_config(void *display); /* * dsi_display_get_panel_vfp - get panel vsync * @display: Pointer to private display structure * @h_active: width * @v_active: height * Returns: v_front_porch on success error code on failure */ int dsi_display_get_panel_vfp(void *display, int h_active, int v_active); #endif /* _DSI_DISPLAY_H_ */ drivers/gpu/drm/msm/sde/sde_connector.c +22 −0 Original line number Diff line number Diff line Loading @@ -1411,6 +1411,28 @@ int sde_connector_helper_reset_custom_properties( return 0; } int sde_connector_get_panel_vfp(struct drm_connector *connector, struct drm_display_mode *mode) { struct sde_connector *c_conn; int vfp = -EINVAL; if (!connector || !mode) { SDE_ERROR("invalid connector\n"); return vfp; } c_conn = to_sde_connector(connector); if (!c_conn->ops.get_panel_vfp) return vfp; vfp = c_conn->ops.get_panel_vfp(c_conn->display, mode->hdisplay, mode->vdisplay); if (vfp <= 0) SDE_ERROR("Failed get_panel_vfp %d\n", vfp); return vfp; } static int _sde_debugfs_conn_cmd_tx_open(struct inode *inode, struct file *file) { /* non-seekable */ Loading drivers/gpu/drm/msm/sde/sde_connector.h +18 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,15 @@ struct sde_connector_ops { * Returns: zero for success, negetive for failure */ int (*cont_splash_config)(void *display); /** * get_panel_vfp - returns original panel vfp * @display: Pointer to private display handle * @h_active: width * @v_active: height * Returns: v_front_porch on success error-code on failure */ int (*get_panel_vfp)(void *display, int h_active, int v_active); }; /** Loading Loading @@ -752,4 +761,13 @@ void sde_conn_timeline_status(struct drm_connector *conn); */ void sde_connector_helper_bridge_disable(struct drm_connector *connector); /** * sde_connector_get_panel_vfp - helper to get panel vfp * @connector: pointer to drm connector * @h_active: panel width * @v_active: panel heigth * Returns: v_front_porch on success error-code on failure */ int sde_connector_get_panel_vfp(struct drm_connector *connector, struct drm_display_mode *mode); #endif /* _SDE_CONNECTOR_H_ */ drivers/gpu/drm/msm/sde/sde_encoder.c +11 −4 Original line number Diff line number Diff line Loading @@ -2723,9 +2723,12 @@ static void sde_encoder_virt_disable(struct drm_encoder *drm_enc) sde_encoder_resource_control(drm_enc, SDE_ENC_RC_EVENT_STOP); for (i = 0; i < sde_enc->num_phys_encs; i++) { if (sde_enc->phys_encs[i]) if (sde_enc->phys_encs[i]) { sde_enc->phys_encs[i]->cont_splash_settings = false; sde_enc->phys_encs[i]->cont_splash_single_flush = 0; sde_enc->phys_encs[i]->connector = NULL; } } sde_enc->cur_master = NULL; /* Loading Loading @@ -4793,15 +4796,19 @@ int sde_encoder_update_caps_for_cont_splash(struct drm_encoder *encoder) return -EINVAL; } /* update connector for master and slave phys encoders */ phys->connector = conn; phys->cont_splash_single_flush = sde_kms->splash_data.single_flush_en; phys->cont_splash_settings = true; phys->hw_pp = sde_enc->hw_pp[i]; if (phys->ops.cont_splash_mode_set) phys->ops.cont_splash_mode_set(phys, drm_mode); if (phys->ops.is_master && phys->ops.is_master(phys)) { phys->connector = conn; if (phys->ops.is_master && phys->ops.is_master(phys)) sde_enc->cur_master = phys; } } return ret; } Loading Loading
drivers/gpu/drm/msm/dsi-staging/dsi_display.c +47 −0 Original line number Diff line number Diff line Loading @@ -5186,6 +5186,53 @@ int dsi_display_get_modes(struct dsi_display *display, return rc; } int dsi_display_get_panel_vfp(void *dsi_display, int h_active, int v_active) { int i, rc = 0; u32 count, refresh_rate = 0; struct dsi_dfps_capabilities dfps_caps; struct dsi_display *display = (struct dsi_display *)dsi_display; if (!display) return -EINVAL; rc = dsi_display_get_mode_count(display, &count); if (rc) return rc; mutex_lock(&display->display_lock); if (display->panel && display->panel->cur_mode) refresh_rate = display->panel->cur_mode->timing.refresh_rate; dsi_panel_get_dfps_caps(display->panel, &dfps_caps); if (dfps_caps.dfps_support) refresh_rate = dfps_caps.max_refresh_rate; if (!refresh_rate) { mutex_unlock(&display->display_lock); pr_err("Null Refresh Rate\n"); return -EINVAL; } h_active *= display->ctrl_count; for (i = 0; i < count; i++) { struct dsi_display_mode *m = &display->modes[i]; if (m && v_active == m->timing.v_active && h_active == m->timing.h_active && refresh_rate == m->timing.refresh_rate) { rc = m->timing.v_front_porch; break; } } mutex_unlock(&display->display_lock); return rc; } int dsi_display_find_mode(struct dsi_display *display, const struct dsi_display_mode *cmp, struct dsi_display_mode **out_mode) Loading
drivers/gpu/drm/msm/dsi-staging/dsi_display.h +10 −0 Original line number Diff line number Diff line Loading @@ -647,4 +647,14 @@ enum dsi_pixel_format dsi_display_get_dst_format(void *display); * Return: Zero on Success */ int dsi_display_cont_splash_config(void *display); /* * dsi_display_get_panel_vfp - get panel vsync * @display: Pointer to private display structure * @h_active: width * @v_active: height * Returns: v_front_porch on success error code on failure */ int dsi_display_get_panel_vfp(void *display, int h_active, int v_active); #endif /* _DSI_DISPLAY_H_ */
drivers/gpu/drm/msm/sde/sde_connector.c +22 −0 Original line number Diff line number Diff line Loading @@ -1411,6 +1411,28 @@ int sde_connector_helper_reset_custom_properties( return 0; } int sde_connector_get_panel_vfp(struct drm_connector *connector, struct drm_display_mode *mode) { struct sde_connector *c_conn; int vfp = -EINVAL; if (!connector || !mode) { SDE_ERROR("invalid connector\n"); return vfp; } c_conn = to_sde_connector(connector); if (!c_conn->ops.get_panel_vfp) return vfp; vfp = c_conn->ops.get_panel_vfp(c_conn->display, mode->hdisplay, mode->vdisplay); if (vfp <= 0) SDE_ERROR("Failed get_panel_vfp %d\n", vfp); return vfp; } static int _sde_debugfs_conn_cmd_tx_open(struct inode *inode, struct file *file) { /* non-seekable */ Loading
drivers/gpu/drm/msm/sde/sde_connector.h +18 −0 Original line number Diff line number Diff line Loading @@ -257,6 +257,15 @@ struct sde_connector_ops { * Returns: zero for success, negetive for failure */ int (*cont_splash_config)(void *display); /** * get_panel_vfp - returns original panel vfp * @display: Pointer to private display handle * @h_active: width * @v_active: height * Returns: v_front_porch on success error-code on failure */ int (*get_panel_vfp)(void *display, int h_active, int v_active); }; /** Loading Loading @@ -752,4 +761,13 @@ void sde_conn_timeline_status(struct drm_connector *conn); */ void sde_connector_helper_bridge_disable(struct drm_connector *connector); /** * sde_connector_get_panel_vfp - helper to get panel vfp * @connector: pointer to drm connector * @h_active: panel width * @v_active: panel heigth * Returns: v_front_porch on success error-code on failure */ int sde_connector_get_panel_vfp(struct drm_connector *connector, struct drm_display_mode *mode); #endif /* _SDE_CONNECTOR_H_ */
drivers/gpu/drm/msm/sde/sde_encoder.c +11 −4 Original line number Diff line number Diff line Loading @@ -2723,9 +2723,12 @@ static void sde_encoder_virt_disable(struct drm_encoder *drm_enc) sde_encoder_resource_control(drm_enc, SDE_ENC_RC_EVENT_STOP); for (i = 0; i < sde_enc->num_phys_encs; i++) { if (sde_enc->phys_encs[i]) if (sde_enc->phys_encs[i]) { sde_enc->phys_encs[i]->cont_splash_settings = false; sde_enc->phys_encs[i]->cont_splash_single_flush = 0; sde_enc->phys_encs[i]->connector = NULL; } } sde_enc->cur_master = NULL; /* Loading Loading @@ -4793,15 +4796,19 @@ int sde_encoder_update_caps_for_cont_splash(struct drm_encoder *encoder) return -EINVAL; } /* update connector for master and slave phys encoders */ phys->connector = conn; phys->cont_splash_single_flush = sde_kms->splash_data.single_flush_en; phys->cont_splash_settings = true; phys->hw_pp = sde_enc->hw_pp[i]; if (phys->ops.cont_splash_mode_set) phys->ops.cont_splash_mode_set(phys, drm_mode); if (phys->ops.is_master && phys->ops.is_master(phys)) { phys->connector = conn; if (phys->ops.is_master && phys->ops.is_master(phys)) sde_enc->cur_master = phys; } } return ret; } Loading