lkml.org 
[lkml]   [2012]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[ 21/66] drm/i915: fix overlay on i830M
    Date
    3.6-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Daniel Vetter <daniel.vetter@ffwll.ch>

    commit a9193983f4f292a82a00c72971c17ec0ee8c6c15 upstream.

    The overlay on the i830M has a peculiar failure mode: It works the
    first time around after boot-up, but consistenly hangs the second time
    it's used.

    Chris Wilson has dug out a nice errata:

    "1.5.12 Clock Gating Disable for Display Register
    Address Offset: 06200h–06203h

    "Bit 3
    Ovrunit Clock Gating Disable.
    0 = Clock gating controlled by unit enabling logic
    1 = Disable clock gating function
    DevALM Errata ALM049: Overlay Clock Gating Must be Disabled: Overlay
    & L2 Cache clock gating must be disabled in order to prevent device
    hangs when turning off overlay.SW must turn off Ovrunit clock gating
    (6200h) and L2 Cache clock gating (C8h)."

    Now I've nowhere found that 0xc8 register and hence couldn't apply the
    l2 cache workaround. But I've remembered that part of the magic that
    the OVERLAY_ON/OFF commands are supposed to do is to rearrange cache
    allocations so that the overlay scaler has some scratch space.

    And while pondering how that could explain the hang the 2nd time we
    enable the overlay, I've remembered that the old ums overlay code did
    _not_ issue the OVERLAY_OFF cmd.

    And indeed, disabling the OFF cmd results in the overlay working
    flawlessly, so I guess we can workaround the lack of the above
    workaround by simply never disabling the overlay engine once it's
    enabled.

    Note that we have the first part of the above w/a already implemented
    in i830_init_clock_gating - leave that as-is to avoid surprises.

    v2: Add a comment in the code.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47827
    Tested-by: Rhys <rhyspuk@gmail.com>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/gpu/drm/i915/intel_overlay.c | 14 +++++++++++---
    1 file changed, 11 insertions(+), 3 deletions(-)

    --- a/drivers/gpu/drm/i915/intel_overlay.c
    +++ b/drivers/gpu/drm/i915/intel_overlay.c
    @@ -431,9 +431,17 @@ static int intel_overlay_off(struct inte
    intel_ring_emit(ring, flip_addr);
    intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
    /* turn overlay off */
    - intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_OFF);
    - intel_ring_emit(ring, flip_addr);
    - intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
    + if (IS_I830(dev)) {
    + /* Workaround: Don't disable the overlay fully, since otherwise
    + * it dies on the next OVERLAY_ON cmd. */
    + intel_ring_emit(ring, MI_NOOP);
    + intel_ring_emit(ring, MI_NOOP);
    + intel_ring_emit(ring, MI_NOOP);
    + } else {
    + intel_ring_emit(ring, MI_OVERLAY_FLIP | MI_OVERLAY_OFF);
    + intel_ring_emit(ring, flip_addr);
    + intel_ring_emit(ring, MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
    + }
    intel_ring_advance(ring);

    return intel_overlay_do_wait_request(overlay, request,

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2012-11-15 06:22    [W:8.648 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site