1. 08 4月, 2017 6 次提交
  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
  6. 13 1月, 2017 1 次提交
    • R
      drm/msm/mdp5: rip out plane->pending tracking · c57a94ff
      Rob Clark 提交于
      It would race between userspace thread and commit worker.  Ie. vblank
      irq would trigger event and userspace could begin the next atomic
      update, before the commit worker had a chance to clear the pending
      flag.
      
      If we do end up needing something to prevent userspace from trying
      another pageflip before getting vblank event, it should probably be
      implemented as a pending_planes bitmask, similar to pending_crtcs.  See
      start_atomic() and end_atomic().
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      c57a94ff
  7. 15 12月, 2016 1 次提交
  8. 29 11月, 2016 2 次提交
  9. 28 11月, 2016 12 次提交
    • R
      drm/msm/mdp5: move LM bounds check into plane->atomic_check() · 9708ebbe
      Rob Clark 提交于
      The mode_config->max_{width,height} is for the maximum size of a fb, not
      the max scanout limits (of the layer-mixer).  It is legal, and in fact
      common, to create a larger fb, only only scan-out a smaller part of it.
      For example multi-monitor configurations for x11, or android wallpaper
      layer (which is created larger than the screen resolution for fast
      scrolling by just changing the src x/y coordinates).
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      9708ebbe
    • R
      drm/msm/mdp5: dump smp state on errors too · e8406b61
      Rob Clark 提交于
      If the dumpstate modparam is enabled, for debugging error irq's, also
      dump SMP state.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      e8406b61
    • R
      drm/msm/mdp5: add debugfs to show smp block status · bc5289ee
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      bc5289ee
    • R
      drm/msm/mdp5: handle SMP block allocations "atomically" · 49ec5b2e
      Rob Clark 提交于
      Previously, SMP block allocation was not checked in the plane's
      atomic_check() fxn, so we could fail allocation SMP block allocation at
      atomic_update() time.  Re-work the block allocation to request blocks
      during atomic_check(), but not update the hw until committing the atomic
      update.
      
      Since SMP blocks allocated at atomic_check() time, we need to manage the
      SMP state as part of mdp5_state (global atomic state).  This actually
      ends up significantly simplifying the SMP management, as the SMP module
      does not need to manage the intermediate state between assigning new
      blocks before setting flush bits and releasing old blocks after vblank.
      (The SMP registers and SMP allocation is not double-buffered, so newly
      allocated blocks need to be updated in kms->prepare_commit() released
      blocks in kms->complete_commit().)
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      49ec5b2e
    • 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: add skeletal mdp5_state · ac2a3fd3
      Rob Clark 提交于
      Add basic state duplication/apply mechanism.  Following commits will
      move actual global hw state into this.
      
      The state_lock allows multiple concurrent updates to proceed as long as
      they don't both try to alter global state.  The ww_mutex mechanism will
      trigger backoff in case of deadlock between multiple threads trying to
      update state.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NArchit Taneja <architt@codeaurora.org>
      ac2a3fd3
    • 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: rip out mode_changed · f5903bad
      Rob Clark 提交于
      It wasn't really doing the right thing if, for example, position or
      height changed.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      f5903bad
    • R
      drm/msm/mdp5: don't be so casty · 6ff3ddca
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      6ff3ddca
    • R
      drm/msm/mdp5: drop mdp5_plane::name · 0002d30f
      Rob Clark 提交于
      Just use plane->name now that it is a thing.  In a following patch, once
      we dynamically assign hw pipes to planes, it won't make sense to name
      planes the way we do, so this also partly reduces churn in following
      patch.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      0002d30f
    • 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