|
@@ -468,7 +468,7 @@ static bool vop_line_flag_irq_is_enabled(struct vop *vop)
|
|
return !!line_flag_irq;
|
|
return !!line_flag_irq;
|
|
}
|
|
}
|
|
|
|
|
|
-static void vop_line_flag_irq_enable(struct vop *vop, int line_num)
|
|
|
|
|
|
+static void vop_line_flag_irq_enable(struct vop *vop)
|
|
{
|
|
{
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
@@ -477,7 +477,6 @@ static void vop_line_flag_irq_enable(struct vop *vop, int line_num)
|
|
|
|
|
|
spin_lock_irqsave(&vop->irq_lock, flags);
|
|
spin_lock_irqsave(&vop->irq_lock, flags);
|
|
|
|
|
|
- VOP_CTRL_SET(vop, line_flag_num[0], line_num);
|
|
|
|
VOP_INTR_SET_TYPE(vop, clear, LINE_FLAG_INTR, 1);
|
|
VOP_INTR_SET_TYPE(vop, clear, LINE_FLAG_INTR, 1);
|
|
VOP_INTR_SET_TYPE(vop, enable, LINE_FLAG_INTR, 1);
|
|
VOP_INTR_SET_TYPE(vop, enable, LINE_FLAG_INTR, 1);
|
|
|
|
|
|
@@ -981,6 +980,8 @@ static void vop_crtc_enable(struct drm_crtc *crtc)
|
|
VOP_CTRL_SET(vop, vact_st_end, val);
|
|
VOP_CTRL_SET(vop, vact_st_end, val);
|
|
VOP_CTRL_SET(vop, vpost_st_end, val);
|
|
VOP_CTRL_SET(vop, vpost_st_end, val);
|
|
|
|
|
|
|
|
+ VOP_CTRL_SET(vop, line_flag_num[0], vact_end);
|
|
|
|
+
|
|
clk_set_rate(vop->dclk, adjusted_mode->clock * 1000);
|
|
clk_set_rate(vop->dclk, adjusted_mode->clock * 1000);
|
|
|
|
|
|
VOP_CTRL_SET(vop, standby, 0);
|
|
VOP_CTRL_SET(vop, standby, 0);
|
|
@@ -1507,19 +1508,16 @@ static void vop_win_init(struct vop *vop)
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * rockchip_drm_wait_line_flag - acqiure the give line flag event
|
|
|
|
|
|
+ * rockchip_drm_wait_vact_end
|
|
* @crtc: CRTC to enable line flag
|
|
* @crtc: CRTC to enable line flag
|
|
- * @line_num: interested line number
|
|
|
|
* @mstimeout: millisecond for timeout
|
|
* @mstimeout: millisecond for timeout
|
|
*
|
|
*
|
|
- * Driver would hold here until the interested line flag interrupt have
|
|
|
|
- * happened or timeout to wait.
|
|
|
|
|
|
+ * Wait for vact_end line flag irq or timeout.
|
|
*
|
|
*
|
|
* Returns:
|
|
* Returns:
|
|
* Zero on success, negative errno on failure.
|
|
* Zero on success, negative errno on failure.
|
|
*/
|
|
*/
|
|
-int rockchip_drm_wait_line_flag(struct drm_crtc *crtc, unsigned int line_num,
|
|
|
|
- unsigned int mstimeout)
|
|
|
|
|
|
+int rockchip_drm_wait_vact_end(struct drm_crtc *crtc, unsigned int mstimeout)
|
|
{
|
|
{
|
|
struct vop *vop = to_vop(crtc);
|
|
struct vop *vop = to_vop(crtc);
|
|
unsigned long jiffies_left;
|
|
unsigned long jiffies_left;
|
|
@@ -1527,14 +1525,14 @@ int rockchip_drm_wait_line_flag(struct drm_crtc *crtc, unsigned int line_num,
|
|
if (!crtc || !vop->is_enabled)
|
|
if (!crtc || !vop->is_enabled)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
- if (line_num > crtc->mode.vtotal || mstimeout <= 0)
|
|
|
|
|
|
+ if (mstimeout <= 0)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
if (vop_line_flag_irq_is_enabled(vop))
|
|
if (vop_line_flag_irq_is_enabled(vop))
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
|
|
|
|
reinit_completion(&vop->line_flag_completion);
|
|
reinit_completion(&vop->line_flag_completion);
|
|
- vop_line_flag_irq_enable(vop, line_num);
|
|
|
|
|
|
+ vop_line_flag_irq_enable(vop);
|
|
|
|
|
|
jiffies_left = wait_for_completion_timeout(&vop->line_flag_completion,
|
|
jiffies_left = wait_for_completion_timeout(&vop->line_flag_completion,
|
|
msecs_to_jiffies(mstimeout));
|
|
msecs_to_jiffies(mstimeout));
|
|
@@ -1547,7 +1545,7 @@ int rockchip_drm_wait_line_flag(struct drm_crtc *crtc, unsigned int line_num,
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
-EXPORT_SYMBOL(rockchip_drm_wait_line_flag);
|
|
|
|
|
|
+EXPORT_SYMBOL(rockchip_drm_wait_vact_end);
|
|
|
|
|
|
static int vop_bind(struct device *dev, struct device *master, void *data)
|
|
static int vop_bind(struct device *dev, struct device *master, void *data)
|
|
{
|
|
{
|