Don't walk through the delayed delete list completely on each try,
but stop after the first buffer with an unsignaled fence.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
Fix destruction and initalization of "ghost" buffer objects
that are created on pipelined buffer moves.
Reported and suggestions by Jerome Glisse.
Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
Unichrome's don't like small command submissions, so pad the
command stream with dummy data.
Also use 0x40c as pause address register instead of 0x418, as
reading the latter seems to sometimes stall the PCI bus until
the AGP command reader has completed a cycle.
Michel caught a case where we might overwrite a success or other return
value with EBUSY, so check the return value before checking for the
timeout condition.
In some cases, vblank interrupts may be disabled or otherwise broken.
The kernel has a 3s timeout builtin to handle these cases, but the X
server's SIGALM for cursor handling may interrupt vblank wait ioctls,
causing libdrm to restart the ioctl, making the kernel's timeout
useless.
This change tracks time across ioctl restarts and returns EBUSY to the
caller if the expected vblank sequence doesn't occur within 1s of the
first call.
Fixes fdo bz #18041, which is caused by a drmWaitVBlank hanging due to
the corresponding pipe getting disabled (thus preventing further events
from coming in).
The values are really going to continue meaning pipe, not plane, and that's
what they're called in the kernel copy of the header. Userland hasn't ever
made the switch to pipe!=plane, since userland checks are based on DRM
version, which is still stuck at 1.6. However, Mesa did start using
plane[AB] names, so provide a compat define.
Remember tiling mode values provided by appplications, and
record tiling mode when creating a buffer from another application. This
eliminates any need to ask the kernel for tiling values and also makes
reused buffers get the right tiling.
Signed-off-by: Keith Packard <keithp@keithp.com>