11 Jan, 2012

1 commit

  • * 'drm-core-next' of git://people.freedesktop.org/~airlied/linux: (307 commits)
    drm/nouveau/pm: fix build with HWMON off
    gma500: silence gcc warnings in mid_get_vbt_data()
    drm/ttm: fix condition (and vs or)
    drm/radeon: double lock typo in radeon_vm_bo_rmv()
    drm/radeon: use after free in radeon_vm_bo_add()
    drm/sis|via: don't return stack garbage from free_mem ioctl
    drm/radeon/kms: remove pointless CS flags priority struct
    drm/radeon/kms: check if vm is supported in VA ioctl
    drm: introduce drm_can_sleep and use in intel/radeon drivers. (v2)
    radeon: Fix disabling PCI bus mastering on big endian hosts.
    ttm: fix agp since ttm tt rework
    agp: Fix multi-line warning message whitespace
    drm/ttm/dma: Fix accounting error when calling ttm_mem_global_free_page and don't try to free freed pages.
    drm/ttm/dma: Only call set_pages_array_wb when the page is not in WB pool.
    drm/radeon/kms: sync across multiple rings when doing bo moves v3
    drm/radeon/kms: Add support for multi-ring sync in CS ioctl (v2)
    drm/radeon: GPU virtual memory support v22
    drm: make DRM_UNLOCKED ioctls with their own mutex
    drm: no need to hold global mutex for static data
    drm/radeon/benchmark: common modes sweep ignores 640x480@32
    ...

    Fix up trivial conflicts in radeon/evergreen.c and vmwgfx/vmwgfx_kms.c

    Linus Torvalds
     

09 Jan, 2012

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (53 commits)
    Kconfig: acpi: Fix typo in comment.
    misc latin1 to utf8 conversions
    devres: Fix a typo in devm_kfree comment
    btrfs: free-space-cache.c: remove extra semicolon.
    fat: Spelling s/obsolate/obsolete/g
    SCSI, pmcraid: Fix spelling error in a pmcraid_err() call
    tools/power turbostat: update fields in manpage
    mac80211: drop spelling fix
    types.h: fix comment spelling for 'architectures'
    typo fixes: aera -> area, exntension -> extension
    devices.txt: Fix typo of 'VMware'.
    sis900: Fix enum typo 'sis900_rx_bufer_status'
    decompress_bunzip2: remove invalid vi modeline
    treewide: Fix comment and string typo 'bufer'
    hyper-v: Update MAINTAINERS
    treewide: Fix typos in various parts of the kernel, and fix some comments.
    clockevents: drop unknown Kconfig symbol GENERIC_CLOCKEVENTS_MIGR
    gpio: Kconfig: drop unknown symbol 'CS5535_GPIO'
    leds: Kconfig: Fix typo 'D2NET_V2'
    sound: Kconfig: drop unknown symbol ARCH_CLPS7500
    ...

    Fix up trivial conflicts in arch/powerpc/platforms/40x/Kconfig (some new
    kconfig additions, close to removed commented-out old ones)

    Linus Torvalds
     

06 Jan, 2012

1 commit

  • So we have a few places where the drm drivers would like to sleep to
    be nice to the system, mainly in the modesetting paths, but we also
    have two cases were atomic modesetting must take place, panic writing
    and kernel debugger. So provide a central inline to determine if a
    sleep or delay should be used and use this in the intel and radeon drivers.

    v2: drop intel_drv.h MSLEEP macro, nobody uses it.

    Based on patch from Michel Dänzer

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43941

    Reviewed-by: Daniel Vetter
    Signed-off-by: Dave Airlie

    Dave Airlie
     

05 Jan, 2012

1 commit

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

    Rob Clark
     

04 Jan, 2012

17 commits

  • If it failed, leave it in the "off" state.

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

    Jesse Barnes
     
  • If a PCH pipe PLL is being used by transcoder C, don't disable it.

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

    Jesse Barnes
     
  • In the pre-gem days with non-existing hangcheck and gpu reset code,
    this timeout of 3 seconds was pretty important to avoid stuck
    processes.

    But now we have the hangcheck code in gem that goes to great length
    to ensure that the gpu is really dead before declaring it wedged.

    So there's no need for this timeout anymore. Actually it's even harmful
    because we can bail out too early (e.g. with xscreensaver slip)
    when running giant batchbuffers. And our code isn't robust enough
    to properly unroll any state-changes, we pretty much rely on the gpu
    reset code cleaning up the mess (like cache tracking, fencing state,
    active list/request tracking, ...).

    With this change intel_begin_ring can only fail when the gpu is
    wedged, and it will return -EAGAIN (like wait_request in case the
    gpu reset is still outstanding).

    v2: Chris Wilson noted that on resume timers aren't running and hence
    we won't ever get kicked out of this loop by the hangcheck code. Use
    an insanely large timeout instead for the HAS_GEM case to prevent
    resume bugs from totally hanging the machine.

    Signed-off-by: Daniel Vetter
    Reviewed-by: Chris Wilson
    Acked-by: Ben Widawsky
    Reviewed-by: Eugeni Dodonov
    Signed-off-by: Keith Packard

    Daniel Vetter
     
  • If our semaphore logic gets confused and we have a ring stuck waiting
    for one, there's a decent chance it'll just execute garbage when being
    kicked. Also, kicking the ring obscures the place where the error
    first occured, making error_state decoding much harder.

    So drop this an let gpu reset handle this mess in a clean fashion.

    In contrast, kicking rings stuck on MI_WAIT is rather harmless, at
    worst there'll be a bit of screen-flickering. There's also old
    broken userspace out there which needs this as a work-around.

    Signed-off-by: Daniel Vetter
    Reviewed-by: Chris Wilson
    Reviewed-by: Ben Widawsky
    Signed-off-by: Keith Packard

    Daniel Vetter
     
  • These registers are automatically incremented by the hardware during
    transform feedback to track where the next streamed vertex output
    should go. Unlike the previous generation, which had a packet for
    setting the corresponding registers to a defined value, gen7 only has
    MI_LOAD_REGISTER_IMM to do so. That's a secure packet (since it loads
    an arbitrary register), so we need to do it from the kernel, and it
    needs to be settable atomically with the batchbuffer execution so that
    two clients doing transform feedback don't stomp on each others'
    state.

    Instead of building a more complicated interface involcing setting the
    registers to a specific value, just set them to 0 when asked and
    userland can tweak its pointers accordingly.

    Signed-off-by: Eric Anholt
    Reviewed-by: Eugeni Dodonov
    Reviewed-by: Kenneth Graunke
    Signed-off-by: Keith Packard

    Eric Anholt
     
  • The waits we do here are generally so short that sleeping is a bad
    idea unless we have an IRQ to wake us up. Improves regression test
    performance from 18 minutes to 3.5 minutes on gen7, which is now
    consistent with the previous generation.

    Signed-off-by: Eric Anholt
    Tested-by: Eugeni Dodonov
    Reviewed-by: Eugeni Dodonov
    Acked-by: Kenneth Graunke
    Signed-off-by: Keith Packard

    Eric Anholt
     
  • Previous to this commit, testing easily reproduced a failure where the
    seqno would apparently arrive after the IRQ associated with it, with test programs as simple as:

    for (;;) {
    glCopyPixels(0, 0, 1, 1);
    glFinish();
    }

    Various workarounds we've seen for previous generations didn't work to
    fix this issue, so until new information comes in, replace the IRQ
    waits on the BLT ring with polling.

    Signed-off-by: Eric Anholt
    Tested-by: Eugeni Dodonov
    Reviewed-by: Eugeni Dodonov
    Acked-by: Kenneth Graunke
    Signed-off-by: Keith Packard

    Eric Anholt
     
  • As a workaround for IRQ synchronization issues in the gen7 BLT ring,
    we want to turn the two wait functions into polling loops.

    Signed-off-by: Eric Anholt
    Tested-by: Eugeni Dodonov
    Reviewed-by: Eugeni Dodonov
    Acked-by: Kenneth Graunke
    Signed-off-by: Keith Packard

    Eric Anholt
     
  • They don't fix our problems alone, but we're told to set them.

    Signed-off-by: Eric Anholt
    Signed-off-by: Keith Packard

    Eric Anholt
     
  • Add new ioctls for getting and setting the current destination color
    key. This allows for simple overlay display control by matching a color
    key value in the primary plane before blending the overlay on top.

    v2: remove unnecessary mutex acquire/release around reg accesses
    v3: add support for full color key management
    v4: fix copy & paste bug in snb_get_colorkey
    don't bother checking min/max values against docs as the docs are likely
    wrong (how could we handle 10bpc surface formats?)

    Reviewed-by: Daniel Vetter
    Signed-off-by: Jesse Barnes

    Jesse Barnes
     
  • To save power when the sprite is full screen, we can disable the primary
    plane on the same pipe. Track the sprite status and enable/disable the
    primary opportunistically.

    v2: remove primary plane enable/disable hooks; they're identical

    Reviewed-by: Daniel Vetter
    Signed-off-by: Jesse Barnes
    Signed-off-by: Keith Packard

    Jesse Barnes
     
  • The video sprites support various video surface formats natively and can
    handle scaling as well. So add support for them using the new DRM core
    sprite support functions.

    v2: use drm specific fourcc header and defines
    v3: address Daniel's comments:
    - don't take struct mutex around register access (only needed for
    regs in the GT power well)
    - don't hold struct mutex across vblank waits
    - fix up update_plane API (pass obj instead of GTT offset)
    - add interlaced defines for sprite regs
    - drop unnecessary 'reg' variables
    - comment double buffered reg flushing
    Also fix w/h confusion when writing the scaling reg.
    v4: more fixes, address more comments from Daniel, and include Hai's fix
    - prevent divide by zero in scaling calculation (Hai Lan)
    - update to Ville's new DRM_FORMAT_* types
    - fix sprite watermark handling (calc based on CRTC size, separate
    from normal display wm)
    - remove private refcounts now that the fb cleanups handles things
    v5: add linear surface support
    v6: remove color key clearing & setting from update_plane

    For this version, I tested DPMS since it came up in the last review;
    DPMS off/on works ok when a video player is working under X, but for
    power saving we'll probably want to do something smarter. I'll leave
    that for a separate patch on top. Likewise with the refcounting/fb
    layer handling, which are really separate cleanups.

    Reviewed-by: Daniel Vetter
    Signed-off-by: Jesse Barnes
    Signed-off-by: Keith Packard

    Jesse Barnes
     
  • We learned that the ECOBUS register was inside the GT power well, and
    so *did* need force wake to be read, so it gets removed from the list
    of 'doesn't need force wake' registers.

    That means the code reading ECOBUS after forcing the mt_force_wake
    function to be called needs to use I915_READ_NOTRACE; it doesn't need
    to do more force wake fun as it's already done it manually.

    This also adds a comment explaining why the MT forcewake testing code
    only needs to call mt_forcewake_get/put and not disable RC6 manually
    -- the ECOBUS read will return 0 if the device is in RC6 and isn't
    using MT forcewake, causing the test to work correctly.

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

    Keith Packard
     
  • Many of the old fields from Ironlake have gone away. Strip all those
    fields, and try to update to fields people care about. RC information
    isn't exactly ideal anymore. All we can guarantee when we read the
    register is that we're not using forcewake, ie. the software isn't
    forcing the hardware to stay awake. The downside is that in doing this
    we may wait a while and that causes an unnaturally idle state on the
    GPU.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42578
    Signed-off-by: Ben Widawsky
    Reviewed-by: Jesse Barnes
    Signed-off-by: Keith Packard

    Ben Widawsky
     
  • This matches the modern specs more accurately.

    This will be used by the following patch to fix the way we display RC
    status.

    Signed-off-by: Ben Widawsky
    Reviewed-by: Jesse Barnes
    Reviewed-by: Eugeni Dodonov
    Signed-off-by: Keith Packard

    Ben Widawsky
     
  • The docs say this is required for Gen7, and since the bit was added for
    Gen6, we are also setting it there pit pf paranoia. Particularly as
    Chris points out, if PIPE_CONTROL counts as a 3d state packet.

    This was found through doc inspection by Ken and applies to Gen6+;

    Reported-by: Kenneth Graunke
    Signed-off-by: Ben Widawsky
    Reviewed-by: Chris Wilson
    Reviewed-by: Daniel Vetter
    Reviewed-by: Eric Anholt
    Signed-off-by: Keith Packard

    Ben Widawsky
     
  • dev_priv keeps track of the current addressing mode that gets set at
    execbuffer time. Unfortunately the existing code was doing this before
    acquiring struct_mutex which leaves a race with another thread also
    doing an execbuffer. If that wasn't bad enough, relocate_slow drops
    struct_mutex which opens a much more likely error where another thread
    comes in and modifies the state while relocate_slow is being slow.

    The solution here is to just defer setting this state until we
    absolutely need it, and we know we'll have struct_mutex for the
    remainder of our code path.

    v2: Keith noticed a bug in the original patch.

    Signed-off-by: Ben Widawsky
    Reviewed-by: Daniel Vetter
    Signed-off-by: Keith Packard

    Ben Widawsky
     

03 Jan, 2012

1 commit


02 Jan, 2012

1 commit


27 Dec, 2011

2 commits

  • RC6 fails again.

    > I found my system freeze mostly during starting up X and KDE. Sometimes it
    > works for some minutes, sometimes it freezes immediatly. When the freeze
    > happens, everything is dead (even the reset button does not work, I need to
    > power cycle).

    > I disabled RC6, and my system runs wonderfully.

    > The system is a Z68 Pro board with Sandybridge i5-2500K processor, 8
    > GB of RAM and UEFI firmware.

    Reported-by: Kai Krakow
    Signed-off-by: Keith Packard
    Signed-off-by: Linus Torvalds

    Keith Packard
     
  • Semaphores still cause problems on some machines:

    > From Udo Steinberg:
    >
    > With Linux-3.2-rc6 I'm frequently seeing GPU hangs when large amounts of
    > text scroll in an xterm, such as when extracting a tar archive. Such as this
    > one (note the timestamps):
    >
    > I can reproduce it fairly easily with something
    > as simple as:
    >
    > while true; do dmesg; done

    This patch turns them off on SNB while leaving them on for IVB.

    Reported-by: Udo Steinberg
    Cc: Daniel Vetter
    Cc: Eugeni Dodonov
    Signed-off-by: Keith Packard
    Signed-off-by: Linus Torvalds

    Keith Packard
     

20 Dec, 2011

9 commits

  • Merge in the upstream tree to bring in the mainline fixes.

    Conflicts:
    drivers/gpu/drm/exynos/exynos_drm_fbdev.c
    drivers/gpu/drm/nouveau/nouveau_sgdma.c

    Dave Airlie
     
  • Otherwise each driver would need to keep the information inside
    their own framebuffer object structure. Also add offsets[]. BOs
    on the other hand are driver specific, so those can be kept in
    driver specific structures.

    Signed-off-by: Ville Syrjälä
    Signed-off-by: Dave Airlie

    Ville Syrjälä
     
  • My EFI BIOS starts the graphics card up in my projector's preferred EDID
    mode, 1080@60i. The Intel driver does not clear all the interlaced bits.

    This patch introduces a new PIPECONF_INTERLACE_MASK define and uses it
    to restore progressive mode.

    Signed-of-by: Christian Schmidt
    Reviewed-by: Chris Wilson
    Signed-off-by: Dave Airlie

    Christian Schmidt
     
  • Otherwise hangcheck spuriously fires when running blitter/bsd-only
    workloads.

    Contrary to a similar patch by Ben Widawsky this does not check
    INSTDONE of the other rings. Chris Wilson implied that in a failure to
    detect a hang, most likely because INSTDONE was fluctuating. Thus only
    check ACTHD, which as far as I know is rather reliable. Also, blitter
    and bsd rings can't launch complex tasks from a single instruction
    (like 3D_PRIM on the render with complex or even infinite shaders).

    This fixes spurious gpu hang detection when running
    tests/gem_hangcheck_forcewake on snb/ivb.

    Signed-Off-by: Daniel Vetter
    Reviewed-by: Chris Wilson
    Signed-off-by: Keith Packard

    Daniel Vetter
     
  • On DP monitor hot remove, clear DP_AUDIO_OUTPUT_ENABLE accordingly,
    so that the audio driver will receive hot plug events and take action
    to refresh its device state and ELD contents.

    Note that the DP_AUDIO_OUTPUT_ENABLE bit may be enabled or disabled
    only when the link training is complete and set to "Normal".

    Tested OK for both hot plug/remove and DPMS on/off.

    Signed-off-by: Wu Fengguang
    Signed-off-by: Keith Packard

    Wu Fengguang
     
  • On HDMI monitor hot remove, clear SDVO_AUDIO_ENABLE accordingly, so that
    the audio driver will receive hot plug events and take action to refresh
    its device state and ELD contents.

    The cleared SDVO_AUDIO_ENABLE bit needs to be restored to prevent losing
    HDMI audio after DPMS on.

    CC: Wang Zhenyu
    Signed-off-by: Wu Fengguang
    Signed-off-by: Keith Packard

    Wu Fengguang
     
  • The ELD may or may not change when switching the video mode.
    If unchanged, don't trigger hot plug events to HDMI audio driver.

    This avoids disturbing the user with repeated printks.

    Reported-by: Nick Bowler
    Signed-off-by: Wu Fengguang
    Signed-off-by: Keith Packard

    Wu Fengguang
     
  • Change the definitions from GEN5 to IBX as they aren't in the CPU and
    some SNB systems actually shipped with IBX chipsets (or, at least that's
    a supported configuration).

    The GEN7_* register addresses actually take effect since GEN6 and should
    be prefixed by CPT, the PCH code name.

    Suggested-by: Keith Packard
    Signed-off-by: Wu Fengguang
    Signed-off-by: Keith Packard

    Wu Fengguang
     
  • SandyBridge should be using the same register addresses as IvyBridge.

    Signed-off-by: Wu Fengguang
    Signed-off-by: Keith Packard

    Wu Fengguang
     

17 Dec, 2011

6 commits

  • This reverts commit eb1711bb94991e93669c5a1b5f84f11be2d51ea1.

    It blows up the i915 seqno tracking, resulting in the

    BUG_ON(seqno == 0);

    in i915_wait_request() triggering, which will cause lock-ups.

    See for example
    https://bugs.launchpad.net/ubuntu/+source/linux/+bug/903010
    https://lkml.org/lkml/2011/12/14/395

    Reported-requested-and-tested-by: Dirk Hohndel
    Reported-by: Richard Eames
    Reported-by: Rocko Requin
    Acked-by: Daniel Vetter
    Cc: Dave Airlie
    Cc: Chris Wilson
    Cc: Keith Packard
    Cc: Eric Anholt
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * 'drm-intel-fixes' of git://people.freedesktop.org/~keithp/linux:
    drm/i915/dp: Dither down to 6bpc if it makes the mode fit
    drm/i915: enable semaphores on per-device defaults
    drm/i915: don't set unpin_work if vblank_get fails
    drm/i915: By default, enable RC6 on IVB and SNB when reasonable
    iommu: Export intel_iommu_enabled to signal when iommu is in use
    drm/i915/sdvo: Include LVDS panels for the IS_DIGITAL check
    drm/i915: prevent division by zero when asking for chipset power
    drm/i915: add PCH info to i915_capabilities
    drm/i915: set the right SDVO transcoder for CPT
    drm/i915: no-lvds quirk for ASUS AT5NM10T-I
    drm/i915: Treat pre-gen4 backlight duty cycle value consistently
    drm/i915: Hook up Ivybridge eDP
    drm/i915: add multi-threaded forcewake support

    Linus Torvalds
     
  • Some active adaptors (VGA usually) only have two lanes at 2.7GHz.
    That's a maximum pixel clock of 144MHz at 8bpc, but 192MHz at 6bpc.

    Fixes Asus UX31 panel being black at startup due to no valid modes since
    dc22ee6fc18ce0f15424e753e8473c306ece95c1.

    v2: Rebased to current code, resulting in the fix applying to EDP panels as
    well. Also changed from spatio-temporal to just spatial dithering on
    pre-ironlake, to be conssitent (and less visual flicker)

    Signed-off-by: Adam Jackson
    Signed-off-by: Eric Anholt
    Tested-by: Eric Anholt
    Tested-by: Dirk Hohndel
    Signed-off-by: Keith Packard

    Adam Jackson
     
  • This adds a default setting for semaphores parameter, and enables
    semaphores by default on IVB.

    For now, as semaphores interaction with VTd causes random issues on
    SNB, we do not enable them by default. But they can still be enabled
    via the semaphores=1 kernel parameter.

    v2: enables semaphores on SNB when IO remapping is disabled, with base
    on Keith Packard patch.

    CC: Daniel Vetter
    CC: Ben Widawsky
    CC: Keith Packard
    CC: Jesse Barnes
    CC: Chris Wilson
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42696
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40564
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41353
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38862
    Reviewed-by: Chris Wilson
    Reviewed-by: Daniel Vetter
    Signed-off-by: Eugeni Dodonov
    Signed-off-by: Keith Packard

    Eugeni Dodonov
     
  • This fixes a race where we may try to finish a page flip and decrement
    the refcount even if our vblank_get failed and we ended up with a
    spurious flip pending interrupt.

    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=34211.

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

    Jesse Barnes
     
  • RC6 should always work on IVB, and should work on SNB whenever IO
    remapping is disabled. RC6 never works on Ironlake. Make the default
    value for the parameter follow these guidelines. Setting the value
    to either 0 or 1 will force the specified behavior.

    Signed-off-by: Keith Packard
    Reviewed-by: Kenneth Graunke
    Reviewed-by: Eugeni Dodonov
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38567
    Cc: Ted Phelps
    Cc: Peter
    Cc: Lukas Hejtmanek
    Cc: Andrew Lutomirski

    Keith Packard