1. 26 2月, 2020 1 次提交
  2. 18 2月, 2020 1 次提交
  3. 31 1月, 2020 4 次提交
    • B
      drm/bridge: Add the necessary bits to support bus format negotiation · f32df58a
      Boris Brezillon 提交于
      drm_bridge_state is extended to describe the input and output bus
      configurations. These bus configurations are exposed through the
      drm_bus_cfg struct which encodes the configuration of a physical
      bus between two components in an output pipeline, usually between
      two bridges, an encoder and a bridge, or a bridge and a connector.
      
      The bus configuration is stored in drm_bridge_state separately for
      the input and output buses, as seen from the point of view of each
      bridge. The bus configuration of a bridge output is usually identical
      to the configuration of the next bridge's input, but may differ if
      the signals are modified between the two bridges, for instance by an
      inverter on the board. The input and output configurations of a
      bridge may differ if the bridge modifies the signals internally,
      for instance by performing format conversion, or*modifying signals
      polarities.
      
      Bus format negotiation is automated by the core, drivers just have
      to implement the ->atomic_get_{output,input}_bus_fmts() hooks if they
      want to take part to this negotiation. Negotiation happens in reverse
      order, starting from the last element of the chain (the one directly
      connected to the display) up to the first element of the chain (the one
      connected to the encoder).
      During this negotiation all supported formats are tested until we find
      one that works, meaning that the formats array should be in decreasing
      preference order (assuming the driver has a preference order).
      
      Note that the bus format negotiation works even if some elements in the
      chain don't implement the ->atomic_get_{output,input}_bus_fmts() hooks.
      In that case, the core advertises only MEDIA_BUS_FMT_FIXED and lets
      the previous bridge element decide what to do (most of the time, bridge
      drivers will pick a default bus format or extract this piece of
      information from somewhere else, like a FW property).
      
      v10:
      * Add changelog to the commit message
      
      v9:
      * No changes
      
      v8:
      * Fix a test in drm_atomic_bridge_chain_select_bus_fmts() (Reported by
        Jonas)
      
      v7:
      * Adapt the code to deal with the fact that not all bridges in the
        chain have a bridge state
      
      v5 -> v6:
      * No changes
      
      v4:
      * Enhance the doc
      * Fix typos
      * Rename some parameters/fields
      * Reword the commit message
      
      v3:
      * Fix the commit message (Reported by Laurent)
      * Document the fact that bus formats should not be directly modified by
        drivers (Suggested by Laurent)
      * Document the fact that format order matters (Suggested by Laurent)
      * Propagate bus flags by default
      * Document the fact that drivers can tweak bus flags if needed
      * Let ->atomic_get_{output,input}_bus_fmts() allocate the bus format
        array (Suggested by Laurent)
      * Add a drm_atomic_helper_bridge_propagate_bus_fmt()
      * Mandate that bridge drivers return accurate input_fmts even if they
        are known to be the first element in the bridge chain
      
      v2:
      * Rework things to support more complex use cases
      Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      [narmstrong: fixed doc in include/drm/drm_bridge.h:69 fmt->format]
      Reviewed-by: NJernej Skrabec <jernej.skrabec@siol.net>
      Tested-by: NJonas Karlman <jonas@kwiboo.se>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200128135514.108171-7-boris.brezillon@collabora.com
      f32df58a
    • B
      drm/bridge: Add an ->atomic_check() hook · 5061b8a9
      Boris Brezillon 提交于
      So that bridge drivers have a way to check/reject an atomic operation.
      The drm_atomic_bridge_chain_check() (which is just a wrapper around
      the ->atomic_check() hook) is called in place of
      drm_bridge_chain_mode_fixup() (when ->atomic_check() is not implemented,
      the core falls back on ->mode_fixup(), so the behavior should stay
      the same for existing bridge drivers).
      
      v10:
      * Add changelog to the commit message
      
      v8 -> v9:
      * No changes
      
      v7:
      * Fix a NULL pointer dereference
      
      v5 -> v6:
      * No changes
      
      v4:
      * Add R-bs
      
      v3:
      * No changes
      
      v2:
      * Clarify the fact that ->atomic_check() is replacing ->mode_fixup()
      Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Reviewed by: Jernej Skrabec <jernej.skrabec@siol.net>
      Tested-by: NJonas Karlman <jonas@kwiboo.se>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200128135514.108171-6-boris.brezillon@collabora.com
      5061b8a9
    • B
      drm/bridge: Patch atomic hooks to take a drm_bridge_state · 41cf5712
      Boris Brezillon 提交于
      This way the drm_bridge_funcs interface is consistent with the rest of
      the subsystem.
      
      The drivers implementing those hooks are patched too.
      
      v10:
      * Add changelog to the commit message
      
      v8 -> v9:
      * No changes
      
      v7:
      * Adjust things to the bridge_state changes
      
      v6:
      * Also fixed rcar-du/rcar_lvds.c same as analogix/analogix_dp_core.c
      
      v5:
      * No changes
      
      v4:
      * Rename func params into old_bridge_state
      * Add Laurent's Rb
      
      v3:
      * Old state clarification moved to a separate patch
      
      v2:
      * Pass the old bridge state
      Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      [narmstrong: renamed state as old_bridge_state in rcar_lvds_atomic_disable]
      Reviewed by: Jernej Skrabec <jernej.skrabec@siol.net>
      Tested-by: NJonas Karlman <jonas@kwiboo.se>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200128135514.108171-5-boris.brezillon@collabora.com
      41cf5712
    • B
      drm/bridge: Add a drm_bridge_state object · 75146591
      Boris Brezillon 提交于
      One of the last remaining objects to not have its atomic state.
      
      This is being motivated by our attempt to support runtime bus-format
      negotiation between elements of the bridge chain.
      This patch just paves the road for such a feature by adding a new
      drm_bridge_state object inheriting from drm_private_obj so we can
      re-use some of the existing state initialization/tracking logic.
      
      v10:
      * Add changelog to the commit message
      
      v9:
      * Clarify the fact that the bridge->atomic_reset() and
        {connector,plane,crtc,...}->reset() semantics are different
      * Move the drm_atomic_private_obj_init() call back to
        drm_bridge_attach()
      * Check the presence of ->atomic_duplicate_state instead of
        ->atomic_reset in drm_atomic_add_encoder_bridges()
      * Fix copy&paste errors in the atomic bridge state helpers doc
      * Add A-b/R-b tags
      
      v8:
      * Move bridge state helpers out of the CONFIG_DEBUGFS section
      
      v7:
      * Move helpers, struct-defs, ... to atomic helper files to avoid the
        drm -> drm_kms_helper -> drm circular dep
      * Stop providing default implementation for atomic state reset,
        duplicate and destroy hooks (has to do with the helper/core split)
      * Drop all R-b/T-b as helpers have now be moved to other places
      
      v6:
      * Made helpers private, removed doc and moved them to satisfy dependencies
      * Renamed helpers to _default_
      
      v5:
      * Re-introduced the helpers from v4
      
      v4:
      * Fix the doc
      * Kill default helpers (inlined)
      * Fix drm_atomic_get_bridge_state() to check for an ERR_PTR()
      * Add Neil's R-b
      
      v3:
      * No changes
      
      v2:
      * Use drm_for_each_bridge_in_chain()
      * Rename helpers to be more consistent with the rest of the DRM API
      * Improve/fix the doc
      Signed-off-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Reviewed-by: NNeil Armstrong <narmstrong@baylibre.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200128135514.108171-2-boris.brezillon@collabora.com
      75146591
  4. 08 1月, 2020 4 次提交
  5. 07 1月, 2020 4 次提交
  6. 10 12月, 2019 1 次提交
  7. 09 12月, 2019 7 次提交
  8. 13 9月, 2019 1 次提交
  9. 09 9月, 2019 1 次提交
    • L
      drm/bridge: panel: Infer connector type from panel by default · 89958b7c
      Laurent Pinchart 提交于
      The drm panel bridge creates a connector using a connector type
      explicitly passed by the display controller or bridge driver that
      instantiates the panel bridge. Now that drm_panel reports its connector
      type, we can use it to avoid passing an explicit (and often incorrect)
      connector type to drm_panel_bridge_add() and
      devm_drm_panel_bridge_add().
      
      Several drivers report incorrect or unknown connector types to
      userspace. Reporting a different type may result in a breakage. For that
      reason, rename (devm_)drm_panel_bridge_add() to
      (devm_)drm_panel_bridge_add_typed(), and add new
      (devm_)drm_panel_bridge_add() functions that use the panel connector
      type. Update all callers of (devm_)drm_panel_bridge_add() to the _typed
      function, they will be converted one by one after testing.
      
      The panel drivers have been updated with the following Coccinelle
      semantic patch, with manual inspection and fixes to indentation.
      
      @@
      expression bridge;
      expression dev;
      expression panel;
      identifier type;
      @@
      (
      -bridge = drm_panel_bridge_add(panel, type);
      +bridge = drm_panel_bridge_add_typed(panel, type);
      |
      -bridge = devm_drm_panel_bridge_add(dev, panel, type);
      +bridge = devm_drm_panel_bridge_add_typed(dev, panel, type);
      )
      Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190904132804.29680-3-laurent.pinchart@ideasonboard.com
      89958b7c
  10. 14 6月, 2019 1 次提交
  11. 08 6月, 2019 1 次提交
  12. 18 3月, 2019 2 次提交
  13. 14 1月, 2019 1 次提交
  14. 22 6月, 2018 1 次提交
  15. 17 5月, 2018 1 次提交
  16. 15 5月, 2018 1 次提交
  17. 07 2月, 2018 1 次提交
  18. 12 1月, 2018 1 次提交
  19. 21 8月, 2017 1 次提交
  20. 27 7月, 2017 1 次提交
  21. 05 6月, 2017 1 次提交
  22. 30 5月, 2017 1 次提交
  23. 23 5月, 2017 2 次提交
    • D
      drm/doc: Document adjusted/request modes a bit better · 9de5d4a6
      Daniel Vetter 提交于
      Laurent started a massive discussion on IRC about this. Let's try to
      document common usage a bit better.
      
      v2: Cross-links+typos.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Jose Abreu <Jose.Abreu@synopsys.com>
      Reviewed-by: NJose Abreu <joabreu@synopsys.com>
      Reviewed-by: NAndrzej Hajda <a.hajda@samsung.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170515091136.26307-1-daniel.vetter@ffwll.ch
      9de5d4a6
    • J
      drm: Add crtc/encoder/bridge->mode_valid() callbacks · 3eb220a5
      Jose Abreu 提交于
      This adds a new callback to crtc, encoder and bridge helper functions
      called mode_valid(). This callback shall be implemented if the
      corresponding component has some sort of restriction in the modes
      that can be displayed. A NULL callback implicates that the component
      can display all the modes.
      
      We also change the documentation so that the new and old callbacks
      are correctly documented.
      
      Only the callbacks were implemented to simplify review process,
      following patches will make use of them.
      
      Changes in v2 from Daniel:
      - Update the warning about how modes aren't filtered in atomic_check -
        the heleprs help out a lot more now.
      - Consistenly roll out that warning, crtc/encoder's atomic_check
        missed it.
      - Sprinkle more links all over the place, so it's easier to see where
        this stuff is used and how the differen hooks are related.
      - Note that ->mode_valid is optional everywhere.
      - Explain why the connector's mode_valid is special and does _not_ get
        called in atomic_check.
      
      v3: Document what can and cannot be checked in mode_valid a bit better
      (Andrjez). Answer: Only allowed to look at the mode, nothing else.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Cc: Jose Abreu <joabreu@synopsys.com>
      Cc: Carlos Palminha <palminha@synopsys.com>
      Cc: Alexey Brodkin <abrodkin@synopsys.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dave Airlie <airlied@linux.ie>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Archit Taneja <architt@codeaurora.org>
      Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v2)
      Reviewed-by: Jose Abreu <joabreu@synopsys.com> (v2)
      Reviewed-by: NAndrzej Hajda <a.hajda@samsung.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170515093347.31098-1-daniel.vetter@ffwll.ch
      3eb220a5