Andreas Beck wrote:
> It just polls the accelIdle bit and waits for it to come up while the ioctl
> is still running.
Alternatively, some cards can also send an interrupt when the accel
engine has finished, no ? (But you need to protect the critical
section whatsoever.)
> On SMP machines, you will have to put an explicit lock there. This needs
> some support in the kernel. The IMHO best implementation would be to
> unmap the framebuffer for _all_ processes while an accel is running.
>
> However this has a serious performance impact. Another possibility would be
> to influence the scheduler to make sure only one process that accesses
> /dev/gfx would run during this operation.
Why not use a kernel lock here then? IMHO there should exist already
some way to control this: setting up a mutex (0/1 semaphore) or lock
associated to the framebuffer. HW accelerated operations would acquire
the lock (on behalf of the hw engine that surely cannot do it itself)
and release it when it is idle (this can be done via interrupt notification).
Normal MMIO operations should also acquire this lock IMO. (Maybe this
is where there is a potential problem? There is no way to set up
semaphore control for shared-MMIO areas?)
Isn't this possible? [We are in the usual case of mutual exclusion
so, I'm turning towards conventional mechanism - but I don't know if
they are really applicable.]
Rodolphe