“234f82a70244f36f770b6f8567c51ba231b6bfcc”上不存在“arch/git@gitcode.net:openanolis/cloud-kernel.git”
  1. 08 4月, 2017 11 次提交
    • A
      drm/msm/mdp5: Stage right side hwpipes on Right-side Layer Mixer · bf8dc0a0
      Archit Taneja 提交于
      Now that our mdp5_planes can consist of 2 hwpipes, update the
      blend_setup() code to stage the right hwpipe to the left and
      right LMs
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      bf8dc0a0
    • A
      drm/msm/mdp5: Prepare Layer Mixers for source split · ed78560d
      Archit Taneja 提交于
      In order to enable Source Split in HW, we need to add/modify
      a few LM register configurations:
      
      - Configure the LM width to be half the mode width, so that
        each LM manages one half of the scanout.
      - Tell the 'right' LM that it is configured to be the 'right'
        LM in source split mode.
      - Since we now have 2 places where REG_MDP5_LM_BLEND_COLOR_OUT is
        configured, do a read-update-store for the register instead of
        directly writing a value to it.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      ed78560d
    • A
      drm/msm/mdp5: Add optional 'right' Layer Mixer in CRTC state · b7621b2a
      Archit Taneja 提交于
      Add another mdp5_hw_mixer pointer (r_mixer) in mdp5_crtc_state.
      This mixer will be used to generate the right half of the scanout.
      
      With Source Split, a SSPP can now be connected to 2 Layer Mixers, but
      has to be at the same blend level (stage #) on both Layer Mixers.
      
      A drm_plane that has a lesser width than the max width supported, will
      comprise of a single SSPP/hwpipe, staged on both the Layer Mixers at
      the same blend level. A plane that is greater than max width will comprise
      of 2 SSPPs, with the 'left' SSPP staged on the left LM, and the 'right'
      SSPP staged on the right LM at the same blend level.
      
      For now, the drm_plane consists of only one SSPP, therefore, it
      needs to be staged on both the LMs in blend_setup() and mdp5_ctl_blend().
      We'll extend this logic to support 2 hwpipes per plane later.
      
      The crtc cursor ops (using the LM cursors, not SSPP cursors) simply
      return an error if they're called when the right mixer is assigned to
      the CRTC state. With source split is enabled, we're expected to only
      SSPP cursors.
      
      This commit adds code that configures the right mixer, but the r_mixer
      itself isn't assigned at the moment.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      b7621b2a
    • A
      drm/msm/mdp5: Remove mixer/intf pointers from mdp5_ctl · f316b25a
      Archit Taneja 提交于
      These are a part of CRTC state, it doesn't feel nice to leave them
      hanging in mdp5_ctl struct. Pass mdp5_pipeline pointer instead
      wherever it is needed.
      
      We still have some params in mdp5_ctl like start_mask etc which
      are derivative of atomic state, and should be rolled back if
      a commit fails, but it doesn't seem to cause much trouble.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      f316b25a
    • A
      drm/msm/mdp5: Start using parameters from CRTC state · 0ddc3a63
      Archit Taneja 提交于
      In the last few commits, we've been adding params to mdp5_crtc_state, and
      assigning them in the atomic_check() funcs. Now it's time to actually
      start using them.
      
      Remove the duplicated params from the mdp5_crtc struct, and start using
      them in the mdp5_crtc code. The majority of the references to these params
      is in code that executes after the atomic swap has occurred, so it's okay
      to use crtc->state in them. There are a couple of legacy LM cursor ops that
      may not use the updated state, but (I think) it's okay to live with that.
      
      Now that we dynamically allocate a mixer to the CRTC, we can also remove
      the static assignment to it in mdp5_crtc_init, and also drop the code that
      skipped init-ing WB bound mixers (those will now be rejected by
      mdp5_mixer_assign()).
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      0ddc3a63
    • A
      drm/msm/mdp5: Add more stuff to CRTC state · bcb877b7
      Archit Taneja 提交于
      Things like vblank/err irq masks, mode of operation (command mode or not)
      are derivative of the interface and mixer state. Therefore, they need to
      be a part of the CRTC state too.
      
      Add them to mdp5_crtc_state, and assign them in the CRTC's atomic_check()
      func, so that it can be rolled back to a clean state.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      bcb877b7
    • A
      drm/msm/mdp5: Prepare for dynamic assignment of mixers · 894558ec
      Archit Taneja 提交于
      Add the stuff needed to allow dynamically assigning a mixer to a CRTC.
      
      Since mixers are a resource that can be shared across multiple CRTCs, we
      need to maintain a 'hwmixer_to_crtc' map in the global atomic state,
      acquire the mdp5_kms.state_lock modeset lock and so on.
      
      The mixer is assigned in the CRTC's atomic_check() func, a failure will
      result in the new state being cleanly rolled back.
      
      The mixer assignment itself is straightforward, and almost identical to
      what we do for hwpipes. We don't need to grab the old hwmixer_to_crtc
      state like we do in hwpipes since we don't need to compare anything
      with the old state at the moment.
      
      The only LM capability we care about at the moment is whether the mixer
      instance can be used to display stuff (i.e, connect to an INTF
      downstream).
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      894558ec
    • A
      drm/msm/mdp5: subclass CRTC state · c1e2a130
      Archit Taneja 提交于
      Subclass drm_crtc_state so that we can maintain additional state for
      our CRTCs.
      
      Add mdp5_pipeline and mdp5_ctl pointers in the subclassed state.
      mdp5_pipeline is a grouping of the HW entities that forms the downstream
      pipeline for a particular CRTC. It currently contains pointers to
      mdp5_interface and mdp5_hw_mixer tied to this CRTC. Later, we will
      have 2 hwmixers in this struct. (We could also have 2 intfs if we want
      to support dual DSI with Source Split enabled. Implementing that feature
      isn't planned at the moment).
      
      The mdp5_pipeline state isn't used at the moment. For now, we just
      introduce mdp5_crtc_state and the crtc funcs needed to manage the
      subclassed state.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      c1e2a130
    • A
      drm/msm/mdp5: Simplify LM <-> PP mapping · a2380124
      Archit Taneja 提交于
      PingPong ID for a Layer Mixer is already contained in
      mdp5_hw_mixer.
      
      This avoids the need to retrieve PP ID using macros
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      a2380124
    • A
      drm/msm/mdp5: Start using mdp5_hw_mixer · adfc0e63
      Archit Taneja 提交于
      Use the mdp5_hw_mixer struct in the mdp5_crtc and mdp5_ctl instead of
      using the LM index.
      
      Like before, the Layer Mixers are assigned statically to the CRTCs.
      The hwmixer(s) will later be dynamically assigned to CRTCs.
      
      For now, ignore the hwmixers that can only do WB.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      adfc0e63
    • D
      drm/msm: Simplify vblank event delivery · 02efb359
      Daniel Vetter 提交于
      The core takes care of handling the send_event vs. close() issues, we
      can remove that driver code.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: linux-arm-msm@vger.kernel.org
      Cc: freedreno@lists.freedesktop.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      02efb359
  2. 07 2月, 2017 4 次提交
    • A
      drm/msm/mdp5: Add support for legacy cursor updates · 10967a06
      Archit Taneja 提交于
      This code has been more or less picked up from the vc4 and intel
      implementations of update_plane() funcs for cursor planes.
      
      The update_plane() func is usually the drm_atomic_helper_update_plane
      func that will issue an atomic commit with the plane updates. Such
      commits are not intended to be done faster than the vsync rate.
      
      The legacy cursor userspace API, on the other hand, expects the kernel
      to handle cursor updates immediately.
      
      Create a fast path in update_plane, which updates the cursor registers
      and flushes the configuration. The fast path is taken when there is only
      a change in the cursor's position in the crtc, or a change in the
      cursor's crop co-ordinates. For anything else, we go via the slow path.
      
      We take the slow path even when the fb changes, and when there is
      currently no fb tied to the plane. This should hopefully ensure that we
      always take a slow path for every new fb. This in turn should ensure that
      the fb is pinned/prepared.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      10967a06
    • A
      drm/msm/mdp5: Misc cursor plane bits · 5798c8e0
      Archit Taneja 提交于
      These are various changes added in preparation for cursor planes:
      
      - Add a pipe_cursor block for 8x96 in mdp5_cfg.
      - Add a new pipe CAP called MDP_PIPE_CAP_CURSOR. Use this to ensure we
        assign a cursor SSPP for a drm_plane with type DRM_PLANE_TYPE_CURSOR.
      - Update mdp5_ctl_blend_mask/ext_blend_mask funcs to incorporate cursor
        SSPPs.
      - In mdp5_ctl_blend, iterate through MAX_STAGES instead of stage_cnt,
        we need to do this because we can now have empty stages in between.
      - In mdp5_crtc_atomic_check, make sure that the cursor plane has the
        highest zorder, and stage the cursor plane to the maximum stage #
        present on the HW.
      - Create drm_crtc_funcs that doesn't try to implement cursors using the
        older LM cursor HW.
      - Pass drm_plane_type in mdp5_plane_init instead of a bool telling
        whether plane is primary or not.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      5798c8e0
    • A
      drm/msm/mdp5: Configure COLOR3_OUT propagation · 829200ac
      Archit Taneja 提交于
      In MDP5 Layer Mixer HW, the blender output is only the blended color
      components (i.e R, G and B, or COLOR0/1/2 in MDP5 HW terminology). This
      is fed to the BG input of the next blender. We also need to provide an
      alpha (COLOR3) value for the BG input at the next stage.
      
      This is configured via using the REG_MDP5_LM_BLEND_COLOR_OUT register.
      For each stage, we can propagate either the BG or FG alpha to the next
      stage.
      
      The approach taken by the driver is to propagate FG alpha, if the plane
      staged on that blender has an alpha. If it doesn't, we try to propagate
      the base layer's alpha.
      
      This is borrowed from downstream MDP5 kernel driver. Without this, we
      don't see any cursor plane content.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      829200ac
    • A
      drm/msm/mdp5: Prepare CRTC/LM for empty stages · 106f9727
      Archit Taneja 提交于
      Use SSPP_NONE in mdp5_plane_pipe() if there is now hwpipe allocated for
      the drm_plane. Returning '0' means we are returning VIG0 pipe.
      
      Also, use the mdp5_pipe enum to pass around the stage array. Initialize
      the stage to SSPP_NONE by default.
      
      We do the above because 1) Cursor plane has to be staged at the topmost
      blender of the LM, which can result in empty stages in between 2) In
      the future, when we support multiple LMs per CRTC. We could have stages
      which don't have any pipe assigned to them.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      106f9727
  3. 29 11月, 2016 1 次提交
    • R
      drm/msm: convert iova to 64b · 78babc16
      Rob Clark 提交于
      For a5xx the gpu is 64b so we need to change iova to 64b everywhere.  On
      the display side, iova is still 32b so it can ignore the upper bits.
      (Although all the armv8 devices have an iommu that can map 64b pa to 32b
      iova.)
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      78babc16
  4. 28 11月, 2016 4 次提交
    • R
      drm/msm/mdp5: dynamically assign hw pipes to planes · 4a0f012d
      Rob Clark 提交于
      (re)assign the hw pipes to planes based on required caps, and to handle
      situations where we could not modify an in-use plane (ie. SMP block
      reallocation).
      
      This means all planes advertise the superset of formats and properties.
      Userspace must (as always) use atomic TEST_ONLY step for atomic updates,
      as not all planes may be available for use on every frame.
      
      The mapping of hwpipe to plane is stored in mdp5_state, so that state
      updates are atomically committed in the same way that plane/etc state
      updates are managed.  This is needed because the mdp5_plane_state keeps
      a pointer to the hwpipe, and we don't want global state to become out
      of sync with the plane state if an atomic update fails, we hit deadlock/
      backoff scenario, etc.  The use of state_lock keeps multiple parallel
      updates which both re-assign hwpipes properly serialized.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      4a0f012d
    • R
      drm/msm/mdp5: introduce mdp5_hw_pipe · c056b55d
      Rob Clark 提交于
      Split out the hardware pipe specifics from mdp5_plane.  To start, the hw
      pipes are statically assigned to planes, but next step is to assign the
      hw pipes during plane->atomic_check() based on requested caps (scaling,
      YUV, etc).  And then hw pipe re-assignment if required if required SMP
      blocks changes.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NArchit Taneja <architt@codeaurora.org>
      c056b55d
    • R
      drm/msm/mdp5: nuke mdp5_plane_complete_flip() · a2100695
      Rob Clark 提交于
      We can do this all from mdp5_plane_complete_commit(), so simplify things
      a bit and drop mdp5_plane_complete_flip().
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      a2100695
    • R
      drm/msm/mdp5: drop mdp5_crtc::name · cee26588
      Rob Clark 提交于
      Plane's (pipes) can be assigned dynamically with atomic, so it doesn't
      make much sense to name the pipe after it's primary plane.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      cee26588
  5. 27 11月, 2016 1 次提交
    • R
      drm/msm/mdp5: handle non-fullscreen base plane case · 1455adbd
      Rob Clark 提交于
      If the bottom-most layer is not fullscreen, we need to use the BASE
      mixer stage for solid fill (ie. MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT).  The
      blend_setup() code pretty much handled this already, we just had to
      figure this out in _atomic_check() and assign the stages appropriately.
      
      Also fix the case where there are zero enabled planes, where we also
      need to enable BORDER_OUT.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      1455adbd
  6. 02 11月, 2016 1 次提交
    • R
      drm/msm/mdp5: handle non-fullscreen base plane case · 31e4801a
      Rob Clark 提交于
      If the bottom-most layer is not fullscreen, we need to use the BASE
      mixer stage for solid fill (ie. MDP5_CTL_BLEND_OP_FLAG_BORDER_OUT).  The
      blend_setup() code pretty much handled this already, we just had to
      figure this out in _atomic_check() and assign the stages appropriately.
      
      Also fix the case where there are zero enabled planes, where we also
      need to enable BORDER_OUT.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      31e4801a
  7. 16 7月, 2016 1 次提交
  8. 02 6月, 2016 1 次提交
  9. 17 5月, 2016 1 次提交
  10. 02 5月, 2016 1 次提交
  11. 05 3月, 2016 1 次提交
  12. 03 3月, 2016 1 次提交
  13. 08 2月, 2016 1 次提交
  14. 11 12月, 2015 1 次提交
    • V
      drm: Pass 'name' to drm_crtc_init_with_planes() · f9882876
      Ville Syrjälä 提交于
      Done with coccinelle for the most part. However, it thinks '...' is
      part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
      in its place and got rid of it with sed afterwards.
      
      I didn't convert drm_crtc_init() since passing the varargs through
      would mean either cpp macros or va_list, and I figured we don't
      care about these legacy functions enough to warrant the extra pain.
      
      @@
      identifier dev, crtc, primary, cursor, funcs;
      @@
       int drm_crtc_init_with_planes(struct drm_device *dev,
                                     struct drm_crtc *crtc,
                                     struct drm_plane *primary, struct drm_plane *cursor,
                                     const struct drm_crtc_funcs *funcs
      +                              ,const char *name, int DOTDOTDOT
                                     )
      { ... }
      
      @@
      identifier dev, crtc, primary, cursor, funcs;
      @@
       int drm_crtc_init_with_planes(struct drm_device *dev,
                                     struct drm_crtc *crtc,
                                     struct drm_plane *primary, struct drm_plane *cursor,
                                     const struct drm_crtc_funcs *funcs
      +                              ,const char *name, int DOTDOTDOT
                                     );
      
      @@
      expression E1, E2, E3, E4, E5;
      @@
       drm_crtc_init_with_planes(E1, E2, E3, E4, E5
      +                          ,NULL
                                 )
      
      v2: Split crtc and plane changes apart
          Pass NULL for no-name instead of ""
          Leave drm_crtc_init() alone
      v3: Add ', or NULL...' to @name kernel doc (Jani)
          Annotate the function with __printf() attribute (Jani)
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
      f9882876
  15. 16 8月, 2015 3 次提交
  16. 27 7月, 2015 1 次提交
  17. 12 6月, 2015 3 次提交
    • H
      drm/msm/mdp5: Wait for PP_DONE irq for command mode CRTC atomic commit · 68cdbed9
      Hai Li 提交于
      CRTCs in DSI command mode data path should wait for pingpong done,
      instead of vblank, to finish atomic commit.
      
      This change is to enable PP_DONE irq on command mode CRTCs and wait for
      this irq happens before atomic commit completion.
      Signed-off-by: NHai Li <hali@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      68cdbed9
    • H
      drm/msm: Use customized function to wait for atomic commit done · 0a5c9aad
      Hai Li 提交于
      MDP FLUSH registers could indicate if the previous flush updates
      has taken effect at vsync boundary. Making use of this H/W feature
      can catch the vsync that happened between CRTC atomic_flush and
      *_wait_for_vblanks, to avoid unnecessary wait.
      
      This change allows kms CRTCs to use their own *_wait_for_commit_done
      functions to wait for FLUSH register cleared at vsync, before commit
      completion.
      Signed-off-by: NHai Li <hali@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      0a5c9aad
    • R
      drm/msm/mdp5: fix for crash in disable path · e5989ee1
      Rob Clark 提交于
      Seems like disable can race with complete_flip() in process of disabling
      a crtc, leading to:
      
      [   49.065364] Call trace:
      [   49.071441] [<ffffffc00041d5a0>] mdp5_ctl_blend+0x20/0x1c0
      [   49.073788] [<ffffffc00041ebcc>] mdp5_crtc_disable+0x3c/0xa8
      [   49.079348] [<ffffffc0003e7854>] disable_outputs.isra.4+0x11c/0x220
      [   49.085164] [<ffffffc0003e7afc>] drm_atomic_helper_commit_modeset_disables+0x14/0x38
      [   49.091155] [<ffffffc000425c80>] complete_commit+0x40/0xb8
      [   49.099136] [<ffffffc0004260ac>] msm_atomic_commit+0x364/0x398
      [   49.104430] [<ffffffc00040a614>] drm_atomic_commit+0x3c/0x70
      [   49.110249] [<ffffffc0003e67b8>] drm_atomic_helper_set_config+0x1b0/0x3e0
      [   49.116065] [<ffffffc0003f99bc>] drm_mode_set_config_internal+0x64/0xf8
      [   49.122746] [<ffffffc0003fa624>] drm_framebuffer_remove+0xe4/0x128
      [   49.129171] [<ffffffc0003feaf8>] drm_mode_rmfb+0xc0/0x100
      [   49.135420] [<ffffffc0003efba8>] drm_ioctl+0x258/0x4d0
      [   49.140889] [<ffffffc0001b0388>] do_vfs_ioctl+0x338/0x5d0
      [   49.145921] [<ffffffc0001b06a8>] SyS_ioctl+0x88/0xa0
      
      It makes no sense to free the ctl without disabling all stages, so lets
      just move them together to avoid the crash.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      e5989ee1
  18. 02 4月, 2015 3 次提交