Merge branch 'for-next' of git://people.freedesktop.org/~seanpaul/dogwood into drm...
authorDave Airlie <airlied@redhat.com>
Thu, 25 Aug 2016 02:35:35 +0000 (12:35 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 25 Aug 2016 02:35:35 +0000 (12:35 +1000)
This pull request contains the following rockchip drm changes:

  - Introduce support for rk3399 vop/crtc
  - Add PSR framework to the rockchip driver
  - Implement PSR in the rockchip analogix edp driver
  - Fix panel on/off in analogix to avoid damaging panels
  - Some miscellaneous fixes to clean up logs and code readability

* 'for-next' of git://people.freedesktop.org/~seanpaul/dogwood:
  drm/rockchip: analogix_dp: drop unnecessary probe deferral "error" print
  drm/rockchip: Enable vblank without event
  drm/rockchip: Improve analogix-dp psr handling
  drm/rockchip: A couple small fixes to psr
  drm/rockchip: Use a spinlock to protect psr state
  drm/rockchip: Don't use a delayed worker for psr state changes
  drm/rockchip: Convert psr_list_mutex to spinlock and use it
  drm/rockchip: analogix_dp: implement PSR function
  drm/bridge: analogix_dp: add the PSR function support
  drm/rockchip: add an common abstracted PSR driver
  drm/rockchip: vop: export line flag function
  drm/bridge: analogix_dp: Ensure the panel is properly prepared/unprepared
  dt-bindings: add compatible strings for big/little rockchip vops
  dt-bindings: sort Rockchip vop compatible by chip's number
  drm/rockchip: vop: add rk3399 vop support
  drm/rockchip: vop: introduce VOP_REG_MASK
  drm/rockchip: sort registers define by chip's number

1  2 
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
drivers/gpu/drm/rockchip/rockchip_vop_reg.c

index efbc41ad83b6c9d208852cd52083007de6d424f5,790ba917e12d83d92d42e9e12e584467bd9da54d..d486049f97228131d67eb77873d0cd03bba9ddbd
@@@ -428,7 -433,72 +433,72 @@@ static void vop_dsp_hold_valid_irq_disa
        spin_unlock_irqrestore(&vop->irq_lock, flags);
  }
  
 -static void vop_enable(struct drm_crtc *crtc)
+ /*
+  * (1) each frame starts at the start of the Vsync pulse which is signaled by
+  *     the "FRAME_SYNC" interrupt.
+  * (2) the active data region of each frame ends at dsp_vact_end
+  * (3) we should program this same number (dsp_vact_end) into dsp_line_frag_num,
+  *      to get "LINE_FLAG" interrupt at the end of the active on screen data.
+  *
+  * VOP_INTR_CTRL0.dsp_line_frag_num = VOP_DSP_VACT_ST_END.dsp_vact_end
+  * Interrupts
+  * LINE_FLAG -------------------------------+
+  * FRAME_SYNC ----+                         |
+  *                |                         |
+  *                v                         v
+  *                | Vsync | Vbp |  Vactive  | Vfp |
+  *                        ^     ^           ^     ^
+  *                        |     |           |     |
+  *                        |     |           |     |
+  * dsp_vs_end ------------+     |           |     |   VOP_DSP_VTOTAL_VS_END
+  * dsp_vact_start --------------+           |     |   VOP_DSP_VACT_ST_END
+  * dsp_vact_end ----------------------------+     |   VOP_DSP_VACT_ST_END
+  * dsp_total -------------------------------------+   VOP_DSP_VTOTAL_VS_END
+  */
+ static bool vop_line_flag_irq_is_enabled(struct vop *vop)
+ {
+       uint32_t line_flag_irq;
+       unsigned long flags;
+       spin_lock_irqsave(&vop->irq_lock, flags);
+       line_flag_irq = VOP_INTR_GET_TYPE(vop, enable, LINE_FLAG_INTR);
+       spin_unlock_irqrestore(&vop->irq_lock, flags);
+       return !!line_flag_irq;
+ }
+ static void vop_line_flag_irq_enable(struct vop *vop, int line_num)
+ {
+       unsigned long flags;
+       if (WARN_ON(!vop->is_enabled))
+               return;
+       spin_lock_irqsave(&vop->irq_lock, flags);
+       VOP_CTRL_SET(vop, line_flag_num[0], line_num);
+       VOP_INTR_SET_TYPE(vop, enable, LINE_FLAG_INTR, 1);
+       spin_unlock_irqrestore(&vop->irq_lock, flags);
+ }
+ static void vop_line_flag_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, LINE_FLAG_INTR, 0);
+       spin_unlock_irqrestore(&vop->irq_lock, flags);
+ }
 +static int vop_enable(struct drm_crtc *crtc)
  {
        struct vop *vop = to_vop(crtc);
        int ret;
@@@ -908,8 -985,7 +982,8 @@@ static void vop_crtc_enable(struct drm_
        u16 vsync_len = adjusted_mode->vsync_end - adjusted_mode->vsync_start;
        u16 vact_st = adjusted_mode->vtotal - adjusted_mode->vsync_start;
        u16 vact_end = vact_st + vdisplay;
-       uint32_t val;
+       uint32_t pin_pol, val;
 +      int ret;
  
        WARN_ON(vop->event);