1. 02 12月, 2011 1 次提交
    • C
      drm: Fix lack of CRTC disable for drm_crtc_helper_set_config(.fb=NULL) · 6eebd6bb
      Chris Wilson 提交于
      Disabling the CRTC by setting its framebuffer to NULL, as used by
      drm_framebuffer_cleanup(), was failing to pass the current framebuffer
      to the crtc_func->disable callback. This is because of the dance within
      drm_crtc_helper_set_config to pass the new_fb (NULL in this case) to the
      drm_crtc_helper_set_mode with the currently attached fb as a parameter.
      drm_crtc_helper_set_mode treats this as a no-op and the encoder is still
      enabled. And so the current fb is forgotten before the call to
      drm_helper_disable_unused_functions.
      
      This patch treats disabling the CRTC as a simple special case rather
      than adding further complexity into the configuration logic.
      
      This fixes a pin-leak of the fb bo on Xserver close.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      6eebd6bb
  2. 11 11月, 2011 1 次提交
  3. 01 11月, 2011 2 次提交
  4. 11 10月, 2011 1 次提交
  5. 08 7月, 2011 1 次提交
  6. 05 2月, 2011 1 次提交
  7. 31 1月, 2011 3 次提交
  8. 10 1月, 2011 1 次提交
    • C
      drm: Restore the old_fb upon modeset failure · 0ba41e44
      Chris Wilson 提交于
      ... or else we may end up disabling the wrong framebuffer, leading to an
      OOPS, e.g:
      
      [ 6033.229012] kernel BUG at drivers/gpu/drm/i915/i915_gem.c:3271!
      [ 6033.229012] invalid opcode: 0000 [#1] SMP
      [ 6033.229012] last sysfs file:
      /sys/devices/virtual/backlight/acpi_video0/uevent
      [ 6033.229012] Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq
      mperf snd_hda_codec_analog snd_hda_intel snd_hda_codec snd_hwdep snd_seq
      snd_seq_device snd_pcm snd_timer thinkpad_acpi ppdev snd r852 sm_common
      iTCO_wdt uvcvideo i2c_i801 iTCO_vendor_support microcode wmi nand
      videodev nand_ids nand_ecc snd_page_alloc parport_pc parport mtd
      soundcore joydev v4l1_compat pcspkr uinput ipv6 sdhci_pci sdhci mmc_core
      yenta_socket i915 drm_kms_helper drm i2c_algo_bit i2c_core video output
      [last unloaded: scsi_wait_scan]
      [ 6033.229012]
      [ 6033.229012] Pid: 4834, comm: Xorg Not tainted 2.6.37-rc8+ #25 7661BL5/7661BL5
      [ 6033.229012] EIP: 0060:[<f86fda5e>] EFLAGS: 00013246 CPU: 0
      [ 6033.229012] EIP is at i915_gem_object_unpin+0x23/0x76 [i915]
      [ 6033.229012] EAX: f68a4000 EBX: f6831f00 ECX: 000600fa EDX: f68a8000
      [ 6033.229012] ESI: f68a4014 EDI: f68a42b8 EBP: f2169c44 ESP: f2169c3c
      [ 6033.229012]  DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
      [ 6033.229012] Process Xorg (pid: 4834, ti=f2168000 task=f21c8000 task.ti=f2168000)
      [ 6033.229012] Stack:
      [ 6033.229012]  f3a84800 f68a4014 f2169c54 f87045d8 f3a84800 f872d9a8 f2169c68 f7fd8091
      [ 6033.229012]  f3b952a4 00000000 f68a414c f2169cf0 f7fd9377 00000000 00000000 f7fd98b0
      [ 6033.229012]  f7fd9f4e 0000000f f7f328a0 00000000 00000000 00000000 f2169ca4 f68a414c
      [ 6033.229012] Call Trace:
      [ 6033.229012]  [<f87045d8>] ? intel_crtc_disable+0x36/0x41 [i915]
      [ 6033.229012]  [<f7fd8091>] ?  drm_helper_disable_unused_functions+0xcd/0xf9 [drm_kms_helper]
      [ 6033.229012]  [<f7fd9377>] ? drm_crtc_helper_set_config+0x62a/0x7f7 [drm_kms_helper]
      [ 6033.229012]  [<c04daa10>] ? __slab_free+0x1b/0xa4
      [ 6033.229012]  [<f7fd7e62>] ? drm_fb_helper_initial_config+0x466/0x497 [drm_kms_helper]
      [ 6033.229012]  [<f7fd7ea3>] ? drm_fb_helper_restore+0x10/0x2a [drm_kms_helper]
      [ 6033.229012]  [<f86f2577>] ? i915_driver_lastclose+0x2a/0x57 [i915]
      [ 6033.229012]  [<f7f1989f>] ? drm_lastclose+0x45/0x23e [drm]
      [ 6033.229012]  [<f7f1a0b4>] ? drm_release+0x462/0x4d7 [drm]
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: stable@kernel.org
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0ba41e44
  9. 22 12月, 2010 1 次提交
  10. 21 12月, 2010 1 次提交
  11. 08 12月, 2010 1 次提交
  12. 29 11月, 2010 2 次提交
  13. 22 11月, 2010 1 次提交
    • M
      drm/vblank: Add support for precise vblank timestamping. · 27641c3f
      Mario Kleiner 提交于
      The DRI2 swap & sync implementation needs precise
      vblank counts and precise timestamps corresponding
      to those vblank counts. For conformance to the OpenML
      OML_sync_control extension specification the DRM
      timestamp associated with a vblank count should
      correspond to the start of video scanout of the first
      scanline of the video frame following the vblank
      interval for that vblank count.
      
      Therefore we need to carry around precise timestamps
      for vblanks. Currently the DRM and KMS drivers generate
      timestamps ad-hoc via do_gettimeofday() in some
      places. The resulting timestamps are sometimes not
      very precise due to interrupt handling delays, they
      don't conform to OML_sync_control and some are wrong,
      as they aren't taken synchronized to the vblank.
      
      This patch implements support inside the drm core
      for precise and robust timestamping. It consists
      of the following interrelated pieces.
      
      1. Vblank timestamp caching:
      
      A per-crtc ringbuffer stores the most recent vblank
      timestamps corresponding to vblank counts.
      
      The ringbuffer can be read out lock-free via the
      accessor function:
      
      struct timeval timestamp;
      vblankcount = drm_vblank_count_and_time(dev, crtcid, &timestamp).
      
      The function returns the current vblank count and
      the corresponding timestamp for start of video
      scanout following the vblank interval. It can be
      used anywhere between enclosing drm_vblank_get(dev, crtcid)
      and drm_vblank_put(dev,crtcid) statements. It is used
      inside the drmWaitVblank ioctl and in the vblank event
      queueing and handling. It should be used by kms drivers for
      timestamping of bufferswap completion.
      
      The timestamp ringbuffer is reinitialized each time
      vblank irq's get reenabled in drm_vblank_get()/
      drm_update_vblank_count(). It is invalidated when
      vblank irq's get disabled.
      
      The ringbuffer is updated inside drm_handle_vblank()
      at each vblank irq.
      
      2. Calculation of precise vblank timestamps:
      
      drm_get_last_vbltimestamp() is used to compute the
      timestamp for the end of the most recent vblank (if
      inside active scanout), or the expected end of the
      current vblank interval (if called inside a vblank
      interval). The function calls into a new optional kms
      driver entry point dev->driver->get_vblank_timestamp()
      which is supposed to provide the precise timestamp.
      If a kms driver doesn't implement the entry point or
      if the call fails, a simple do_gettimeofday() timestamp
      is returned as crude approximation of the true vblank time.
      
      A new drm module parameter drm.timestamp_precision_usec
      allows to disable high precision timestamps (if set to
      zero) or to specify the maximum acceptable error in
      the timestamps in microseconds.
      
      Kms drivers could implement their get_vblank_timestamp()
      function in a gpu specific way, as long as returned
      timestamps conform to OML_sync_control, e.g., by use
      of gpu specific hardware timestamps.
      
      Optionally, kms drivers can simply wrap and use the new
      utility function drm_calc_vbltimestamp_from_scanoutpos().
      This function calls a new optional kms driver function
      dev->driver->get_scanout_position() which returns the
      current horizontal and vertical video scanout position
      of the crtc. The scanout position together with the
      drm_display_timing of the current video mode is used
      to calculate elapsed time relative to start of active scanout
      for the current video frame. This elapsed time is subtracted
      from the current do_gettimeofday() time to get the timestamp
      corresponding to start of video scanout. Currently
      non-interlaced, non-doublescan video modes, with or
      without panel scaling are handled correctly. Interlaced/
      doublescan modes are tbd in a future patch.
      
      3. Filtering of redundant vblank irq's and removal of
      some race-conditions in the vblank irq enable/disable path:
      
      Some gpu's (e.g., Radeon R500/R600) send spurious vblank
      irq's outside the vblank if vblank irq's get reenabled.
      These get detected by use of the vblank timestamps and
      filtered out to avoid miscounting of vblanks.
      
      Some race-conditions between the vblank irq enable/disable
      functions, the vblank irq handler and the gpu itself (updating
      its hardware vblank counter in the "wrong" moment) are
      fixed inside vblank_disable_and_save() and
      drm_update_vblank_count() by use of the vblank timestamps and
      a new spinlock dev->vblank_time_lock.
      
      The time until vblank irq disable is now configurable via
      a new drm module parameter drm.vblankoffdelay to allow
      experimentation with timeouts that are much shorter than
      the current 5 seconds and should allow longer vblank off
      periods for better power savings.
      
      Followup patches will use these new functions to
      implement precise timestamping for the intel and radeon
      kms drivers.
      Signed-off-by: NMario Kleiner <mario.kleiner@tuebingen.mpg.de>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      27641c3f
  14. 09 11月, 2010 1 次提交
  15. 14 9月, 2010 1 次提交
  16. 13 9月, 2010 3 次提交
  17. 07 9月, 2010 2 次提交
    • C
      drm: Do not force 1024x768 modes on unknown connectors · c7ef35a9
      Chris Wilson 提交于
      Only fallback to a set of default modes on a connector iff that
      connector is known to be connected. The issue occurs that with limited
      hardware which cannot probe a connector and so reports the
      connector status as unknown will then attempt to retrieve the modes for
      it during drm_helper_probe_single_connector_modes(). Should that fail,
      the helper then generates a default set which fools the fb_helper and
      causes havoc with the console and beyond.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c7ef35a9
    • C
      drm/kms: Add a module parameter to disable polling · e58f637b
      Chris Wilson 提交于
      Polling for a VGA device on an old system can be quite expensive,
      causing latencies on the order of 600ms. As we hold the mode mutex for
      this time and also need the same mutex to move the cursor, we trigger a
      user-visible stall.
      
      The real solution would involve improving the granulatity of the
      locking and so perhaps performing some of the probing not under the lock
      or some other updates can be done under different locks. Also reducing the
      cost of probing for a non-existent monitor would be worthwhile. However,
      exposing a parameter to disable polling is a simple workaround in the
      meantime.
      
      In order to accommodate users turning polling on and off at runtime, the
      polling is potentially re-enabled on every probe. This is coupled to
      the user calling xrandr, which seems to be a vaild time to reset the
      polling timeout since the information on the connection has just been
      updated. (The presumption being that all connections are probed in a
      single xrandr pass, which is currently valid.)
      
      References:
      
        Bug 29536 - 2.6.35 causes ~600ms latency every 10s
        https://bugs.freedesktop.org/show_bug.cgi?id=29536
      
        Bug 16265 - Why is kslowd accumulating so much CPU time?
        https://bugzilla.kernel.org/show_bug.cgi?id=16265Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reported-and-tested-by: NBruno Prémont <bonbons@linux-vserver.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e58f637b
  18. 10 8月, 2010 1 次提交
  19. 09 8月, 2010 1 次提交
    • T
      drm: fix fallouts from slow-work -> wq conversion · 9a919c46
      Tejun Heo 提交于
      Commit 991ea75c (drm: use workqueue instead of slow-work), which made
      drm to use wq instead of slow-work, didn't account for the return
      value difference between delayed_slow_work_enqueue() and
      queue_delayed_work().  The former returns 0 on success and -errno on
      failures while the latter never fails and only uses the return value
      to indicate whether the work was already pending or not.
      
      This misconversion triggered spurious error messages.  Remove the now
      unnecessary return value check and error message.
      
      Markus: caught another incorrect conversion in drm_kms_helper_poll_enable()
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Tested-by: NMarkus Trippelsdorf <markus@trippelsdorf.de>
      Cc: David Airlie <airlied@linux.ie>
      Cc: dri-devel@lists.freedesktop.org
      9a919c46
  20. 23 7月, 2010 1 次提交
  21. 16 7月, 2010 1 次提交
  22. 13 7月, 2010 1 次提交
  23. 07 7月, 2010 1 次提交
  24. 01 6月, 2010 1 次提交
  25. 18 5月, 2010 1 次提交
    • D
      drm/fbdev: rework output polling to be back in the core. (v4) · eb1f8e4f
      Dave Airlie 提交于
      After thinking it over a lot it made more sense for the core to deal with
      the output polling especially so it can notify X.
      
      v2: drop plans for fake connector - per Michel's comments - fix X patch sent to xorg-devel, add intel polled/hpd setting, add initial nouveau polled/hpd settings.
      
      v3: add config lock take inside polling, add intel/nouveau poll init/fini calls
      
      v4: config lock was a bit agressive, only needed around connector list reading.
      otherwise it could re-enter.
      
      glisse: discard drm_helper_hpd_irq_event
      
      v3: Reviewed-by: Michel Dänzer <michel@daenzer.net>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      eb1f8e4f
  26. 07 4月, 2010 2 次提交
    • D
      drm/kms/fb: move to using fb helper crtc grouping instead of core crtc list · 8be48d92
      Dave Airlie 提交于
      This move to using the list of crtcs in the fb helper and cleans up the
      whole picking code, now we store the crtc/connectors we want directly
      into the modeset and we use the modeset directly to set the mode.
      
      Fixes from James Simmons and Ben Skeggs.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8be48d92
    • D
      drm/fb: fix fbdev object model + cleanup properly. · 38651674
      Dave Airlie 提交于
      The fbdev layer in the kms code should act like a consumer of the kms services and avoid having relying on information being store in the kms core structures in order for it to work.
      
      This patch
      
      a) removes the info pointer/psuedo palette from the core drm_framebuffer structure and moves it to the fbdev helper layer, it also removes the core drm keeping a list of kernel kms fbdevs.
      b) migrated all the fb helper functions out of the crtc helper file into the fb helper file.
      c) pushed the fb probing/hotplug control into the driver
      d) makes the surface sizes into a structure for ease of passing
      This changes the intel/radeon/nouveau drivers to use the new helper.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      38651674
  27. 15 3月, 2010 1 次提交
  28. 11 2月, 2010 1 次提交
  29. 13 1月, 2010 2 次提交
  30. 11 1月, 2010 2 次提交