1. 10 10月, 2013 1 次提交
  2. 19 9月, 2013 1 次提交
    • D
      drm/fb-helper: don't sleep for screen unblank when an oops is in progress · 928c2f0c
      Daniel Vetter 提交于
      Otherwise the system will burn even brighter and worse, leave the user
      wondering what's going on exactly.
      
      Since we already have a panic handler which will (try) to restore the
      entire fbdev console mode, we can just bail out.  Inspired by a patch from
      Konstantin Khlebnikov.  The callchain leading to this, cut&pasted from
      Konstantin's original patch:
      
      callstack:
      panic()
      bust_spinlocks(1)
      unblank_screen()
      vc->vc_sw->con_blank()
      fbcon_blank()
      fb_blank()
      info->fbops->fb_blank()
      drm_fb_helper_blank()
      drm_fb_helper_dpms()
      drm_modeset_lock_all()
      mutex_lock(&dev->mode_config.mutex)
      
      Note that the entire locking in the fb helper around panic/sysrq and kdbg
      is ...  non-existant.  So we have a decent change of blowing up
      everything.  But since reworking this ties in with funny concepts like the
      fbdev notifier chain or the impressive things which happen around
      console_lock while oopsing, I'll leave that as an exercise for braver
      souls than me.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Dave Airlie <airlied@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      928c2f0c
  3. 17 6月, 2013 3 次提交
  4. 12 4月, 2013 1 次提交
  5. 27 3月, 2013 1 次提交
  6. 14 2月, 2013 10 次提交
    • D
      drm/fb-helper: don't sleep for screen unblank when an oopps is in progress · 1b1d5397
      Daniel Vetter 提交于
      Otherwise the system will burn even brighter and worse, leave the user
      wondering what's going on exactly.
      
      Since we already have a panic handler which will (try) to restore the
      entire fbdev console mode, we can just bail out. Inspired by a patch
      from Konstantin Khlebnikov. The callchain leading to this, cut&pasted
      from Konstantin's original patch:
      
      callstack:
      panic()
      bust_spinlocks(1)
      unblank_screen()
      vc->vc_sw->con_blank()
      fbcon_blank()
      fb_blank()
      info->fbops->fb_blank()
      drm_fb_helper_blank()
      drm_fb_helper_dpms()
      drm_modeset_lock_all()
      mutex_lock(&dev->mode_config.mutex)
      
      Note that the entire locking in the fb helper around panic/sysrq and
      kdbg is ... non-existant. So we have a decent change of blowing up
      everything. But since reworking this ties in with funny concepts like
      the fbdev notifier chain or the impressive things which happen around
      console_lock while oopsing, I'll leave that as an exercise for braver
      souls than me.
      
      v2: Drop the -EBUSY return value I've copied, we don't need it since
      the we'll take care of things ourselves anyway.
      
      Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      References: https://patchwork.kernel.org/patch/1878181/Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1b1d5397
    • D
      drm/fb-helper: improve kerneldoc · 207fd329
      Daniel Vetter 提交于
      Now that the fbdev helper interface for drivers is trimmed down,
      update the kerneldoc for all the remaining exported functions.
      
      I've tried to beat the DocBook a bit by reordering the function
      references a bit into a more sensible ordering. But that didn't work
      out at all. Hence just extend the in-code DOC: section a bit.
      
      Also remove the LOCKING: sections - especially for the setup functions
      they're totally bogus. But that's not a documentation problem, but
      simply an artifact of the current rather hazardous locking around drm
      init and even more so around fbdev setup ...
      
      v2: Some further improvements:
      - Also add documentation for drm_fb_helper_single_add_all_connectors,
        Dave Airlie didn't want me to kill this one from the fb helper
        interface.
      - Update docs for drm_fb_helper_fill_var/fix - they should be used
        from the driver's ->fb_probe callback to setup the fbdev info
        structure.
      - Clarify what the ->fb_probe callback should all do - it needs to
        setup both the fbdev info and allocate the drm framebuffer used as
        backing storage.
      - Add basic documentaation for the drm_fb_helper_funcs driver callback
        vfunc.
      
      v3: Implement clarifications Laurent Pinchart suggested in his review.
      
      v4: Fix another mispelling Laurent spotted.
      
      Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
      Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      207fd329
    • D
      drm/fb-helper: streamline drm_fb_helper_single_fb_probe · 8acf658a
      Daniel Vetter 提交于
      No need to check whether we've allocated a new fb since we're not
      always doing that. Also, we always need to register the fbdev and add
      it to the panic notifier.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8acf658a
    • D
      drm/fb-helper: directly call set_par from the hotplug handler · 2180c3c7
      Daniel Vetter 提交于
      The idea behind calling down into the driver's ->fb_probe function on each
      hotplug seems to be able to reallocate the backing storage (if e.g. a screen
      with higher resolution gets added). But that requires quite a bit of work in the
      fb helper itself, since currently we limit new screens to the currently
      allocated fb. An no kms driver supports fbdev fb resizing.
      
      So don't bother and start to simplify the code by calling drm_fb_helper_set_par
      directly from the fbdev hotplug function, since that's the only thing left in
      drm_fb_helper_single_fb_probe which does not concern itself with fb allocation
      and initial setup. Follow-on patches will streamline the initial setup
      code.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2180c3c7
    • D
      drm/fb-helper: fixup set_config semantics · 7e53f3a4
      Daniel Vetter 提交于
      While doing the modeset rework for drm/i915 I've noticed that the fb
      helper is very liberal with the semantics of the ->set_config
      interface:
      - It doesn't bother clearing stale modes (e.g. when unplugging a
        screen).
      - It unconditionally sets the fb, even if no mode will be set on a
        given crtc.
      - The initial setup is a bit fun since we need to pick crtcs to decide
        the desired fb size, but also should set the modeset->fb pointer.
        Explain what's going on in the fixup code after the fb is allocated.
      
      The crtc helper didn't really care, but the new i915 modeset
      infrastructure did, so I've had to add a bunch of special-cases to
      catch this.
      
      Fix this all up and enforce the interface by converting the checks in
      drm/i915/intel_display.c to BUG_ONs.
      
      v2: Fix commit message spell fail spotted by Rob Clark.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7e53f3a4
    • D
      drm/fb-helper: don't disable everything in initial_config · 76a39dbf
      Daniel Vetter 提交于
      This should be done in the drivers for two reasons:
      - it gets in the way of fastboot efforts
      - it links the fb helpers with the crtc helpers instead of going
        through the real interface vfuncs, forcing i915 to fake all the
        ->disable callbacks used by the crtc helper to avoid ugly Oopsen
      
      v2: Resolve conflicts since drivers still call
      drm_fb_helper_single_add_all_connectors.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      76a39dbf
    • D
      drm/fb-helper: unexport drm_fb_helper_single_fb_probe · de1ace5b
      Daniel Vetter 提交于
      Not called by anyone, and really, shouldn't be. Drivers are supposed
      either drm_fb_helper_initial_config or drm_fb_helper_hotplug_event.
      Originally this was done differently, but is now consolidated in the
      helper functions and no longer done by drivers directly.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      de1ace5b
    • D
      drm/fb-helper: unexport drm_fb_helper_panic · 43c8a849
      Daniel Vetter 提交于
      It doesn't even show up in any header files and only used iternally.
      Originally it was (ab)used to restore the fbcon on lastclose, but that
      died with
      
      commit e8e7a2b8
      Author: Dave Airlie <airlied@redhat.com>
      Date:   Thu Apr 21 22:18:32 2011 +0100
      
          drm/i915: restore only the mode of this driver on lastclose (v2)
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      43c8a849
    • D
      drm/fb-helper: kill drm_fb_helper_restore · d21bf469
      Daniel Vetter 提交于
      It's only used internally for the sysrq and panic handlers provided by
      the drm fb helper implementation. Hence just inline it, kill the
      export and remove the confusing kerneldoc. Driver's are supposed to
      call drm_fb_helper_restore_fbdev_mode on lastclose.
      
      Note that locking is totally fubar - the sysrq case doesn't take any
      locks at all. The panic handler probably shouldn't take any locks
      since it'll only make things worse. Otoh it's probably better to
      switch things over to the atomic modeset callbacks (and disable the
      panic handler for those drivers which don't implement it).
      
      But that's both better done in separate patches.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d21bf469
    • D
      drm: review locking for drm_fb_helper_restore_fbdev_mode · 6aed8ec3
      Daniel Vetter 提交于
      ... it's required. Fix up exynos and the cma helper, and add a
      corresponding WARN_ON to drm_fb_helper_restore_fbdev_mode.
      
      Note that tegra calls the fbdev cma helper restore function also from
      it's driver-load callback. Which is a bit against current practice,
      since usually the call is only from ->lastclose, and initial setup is
      done by drm_fb_helper_initial_config.
      
      Also add the relevant drm DocBook entry.
      
      v2: Add promised WARN to restore_fbdev_mode.
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6aed8ec3
  7. 21 1月, 2013 2 次提交
    • D
      drm/fb_helper: check whether fbcon is bound · 20c60c35
      Daniel Vetter 提交于
      We need to make sure that the fbcon is still bound when touching the
      hw, since otherwise we might corrupt the modeset state of kms clients.
      X mostly works around that with VT switching and setting the VT into
      raw mode, which disables most fbcon events.
      
      Raw kms test programs though don't do that dance, and in the future
      we might want to aim to abolish CONFIG_VT anyway. So improve preventive
      measures a bit. To do so, extract the existing logic for handling hotplug
      events (which X can't block with the current set of tricks) and reuse
      it for the fbdev blanking helper.
      
      Long-term we really need to either scrap this all and only have a OOPS
      console, or come up with a saner model for device ownership sharing
      between fbdev/fbcon and kms userspace.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      20c60c35
    • 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
  8. 20 1月, 2013 1 次提交
  9. 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
  10. 28 11月, 2012 1 次提交
  11. 20 11月, 2012 4 次提交
  12. 03 10月, 2012 1 次提交
  13. 08 9月, 2012 1 次提交
  14. 24 8月, 2012 1 次提交
  15. 17 8月, 2012 1 次提交
    • D
      drm/fb-helper: don't clobber output routing in setup_crtcs · 33faad19
      Daniel Vetter 提交于
      Yet again the too close relationship between the fb helper and the
      crtc helper code strikes. This time around the fb helper resets all
      encoder->crtc pointers to NULL before starting to set up it's own
      mode. Which is total bullocks, because this will clobber the existing
      output routing, which the new drm/i915 code depends upon to be
      absolutely correct.
      
      The crtc helper itself doesn't really care about that, since it
      disables unused encoders in a rather roundabout way anyway.
      
      Two places call drm_setup_crts:
      
      - For the initial fb config. I've auditted all current drivers, and
        they all allocate their encoders with kzalloc. So there's no need to
        clear encoder->crtc once more.
      
      - When processing hotplug events while showing the fb console. This
        one is a bit more tricky, but both the crtc helper code and the new
        drm/i915 modeset code disable encoders if their crtc is changed and
        that encoder isn't part of the new config. Also, both disable any
        disconnected outputs, too.
      
        Which only leaves encoders that are on, connected, but for some odd
        reason the fb helper code doesn't want to use. That would be a bug
        in the fb configuration selector, since it tries to light up as many
        outputs as possible.
      
      v2: Kill the now unused encoders variable.
      Acked-by: NDave Airlie <airlied@gmail.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      33faad19
  16. 20 7月, 2012 2 次提交
    • D
      drm/fb helper: don't call drm_crtc_helper_set_config · d3904754
      Daniel Vetter 提交于
      Go through the interface vtable instead, because not everyone might be
      using the crtc helper code.
      
      Cc: dri-devel@lists.freedesktop.org
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d3904754
    • D
      drm/fb-helper: delay hotplug handling when partially bound · 343065a6
      Daniel Vetter 提交于
      Ok, this requires quite a dance to actually hit:
      1) We plug in a 2nd screen, enable it in both X and (by vt-switching)
      in the fbcon.
      2) We disable that screen again in with xrandr.
      3) We vt-switch again, so that fbcon displays on the 2nd screen, but X
      on the first screen. This obviously needs a driver that doesn't switch
      off unused functions when regaining the VT.
      3) When X controls the vt, we unplug that screen.
      
      Now drm_fb_helper_hotplug_event we noticed that that some crtcs are
      bound, but because we still have the fbcon on the 2nd screeen we also
      have bound set. Which means the fbcon wrongly assumes it's in control
      of everything an happily disables the output on the 2nd screen, but
      enables its fb on the first screen.
      
      Work around this issue by counting how many crtcs are bound and how
      many are bound to fbcon and assuming that when fbcon isn't bound to
      all of them, it better not touch the output configuration.
      
      Conceptually this is the same as only restoring the fbcon output
      configuration on the driver's ->lastclose, when we're sure that no one
      else is using kms. So this should be consistent with existing kms
      drivers.
      
      Chris has created a separate patch for the intel ddx, but I think we
      should fix this issue here regardless - the fbcon messing with the
      output config while it's not fully in control simply isn't a too
      polite behaviour.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50772Tested-by: NMaxim A. Nikulin <M.A.Nikulin@gmail.com>
      Signed-Off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      343065a6
  17. 22 5月, 2012 2 次提交
  18. 20 4月, 2012 1 次提交
  19. 03 4月, 2012 1 次提交
  20. 03 2月, 2012 4 次提交