Merge "drm/msm/dsi-staging: update frame transfer time calculations"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
21af73b82c
@@ -1704,7 +1704,7 @@ static int dsi_enable_io_clamp(struct dsi_ctrl *dsi_ctrl,
|
|||||||
static int dsi_ctrl_dts_parse(struct dsi_ctrl *dsi_ctrl,
|
static int dsi_ctrl_dts_parse(struct dsi_ctrl *dsi_ctrl,
|
||||||
struct device_node *of_node)
|
struct device_node *of_node)
|
||||||
{
|
{
|
||||||
u32 index = 0;
|
u32 index = 0, frame_threshold_time_us = 0;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if (!dsi_ctrl || !of_node) {
|
if (!dsi_ctrl || !of_node) {
|
||||||
@@ -1730,6 +1730,15 @@ static int dsi_ctrl_dts_parse(struct dsi_ctrl *dsi_ctrl,
|
|||||||
dsi_ctrl->null_insertion_enabled = of_property_read_bool(of_node,
|
dsi_ctrl->null_insertion_enabled = of_property_read_bool(of_node,
|
||||||
"qcom,null-insertion-enabled");
|
"qcom,null-insertion-enabled");
|
||||||
|
|
||||||
|
rc = of_property_read_u32(of_node, "frame-threshold-time-us",
|
||||||
|
&frame_threshold_time_us);
|
||||||
|
if (rc) {
|
||||||
|
pr_debug("frame-threshold-time not specified, defaulting\n");
|
||||||
|
frame_threshold_time_us = 2666;
|
||||||
|
}
|
||||||
|
|
||||||
|
dsi_ctrl->frame_threshold_time_us = frame_threshold_time_us;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -204,6 +204,9 @@ struct dsi_ctrl_interrupts {
|
|||||||
* @debugfs_root: Root for debugfs entries.
|
* @debugfs_root: Root for debugfs entries.
|
||||||
* @misr_enable: Frame MISR enable/disable
|
* @misr_enable: Frame MISR enable/disable
|
||||||
* @misr_cache: Cached Frame MISR value
|
* @misr_cache: Cached Frame MISR value
|
||||||
|
* @frame_threshold_time_us: Frame threshold time in microseconds, where
|
||||||
|
* dsi data lane will be idle i.e from pingpong done to
|
||||||
|
* next TE for command mode.
|
||||||
* @phy_isolation_enabled: A boolean property allows to isolate the phy from
|
* @phy_isolation_enabled: A boolean property allows to isolate the phy from
|
||||||
* dsi controller and run only dsi controller.
|
* dsi controller and run only dsi controller.
|
||||||
* @null_insertion_enabled: A boolean property to allow dsi controller to
|
* @null_insertion_enabled: A boolean property to allow dsi controller to
|
||||||
@@ -255,6 +258,8 @@ struct dsi_ctrl {
|
|||||||
bool misr_enable;
|
bool misr_enable;
|
||||||
u32 misr_cache;
|
u32 misr_cache;
|
||||||
|
|
||||||
|
u32 frame_threshold_time_us;
|
||||||
|
|
||||||
/* Check for spurious interrupts */
|
/* Check for spurious interrupts */
|
||||||
unsigned long jiffies_start;
|
unsigned long jiffies_start;
|
||||||
unsigned int error_interrupt_count;
|
unsigned int error_interrupt_count;
|
||||||
|
@@ -5749,6 +5749,7 @@ int dsi_display_get_modes(struct dsi_display *display,
|
|||||||
struct dsi_display_mode **out_modes)
|
struct dsi_display_mode **out_modes)
|
||||||
{
|
{
|
||||||
struct dsi_dfps_capabilities dfps_caps;
|
struct dsi_dfps_capabilities dfps_caps;
|
||||||
|
struct dsi_display_ctrl *ctrl;
|
||||||
u32 num_dfps_rates, panel_mode_count, total_mode_count;
|
u32 num_dfps_rates, panel_mode_count, total_mode_count;
|
||||||
u32 mode_idx, array_idx = 0;
|
u32 mode_idx, array_idx = 0;
|
||||||
struct dsi_dyn_clk_caps *dyn_clk_caps;
|
struct dsi_dyn_clk_caps *dyn_clk_caps;
|
||||||
@@ -5760,6 +5761,7 @@ int dsi_display_get_modes(struct dsi_display *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*out_modes = NULL;
|
*out_modes = NULL;
|
||||||
|
ctrl = &display->ctrl[0];
|
||||||
|
|
||||||
mutex_lock(&display->display_lock);
|
mutex_lock(&display->display_lock);
|
||||||
|
|
||||||
@@ -5793,6 +5795,7 @@ int dsi_display_get_modes(struct dsi_display *display,
|
|||||||
for (mode_idx = 0; mode_idx < panel_mode_count; mode_idx++) {
|
for (mode_idx = 0; mode_idx < panel_mode_count; mode_idx++) {
|
||||||
struct dsi_display_mode panel_mode;
|
struct dsi_display_mode panel_mode;
|
||||||
int topology_override = NO_OVERRIDE;
|
int topology_override = NO_OVERRIDE;
|
||||||
|
u32 frame_threshold_us = ctrl->ctrl->frame_threshold_time_us;
|
||||||
|
|
||||||
if (display->cmdline_timing == mode_idx)
|
if (display->cmdline_timing == mode_idx)
|
||||||
topology_override = display->cmdline_topology;
|
topology_override = display->cmdline_topology;
|
||||||
@@ -5812,7 +5815,7 @@ int dsi_display_get_modes(struct dsi_display *display,
|
|||||||
if (display->panel->panel_mode == DSI_OP_CMD_MODE) {
|
if (display->panel->panel_mode == DSI_OP_CMD_MODE) {
|
||||||
dsi_panel_calc_dsi_transfer_time(
|
dsi_panel_calc_dsi_transfer_time(
|
||||||
&display->panel->host_config,
|
&display->panel->host_config,
|
||||||
&panel_mode.timing);
|
&panel_mode, frame_threshold_us);
|
||||||
panel_mode.priv_info->dsi_transfer_time_us =
|
panel_mode.priv_info->dsi_transfer_time_us =
|
||||||
panel_mode.timing.dsi_transfer_time_us;
|
panel_mode.timing.dsi_transfer_time_us;
|
||||||
panel_mode.priv_info->min_dsi_clk_hz =
|
panel_mode.priv_info->min_dsi_clk_hz =
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#define DSI_PANEL_DEFAULT_LABEL "Default dsi panel"
|
#define DSI_PANEL_DEFAULT_LABEL "Default dsi panel"
|
||||||
|
|
||||||
#define DEFAULT_MDP_TRANSFER_TIME 14000
|
|
||||||
|
|
||||||
#define DEFAULT_PANEL_JITTER_NUMERATOR 2
|
#define DEFAULT_PANEL_JITTER_NUMERATOR 2
|
||||||
#define DEFAULT_PANEL_JITTER_DENOMINATOR 1
|
#define DEFAULT_PANEL_JITTER_DENOMINATOR 1
|
||||||
#define DEFAULT_PANEL_JITTER_ARRAY_SIZE 2
|
#define DEFAULT_PANEL_JITTER_ARRAY_SIZE 2
|
||||||
@@ -763,8 +761,7 @@ static int dsi_panel_parse_timing(struct dsi_mode_info *mode,
|
|||||||
display_mode->priv_info->mdp_transfer_time_us =
|
display_mode->priv_info->mdp_transfer_time_us =
|
||||||
mode->mdp_transfer_time_us;
|
mode->mdp_transfer_time_us;
|
||||||
else
|
else
|
||||||
display_mode->priv_info->mdp_transfer_time_us =
|
display_mode->priv_info->mdp_transfer_time_us = 0;
|
||||||
DEFAULT_MDP_TRANSFER_TIME;
|
|
||||||
|
|
||||||
rc = utils->read_u32(utils->data,
|
rc = utils->read_u32(utils->data,
|
||||||
"qcom,mdss-dsi-panel-framerate",
|
"qcom,mdss-dsi-panel-framerate",
|
||||||
@@ -3362,20 +3359,18 @@ void dsi_panel_put_mode(struct dsi_display_mode *mode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config,
|
void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config,
|
||||||
struct dsi_mode_info *timing)
|
struct dsi_display_mode *mode, u32 frame_threshold_us)
|
||||||
{
|
{
|
||||||
u32 frame_time_us,nslices;
|
u32 frame_time_us,nslices;
|
||||||
u64 min_bitclk, total_active_pixels, bits_per_line;
|
u64 min_bitclk, total_active_pixels, bits_per_line;
|
||||||
struct msm_display_dsc_info *dsc = timing->dsc;
|
struct msm_display_dsc_info *dsc = mode->timing.dsc;
|
||||||
|
struct dsi_mode_info *timing = &mode->timing;
|
||||||
|
|
||||||
/* Packet overlead in bits,2 bytes header + 2 bytes checksum
|
/* Packet overlead in bits,2 bytes header + 2 bytes checksum
|
||||||
* + 1 byte dcs data command.
|
* + 1 byte dcs data command.
|
||||||
*/
|
*/
|
||||||
const u32 packet_overhead = 56;
|
const u32 packet_overhead = 56;
|
||||||
|
|
||||||
/* Default time between pingpong done to TE in microsecs */
|
|
||||||
const u32 max_tx_threshold_time = 2166;
|
|
||||||
|
|
||||||
frame_time_us = mult_frac(1000, 1000, (timing->refresh_rate));
|
frame_time_us = mult_frac(1000, 1000, (timing->refresh_rate));
|
||||||
|
|
||||||
if (timing->dsc_enabled) {
|
if (timing->dsc_enabled) {
|
||||||
@@ -3403,9 +3398,12 @@ void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config,
|
|||||||
/* adjust the transfer time proportionately for bit clk*/
|
/* adjust the transfer time proportionately for bit clk*/
|
||||||
timing->dsi_transfer_time_us = mult_frac(frame_time_us,
|
timing->dsi_transfer_time_us = mult_frac(frame_time_us,
|
||||||
min_bitclk, timing->clk_rate_hz);
|
min_bitclk, timing->clk_rate_hz);
|
||||||
|
} else if (mode->priv_info->mdp_transfer_time_us) {
|
||||||
|
timing->dsi_transfer_time_us =
|
||||||
|
mode->priv_info->mdp_transfer_time_us;
|
||||||
} else {
|
} else {
|
||||||
timing->dsi_transfer_time_us = frame_time_us -
|
timing->dsi_transfer_time_us = frame_time_us -
|
||||||
max_tx_threshold_time;
|
frame_threshold_us;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -309,6 +309,6 @@ int dsi_panel_parse_esd_reg_read_configs(struct dsi_panel *panel);
|
|||||||
void dsi_panel_ext_bridge_put(struct dsi_panel *panel);
|
void dsi_panel_ext_bridge_put(struct dsi_panel *panel);
|
||||||
|
|
||||||
void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config,
|
void dsi_panel_calc_dsi_transfer_time(struct dsi_host_common_cfg *config,
|
||||||
struct dsi_mode_info *timing);
|
struct dsi_display_mode *mode, u32 frame_threshold_us);
|
||||||
|
|
||||||
#endif /* _DSI_PANEL_H_ */
|
#endif /* _DSI_PANEL_H_ */
|
||||||
|
Reference in New Issue
Block a user