[PATCH 3/6] drm/i915: Don't emit semaphore wait if wrap happened

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

2012/12/4 Mika Kuoppala <mika.kuoppala at linux.intel.com>:
> If wrap just happened we need to prevent emitting waits for
> pre wrap values. Detect this and emit no-ops instead.
>
> v2: Use olr > seqno to detect wrap instead of *seqno == 0
> as suggested by Chris Wilson.

This commit introduces a bug on Haswell. Now when I'm typing my
password on GDM the screen keeps doing wrong rendering. It "blinks
blue". After logging in I don't see more problems.

>
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ringbuffer.c |   21 ++++++++++++++++-----
>  1 file changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index 36e1e13a..2305af5 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -626,11 +626,22 @@ gen6_ring_sync(struct intel_ring_buffer *waiter,
>         if (ret)
>                 return ret;
>
> -       intel_ring_emit(waiter,
> -                       dw1 | signaller->semaphore_register[waiter->id]);
> -       intel_ring_emit(waiter, seqno);
> -       intel_ring_emit(waiter, 0);
> -       intel_ring_emit(waiter, MI_NOOP);
> +       BUG_ON(!waiter->outstanding_lazy_request);
> +
> +       /* If seqno wrap happened, omit the wait with no-ops */
> +       if (likely(waiter->outstanding_lazy_request > seqno)) {
> +               intel_ring_emit(waiter,
> +                               dw1 |
> +                               signaller->semaphore_register[waiter->id]);
> +               intel_ring_emit(waiter, seqno);
> +               intel_ring_emit(waiter, 0);
> +               intel_ring_emit(waiter, MI_NOOP);
> +       } else {
> +               intel_ring_emit(waiter, MI_NOOP);
> +               intel_ring_emit(waiter, MI_NOOP);
> +               intel_ring_emit(waiter, MI_NOOP);
> +               intel_ring_emit(waiter, MI_NOOP);
> +       }
>         intel_ring_advance(waiter);
>
>         return 0;
> --
> 1.7.9.5
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux