[Spice-devel] [PATCH qxl-win v3] display: add FlushRelease and FlushSurfaces for alternative V06 (2) revision implementation

Yonit Halperin yhalperi at redhat.com
Sat Jul 9 22:39:55 PDT 2011


On 07/07/2011 12:43 PM, Alon Levy wrote:
> ---
>   display/driver.c |   44 ++++++++++++++++++++++++++++++++++++++++++--
>   1 files changed, 42 insertions(+), 2 deletions(-)
>
> diff --git a/display/driver.c b/display/driver.c
> index fff462d..e77e32f 100644
> --- a/display/driver.c
> +++ b/display/driver.c
> @@ -958,13 +958,53 @@ VOID DrvDisableSurface(DHPDEV in_pdev)
>       DEBUG_PRINT((pdev, 1, "%s: 0x%lx exit\n", __FUNCTION__, pdev));
>   }
>
> +static void FlushSurfaces(PDev *pdev)
> +{
> +    UINT32 surface_id;
> +    SurfaceInfo *surface_info;
> +    SURFOBJ *surf_obj;
> +    RECTL area = {0, 0, 0, 0};
> +
> +    if (pdev->pci_revision<  QXL_REVISION_STABLE_V10) {
> +        DEBUG_PRINT((pdev, 1, "%s: revision too old for QXL_IO_FLUSH_SURFACES", __FUNCTION__));
> +        for (surface_id = pdev->n_surfaces - 1 ; surface_id>  0 ; --surface_id) {
> +            surface_info = GetSurfaceInfo(pdev, surface_id);
> +            if (!surface_info->draw_area.base_mem) {
> +                continue;
> +            }
> +            surf_obj = surface_info->draw_area.surf_obj;
> +            if (!surf_obj) {
> +                continue;
> +            }
> +            area.right = surf_obj->sizlBitmap.cx;
> +            area.bottom = surf_obj->sizlBitmap.cy;
> +            UpdateArea(pdev,&area, surface_id);
> +        }
> +    } else {
> +        WRITE_PORT_UCHAR(pdev->flush_surfaces_port, 0);
> +    }
> +}
> +static void FlushRelease(PDev *pdev)
> +{
> +    if (pdev->pci_revision<  QXL_REVISION_STABLE_V10) {
> +        DEBUG_PRINT((pdev, 1, "%s: revision too old for QXL_IO_FLUSH_RELEASE", __FUNCTION__));
> +        // ooming a few times causes the server to flush
> +        // all releasable resources
> +        WRITE_PORT_UCHAR(pdev->notify_oom_port, 0);
> +        WRITE_PORT_UCHAR(pdev->notify_oom_port, 0);
> +        WRITE_PORT_UCHAR(pdev->notify_oom_port, 0);
Hi,
since OOM is asynchronic, you should wait to display_event (first 
SPICE_RING_CONS_WAIT on the release ring and then waiting on 
display_event). Also, only one OOM call sould be enough, since all the 
resources were already released by the wroker, and one OOM makes it 
flush the release ring.

Cheers,
Yonit.



More information about the Spice-devel mailing list