22 Sep, 2011

1 commit

  • 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
    CC: Wang Zhenyu
    CC: Jeremy Bush
    CC: Christopher White
    CC: Pierre-Louis Bossart
    CC: Paul Menzel
    CC: James Cloos
    CC: Chris Wilson
    Signed-off-by: Ben Skeggs
    Signed-off-by: Wu Fengguang
    Signed-off-by: Keith Packard

    Wu Fengguang
     

04 Aug, 2011

2 commits

  • Provides function drm_edid_header_is_valid() for EDID header check
    and replaces EDID header check part of function drm_edid_block_valid()
    by a call of drm_edid_header_is_valid().
    This is a prerequisite to extend DDC probing, e. g. in function
    radeon_ddc_probe() for Radeon devices, by a central EDID header check.

    Tested for kernel 2.6.35, 2.6.38 and 3.0

    Cc:
    Signed-off-by: Thomas Reim
    Reviewed-by: Alex Deucher
    Acked-by: Stephen Michaels
    Signed-off-by: Dave Airlie

    Thomas Reim
     
  • Drivers need to know the CEA version number in addition to other display
    info (like whether the display is an HDMI sink) before enabling certain
    features. So track the CEA version number in the display info
    structure.

    Signed-off-by: Jesse Barnes
    Signed-off-by: Keith Packard

    Jesse Barnes
     

16 Jun, 2011

1 commit

  • Some RS690 chipsets seem to end up with floating connectors, either
    a DVI connector isn't actually populated, or an add-in HDMI card
    is available but not installed. In this case we seem to get a NULL byte
    response for each byte of the i2c transaction, so we detect this
    case and if we see it we don't do anymore DDC transactions on this
    connector.

    I've tested this on my RS690 without the HDMI card installed and
    it seems to work fine.

    Signed-off-by: Dave Airlie
    Reviewed-by: Alex Deucher

    Dave Airlie
     

28 Apr, 2011

2 commits

  • EDID 1.4 digital displays report the color spaces they support in the
    features block. Add support for grabbing this data and stuffing it into
    the display_info struct for driver use.

    Signed-off-by: Jesse Barnes
    Reviewed-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Jesse Barnes
     
  • EDID 1.4 digital monitors report the bit depth supported in the input
    field. Add support for parsing this out and storing the info in the
    display_info structure for use by drivers.

    [airlied: tweaked to fix inter-patch dependency]
    Signed-off-by: Jesse Barnes
    Reviewed-by: Adam Jackson
    Signed-off-by: Dave Airlie

    Jesse Barnes
     

08 Apr, 2011

1 commit


01 Apr, 2011

1 commit


31 Mar, 2011

1 commit


23 Feb, 2011

1 commit


07 Feb, 2011

1 commit

  • 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: Dave Airlie

    Dave Airlie
     

26 Jan, 2011

1 commit

  • Iterate over the attached CRTCs, encoders and connectors and call the
    supplied reset vfunc in order to reset any cached state back to unknown.
    Useful after an invalidation event such as a GPU reset or resuming.

    Tested-by: Takashi Iwai
    Signed-off-by: Chris Wilson

    Chris Wilson
     

22 Nov, 2010

1 commit

  • 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, ×tamp).

    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: Mario Kleiner
    Signed-off-by: Dave Airlie

    Mario Kleiner
     

19 Oct, 2010

1 commit


06 Oct, 2010

1 commit


14 Sep, 2010

1 commit


13 Sep, 2010

1 commit

  • Destructive load-detection is very expensive and due to failings
    elsewhere can trigger system wide stalls of up to 600ms. A simple
    first step to correcting this is not to invoke such an expensive
    and destructive load-detection operation automatically.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=29536
    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16265
    Reported-by: Bruno Prémont
    Tested-by: Sitsofe Wheeler
    Signed-off-by: Chris Wilson
    Cc: stable@kernel.org
    Signed-off-by: Dave Airlie

    Chris Wilson
     

13 Aug, 2010

1 commit

  • * 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (55 commits)
    io-mapping: move asm include inside the config option
    vgaarb: drop vga.h include
    drm/radeon: Add probing of clocks from device-tree
    drm/radeon: drop old and broken mesa warning
    drm/radeon: Fix pci_map_page() error checking
    drm: Remove count_lock for calling lastclose() after 58474713 (v2)
    drm/radeon/kms: allow FG_ALPHA_VALUE on r5xx
    drm/radeon/kms: another r6xx/r7xx CS checker fix
    DRM: Replace kmalloc/memset combos with kzalloc
    drm: expand gamma_set
    drm/edid: Split mode lists out to their own header for readability
    drm/edid: Rewrite mode parse to use the generic detailed block walk
    drm/edid: Add detailed block walk for VTB extensions
    drm/edid: Add detailed block walk for CEA extensions
    drm: Remove unused fields from drm_display_info
    drm: Use ENOENT consistently for the error return for an unmatched handle.
    drm/radeon/kms: mark 3D power states as performance
    drm: Only set DPMS once on the CRTC not after every encoder.
    drm/radeon/kms: add additional quirk for Acer rv620 laptop
    drm: Propagate error code from fb_create()
    ...

    Fix up trivial conflicts in drivers/gpu/drm/drm_edid.c

    Linus Torvalds
     

10 Aug, 2010

2 commits


23 Jul, 2010

1 commit

  • Workqueue can now handle high concurrency. Convert drm_crtc_helper to
    use system_nrt_wq instead of slow-work. The conversion is mostly
    straight forward. One difference is that drm_helper_hpd_irq_event()
    no longer blocks and can be called from any context.

    Signed-off-by: Tejun Heo
    Acked-by: David Airlie
    Cc: dri-devel@lists.freedesktop.org

    Tejun Heo
     

18 May, 2010

2 commits

  • Simple cloning rules compared to server:
    (a) single crtc
    (b) > 1 connector active
    (c) check command line mode
    (d) try and find 1024x768 DMT mode if no command line.
    (e) fail to clone

    Signed-off-by: Dave Airlie

    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
    Signed-off-by: Dave Airlie

    Dave Airlie
     

20 Apr, 2010

1 commit

  • * drm-fbdev-cleanup:
    drm/fb: remove drm_fb_helper_setcolreg
    drm/kms/fb: use slow work mechanism for normal hotplug also.
    drm/kms/fb: add polling support for when nothing is connected.
    drm/kms/fb: provide a 1024x768 fbcon if no outputs found.
    drm/kms/fb: separate fbdev connector list from core drm connectors
    drm/kms/fb: move to using fb helper crtc grouping instead of core crtc list
    drm/fb: fix fbdev object model + cleanup properly.

    Conflicts:
    drivers/gpu/drm/i915/i915_drv.h
    drivers/gpu/drm/nouveau/nouveau_drv.h

    Dave Airlie
     

07 Apr, 2010

3 commits

  • This breaks the connection between the core drm connector list
    and the fbdev connector usage, and allows them to become disjoint
    in the future. It also removes the untype void* that was in the
    connector struct to support this.

    All connectors are added to the fbdev now but this could be
    changed in the future.

    Signed-off-by: Dave Airlie

    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: Dave Airlie

    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: Dave Airlie

    Dave Airlie
     

06 Apr, 2010

2 commits

  • Before CVT-R, some monitors would advertise support for an alternative
    GTF formula with lower blanking intervals. Correctly identify such
    monitors, and use the alternative formula when generating modes for
    them.

    Note that we only do this for "standard" timing descriptors (tuples of
    hsize in characters / aspect ratio / vertical refresh). Range-based
    mode lists still only refer to the primary GTF curve. It would be
    possible to do better for the latter case, but monitors are required to
    support the primary curve over the entire advertised range, so all it
    would win you is a lower pixel clock and therefore possibly better image
    quality on analog links.

    Signed-off-by: Adam Jackson
    Signed-off-by: Dave Airlie

    Adam Jackson
     
  • This makes fetching the second EDID block on HDMI monitors actually
    work. DDC can't transfer more than 128 bytes at a time. Also,
    rearrange the code so the pure DDC bits are separate from block parse.

    Signed-off-by: Adam Jackson
    Signed-off-by: Dave Airlie

    Adam Jackson
     

09 Feb, 2010

1 commit

  • Some servers hardcode an edid in rom so that they will
    work properly with KVMs. This is a port of the relevant
    code from the ddx.

    [airlied: reworked to validate edid at boot stage - and
    remove special quirk, if there is a valid EDID in the BIOS rom
    we'll just try and use it.]

    Signed-off-by: Alex Deucher
    Signed-off-by: Dave Airlie

    Alex Deucher
     

08 Dec, 2009

1 commit


04 Dec, 2009

2 commits

  • This commit adds a ioctl and property to allow userspace
    to notify the kernel that a framebuffer has changed. Instead
    of snooping the command stream this allows finer grained
    tracking of which areas have changed.

    The primary user for this functionality is virtual hardware
    like the vmware svga device, but also Xen hardware likes to
    be notify. There is also real hardware like DisplayLink and
    DisplayPort that might take advantage of this ioctl.

    Signed-off-by: Jakob Bornecrantz
    Signed-off-by: Dave Airlie

    Jakob Bornecrantz
     
  • Signed-off-by: Adam Jackson
    Signed-off-by: Dave Airlie

    Adam Jackson
     

02 Dec, 2009

1 commit


19 Nov, 2009

1 commit


18 Nov, 2009

1 commit

  • This adds a page flipping ioctl to the KMS API. The ioctl takes an fb ID
    and a ctrc ID and flips the crtc to the given fb at the next vblank.
    The ioctl returns immediately but the flip doesn't happen until after
    any rendering that's currently queued up against the new framebuffer
    is done. After submitting a page flip, any execbuffer involving the
    old front buffer will block until the flip is completed.

    Optionally, a vblank event can be generated when the swap eventually
    happens.

    Signed-off-by: Kristian Høgsberg
    Reviewed-by: Chris Wilson
    Signed-off-by: Dave Airlie

    Kristian Høgsberg
     

06 Nov, 2009

1 commit


25 Sep, 2009

1 commit

  • [note this requires an fb patch posted to linux-fbdev-devel already]

    This uses the normal video= command line option to control the kms
    output setup at boot time. It is used to override the autodetection
    done by kms.

    video= normally takes a framebuffer as the first parameter, in kms
    it will take a connector name, DVI-I-1, or LVDS-1 etc. If no output
    connector is specified the mode string will apply to all connectors.

    The mode specification used will match down the probed modes, and if
    no mode is found it will add a CVT mode that matches.

    video=1024x768 - all connectors match a 1024x768 mode or add a CVT on
    video=VGA-1:1024x768, VGA-1 connector gets mode only.

    The same strings as used in current fb modedb.c are used, except I've
    added three more letters, e, D, d, e = enable, D = enable Digital,
    d = disable, which allow a connector to be forced into a certain state.

    Signed-off-by: Dave Airlie

    Dave Airlie
     

07 Sep, 2009

1 commit


31 Aug, 2009

1 commit

  • Initially I always meant this code to be shared, but things
    ran away from me before I got to it.

    This refactors the i915 and radeon kms fbdev interaction layers
    out into generic helpers + driver specific pieces.

    It moves all the panic/sysrq enhancements to the core file,
    and stores a linked list of kernel fbs. This could possibly be
    improved to only store the fb which has fbcon on it for panics
    etc.

    radeon retains some specific codes used for a big endian
    workaround.

    changes:
    fix oops in v1
    fix freeing path for crtc_info

    Reviewed-by: Jesse Barnes
    Signed-off-by: Dave Airlie

    Dave Airlie