1. 21 1月, 2013 1 次提交
    • D
      drm: add drm_modeset_lock|unlock_all · 84849903
      Daniel Vetter 提交于
      This is the first step towards introducing the new modeset locking
      scheme. The plan is to put helper functions into place at all the
      right places step-by-step, so that the final patch to switch on the
      new locking scheme doesn't need to touch every single driver.
      
      This helper here will serve as the shotgun solutions for all places
      where a more fine-grained locking isn't (yet) implemented.
      
      v2: Fixup kerneldoc for unlock_all.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      84849903
  2. 20 1月, 2013 5 次提交
    • D
      drm: encapsulate crtc->set_config calls · 2d13b679
      Daniel Vetter 提交于
      With refcounting we need to adjust framebuffer refcounts at each
      callsite - much easier to do if they all call the same little helper
      function.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2d13b679
    • D
      drm/<drivers>: Unified handling of unimplemented fb->create_handle · af26ef3b
      Daniel Vetter 提交于
      Some drivers don't have real ->create_handle callbacks.
      
      - cirrus/ast/mga200: Returns either 0 or -EINVAL.
      
      - udl: Didn't even bother with a callback, leading to a nice
        userspace-triggerable OOPS.
      
      - vmwgfx: This driver bothered with an implementation to return 0 as
        the handle (which is the canonical no-obj gem handle).
      
      All have in common that ->create_handle doesn't really make too much
      sense for them - that ioctl is used only for seamless fb takeover in
      the radeon/nouveau/i915 ddx drivers. So allow drivers to not implement
      this and return a consistent -ENODEV.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      af26ef3b
    • D
      drm/gma500: move fbcon restore to lastclose · 7147573a
      Daniel Vetter 提交于
      Doing this within the fb->destroy callback leads to a locking
      nightmare. And all other drm drivers that restore the fbcon do
      it in lastclose, too.
      
      With this adjustments all fb->destroy callbacks optionally drop
      references to any gem objects used as backing storage, call
      drm_framebuffer_cleanup and then kfree the struct. Which nicely
      simplifies the locking for framebuffer unreferencing and freeing,
      since this doesn't require that we hold the mode_config lock. A
      slight exception is the vmwgfx surface backed framebuffer, it also
      calls drm_master_put and removes the object from a device-private
      framebuffer list. Both seem to have solid locking in place already.
      
      Conclusion is that now it is no longer required to hold the
      mode_config lock while freeing a framebuffer.
      
      v2: Drop the corresponding mutex_lock WARN check from
      drm_framebuffer_unreference.
      
      v3: Use just the mode_config lock not modeset_lock_all, due to patch
      reordering.
      Acked-by: NAlan Cox <alan@lxorguk.ukuu.org.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7147573a
    • D
      drm/doc: integrate drm_crtc.c kerneldoc · 065a50ed
      Daniel Vetter 提交于
      And do a quick pass to adjust them to the last few (years?) of changes
      ...
      
      This time actually compile-tested ;-)
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      065a50ed
    • D
      drm: review locking rules in drm_crtc.c · 8faf6b18
      Daniel Vetter 提交于
      - config_cleanup was confused: It claimed that callers need to hold
        the modeset lock, but the connector|encoder_cleanup helpers grabbed
        that themselves (note that crtc_cleanup did _not_ grab the modeset
        lock). Which resulted in all drivers _not_ hodling the lock. Since
        this is for single-threaded cleanup code, drop the requirement from
        docs and also drop the lock_grabbing from all _cleanup functions.
      
      - Kill the LOCKING section in the doctype, since clearly we're not
        good enough to keep them up-to-date. And misleading locking
        documentation is worse than useless (see e.g. the comment in the
        vmgfx driver about the cleanup mess). And since for most functions
        the very first line either grabs the lock or has a WARN_ON(!locked)
        the documentation doesn't really add anything.
      
      - Instead put in some effort into explaining the only two special
        cases a bit better: config_init and config_cleanup are both called
        from single-threaded setup/teardown code, so don't do any locking.
        It's the driver's job though to enforce this.
      
      - Where lacking, add a WARN_ON(!is_locked). Not many places though,
        since locking around fbdev setup/teardown is through-roughly screwed
        up, and so will break almost every single WARN annotation I've tried
        to add.
      
      - Add a drm_modeset_is_locked helper - the Grate Modset Locking Rework
        will use the compiler to assist in the big reorg by renaming the
        mode lock, so start encapsulating things. Unfortunately this ended
        up in the "wrong" header file since it needs the definition of
        struct drm_device.
      
      v2: Drop most WARNS again - we hit them all over the place, mostly in
      the setup and teardown sequences. And trying to fix it up leads to
      nice deadlocks, since the locking in the setup code is really
      inconsistent.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8faf6b18
  3. 01 12月, 2012 1 次提交
    • R
      drm: remove legacy drm_connector_property fxns · 58495563
      Rob Clark 提交于
      Replace references to and remove the connector property fxns, which
      have been superseded with the more general object property fxns:
      
        + drm_connector_attach_property -> drm_object_attach_property
        + drm_connector_property_set_value -> drm_object_property_set_value
        + drm_connector_property_get_value -> drm_object_property_get_value
      Signed-off-by: NRob Clark <rob@ti.com>
      58495563
  4. 20 11月, 2012 4 次提交
  5. 07 11月, 2012 2 次提交
  6. 03 10月, 2012 2 次提交
  7. 02 10月, 2012 3 次提交
    • R
      drm: support for rotated scanout · 7c80e128
      Rob Clark 提交于
      For drivers that can support rotated scanout, the extra parameter
      checking in drm-core, while nice, tends to get confused.  To solve
      this drivers can set the crtc or plane invert_dimensions field so
      that the dimension checking takes into account the rotation that
      the driver is performing.
      
      v1: original
      v2: remove invert_dimensions from plane, at Ville's suggestion.
          Userspace can give rotated src coordinates, so invert_dimensions
          is not required for planes.
      Signed-off-by: NRob Clark <rob@ti.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      7c80e128
    • R
      drm: refcnt drm_framebuffer (v4.1) · f7eff60e
      Rob Clark 提交于
      This simplifies drm fb lifetime, and if the crtc/plane needs to hold
      a ref to the fb when disabling a pipe until the next vblank, this
      avoids the need to make disabling an overlay synchronous.  This is a
      problem that shows up when userspace is using a drm plane to
      implement a hw cursor.. making overlay disable synchronous causes
      a performance problem when x11 is rapidly enabling/disabling the
      hw cursor.  But not making it synchronous opens up a race condition
      for crashing if userspace turns around and immediately deletes the
      fb.  Refcnt'ing the fb makes it possible to solve this problem.
      
      v1: original
      v2: add drm_framebuffer_remove() which is called in all paths where
          fb->funcs->destroy() was directly called before.  This cleans
          up the CRTCs/planes that the fb was attached to.  You should
          only directly use drm_framebuffer_unreference() if you are also
          using drm_framebuffer_reference() to keep a ref to the fb.
      v3: add comment explaining the fb refcount
      v4: remove duplicate 'list_del(&fb->filp_head)'
      
      [airlied: v4.1: fix local rejection]
      Signed-off-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      f7eff60e
    • C
      drm: Destroy the planes prior to destroying the associated CRTC · 3184009c
      Chris Wilson 提交于
      As during the plane cleanup, we wish to disable the hardware and
      so may modify state on the associated CRTC, that CRTC must continue to
      exist until we are finished.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54101Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: stable@vger.kernel.org
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Tested-by: Nlu hua <huax.lu@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3184009c
  8. 18 9月, 2012 1 次提交
  9. 24 8月, 2012 1 次提交
  10. 29 5月, 2012 2 次提交
  11. 22 5月, 2012 5 次提交
  12. 17 5月, 2012 7 次提交
  13. 02 5月, 2012 1 次提交
  14. 24 4月, 2012 1 次提交
  15. 20 4月, 2012 4 次提交