1. 08 4月, 2017 2 次提交
  2. 01 3月, 2017 1 次提交
  3. 07 2月, 2017 7 次提交
    • 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: 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: 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
  4. 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
  5. 28 11月, 2016 8 次提交
    • 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: 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: small rename · d3937111
      Rob Clark 提交于
      These are really plane-id's, not crtc-id's.  Only connection to CRTCs is
      that they are used as primary-planes.
      
      Current name is just legacy from when we only supported RGB/primary
      planes.  Lets pick a better name now.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      d3937111
    • R
      drm/msm: support multiple address spaces · 667ce33e
      Rob Clark 提交于
      We can have various combinations of 64b and 32b address space, ie. 64b
      CPU but 32b display and gpu, or 64b CPU and GPU but 32b display.  So
      best to decouple the device iova's from mmap offset.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      667ce33e
  6. 16 7月, 2016 10 次提交
    • A
      drm/msm/mdp5: Update compatible strings for MDSS/MDP5 · 96a611b5
      Archit Taneja 提交于
      Introduce new compatible strings for the top level MDSS wrapper device,
      and the MDP5 device.
      
      Previously, the "qcom,mdp5" and "qcom,mdss_mdp" compatible strings
      were used to match the top level platform_device (which was also tied
      to the top level drm_device struct). Now, these strings are used
      to match the MDP5 platform device.
      
      Use "qcom,mdss" as the compatible string for top level MDSS device.
      This is now used to match the top level platform_device (which is
      tied to the drm_device struct).
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      96a611b5
    • A
      drm/msm/mdp5: Add missing mdp5_enable/disable calls · 7c8f0235
      Archit Taneja 提交于
      Since runtime PM isn't implemented yet, we need to call
      mdp5_enable/disable in a few more places. These would later be
      replaced by runtime PM get/put calls.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      7c8f0235
    • A
      drm/msm: Call pm_runtime_enable/disable for newly created devices · cd792726
      Archit Taneja 提交于
      With the new device hierarchy for MDP5, we need to enable runtime PM
      for both the toplevel MDSS device and the MDP5 device itself. Enable
      runtime PM for the new devices.
      
      Since MDP4 and MDP5 now have different places where runtime PM is
      enabled, remove the previous pm_runtime_enable/disable calls, and
      squash them in the respective kms drivers.
      
      The new device hierarchy (as expressed in the DT bindings) has the GDSC
      tied only to the MDSS wrapper device. This GDSC needs to be enabled for
      accessing any register in the MDSS sub-blocks. Once every driver is
      runtime adapted, the GDSC will be enabled when any sub-block device
      calls runtime_get because of the parent-child relationship with MDSS.
      
      Until then, we call pm_runtime_get_sync() once for the MDSS device to
      ensure the GDSC is never disabled. This will be removed once all the
      drivers are runtime PM adapted.
      
      The error handling paths become a bit tricky when we call these runtime
      PM funcs. There doesn't seem to be any helper that checks if runtime PM
      is enabled already. Add bool variables in mdp4_kms/mdp5_kms structs to
      check if the driver had managed to call pm_runtime_enable before bailing
      out.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      cd792726
    • A
      drm/msm/mdp5: Use updated MDP5 register names · 7b59c7e4
      Archit Taneja 提交于
      Since MDSS registers were stuffed within the the MDP5 register
      space, we had an __offset_MDP() macro to identify the offset
      between the start of MDSS and MDP5 address spaces. This offset
      macro expected a MDP index argument, which didn't make much
      sense since we don't have multiple MDPs.
      
      The offset is no longer needed now that we have devices for the 2
      different register address spaces. Also, remove the "REG_MDP5_MDP_"
      prefix to "REG_MDP5_".
      
      Update the generated headers in mdp5.xml.h
      
      We generally update headers as a separate patch, but we need to
      do these together to prevent breaking build.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      7b59c7e4
    • A
      drm/msm/mdp5: Remove old kms init/destroy funcs · 392ae6e0
      Archit Taneja 提交于
      With the new kms_init/destroy funcs in place for MDP5, we can get rid of
      the old kms funcs. Some members of the mdp5_kms struct also become
      redundant, so we remove those too.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      392ae6e0
    • A
      drm/msm/mdp5: Use the new hierarchy and drop old irq management · 0a6030d2
      Archit Taneja 提交于
      Call msm_mdss_init in msm_drv to set up top level registers/irq line.
      Start using the new kms_init2/destroy2 funcs to inititalize MDP5 KMS.
      
      With the MDSS interrupt and irqdomain set up, the old MDP5 irq code
      can be dropped.
      
      The mdp5_hw_init kms func now uses the platform device tied to MDP5
      instead of the one tied to the drm_device/MDSS.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      0a6030d2
    • A
      drm/msm/mdp5: Prepare new kms_init funcs · aec095ec
      Archit Taneja 提交于
      With MDP5 as a new device, we need to do less for MDP when initializing
      modeset after all the components are bound.
      
      Create mdp5_kms_init2/destroy2 funcs that inits modeset. These will
      eventually replace the older kms_init/destroy funcs.
      
      In the new kms_init2, the platform_device used is the one corresponding
      to the new MDP5 platform_device. The new change here is that the irq is
      now retrieved using irq_of_parse_and_map(), since MDP5 is a child interrupt
      of the MDSS interrupt controller.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      aec095ec
    • A
      drm/msm/mdp5: Create a separate MDP5 device · 1dd0a0b1
      Archit Taneja 提交于
      In order to have a tree-like device hierarchy between MDSS and its
      sub-blocks (MDP5, DSI, HDMI, eDP etc), we need to create a separate
      device/driver for MDP5. Currently, MDP5 and MDSS are squashed
      together are are tied to the top level platform_device, which is
      also the one used to create drm_device.
      
      The mdp5_kms_init code is split into two parts. The part where device
      resources are allocated are associated with the MDP5 driver's probe,
      the rest is executed later when we initialize modeset.
      
      With this change, unlike MDP4, the MDP5 platform_device isn't tied to
      the top level drm_device anymore. The top level drm_device is now
      associated with a platform device that corresponds to MDSS wrapper
      hardware.
      
      Create mdp5_init/destroy funcs that will be used by the MDP5 driver
      probe/remove. Use the HW_VERSION register in the MDP5 register address
      space. Both the MDSS and MDP VERSION registers give out identical
      version info.
      
      The older mdp5_kms_init code is left as is for now, this would be removed
      later when we have all the pieces to support the new device hierarchy.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      1dd0a0b1
    • A
      drm/msm: Get irq number within kms driver itself · a2b3a557
      Archit Taneja 提交于
      The driver gets the irq number using platform_get_irq on the main kms
      platform device. This works fine since both MDP4 and MDP5 currently
      have a flat device hierarchy. The platform device tied with the
      drm_device points to the MDP DT node in both cases.
      
      This won't work when MDP5 supports a tree-like hierarchy. In this
      case, the platform device tied to the top level drm_device is the
      MDSS DT node, and the irq we need for KMS is the one generated by
      MDP5, not MDSS.
      
      Get the irq number from the MDP4/5 kms driver itself. Each driver
      can later provide the irq number based on what device hierarchy it
      uses.
      
      While we're at it, call drm_irq_install only when we have a valid KMS
      driver.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      a2b3a557
    • A
      drm/msm/mdp5: Don't get source of MDP core clock · 0e0d9dfe
      Archit Taneja 提交于
      The driver expects DT to provide the parent to MDP core clock. The only
      operation done to the parent clock is to set a rate. This can be
      achieved by setting the rate on the core clock itsef. Don't try to
      get the parent clock anymore.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      0e0d9dfe
  7. 02 6月, 2016 1 次提交
  8. 04 3月, 2016 1 次提交
    • A
      drm/msm: rename hdmi symbols · fcda50c8
      Arnd Bergmann 提交于
      Global symbols in the kernel should be prefixed by the name
      of the subsystem and/or driver to avoid conflicts when all
      code is built-in.
      
      In this case, function names like 'hdmi_register' or 'hdmi_set_mode'
      are way too generic for an MSM specific DRM driver, so I'm renaming
      them all to msm_hdmi_* here.
      
      I also rename a lot of the 'static' symbols along with the global
      names for consistency, even though those are relatively harmless;
      they might only be slightly confusing when they show up in
      backtraces.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      fcda50c8
  9. 08 2月, 2016 1 次提交
  10. 14 12月, 2015 1 次提交
    • A
      drm/msm/mdp5: high precision vblank timestamp support · e2dd9f9f
      Archit Taneja 提交于
      MDP5 has line count and frame count registers for each interface. Enable
      these counters and use them to implement the get_vblank_timestamp drm
      driver op.
      
      The line counter starts with the value 1 at the beginning of the VSYNC
      pulse and ends with value VTOTAL at the end of VFP. This value is used
      to determine whether we're in blanking period or not, and an adjusted
      value of this counter is used to get vpos as expected by
      get_scanout_position. Since there is no way to calculate hpos, we always
      set it to 0.
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      e2dd9f9f
  11. 23 10月, 2015 3 次提交
  12. 16 8月, 2015 4 次提交