1. 08 4月, 2017 22 次提交
    • 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: Configure 'right' hwpipe · c26b4f6c
      Archit Taneja 提交于
      Now that we have a right hwpipe in mdp5_plane_state, configure it
      mdp5_plane_mode_set(). The only parameters that vary between the
      left and right hwpipes are the src_w, src_img_w, src_x and crtc_x
      as we just even chop the fb into left and right halves.
      
      Add a mdp5_plane_right_pipe() which will be used by the crtc code
      to set up LM stages.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      c26b4f6c
    • A
      drm/msm/mdp5: Assign a 'right hwpipe' to plane state · 7a10ee9b
      Archit Taneja 提交于
      If the drm_plane has a source width that's greater than the max width
      supported by a SSPP (2560 pixels on 8x96), then we assign a 'r_hwpipe'
      to it in mdp5_plane_atomic_check().
      
      TODO: There are a few scenarios where the hwpipe assignments aren't
      recommended by HW. For example, an assignment which results in a
      drm_plane to of two different types of hwpipes (say RGB0 on left
      and DMA1 on right) is not recommended.
      Also, hwpipes have a priority mapping, where the higher priority pipe
      needs to be staged on left LM, and the lower priority needs to be
      staged on the right LM. For example, the priority order for VIG pipes
      in decreasing order of priority is VIG0, VIG1, VIG2, and VIG3. So, VIG0
      on left and VIG1 on right is a correct configuration, but VIG1 on left
      and VIG0 on right isn't. These scenarios are ignored for now for the
      sake of simplicity.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      7a10ee9b
    • A
      drm/msm/mdp5: Create mdp5_hwpipe_mode_set · 821be43f
      Archit Taneja 提交于
      Refactor mdp5_plane_mode_set to call mdp5_hwpipe_mode_set. The latter
      func takes in only the hwpipe and the parameters that need to be
      programmed into the hwpipe registers. All the code that calculates these
      parameters is left as is in mdp5_plane_mode_set.
      
      In the future, when we let drm_plane be comprised of 2 hwpipes, this func
      allow us to configure each pipe without adding redundant code.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      821be43f
    • 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: Add a CAP for Source Split · 621da7d9
      Archit Taneja 提交于
      Some of the newer MDP5 versions support Source Split of SSPPs. It is a
      feature that allows us to route the output of a hwpipe to 2 Layer
      Mixers. This is required to achieve the following use cases:
      
      - Dual DSI: For high res DSI panels (such as 2560x1600 etc), a single
        DSI interface doesn't have the bandwidth to drive the required pixel
        clock. We use 2 DSI interfaces to drive the left and right halves
        of the panel (i.e, 1280x1600 each). The MDP5 pipeline here would look
        like:
      
               LM0 -- DSPP0 -- INTF1 -- DSI1
              /
      hwpipe--
              \
               LM1 -- DSPP1 -- INTF2 -- DSI2
      
        A single hwpipe is used to scan out the left and right halves to DSI1
        and DSI2 respectively. In order to do this, we need to configure the
        2 Layer Mixers in Source Split mode.
      
      - HDMI 4K: In order to support resolutions with width higher than the
        max width supported by a hwpipe, we club 2 hwpipes together:
      
      hwpipe1 --- LM0 -- DSPP0
             -   -             \
               -                -- 3D Mux -- INTF0 -- HDMI
             -   -             /
      hwpipe2 --- LM1 -- DSPP1
      
        hwpipe1 is staged on the 'left' Layer Mixer, and hwpipe2 is staged on
        the 'right' Layer Mixer. An additional block called the '3D Mux' is
        used to merge the output of the 2 DSPPs to a single interface.
        In this use case, it is possible that a 4K surface is downscaled and
        placed completely within one of the halves. In order to support such
        scenarios (and keep the programming simple), Layer Mixers with Source
        Split can be assigned 2 hw pipes per stage. While scanning out, the HW
        takes care of fetching the pixels fom the correct pipe.
      
      Add a MDP cap to tell whether the HW supports source split or not.
      Add a MDP LM cap that tells whether a LM instance can operate in
      source split mode (and generate the 'left' part of the display
      output).
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      621da7d9
    • 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: Assign INTF and CTL in encoder's atomic_check() · 502e3550
      Archit Taneja 提交于
      The INTF and CTL used in a display pipeline are going to be maintained as
      a part of the CRTC state (i.e, in mdp5_crtc_state).
      
      These entities, however, are currently statically assigned to drm_encoders
      (i.e. mdp5_encoder). Since these aren't directly visible to the CRTC, we
      assign them to the CRTC state in the encoder's atomic_check() op.
      
      With this approach, we assign portions of CRTC state in two different
      places: the layer mixer in CRTC's atomic_check(), and the INTF and CTL
      pieces in the encoder's atomic_check() op.
      
      We'd have more options here if the drm core maintained encoder state too,
      but the current approach of clubbing everything in CRTC's state works just
      fine.
      
      Unlike hwpipes and mixers, we don't need to keep a track of INTF/CTL
      assignments in the global atomic state. This is because they're currently
      not sharable resources. For example, INTF0 and CTL0 will always be assigned
      to one drm_encoder. This can change later when we implement writeback and
      want a CRTC to use a CTL for a while, and then release it for others to use
      it. Or, when a drm_encoder can switch between using a single INTF vs
      2 INTFs.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      502e3550
    • 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: Remove the pipeline stuff in mdp5_ctl · eda5dbe5
      Archit Taneja 提交于
      The mdp5_ctl has an 'op_mode' struct which contains info on
      the downstream pipeline.
      
      Grouping these params together in a struct doesn't serve much
      purpose in the code. Maybe there was a plan to expand this
      further that never happened.
      
      Remove the op_mode struct, and place its members directly in
      mdp5_ctl. This will help avoid confusion later when I introduce
      my own verion of a mdp5 pipeline :)
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      eda5dbe5
    • A
      drm/msm/mdp5: Clean up interface assignment · 36d1364a
      Archit Taneja 提交于
      mdp5_interface struct contains data corresponding to a INTF
      instance in MDP5 hardware. This sturct is memcpy'd to the
      mdp5_encoder struct, and then later to the mdp5_ctl struct.
      
      Instead of copying around interface data, create mdp5_interface
      instances in mdp5_init, like how it's done currently done for
      pipes and layer mixers. Pass around the interface pointers to
      mdp5_encoder and mdp5_ctl. This simplifies the code, and allows
      us to decouple encoders from INTFs in the future if needed.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      36d1364a
    • 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
    • A
      drm/msm/mdp5: Add structs for hw Layer Mixers · 6803c606
      Archit Taneja 提交于
      Create a struct to represent MDP5 Layer Mixer instances. This will
      eventually allow us to detach CRTCs from the Layer Mixers, and
      generally clean things up a bit.
      
      This is very similar to how hwpipes were previously abstracted away
      from drm planes.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      6803c606
    • A
      drm/msm/mdp5: describe LM instances in mdp5_cfg · 384dbd8c
      Archit Taneja 提交于
      The number of Layer Mixers and the downstream blocks (DSPPs and PPs)
      connected to each LM can vary with different MDP5 revisions. These
      parameters are also static.
      
      Keep the per instance LM data in mdp5_cfg. This will avoid the need
      to have macros which identify PP id or DSPP id the LM is connected
      to. We don't configure DSPPs at the moment, but keeping the DSPP
      instance # here might come handy later.
      
      Also add a 'caps' field that identifies features supported by a
      LM instance. Introduce the caps MDP_LM_CAP_DISPLAY and MDP_LM_CAP_WB
      that identify whether a LM instance can be used for display or
      writeback.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      384dbd8c
    • A
      drm/msm/mdp5: Bring back pipe_lock to mdp5_plane struct · 01f8a969
      Archit Taneja 提交于
      We'd previously moved the pipe_lock spinlock to the hwpipe struct. Bring
      it back to mdp5_plane. We will need this because an mdp5_plane in the
      future could comprise of 2 hw pipes. It makes more sense to have a single
      lock to protect the registers for the hw pipes used by a plane, rather
      than trying to take individual locks per hwpipe when committing a
      configuration.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      01f8a969
    • A
      drm/msm/mdp5: Update SSPP_MAX value · 87878d26
      Archit Taneja 提交于
      'SSPP_MAX + 1' is the max number of hwpipes that can be present on a
      MDP5 platform. Recently, 2 new cursor hwpipes were added, which
      caused overflows in arrays that used SSPP_MAX to represent the number
      of elements. Update the SSPP_MAX value to incorporate the extra
      hwpipes.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      87878d26
    • 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. 29 3月, 2017 1 次提交
  3. 01 3月, 2017 1 次提交
  4. 17 2月, 2017 1 次提交
  5. 07 2月, 2017 15 次提交
    • 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: Refactor mdp5_plane_atomic_check · 9142364e
      Archit Taneja 提交于
      In mdp5_plane_atomic_check, we get crtc_state from drm_plane_state.
      
      Later, for cursor planes, we'll populate the update_plane() func that
      takes a fast asynchronous path to implement cursor movements. There, we
      would need to call a similar atomic_check func to validate the plane
      state, but crtc_state would need to be derived differently.
      
      Refactor mdp5_plane_atomic_check to mdp5_plane_atomic_check_with_state
      such that the latter takes crtc_state as an argument.
      
      This is similar to what the intel driver has done for async cursor
      updates.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      9142364e
    • A
      drm/msm/mdp5: Add cursor planes · bff8fba4
      Archit Taneja 提交于
      Register cursor drm_planes. The loop in modeset_init that inits the
      planes and crtcs has to be refactored a bit. We first iterate all the
      hwpipes to find the cursor planes. Then, we loop again to create
      crtcs.
      
      In msm_atomic_wait_for_commit_done, remove the check which bypasses
      waiting for vsyncs if state->legacy_cursor_updates is true.
      
      We will later create a fast path for cursor position changes in the
      cursor plane's update_plane func that doesn't go via the regular
      atomic commit path. For rest of cursor related updates, we will have
      to wait for vsyncs, so ignore the legacy_cursor_updates flag.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      bff8fba4
    • 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: Use plane helpers to configure src/dst rectangles · 3b6acf14
      Archit Taneja 提交于
      The MDP5 plane's atomic_check ops doesn't perform clipping tests.
      This didn't hurt us much in the past, but clipping becomes important
      with cursor planes.
      
      Use drm_plane_helper_check_state, the way rockchip/intel/mtk drivers
      already do. Use these drivers as reference.
      
      Clipping requires knowledge of the crtc width and height. This requires
      us to call drm_atomic_helper_check_modeset before
      drm_atomic_helper_check_planes in the driver's atomic_check op, because
      check_modetest will populate the mode for the crtc, needed to populate
      the clip rectangle.
      
      We update the plane_enabled(state) local helper to use state->visible,
      since state->visible and 'state->fb && state->crtc' represent the same
      thing.
      
      One issue with the existing code is that we don't have a way to disable
      the plane when it's completely clipped out. Until there isn't an update
      on the crtc (which would de-stage the plane), we would still see the
      plane in its last 'visible' configuration.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      3b6acf14
    • 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
    • A
      drm/msm/mdp5: Create only as many CRTCs as we need · e5366ffe
      Archit Taneja 提交于
      We currently create CRTCs equaling to the # of Layer Mixer blocks we
      have on the MDP5 HW. This number is generally more than the # of encoders
      (INTFs) we have in the MDSS HW. The number of encoders connected to
      displays on the platform (as described by DT) would be even lesser.
      
      Create only N drm_crtcs, where N is the number of drm_encoders
      successfully registered. To do this, we call modeset_init_intf() before
      we init the drm_crtcs and drm_planes.
      
      Because of this change, setting encoder->possible_crtcs needs to be moved
      from construct_encoder() to a later point when we know how many CRTCs we
      have.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      e5366ffe
    • A
      drm/msm/mdp5: cfg: Change count to unsigned int · 710a651f
      Archit Taneja 提交于
      Count can't be non-zero. Changing to uint will also prevent future
      warnings.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      710a651f
    • A
      drm/msm/mdp5: Create single encoder per interface (INTF) · b3a94705
      Archit Taneja 提交于
      For the DSI interfaces, the mdp5_kms core creates 2 encoders for video
      and command modes.
      
      Create only a single encoder per interface. When creating the encoder, set
      the interface type to MDP5_INTF_MODE_NONE. It's the bridge (DSI/HDMI/eDP)
      driver's responsibility to set a different interface type. It can use the
      the kms func op set_encoder_mode to change the mode of operation, which
      in turn would configure the interface type for the INTF.
      
      In mdp5_cmd_encoder.c, we remove the redundant code, and make the commmand
      mode funcs as helpers that are used in mdp5_encoder.c
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      b3a94705
    • A
      drm/msm/mdp5: Prepare for merging video and command encoders · df8a71d2
      Archit Taneja 提交于
      Rename the mdp5_encoder_* ops for active displays to
      mdp5_vid_encoder_* ops.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      df8a71d2
    • A
      drm/msm: Set encoder's mode of operation using a kms func · 9c9f6f8d
      Archit Taneja 提交于
      The mdp5 kms driver currently sets up multiple encoders per interface
      (INTF), one for each kind of mode of operation it supports.
      We create 2 drm_encoders for DSI, one for Video Mode and the other
      for Command Mode operation. The reason behind this approach could have
      been that we aren't aware of the DSI device's mode of operation when
      we create the encoders.
      
      This makes things a bit complicated, since these encoders have to
      be further attached to the same DSI bridge. The easier way out is
      to create a single encoder, and make the DSI driver set its mode
      of operation when we know what the DSI device's mode flags are.
      
      Start with providing a way to set the mdp5_intf_mode using a kms
      func that sets the encoder's mode of operation. When constructing
      a DSI encoder, we set the mode of operation to Video Mode as
      default. When the DSI device is attached to the host, we probe the
      DSI mode flags and set the corresponding mode of operation.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      9c9f6f8d
    • A
      drm/msm: Construct only one encoder for DSI · 97e00119
      Archit Taneja 提交于
      We currently create 2 encoders for DSI interfaces, one for command
      mode and other for video mode operation. This isn't needed as we
      can't really use both the encoders at the same time. It also makes
      connecting bridges harder.
      
      Switch to creating a single encoder. For now, we assume that the
      encoder is configured only in video mode. Later, the same encoder
      would be usable in both modes.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      97e00119
    • A
      drm/msm/mdp5: Update generated headers · f71516bd
      Archit Taneja 提交于
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      f71516bd
    • A
      drm/msm/mdp5: cfg: Add pipe_cursor block · d90d7026
      Archit Taneja 提交于
      Define the block in advance so that the generated mdp5.xml.h doesn't
      break build.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      d90d7026