disp: msm: dsi: add debug ability to read TE read pointer line count
The change adds register mapping of MDP_INTF_[1/2]_TEAR_INT_COUNT_VAL register to DSI controller. This allows for the controller to read the line count and frame count of the read pointer during trigger and successful transfer of DMA command. To enable the debug feature: echo 1 > /d/<panel_name>/dsi-ctrl-0/enable_cmd_dma_stats. To disable the debug feature echo 0 > /d/<panel_name>/dsi-ctrl-0/enable_cmd_dma_stats. To read line count value: cat /d/<panel_name>/dsi-ctrl-0/cmd_dma_stats. Change-Id: I5cdeb54ca941af05b226a9d7ab332b899ecc5797 Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
Dieser Commit ist enthalten in:
@@ -14,6 +14,12 @@
|
||||
#define DSI_DMA_SCHEDULE_CTRL 0x100
|
||||
#define DSI_DMA_SCHEDULE_CTRL2 0x0104
|
||||
|
||||
/* MDP INTF registers to be mapped for debug feature*/
|
||||
#define MDP_INTF1_TEAR_LINE_COUNT 0xAE36298
|
||||
#define MDP_INTF2_TEAR_LINE_COUNT 0xAE37298
|
||||
#define MDP_INTF1_LINE_COUNT 0xAE360B0
|
||||
#define MDP_INTF2_LINE_COUNT 0xAE370B0
|
||||
|
||||
void dsi_ctrl_hw_22_setup_lane_map(struct dsi_ctrl_hw *ctrl,
|
||||
struct dsi_lane_map *lane_map)
|
||||
{
|
||||
@@ -253,3 +259,79 @@ void dsi_ctrl_hw_22_reset_trigger_controls(struct dsi_ctrl_hw *ctrl,
|
||||
DSI_W32(ctrl, DSI_DMA_SCHEDULE_CTRL, 0x0);
|
||||
ctrl->reset_trig_ctrl = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* dsi_ctrl_hw_22_map_mdp_regs() - maps MDP interface line count registers.
|
||||
* @pdev: Pointer to platform device.
|
||||
* @ctrl: Pointer to the controller host hardware.
|
||||
*
|
||||
* Return: 0 on success and error on failure.
|
||||
*/
|
||||
int dsi_ctrl_hw_22_map_mdp_regs(struct platform_device *pdev,
|
||||
struct dsi_ctrl_hw *ctrl)
|
||||
{
|
||||
int rc = 0;
|
||||
void __iomem *ptr = NULL, *ptr1 = NULL;
|
||||
|
||||
if (ctrl->index == 0) {
|
||||
ptr = devm_ioremap(&pdev->dev, MDP_INTF1_TEAR_LINE_COUNT, 1);
|
||||
if (IS_ERR_OR_NULL(ptr)) {
|
||||
DSI_CTRL_HW_ERR(ctrl,
|
||||
"MDP TE LINE COUNT address not found\n");
|
||||
rc = PTR_ERR(ptr);
|
||||
return rc;
|
||||
}
|
||||
|
||||
ptr1 = devm_ioremap(&pdev->dev, MDP_INTF1_LINE_COUNT, 1);
|
||||
if (IS_ERR_OR_NULL(ptr1)) {
|
||||
DSI_CTRL_HW_ERR(ctrl,
|
||||
"MDP TE LINE COUNT address not found\n");
|
||||
rc = PTR_ERR(ptr1);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctrl->index == 1) {
|
||||
ptr = devm_ioremap(&pdev->dev, MDP_INTF2_TEAR_LINE_COUNT, 1);
|
||||
if (IS_ERR_OR_NULL(ptr)) {
|
||||
DSI_CTRL_HW_ERR(ctrl,
|
||||
"MDP TE LINE COUNT address not found\n");
|
||||
rc = PTR_ERR(ptr);
|
||||
return rc;
|
||||
}
|
||||
|
||||
ptr1 = devm_ioremap(&pdev->dev, MDP_INTF2_LINE_COUNT, 1);
|
||||
if (IS_ERR_OR_NULL(ptr1)) {
|
||||
DSI_CTRL_HW_ERR(ctrl,
|
||||
"MDP TE LINE COUNT address not found\n");
|
||||
rc = PTR_ERR(ptr1);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
ctrl->te_rd_ptr_reg = ptr;
|
||||
ctrl->line_count_reg = ptr1;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* dsi_ctrl_hw_22_log_line_count() - reads the MDP interface line count
|
||||
* registers.
|
||||
* @ctrl: Pointer to the controller host hardware.
|
||||
* @cmd_mode: Boolean to indicate command mode operation.
|
||||
*
|
||||
* Return: INTF register value.
|
||||
*/
|
||||
u32 dsi_ctrl_hw_22_log_line_count(struct dsi_ctrl_hw *ctrl, bool cmd_mode)
|
||||
{
|
||||
|
||||
u32 reg = 0;
|
||||
|
||||
if (cmd_mode && ctrl->te_rd_ptr_reg)
|
||||
reg = readl_relaxed(ctrl->te_rd_ptr_reg);
|
||||
else if (ctrl->line_count_reg)
|
||||
reg = readl_relaxed(ctrl->line_count_reg);
|
||||
|
||||
return reg;
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren