drm/rockchip: get rid of vop->is_enabled
authorMark Yao <mark.yao@rock-chips.com>
Mon, 1 Aug 2016 06:32:32 +0000 (14:32 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 2 Aug 2016 12:09:10 +0000 (20:09 +0800)
With atomic helpers there's no need to track the enabled state of a pipe
any more, because atomic helpers track this accurately already.

Change-Id: Ic2441b5acefe327cdef797aca88f6a2098643c69
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/rockchip_drm_vop.c

index 39d0020..2c5ff89 100644 (file)
@@ -153,7 +153,6 @@ struct vop {
        struct device *dev;
        struct drm_device *drm_dev;
        struct drm_property *plane_zpos_prop;
-       bool is_enabled;
 
        /* mutex vsync_ work */
        struct mutex vsync_mutex;
@@ -461,9 +460,6 @@ static void vop_dsp_hold_valid_irq_enable(struct vop *vop)
 {
        unsigned long flags;
 
-       if (WARN_ON(!vop->is_enabled))
-               return;
-
        spin_lock_irqsave(&vop->irq_lock, flags);
 
        VOP_INTR_SET_TYPE(vop, enable, DSP_HOLD_VALID_INTR, 1);
@@ -475,9 +471,6 @@ static void vop_dsp_hold_valid_irq_disable(struct vop *vop)
 {
        unsigned long flags;
 
-       if (WARN_ON(!vop->is_enabled))
-               return;
-
        spin_lock_irqsave(&vop->irq_lock, flags);
 
        VOP_INTR_SET_TYPE(vop, enable, DSP_HOLD_VALID_INTR, 0);
@@ -536,11 +529,6 @@ static void vop_enable(struct drm_crtc *crtc)
                VOP_WIN_SET(vop, win, gate, 1);
        }
 
-       /*
-        * At here, vop clock & iommu is enable, R/W vop regs would be safe.
-        */
-       vop->is_enabled = true;
-
        spin_lock(&vop->reg_lock);
 
        VOP_CTRL_SET(vop, standby, 0);
@@ -604,8 +592,6 @@ static void vop_crtc_disable(struct drm_crtc *crtc)
 
        disable_irq(vop->irq);
 
-       vop->is_enabled = false;
-
        /*
         * vop standby complete, so iommu detach is safe.
         */
@@ -760,9 +746,6 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
        if (!crtc)
                return;
 
-       if (WARN_ON(!vop->is_enabled))
-               return;
-
        if (!vop_plane_state->enable) {
                vop_plane_atomic_disable(plane, old_state);
                return;
@@ -965,9 +948,6 @@ static int vop_crtc_enable_vblank(struct drm_crtc *crtc)
        struct vop *vop = to_vop(crtc);
        unsigned long flags;
 
-       if (WARN_ON(!vop->is_enabled))
-               return -EPERM;
-
        spin_lock_irqsave(&vop->irq_lock, flags);
 
        VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 1);
@@ -982,9 +962,6 @@ static void vop_crtc_disable_vblank(struct drm_crtc *crtc)
        struct vop *vop = to_vop(crtc);
        unsigned long flags;
 
-       if (WARN_ON(!vop->is_enabled))
-               return;
-
        spin_lock_irqsave(&vop->irq_lock, flags);
 
        VOP_INTR_SET_TYPE(vop, enable, FS_INTR, 0);
@@ -1227,9 +1204,6 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc,
                        to_rockchip_crtc_state(crtc->state);
        struct vop *vop = to_vop(crtc);
 
-       if (WARN_ON(!vop->is_enabled))
-               return;
-
        spin_lock(&vop->reg_lock);
 
        VOP_CTRL_SET(vop, dsp_layer_sel, s->dsp_layer_sel);