1. 27 1月, 2015 1 次提交
  2. 25 11月, 2014 2 次提交
  3. 06 11月, 2014 3 次提交
    • D
      drm/crtc-helper: Transitional functions using atomic plane helpers · 2f324b42
      Daniel Vetter 提交于
      These two functions allow drivers to reuse their atomic plane helpers
      functions for the primary plane to implement the interfaces required
      by the crtc helpers for the legacy ->set_config callback.
      
      This is purely transitional and won't be used once the driver is fully
      converted. But it allows partial conversions to the atomic plane
      helpers which are functional.
      
      v2:
      - Use ->atomic_duplicate_state if available.
      - Don't forget to run crtc_funcs->atomic_check.
      
      v3: Shift source coordinates correctly for 16.16 fixed point.
      
      v4: Don't forget to call ->atomic_destroy_state if available.
      
      v5: Fixup kerneldoc.
      
      v6: Reuse the plane_commit function from the transitional plane
      helpers to avoid too much duplication.
      
      v7:
      - Remove some stale comment.
      - Correctly handle the lack of plane->state object, necessary for
        transitional use.
      
      v8: Fixup an embarrassing h/vdisplay mixup.
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2f324b42
    • D
      drm/plane-helper: transitional atomic plane helpers · acf24a39
      Daniel Vetter 提交于
      Converting a driver to the atomic interface can be a daunting
      undertaking. One of the prerequisites is to have full universal planes
      support.
      
      To make that transition a bit easier this patch provides plane helpers
      which use the new atomic helper callbacks just only for the plane
      changes. This way the plane update functionality can be tested without
      being forced to convert everything at once.
      
      Of course a real atomic update capable driver will implement the
      all plane properties through the atomic interface, so these helpers
      are mostly transitional. But they can be used to enable proper
      universal plane support, especially once the crtc helpers have also
      been adapted.
      
      v2: Use ->atomic_duplicate_state if available.
      
      v3: Don't forget to call ->atomic_destroy_state if available.
      
      v4: Fixup kerneldoc, reported by Paulo.
      
      v5: Extract a common plane_commit helper and fix some bugs in the
      plane_state setup of the plane_disable implementation.
      
      v6: Fix issues with the cleanup of the old fb. Since transitional
      helpers can be mixed we need to assume that the old fb has been set up
      by a legacy path (e.g. set_config or page_flip when the primary plane
      is converted to use these functions already). Hence pass an additional
      old_fb parameter to plane_commit to do that cleanup work correctly.
      
      v7:
      - Fix spurious WARNING (crtc helpers really love to disable stuff
        harder) and fix array index bonghits.
      - Correctly handle the lack of plane->state object, necessary for
        transitional use.
      - Don't indicate failure if drm_vblank_get doesn't work - that's
        expected when the pipe is in dpms off mode.
      
      v8: Review from Sean:
      - s/fail/out/ to make the meaning of a label more clear.
      - spelling fix in the commit message.
      
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      acf24a39
    • D
      drm: Add atomic/plane helpers · c2fcd274
      Daniel Vetter 提交于
      This is the first cut of atomic helper code. As-is it's only useful to
      implement a pure atomic interface for plane updates.
      
      Later patches will integrate this with the crtc helpers so that full
      atomic updates are possible. We also need a pile of helpers to aid
      drivers in transitioning from the legacy world to the shiny new atomic
      age. Finally we need helpers to implement legacy ioctls on top of the
      atomic interface.
      
      The design of the overall helpers<->driver interaction is fairly
      simple, but has an unfortunate large interface:
      
      - We have ->atomic_check callbacks for crtcs and planes. The idea is
        that connectors don't need any checking, and if they do they can
        adjust the relevant crtc driver-private state. So no connector hooks
        should be needed. Also the crtc helpers integration will do the
        ->best_encoder checks, so no need for that.
      
      - Framebuffer pinning needs to be done before we can commit to the hw
        state. This is especially important for async updates where we must
        pin all buffers before returning to userspace, so that really only
        hw failures can happen in the asynchronous worker.
      
        Hence we add ->prepare_fb and ->cleanup_fb hooks for this resources
        management.
      
      - The actual atomic plane commit can't fail (except hw woes), so has
        void return type. It has three stages:
        1. Prepare all affected crtcs with crtc->atomic_begin. Drivers can
           use this to unset the GO bit or similar latches to prevent plane
           updates.
        2. Update plane state by looping over all changed planes and calling
           plane->atomic_update. Presuming the hardware is sane and has GO
           bits drivers can simply bash the state into the hardware in this
           function. Other drivers might use this to precompute hw state for
           the final step.
        3. Finally latch the update for the next vblank with
           crtc->atomic_flush. Note that this function doesn't need to wait
           for the vblank to happen even for the synchronous case.
      
      v2: Clear drm_<obj>_state->state to NULL when swapping in state.
      
      v3: Add TODO that we don't short-circuit plane updates for now. Likely
      no one will care.
      
      v4: Squash in a bit of polish that somehow landed in the wrong (later)
      patche.
      
      v5: Integrate atomic functions into the drm docbook and fixup the
      kerneldoc.
      
      v6: Fixup fixup patch squashing fumble.
      
      v7: Don't touch the legacy plane state plane->fb and plane->crtc. This
      is only used by the legacy ioctl code in the drm core, and that code
      already takes care of updating the pointers in all relevant cases.
      This is in stark contrast to connector->encoder->crtc links on the
      modeset side, which we still need to set since the core doesn't touch
      them.
      
      Also some more kerneldoc polish.
      
      v8: Drop outdated comment.
      
      v9: Handle the state->state pointer correctly: Only clearing the
      ->state pointer when assigning the state to the kms object isn't good
      enough. We also need to re-link the swapped out state into the
      drm_atomic_state structure.
      
      v10: Shuffle the misplaced docbook template hunk around that Sean spotted.
      
      Cc: Sean Paul <seanpaul@chromium.org>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c2fcd274
  4. 05 11月, 2014 1 次提交
  5. 05 6月, 2014 1 次提交
    • M
      drm/plane-helper: Add drm_plane_helper_check_update() (v3) · 7daf8d54
      Matt Roper 提交于
      Pull the parameter checking from drm_primary_helper_update() out into
      its own function; drivers that provide their own setplane()
      implementations rather than using the helper may still want to share
      this parameter checking logic.
      
      A few of the checks here were also updated based on suggestions by
      Ville Syrjälä.
      
      v3:
       - s/primary_helper/plane_helper/ --- this checking logic may be useful
         for other types of planes as well.
       - Fix visibility check (need to dereference visibility pointer)
      v2:
       - Pass src/dest/clip rects and min/max scaling down to helper to avoid
         duplication of effort between helper and drivers (suggested by
         Ville).
       - Allow caller to specify whether the primary plane should be
         updatable while the crtc is disabled.
      
      Cc: dri-devel@lists.freedesktop.org
      Reviewed-by: NChon Ming Lee <chon.ming.lee@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Acked-by: NDave Airlie <airlied@gmail.com>
      [danvet: Include header properly and fixup declaration mismatch to
      make this compile.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7daf8d54
  6. 02 6月, 2014 1 次提交
    • T
      drm/plane: Fix sparse warnings · f220e626
      Thierry Reding 提交于
      Include the drm_plane_helper.h header file to fix the following sparse
      warnings:
      
      	  CHECK   drivers/gpu/drm/drm_plane_helper.c
      	drivers/gpu/drm/drm_plane_helper.c:102:5: warning: symbol 'drm_primary_helper_update' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:219:5: warning: symbol 'drm_primary_helper_disable' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:233:6: warning: symbol 'drm_primary_helper_destroy' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:241:30: warning: symbol 'drm_primary_helper_funcs' was not declared. Should it be static?
      	drivers/gpu/drm/drm_plane_helper.c:259:18: warning: symbol 'drm_primary_helper_create_plane' was not declared. Should it be static?
      
      Doing that makes gcc complain as follows:
      
      	  CC      drivers/gpu/drm/drm_plane_helper.o
      	drivers/gpu/drm/drm_plane_helper.c:260:19: error: conflicting types for 'drm_primary_helper_create_plane'
      	 struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
      	                   ^
      	In file included from drivers/gpu/drm/drm_plane_helper.c:29:0:
      	include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here
      	 struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
      	                   ^
      	drivers/gpu/drm/drm_plane_helper.c: In function 'drm_primary_helper_create_plane':
      	drivers/gpu/drm/drm_plane_helper.c:274:11: warning: assignment discards 'const' qualifier from pointer target type
      	   formats = safe_modeset_formats;
      	           ^
      	In file included from include/linux/linkage.h:6:0,
      	                 from include/linux/kernel.h:6,
      	                 from include/drm/drmP.h:45,
      	                 from drivers/gpu/drm/drm_plane_helper.c:27:
      	drivers/gpu/drm/drm_plane_helper.c: At top level:
      	drivers/gpu/drm/drm_plane_helper.c:289:15: error: conflicting types for 'drm_primary_helper_create_plane'
      	 EXPORT_SYMBOL(drm_primary_helper_create_plane);
      	               ^
      	include/linux/export.h:57:21: note: in definition of macro '__EXPORT_SYMBOL'
      	  extern typeof(sym) sym;     \
      	                     ^
      	drivers/gpu/drm/drm_plane_helper.c:289:1: note: in expansion of macro 'EXPORT_SYMBOL'
      	 EXPORT_SYMBOL(drm_primary_helper_create_plane);
      	 ^
      	In file included from drivers/gpu/drm/drm_plane_helper.c:29:0:
      	include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here
      	 struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev,
      	                   ^
      
      Which can easily be fixed by making the signatures of the implementation
      and the prototype match.
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f220e626
  7. 02 4月, 2014 1 次提交
    • M
      drm: Add primary plane helpers (v3) · c103d1cf
      Matt Roper 提交于
      When we expose non-overlay planes to userspace, they will become
      accessible via standard userspace plane API's.  We should be able to
      handle the standard plane operations against primary planes in a generic
      way via the modeset handler.
      
      Drivers that can program primary planes more efficiently, that want to
      use their own primary plane structure to track additional information,
      or that don't have the limitations assumed by the helpers are free to
      provide their own implementation of some or all of these handlers.
      
      v3: Tweak kerneldoc formatting slightly to avoid ugliness
      v2:
       - Move plane helpers to a new file (drm_plane_helper.c)
       - Tighten checks on update handler (check for scaling, CRTC coverage,
         subpixel positioning)
       - Pass proper panning parameters to modeset interface
       - Disallow disabling primary plane (and thus CRTC) if other planes are
         still active on the CRTC.
       - Use a minimal format list that should work on all hardware/drivers.
         Drivers may call this function with a more accurate plane list to
         enable additional formats they can support.
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      c103d1cf
  8. 17 7月, 2012 1 次提交
  9. 12 5月, 2012 1 次提交
  10. 07 5月, 2012 1 次提交
  11. 10 3月, 2012 1 次提交
  12. 09 2月, 2012 1 次提交
  13. 05 7月, 2011 1 次提交
  14. 26 5月, 2011 1 次提交
  15. 03 3月, 2011 1 次提交
  16. 06 10月, 2010 1 次提交
  17. 13 9月, 2010 1 次提交
  18. 08 9月, 2009 1 次提交
    • J
      drm/radeon/kms: add r600 KMS support · 3ce0a23d
      Jerome Glisse 提交于
      This adds the r600 KMS + CS support to the Linux kernel.
      
      The r600 TTM support is quite basic and still needs more
      work esp around using interrupts, but the polled fencing
      should work okay for now.
      
      Also currently TTM is using memcpy to do VRAM moves,
      the code is here to use a 3D blit to do this, but
      isn't fully debugged yet.
      
      Authors:
      Alex Deucher <alexdeucher@gmail.com>
      Dave Airlie <airlied@redhat.com>
      Jerome Glisse <jglisse@redhat.com>
      Signed-off-by: NJerome Glisse <jglisse@redhat.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3ce0a23d