[PATCH 2/5] drm/nouveau: add reservation to nouveau_gem_ioctl_cpu_prep

Maarten Lankhorst maarten.lankhorst at canonical.com
Tue Jan 21 07:29:22 PST 2014


Hey,

op 21-01-14 16:17, Thomas Hellstrom schreef:
> Maarten, for this and the other patches in this series,
>
> I seem to recall we have this discussion before?
> IIRC I stated that reservation was a too heavy-weight lock to hold to
> determine whether a buffer was idle? It's a pretty nasty thing to build in.
>
I've sent this patch after determining that this already didn't end up being heavyweight.
Most places were already using the fence_lock and reservation, I just fixed up the few
places that didn't hold a reservation while waiting. Converting the few places that didn't
ended up being trivial, so I thought I'd submit it.

If a tryreserve fails it's a good indication that the buffer is NOT idle, no need to check the
fences too in that case.

I ended up converting this so I could use shared/exclusive fence slots internally in nouveau,
allowing multiple readers to access the buffers in parallel. See commit
"drm/nouveau: first stab at using shared fences for readable objects" at
http://cgit.freedesktop.org/~mlankhorst/linux/log/

But doing this required killing fence_lock.

~Maarten


More information about the dri-devel mailing list