[Spice-devel] [PATCH] asynchronous io port support (introduced in revision 3 of qxl device)
yhalperi
yhalperi at redhat.com
Tue Jun 28 00:19:28 PDT 2011
On 06/23/2011 09:13 PM, Alon Levy wrote:
Hi,
> +static _inline void async_io(PDev *pdev, PUCHAR async, PUCHAR sync, UCHAR val)
Instead of two parameters, one for async and one for sync, I prefer one
parameter - an enum for the action, and then async_io can choose the
right port.
> +{
> + if (pdev->pci_revision>= QXL_REVISION_STABLE_V10) {
> + WRITE_PORT_UCHAR(async, val);
> + WAIT_FOR_EVENT(pdev, pdev->io_cmd_event, NULL);
> + DEBUG_PRINT((pdev, 3, "finished async %d\n", (int)async));
I think that the writing to the async port and the waiting should be
protected by a semaphore (what happens when two threads wait for the
same io_cmd_event, but for different async calls).
> + } else {
> + WRITE_PORT_UCHAR(sync, val);
> + }
> +}
> +
> }
>
> + if ((status = VideoPortCreateEvent(dev_ext, 0, NULL,&io_cmd_event)) != NO_ERROR) {
:g> + DEBUG_PRINT((dev_ext, 0, "%s: create cursor event failed
%lu\n",
message is incorrect
> + __FUNCTION__, status));
More information about the Spice-devel
mailing list