1. 06 Feb, 2017 20 commits
    • Archit Taneja's avatar
      drm/msm/mdp5: Add cursor planes · bff8fba4
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      bff8fba4
    • Archit Taneja's avatar
      drm/msm/mdp5: Misc cursor plane bits · 5798c8e0
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      5798c8e0
    • Archit Taneja's avatar
      drm/msm/mdp5: Configure COLOR3_OUT propagation · 829200ac
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      829200ac
    • Archit Taneja's avatar
      drm/msm/mdp5: Use plane helpers to configure src/dst rectangles · 3b6acf14
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      3b6acf14
    • Archit Taneja's avatar
      drm/msm/mdp5: Prepare CRTC/LM for empty stages · 106f9727
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      106f9727
    • Archit Taneja's avatar
      drm/msm/mdp5: Create only as many CRTCs as we need · e5366ffe
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      e5366ffe
    • Archit Taneja's avatar
      drm/msm/mdp5: cfg: Change count to unsigned int · 710a651f
      Archit Taneja authored
      Count can't be non-zero. Changing to uint will also prevent future
      warnings.
      Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      710a651f
    • Archit Taneja's avatar
      drm/msm/mdp5: Create single encoder per interface (INTF) · b3a94705
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      b3a94705
    • Archit Taneja's avatar
      drm/msm/mdp5: Prepare for merging video and command encoders · df8a71d2
      Archit Taneja authored
      Rename the mdp5_encoder_* ops for active displays to
      mdp5_vid_encoder_* ops.
      Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      df8a71d2
    • Archit Taneja's avatar
      drm/msm: Set encoder's mode of operation using a kms func · 9c9f6f8d
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      9c9f6f8d
    • Archit Taneja's avatar
      drm/msm: Construct only one encoder for DSI · 97e00119
      Archit Taneja authored
      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: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      97e00119
    • Archit Taneja's avatar
      drm/msm/dsi: Set msm_dsi->encoders before initializing bridge · 0bb70b82
      Archit Taneja authored
      The commit "drm: bridge: Link encoder and bridge in core code" updated
      the drm_bridge_attach() API to also include the drm_encoder pointer
      the bridge attaches to.
      
      The func msm_dsi_manager_bridge_init() now relies on the drm_encoder
      pointer stored in msm_dsi->encoders to pass the encoder to the bridge
      API.
      
      msm_dsi->encoders is unfortunately set after this function is called,
      resulting in us passing a NULL pointer to drm_brigde_attach. This
      results in an error and the DSI driver probe fails.
      
      Move the initialization of msm_dsi->encoders[] a bit up. Also, don't
      try to set the encoder's bridge. That's now managed by the bridge
      API.
      
      Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      0bb70b82
    • Archit Taneja's avatar
      cd576abf
    • Archit Taneja's avatar
      f71516bd
    • Archit Taneja's avatar
      drm/msm/mdp5: cfg: Add pipe_cursor block · d90d7026
      Archit Taneja authored
      Define the block in advance so that the generated mdp5.xml.h doesn't
      break build.
      Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      d90d7026
    • Rob Clark's avatar
      drm/msm: let gpu wire up it's own fault handler · 7f8036b7
      Rob Clark authored
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      7f8036b7
    • Rob Clark's avatar
      drm/msm: drop _clk suffix from clk names · 720c3bb8
      Rob Clark authored
      Suggested by Rob Herring.  We still support the old names for
      compatibility with downstream android dt files.
      
      Cc: Rob Herring <robh@kernel.org>
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      720c3bb8
    • Rob Clark's avatar
      drm/msm: drop quirks binding · 4e09b95d
      Rob Clark authored
      This was never documented or used in upstream dtb.  It is used by
      downstream bindings from android device kernels.  But the quirks are
      a property of the gpu revision, and as such are redundant to be listed
      separately in dt.  Instead, move the quirks to the device table.
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      4e09b95d
    • Rob Clark's avatar
      drm/msm: drop qcom,chipid · 1db7afa4
      Rob Clark authored
      The original way we determined the gpu version was based on downstream
      bindings from android kernel.  A cleaner way is to get the version from
      the compatible string.
      
      Note that no upstream dtb uses these bindings.  But the code still
      supports falling back to the legacy bindings (with a warning), so that
      we are still compatible with the gpu dt node from android device
      kernels.
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      1db7afa4
    • Rob Clark's avatar
      drm/msm: remove qcom,gpu-pwrlevels bindings · 1a4a66dd
      Rob Clark authored
      The plan is to use the OPP bindings.  For now, remove the documentation
      for qcom,gpu-pwrlevels, and make the driver fall back to a safe low
      clock if the node is not present.
      
      Note that no upstream dtb use this node.  For now we keep compatibility
      with this node to avoid breaking compatibility with downstream android
      dt files.
      Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      1a4a66dd
  2. 02 Feb, 2017 9 commits
  3. 31 Jan, 2017 9 commits
    • Dave Airlie's avatar
      Merge branch 'exynos-drm-next' of... · 18566aca
      Dave Airlie authored
      Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
      
      adding runtime PM support to MIC driver, and including some
      cleanups - especially using atomic helper functions
      instead of specific ones - and fixups.
      
      * 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
        drm/exynos: g2d: prevent integer overflow in
        drm/exynos: fix a timeout loop
        drm/exynos: use atomic helper commit
        drm/exynos: remove unnecessary codes
        drm/exynos: mic: Add runtime PM support
        drm/exynos: Stop using drm_framebuffer_unregister_private
        drm/exynos: mic: Fix parse_dt function
        drm/exynos: mic: Add mode_set callback function
      18566aca
    • Dave Airlie's avatar
      Merge tag 'sunxi-drm-for-4.11' of... · 02a84c13
      Dave Airlie authored
      Merge tag 'sunxi-drm-for-4.11' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux into drm-next
      
      Allwinner DRM changes for 4.11
      
      Just one minor fix.
      
      * tag 'sunxi-drm-for-4.11' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux:
        drm/sun4i: Fix a return value in case of error
      02a84c13
    • Dave Airlie's avatar
      Merge branch 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/repos_linux into drm-next · b75e1695
      Dave Airlie authored
      This is to address what we've discussed, moving some of the minor changes
      into a drm-next request.
      
      * 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/repos_linux:
        drm/vmwgfx: Use kmemdup instead of kmalloc and memcpy
        drm/vmwgfx: Fix depth input into drm_mode_legacy_fb_format
        drm/vmwgfx: Fix a potential integer overflow
        drm/vmwgfx: Clear an uninitialized struct member
        drm/vmwgfx: Annotate ignored return values
        drm/vmwgfx: Clear uninitialized fields of a parameter
      b75e1695
    • Dave Airlie's avatar
      Merge branch 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux into drm-next · 29a73d90
      Dave Airlie authored
      This is the main feature pull for radeon and amdgpu for 4.11.  Highlights:
      - Power and clockgating improvements
      - Preliminary SR-IOV support
      - ttm buffer priority support
      - ttm eviction fixes
      - Removal of the ttm lru callbacks
      - Remove SI DPM quirks due to MC firmware issues
      - Handle VFCT with multiple vbioses
      - Powerplay improvements
      - Lots of driver cleanups
      
      * 'drm-next-4.11' of git://people.freedesktop.org/~agd5f/linux: (120 commits)
        drm/amdgpu: fix amdgpu_bo_va_mapping flags
        drm/amdgpu: access stolen VRAM directly on CZ (v2)
        drm/amdgpu: access stolen VRAM directly on KV/KB (v2)
        drm/amdgpu: fix kernel panic when dpm disabled on Kv.
        drm/amdgpu: fix dpm bug on Kv.
        drm/amd/powerplay: fix regresstion issue can't set manual dpm mode.
        drm/amdgpu: handle vfct with multiple vbios images
        drm/radeon: handle vfct with multiple vbios images
        drm/amdgpu: move misc si headers into amdgpu
        drm/amdgpu: remove unused header si_reg.h
        drm/radeon: drop pitcairn dpm quirks
        drm/amdgpu: drop pitcairn dpm quirks
        drm: radeon: radeon_ttm: Handle return NULL error from ioremap_nocache
        drm/amd/amdgpu/amdgpu_ttm: Handle return NULL error from ioremap_nocache
        drm/amdgpu: add new virtual display ID
        drm/amd/amdgpu: remove the uncessary parameter for ib scheduler
        drm/amdgpu: Bring bo creation in line with radeon driver (v2)
        drm/amd/powerplay: fix misspelling in header guard
        drm/ttm: revert "add optional LRU removal callback v2"
        drm/ttm: revert "implement LRU add callbacks v2"
        ...
      29a73d90
    • Dave Airlie's avatar
      Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next · 012bbe28
      Dave Airlie authored
      Another round of -misc stuff:
      - Noralf debugfs cleanup cleanup (not yet everything, some more driver
        patches awaiting acks).
      - More doc work.
      - edid/infoframe fixes from Ville.
      - misc 1-patch fixes all over, as usual
      
      Noralf needs this for his tinydrm pull request.
      
      * tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc: (48 commits)
        drm/vc4: Remove vc4_debugfs_cleanup()
        dma/fence: Export enable-signaling tracepoint for emission by drivers
        drm/tilcdc: Remove tilcdc_debugfs_cleanup()
        drm/tegra: Remove tegra_debugfs_cleanup()
        drm/sti: Remove drm_debugfs_remove_files() calls
        drm/radeon: Remove drm_debugfs_remove_files() call
        drm/omap: Remove omap_debugfs_cleanup()
        drm/hdlcd: Remove hdlcd_debugfs_cleanup()
        drm/etnaviv: Remove etnaviv_debugfs_cleanup()
        drm/etnaviv: allow build with COMPILE_TEST
        drm/amd/amdgpu: Remove drm_debugfs_remove_files() call
        drm/prime: Clarify DMA-BUF/GEM Object lifetime
        drm/ttm: Make sure BOs being swapped out are cacheable
        drm/atomic: Remove drm_atomic_debugfs_cleanup()
        drm: drm_minor_register(): Clean up debugfs on failure
        drm: debugfs: Remove all files automatically on cleanup
        drm/fourcc: add vivante tiled layout format modifiers
        drm/edid: Set YQ bits in the AVI infoframe according to CEA-861-F
        drm/edid: Set AVI infoframe Q even when QS=0
        drm/edid: Introduce drm_hdmi_avi_infoframe_quant_range()
        ...
      012bbe28
    • Dave Airlie's avatar
      Merge tag 'drm/atmel-hlcdc/for-4.11' of... · bb7e9833
      Dave Airlie authored
      Merge tag 'drm/atmel-hlcdc/for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/bbrezillon/linux into drm-next
      
      Contains a single patch to create the fbdev at driver's registration
      time instead of waiting for the connector status change.
      
      * tag 'drm/atmel-hlcdc/for-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/bbrezillon/linux:
        drm/atmel-hlcdc: Rework the fbdev creation logic
      bb7e9833
    • Dave Airlie's avatar
      Merge tag 'zxdrm-4.11' of... · 3a5e6bb9
      Dave Airlie authored
      Merge tag 'zxdrm-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into drm-next
      
      ZTE DRM driver updates for 4.11:
       - Add missing selection of VIDEOMODE_HELPERS in Kconfig, since ZTE DRM
         driver uses drm_display_mode_to_videomode().
       - Enable HDMI audio support through SPDIF interface based on generic
         hdmi-audio-codec driver.
       - Enable VOU VL (Video Layer) to support overlay plane with scaling
         function.
       - Refine zx_vou driver a bit and then add TV Encoder output device
         support.
      
      [airlied: fixup plane format change]
      
      * tag 'zxdrm-4.11' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
        drm: zte: add tvenc driver support
        dt: add bindings for ZTE tvenc device
        drm: zte: add function to configure vou_ctrl dividers
        drm: zte: move struct vou_inf into zx_vou driver
        drm: zte: add interlace mode support
        drm: zte: add overlay plane support
        drm: zte: add .atomic_disable hook to disable graphic layer
        drm: zte: make zx_plane accessible from zx_vou driver
        drm: zte: support hdmi audio through spdif
        drm: zte: select VIDEOMODE_HELPERS in Kconfig
      3a5e6bb9
    • Dave Airlie's avatar
      Merge branch 'drm-intel-next' of git://anongit.freedesktop.org/git/drm-intel into drm-next · 26431055
      Dave Airlie authored
      Updated pull request after I pulled first time :)
      
      * 'drm-intel-next' of git://anongit.freedesktop.org/git/drm-intel:
        drm/i915: Pevent copying uninitialised garbage into vma->ggtt_view
      26431055
    • Dave Airlie's avatar
      Merge branch 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld into drm-next · a155b752
      Dave Airlie authored
      Hope I'm not too late before the cutoff for the v4.11 with these patches.
      Mostly an asorted set of fixes that we have discovered while playing with
      the code and preparing for the next set of features.
      
      * 'for-upstream/mali-dp' of git://linux-arm.org/linux-ld:
        drm: mali-dp: fix stride setting for multi-plane formats
        drm: mali-dp: Add plane offset to the plane's physical start address register
        drm: mali-dp: Check for sufficient address space
        drm: mali-dp: Check hw version matches device-tree
        drm: mali-dp: Rename malidp_input_format to malidp_pixel_format
        drm: mali-dp: fix Lx_CONTROL register fields clobber
        drm: mali-dp: Fix transposed horizontal/vertical flip
        drm: mali-dp: Fix destination size handling when rotating
        drm: mali-dp: Don't force source size == crtc size
        drm: mali-dp: Check more use cases in the plane's ->atomic_check()
        drm: malidp: Remove event_list member from struct malidp_drm
        drm/arm/malidp: Fix possible dereference of NULL
      a155b752
  4. 30 Jan, 2017 2 commits