1. 27 9月, 2020 1 次提交
  2. 15 9月, 2020 1 次提交
    • P
      gpu/drm: ingenic: Add option to mmap GEM buffers cached · 37054fc8
      Paul Cercueil 提交于
      Ingenic SoCs are most notably used in cheap chinese handheld gaming
      consoles. There, the games and applications generally render in software
      directly into GEM buffers.
      
      Traditionally, GEM buffers are mapped write-combine. Writes to the
      buffer are accelerated, and reads are slow. Application doing lots of
      alpha-blending paint inside shadow buffers, which is then memcpy'd into
      the final GEM buffer.
      
      On recent Ingenic SoCs however, it is much faster to have a fully cached
      GEM buffer, in which applications paint directly, and whose data is
      invalidated before scanout, than having a write-combine GEM buffer, even
      when alpha blending is not used.
      
      Add an optional 'cached_gem_buffers' parameter to the ingenic-drm driver
      to allow GEM buffers to be mapped fully-cached, in order to speed up
      software rendering.
      
      v2: Use standard noncoherent DMA APIs
      
      v3: Use damage clips instead of invalidating full frames
      
      v4: Avoid dma_pgprot() which is not exported. Using vm_get_page_prot()
          is enough in this case.
      
      v5:
      - Avoid calling drm_gem_cma_prime_mmap(). It has the side effect that an
        extra object reference is obtained, which causes our dumb buffers to
        never be freed. It should have been drm_gem_cma_mmap_obj(). However,
        our custom mmap function only differs with one flag, so we can cleanly
        handle both modes in ingenic_drm_gem_mmap().
      - Call drm_gem_vm_close() if drm_mmap_attrs() failed, just like in
        drm_gem_cma_mmap_obj().
      Signed-off-by: NPaul Cercueil <paul@crapouillou.net>
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200912195639.176001-1-paul@crapouillou.net
      37054fc8
  3. 31 8月, 2020 2 次提交
  4. 29 7月, 2020 2 次提交
  5. 19 7月, 2020 1 次提交
  6. 17 7月, 2020 10 次提交
  7. 01 7月, 2020 1 次提交
  8. 10 6月, 2020 2 次提交
  9. 17 5月, 2020 2 次提交
  10. 04 5月, 2020 1 次提交
  11. 28 4月, 2020 2 次提交
  12. 08 4月, 2020 2 次提交
  13. 02 4月, 2020 1 次提交
  14. 26 3月, 2020 3 次提交
  15. 26 2月, 2020 1 次提交
    • L
      drm/bridge: Extend bridge API to disable connector creation · a25b988f
      Laurent Pinchart 提交于
      Most bridge drivers create a DRM connector to model the connector at the
      output of the bridge. This model is historical and has worked pretty
      well so far, but causes several issues:
      
      - It prevents supporting more complex display pipelines where DRM
      connector operations are split over multiple components. For instance a
      pipeline with a bridge connected to the DDC signals to read EDID data,
      and another one connected to the HPD signal to detect connection and
      disconnection, will not be possible to support through this model.
      
      - It requires every bridge driver to implement similar connector
      handling code, resulting in code duplication.
      
      - It assumes that a bridge will either be wired to a connector or to
      another bridge, but doesn't support bridges that can be used in both
      positions very well (although there is some ad-hoc support for this in
      the analogix_dp bridge driver).
      
      In order to solve these issues, ownership of the connector should be
      moved to the display controller driver (where it can be implemented
      using helpers provided by the core).
      
      Extend the bridge API to allow disabling connector creation in bridge
      drivers as a first step towards the new model. The new flags argument to
      the bridge .attach() operation allows instructing the bridge driver to
      skip creating a connector. Unconditionally set the new flags argument to
      0 for now to keep the existing behaviour, and modify all existing bridge
      drivers to return an error when connector creation is not requested as
      they don't support this feature yet.
      
      The change is based on the following semantic patch, with manual review
      and edits.
      
      @ rule1 @
      identifier funcs;
      identifier fn;
      @@
       struct drm_bridge_funcs funcs = {
       	...,
       	.attach = fn
       };
      
      @ depends on rule1 @
      identifier rule1.fn;
      identifier bridge;
      statement S, S1;
      @@
       int fn(
       	struct drm_bridge *bridge
      +	, enum drm_bridge_attach_flags flags
       )
       {
       	... when != S
      +	if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
      +		DRM_ERROR("Fix bridge driver to make connector optional!");
      +		return -EINVAL;
      +	}
      +
       	S1
       	...
       }
      
      @ depends on rule1 @
      identifier rule1.fn;
      identifier bridge, flags;
      expression E1, E2, E3;
      @@
       int fn(
       	struct drm_bridge *bridge,
       	enum drm_bridge_attach_flags flags
       ) {
       <...
       drm_bridge_attach(E1, E2, E3
      +	, flags
       )
       ...>
       }
      
      @@
      expression E1, E2, E3;
      @@
       drm_bridge_attach(E1, E2, E3
      +	, 0
       )
      Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com>
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Reviewed-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Tested-by: NSebastian Reichel <sebastian.reichel@collabora.com>
      Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.com>
      Acked-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NTomi Valkeinen <tomi.valkeinen@ti.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-10-laurent.pinchart@ideasonboard.com
      a25b988f
  16. 15 12月, 2019 5 次提交
  17. 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
  18. 29 8月, 2019 2 次提交