1. 20 3月, 2012 1 次提交
    • C
      drm: allow loading an EDID as firmware to override broken monitor · da0df92b
      Carsten Emde 提交于
      Broken monitors and/or broken graphic boards may send erroneous or no
      EDID data. This also applies to broken KVM devices that are unable to
      correctly forward the EDID data of the connected monitor but invent
      their own fantasy data.
      
      This patch allows to specify an EDID data set to be used instead of
      probing the monitor for it. It contains built-in data sets of frequently
      used screen resolutions. In addition, a particular EDID data set may be
      provided in the /lib/firmware directory and loaded via the firmware
      interface. The name is passed to the kernel as module parameter of the
      drm_kms_helper module either when loaded
        options drm_kms_helper edid_firmware=edid/1280x1024.bin
      or as kernel commandline parameter
        drm_kms_helper.edid_firmware=edid/1280x1024.bin
      
      It is also possible to restrict the usage of a specified EDID data set
      to a particular connector. This is done by prepending the name of the
      connector to the name of the EDID data set using the syntax
        edid_firmware=[<connector>:]<edid>
      such as, for example,
        edid_firmware=DVI-I-1:edid/1920x1080.bin
      in which case no other connector will be affected.
      
      The built-in data sets are
      Resolution    Name
      --------------------------------
      1024x768      edid/1024x768.bin
      1280x1024     edid/1280x1024.bin
      1680x1050     edid/1680x1050.bin
      1920x1080     edid/1920x1080.bin
      
      They are ignored, if a file with the same name is available in the
      /lib/firmware directory.
      
      The built-in EDID data sets are based on standard timings that may not
      apply to a particular monitor and even crash it. Ideally, EDID data of
      the connected monitor should be used. They may be obtained through the
      drm/cardX/cardX-<connector>/edid entry in the /sys/devices PCI directory
      of a correctly working graphics adapter.
      
      It is even possible to specify the name of an EDID data set on-the-fly
      via the /sys/module interface, e.g.
      echo edid/myedid.bin >/sys/module/drm_kms_helper/parameters/edid_firmware
      The new screen mode is considered when the related kernel function is
      called for the first time after the change. Such calls are made when the
      X server is started or when the display settings dialog is opened in an
      already running X server.
      Signed-off-by: NCarsten Emde <C.Emde@osadl.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      da0df92b
  2. 15 3月, 2012 1 次提交
  3. 03 2月, 2012 1 次提交
  4. 21 12月, 2011 2 次提交
  5. 20 12月, 2011 1 次提交
  6. 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
  7. 30 11月, 2011 1 次提交
  8. 16 11月, 2011 1 次提交
  9. 11 11月, 2011 1 次提交
  10. 01 11月, 2011 2 次提交
  11. 11 10月, 2011 1 次提交
  12. 08 7月, 2011 1 次提交
  13. 05 2月, 2011 1 次提交
  14. 31 1月, 2011 3 次提交
  15. 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
  16. 22 12月, 2010 1 次提交
  17. 21 12月, 2010 1 次提交
  18. 08 12月, 2010 1 次提交
  19. 29 11月, 2010 2 次提交
  20. 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
  21. 09 11月, 2010 1 次提交
  22. 14 9月, 2010 1 次提交
  23. 13 9月, 2010 3 次提交
  24. 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
  25. 10 8月, 2010 1 次提交
  26. 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
  27. 23 7月, 2010 1 次提交
  28. 16 7月, 2010 1 次提交
  29. 13 7月, 2010 1 次提交
  30. 07 7月, 2010 1 次提交
  31. 01 6月, 2010 1 次提交
  32. 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