[Spice-devel] [PATCH] asynchronous io port support (introduced in revision 3 of qxl device)

Alon Levy alevy at redhat.com
Tue Jun 28 03:39:34 PDT 2011


On Tue, Jun 28, 2011 at 10:19:28AM +0300, yhalperi wrote:
> 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.

ok, I'll do that.

> >+{
> >+    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).

right, will do.

> >+    } 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
ok, will fix.

> >+                     __FUNCTION__, status));


More information about the Spice-devel mailing list