Skip to content
  1. Sep 19, 2017
    • Jani Nikula's avatar
      drm: handle override and firmware EDID at drm_do_get_edid() level · 53fd40a9
      Jani Nikula authored
      
      
      Handle debugfs override edid and firmware edid at the low level to
      transparently and completely replace the real edid. Previously, we
      practically only used the modes from the override EDID, and none of the
      other data, such as audio parameters.
      
      This change also prevents actual EDID reads when the EDID is to be
      overridden, but retains the DDC probe. This is useful if the reason for
      preferring override EDID are problems with reading the data, or
      corruption of the data.
      
      Move firmware EDID loading from helper to core, as the functionality
      moves to lower level as well. This will result in a change of module
      parameter from drm_kms_helper.edid_firmware to drm.edid_firmware, which
      arguably makes more sense anyway.
      
      Some future work remains related to override and firmware EDID
      validation. Like before, no validation is done for override EDID. The
      firmware EDID is validated separately in the loader. Some unification
      and deduplication would be in order, to validate all of them at the
      drm_do_get_edid() level, like "real" EDIDs.
      
      v2: move firmware loading to core
      
      v3: rebase, commit message refresh
      
      Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Tested-by: default avatarAbdiel Janulgue <abdiel.janulgue@linux.intel.com>
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: default avatarDave Airlie <airlied@gmail.com>
      Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/1e8a710bcac46e5136c1a7b430074893c81f364a.1505203831.git.jani.nikula@intel.com
      53fd40a9
  2. Sep 18, 2017
  3. Sep 16, 2017
  4. Sep 13, 2017
  5. Sep 12, 2017
  6. Sep 11, 2017
  7. Sep 10, 2017
  8. Sep 09, 2017
    • Chen-Yu Tsai's avatar
      drm/sun4i: call drm_vblank_init with correct number of crtcs · 070badfa
      Chen-Yu Tsai authored
      
      
      If we want to have vblank on both pipelines at the same time, we need
      to call drm_vblank_init with num_crtcs = 2.
      
      Instead, since the crtc init calls correctly set mode_config.num_crtc,
      we can move the drm_vblank_init call to after the crtc init code is
      called, which is the component bind part. Then we can just pass
      mode_config.num_crtc in.
      
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-8-wens@csie.org
      070badfa
    • Chen-Yu Tsai's avatar
      drm/sun4i: tcon: Support backend input mux · 27e18de7
      Chen-Yu Tsai authored
      
      
      The TCON has a mux to select the source of the data to display.
      This mux includes selecting the display backends. On the A31,
      which has two display pipelines, this mux can let the TCON
      select either backend as its data source. Although the muxing
      can be changed on the fly, DRM needs to be able to group a
      bunch of layers such that they get switched to another crtc
      together. This is because the display backend does the layer
      compositing, while the TCON generates the display timings.
      This constraint is not supported by DRM.
      
      Here we simply pair up backends and TCONs with the same ID.
      
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-7-wens@csie.org
      27e18de7
    • Chen-Yu Tsai's avatar
      drm/sun4i: tcon: Simplify sun4i_tcon_find_engine_traverse for one input · be3fe0f9
      Chen-Yu Tsai authored
      
      
      Now that sun4i_tcon_find_engine_traverse() usage is restricted to the
      single input case, we can remove the for_each_available_child_of_node
      loop.
      
      While at it, consolidate all the of_node_put calls into a common exit
      path.
      
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-6-wens@csie.org
      be3fe0f9
    • Chen-Yu Tsai's avatar
      drm/sun4i: tcon: get TCON ID and matching engine with remote endpoint ID · e8d5bbf7
      Chen-Yu Tsai authored
      
      
      The device tree binding for sun4i-drm says:
      
          For all connections between components up to the TCONs in the display
          pipeline, when there are multiple components of the same type at the
          same depth, the local endpoint ID must be the same as the remote
          component's index. For example, if the remote endpoint is Frontend 1,
          then the local endpoint ID must be 1.
      
      We should be able to get the TCON's ID directly from any of the remote
      endpoints from its input port. With the ID, we can then go through the
      list of registered engines and find a matching one by ID.
      
      However the A31 device tree is incorrect. We assumed that there were no
      cross pipeline connections between the backends and TCONs. As a result,
      in all the endpoints between the backends and TCONs of the second
      display pipeline, the endpoint IDs were incorrectly set to 0, when in
      fact they should've been set to 1.
      
      To maintain compatibility with this incorrect device tree, we first
      check if the TCON's input port has 1 or many endpoints. If there are
      more than 1, then it is likely a fixed version, and we can proceed
      with the new method. If there is only 1 endpoint, then it is possibly
      an incorrect version, or it could be the SoC only has one pipeline.
      In either case we fall back to using the old method of traversing
      the input connections to find a matching engine, and then get its
      ID.
      
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-5-wens@csie.org
      e8d5bbf7
    • Chen-Yu Tsai's avatar
      drm/sun4i: tcon: Check for multiple paths between TCONs and backends · 1469619d
      Chen-Yu Tsai authored
      The patch b317fa3b ("drm/sun4i: tcon: Find matching display backend
      by device node matching") assumed a one-to-one mapping between TCONs
      and backends. This turned out wrong, as we found muxing controls in the
      TCON of the A31, and undocumented usage of the backend output selector
      of the A20.
      
      Make sun4i_tcon_find_engine() bail out if the current node has multiple
      input connections.
      
      Fixes: b317fa3b
      
       ("drm/sun4i: tcon: Find matching display backend
      		      by device node matching")
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-4-wens@csie.org
      1469619d
    • Chen-Yu Tsai's avatar
      drm/sun4i: add components in breadth first traversal order · da82b878
      Chen-Yu Tsai authored
      
      
      The encoder drivers use drm_of_find_possible_crtcs to get upstream
      crtcs from the device tree using of_graph. For the results to be
      correct, encoders must be probed/bound after _all_ crtcs have been
      created. The existing code uses a depth first recursive traversal
      of the of_graph, which means the encoders downstream of the TCON
      get add right after the first TCON. The second TCON or CRTC will
      never be properly associated with encoders connected to it.
      
      Other platforms, such as Rockchip, deal with this by probing all
      CRTCs first, then all subsequent components. This is easy to do
      since the CRTCs correspond to just one device node, and are the
      first nodes in the pipeline.
      
      However with Allwinner SoCs, the function of the CRTC is split
      between the display backend (DE 1.0) or mixer (DE 2.0), which does
      scan-out and compositing, and the TCON, which generates the display
      timing signals. Further complicating the process, there may be a
      Dynamic Range Controller between the backend and the TCON. Also, the
      backend is preceded by the frontend, with a Display Enhancement Unit
      possibly in between.
      
      In a dual display pipeline setup, both frontends can feed either
      backend, and both backends can feed either TCON. We want all
      components of the same type to be added before the next type in the
      pipeline. Fortunately, the pipelines are perfectly symmetric, i.e.
      components of the same type are at the same depth when counted from
      the frontend. The only exception is the third pipeline in the A80
      SoC, which we do not support anyway.
      
      Hence we can use a breadth first search traversal order to add
      components. We do not need to check for duplicates. The component
      matching system handles this for us.
      
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908075016.18657-3-wens@csie.org
      da82b878
    • Chen-Yu Tsai's avatar
      drm/sun4i: tcon: Unconditionally reset the TCON · d57294c1
      Chen-Yu Tsai authored
      When binding the TCON, we were checking the reset control status and
      asserting reset if it wasn't in reset. The check failed to account for
      the reset control API returning error codes if the status callback was
      not implemented.
      
      Since we want the TCON to be reset in all cases, use reset_control_reset
      to force a reset instead.
      
      Fixes: 9026e0d1
      
       ("drm: Add Allwinner A10 Display Engine support")
      Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908090016.32224-1-wens@csie.org
      d57294c1
    • Maxime Ripard's avatar
      MAINTAINERS: sun4i-drm is now maintained in drm-misc · 1f2308f7
      Maxime Ripard authored
      
      
      sun4i-drm is maintained in drm-misc as a small driver.
      
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908194039.882-1-maxime.ripard@free-electrons.com
      1f2308f7
    • Dominik Behr's avatar
      dma-buf/sw_sync: force signal all unsignaled fences on dying timeline · ea4d5a27
      Dominik Behr authored
      
      
      To avoid hanging userspace components that might have been waiting on the
      active fences of the destroyed timeline we need to signal with error all
      remaining fences on such timeline.
      
      This restore the default behaviour of the Android sw_sync framework, which
      Android still relies on. It was broken on the dma fence conversion a few
      years ago and never fixed.
      
      v2: Do not bother with cleanup do the list (Chris Wilson)
      
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarDominik Behr <dbehr@chromium.org>
      Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170907190246.16425-2-gustavo@padovan.org
      ea4d5a27
    • Colin Ian King's avatar
      drm/vc4: clean up error handling on devm_kzalloc failure · 5663077a
      Colin Ian King authored
      
      
      The current error handling when devm_kzalloc fails performs a
      non-null check on connector which is redundant because connector
      is null at that failure point.  Once this is removed, make the
      failure path into a trivial -ENOMEM return to clean up the
      error handling. Also remove need to initialize connector to NULL.
      
      Detected by CoverityScan CID#1339527 ("Logically dead code")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarEric Anholt <eric@anholt.net>
      Reviewed-by: default avatarEric Anholt <eric@anholt.net>
      Link: https://patchwork.freedesktop.org/patch/msgid/20170908140504.1340-1-colin.king@canonical.com
      5663077a