1. 20 4月, 2012 1 次提交
  2. 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
  3. 15 3月, 2012 6 次提交
  4. 17 2月, 2012 1 次提交
    • D
      drm: add some caps for userspace to discover more info for dumb KMS driver (v2) · 019d96cb
      Dave Airlie 提交于
      For the simple KMS driver case we need some more info about what the preferred
      depth and if a shadow framebuffer is preferred.
      
      I've only added this for intel/radeon which support the dumb ioctls so far.
      
      If you need something really fancy you should be writing a real X.org driver.
      
      v2: drop cursor information, just return an error from the cursor ioctls
      and we can make userspace fallback to sw cursor in that case, cursor
      info was getting too messy, best to start smaller.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      019d96cb
  5. 09 2月, 2012 2 次提交
  6. 03 2月, 2012 1 次提交
  7. 13 1月, 2012 1 次提交
  8. 05 1月, 2012 1 次提交
    • R
      drm: add support for private planes · 0a7eb243
      Rob Clark 提交于
      In cases where the scanout hw is sufficiently similar between "overlay"
      and traditional crtc layers, it might be convenient to allow the driver
      to create internal drm_plane helper objects used by the drm_crtc
      implementation, rather than duplicate code between the plane and crtc.
      A private plane is not exposed to userspace.
      Signed-off-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0a7eb243
  9. 20 12月, 2011 2 次提交
  10. 06 12月, 2011 9 次提交
  11. 30 11月, 2011 1 次提交
  12. 16 11月, 2011 2 次提交
  13. 22 9月, 2011 1 次提交
    • W
      drm: support routines for HDMI/DP ELD · 76adaa34
      Wu Fengguang 提交于
      ELD (EDID-Like Data) describes to the HDMI/DP audio driver the audio
      capabilities of the plugged monitor.
      
      This adds drm_edid_to_eld() for converting EDID to ELD. The converted
      ELD will be saved in a new drm_connector.eld[128] data field. This is
      necessary because the graphics driver will need to fixup some of the
      data fields (eg. HDMI/DP connection type, AV sync delay) before writing
      to the hardware ELD buffer. drm_av_sync_delay() will help the graphics
      drivers dynamically compute the AV sync delay for fixing-up the ELD.
      
      ELD selection policy: it's possible for one encoder to be associated
      with multiple connectors (ie. monitors), in which case the first found
      ELD will be returned by drm_select_eld(). This policy may not be
      suitable for all users, but let's start it simple first.
      
      The impact of ELD selection policy: assume there are two monitors, one
      supports stereo playback and the other has 8-channel output; cloned
      display mode is used, so that the two monitors are associated with the
      same internal encoder. If only the stereo playback capability is reported,
      the user won't be able to start 8-channel playback; if the 8-channel ELD
      is reported, then user space applications may send 8-channel samples
      down, however the user may actually be listening to the 2-channel
      monitor and not connecting speakers to the 8-channel monitor.
      
      According to James, many TVs will either refuse the display anything or
      pop-up an OSD warning whenever they receive hdmi audio which they cannot
      handle. Eventually we will require configurability and/or per-monitor
      audio control even when the video is cloned.
      
      CC: Zhao Yakui <yakui.zhao@intel.com>
      CC: Wang Zhenyu <zhenyu.z.wang@intel.com>
      CC: Jeremy Bush <contractfrombelow@gmail.com>
      CC: Christopher White <c.white@pulseforce.com>
      CC: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
      CC: Paul Menzel <paulepanter@users.sourceforge.net>
      CC: James Cloos <cloos@jhcloos.com>
      CC: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
      Signed-off-by: NKeith Packard <keithp@keithp.com>
      76adaa34
  14. 04 8月, 2011 2 次提交
  15. 16 6月, 2011 1 次提交
  16. 28 4月, 2011 2 次提交
  17. 01 4月, 2011 1 次提交
  18. 31 3月, 2011 1 次提交
  19. 23 2月, 2011 1 次提交
  20. 07 2月, 2011 1 次提交
    • D
      drm: dumb scanout create/mmap for intel/radeon (v3) · ff72145b
      Dave Airlie 提交于
      This is just an idea that might or might not be a good idea,
      it basically adds two ioctls to create a dumb and map a dumb buffer
      suitable for scanout. The handle can be passed to the KMS ioctls to create
      a framebuffer.
      
      It looks to me like it would be useful in the following cases:
      a) in development drivers - we can always provide a shadowfb fallback.
      b) libkms users - we can clean up libkms a lot and avoid linking
      to libdrm_*.
      c) plymouth via libkms is a lot easier.
      
      Userspace bits would be just calls + mmaps. We could probably
      mark these handles somehow as not being suitable for acceleartion
      so as top stop people who are dumber than dumb.
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      ff72145b
  21. 26 1月, 2011 1 次提交
  22. 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