[Spice-devel] [qxl-win PATCH] display: add punting where it is missing

Yonit Halperin yhalperi at redhat.com
Mon Jul 29 08:17:50 PDT 2013


Ack
On 07/26/2013 02:43 PM, Alon Levy wrote:
> ---
>   display/brush.c   | 4 +++-
>   display/driver.c  | 2 ++
>   display/pointer.c | 8 ++++++++
>   3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/display/brush.c b/display/brush.c
> index 0b9400d..fe94f1c 100644
> --- a/display/brush.c
> +++ b/display/brush.c
> @@ -235,10 +235,12 @@ BOOL APIENTRY DrvRealizeBrush(BRUSHOBJ *brush, SURFOBJ *target, SURFOBJ *pattern
>       int size;
>
>       if (!(pdev = (PDev *)target->dhpdev)) {
> -        ASSERT(NULL, 0);
> +        DEBUG_PRINT((NULL, 0, "%s: err no pdev\n", __FUNCTION__));
>           return FALSE;
>       }
>
> +    PUNT_IF_DISABLED(pdev);
> +
>       DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
>
>       if (mask) {
> diff --git a/display/driver.c b/display/driver.c
> index d7fdbf7..b8050de 100644
> --- a/display/driver.c
> +++ b/display/driver.c
> @@ -1414,6 +1414,8 @@ HBITMAP APIENTRY DrvCreateDeviceBitmap(DHPDEV dhpdev, SIZEL size, ULONG format)
>
>       pdev = (PDev *)dhpdev;
>
> +    PUNT_IF_DISABLED(pdev);
> +
>       if (!pdev->create_non_primary_surfaces) {
>           return FALSE;
>       }
> diff --git a/display/pointer.c b/display/pointer.c
> index d38a207..17fa3c5 100644
> --- a/display/pointer.c
> +++ b/display/pointer.c
> @@ -43,6 +43,8 @@ ULONG APIENTRY DrvSetPointerShape(SURFOBJ *surf, SURFOBJ *mask, SURFOBJ *color_p
>           return SPS_ERROR;
>       }
>
> +    PUNT_IF_DISABLED(pdev);
> +
>       DEBUG_PRINT((pdev, 3, "%s\n", __FUNCTION__));
>
>       if (flags & SPS_CHANGE) {
> @@ -129,6 +131,12 @@ VOID APIENTRY DrvMovePointer(SURFOBJ *surf, LONG pos_x, LONG pos_y, RECTL *area)
>           return;
>       }
>
> +    if (!pdev->enabled) {
> +        DEBUG_PRINT((pdev, 3, "%s: ignoring when device is disabled\n",
> +                    __FUNCTION__));
> +        return;
> +    }
> +
>       cursor_cmd = CursorCmd(pdev);
>       if (pos_x < 0) {
>           cursor_cmd->type = QXL_CURSOR_HIDE;
>



More information about the Spice-devel mailing list