[PATCH] xf86: call enter/leave VT for gpu screens as well

Alex Deucher alexdeucher at gmail.com
Mon Sep 3 06:43:45 PDT 2012


On Mon, Sep 3, 2012 at 1:10 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> Otherwise we can't do fast user switch properly for multiple GPUs.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  hw/xfree86/common/xf86Events.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
> index 47429ec..3ad34b5 100644
> --- a/hw/xfree86/common/xf86Events.c
> +++ b/hw/xfree86/common/xf86Events.c
> @@ -460,6 +460,8 @@ xf86VTSwitch(void)
>          OsBlockSIGIO();
>          for (i = 0; i < xf86NumScreens; i++)
>              xf86Screens[i]->LeaveVT(xf86Screens[i]);
> +        for (i = 0; i < xf86NumGPUScreens; i++)
> +            xf86GPUScreens[i]->LeaveVT(xf86GPUScreens[i]);
>
>          xf86AccessLeave();      /* We need this here, otherwise */
>
> @@ -474,6 +476,10 @@ xf86VTSwitch(void)
>                  if (!xf86Screens[i]->EnterVT(xf86Screens[i]))
>                      FatalError("EnterVT failed for screen %d\n", i);
>              }
> +            for (i = 0; i < xf86NumGPUScreens; i++) {
> +                if (!xf86GPUScreens[i]->EnterVT(xf86GPUScreens[i]))
> +                    FatalError("EnterVT failed for gpu screen %d\n", i);
> +            }
>              if (!(dispatchException & DE_TERMINATE)) {
>                  for (i = 0; i < xf86NumScreens; i++) {
>                      if (xf86Screens[i]->EnableDisableFBAccess)
> @@ -530,6 +536,11 @@ xf86VTSwitch(void)
>              if (!xf86Screens[i]->EnterVT(xf86Screens[i]))
>                  FatalError("EnterVT failed for screen %d\n", i);
>          }
> +        for (i = 0; i < xf86NumGPUScreens; i++) {
> +            xf86GPUScreens[i]->vtSema = TRUE;
> +            if (!xf86GPUScreens[i]->EnterVT(xf86GPUScreens[i]))
> +                FatalError("EnterVT failed for gpu screen %d\n", i);
> +        }
>          for (i = 0; i < xf86NumScreens; i++) {
>              if (xf86Screens[i]->EnableDisableFBAccess)
>                  (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
> --
> 1.7.10.2
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel


More information about the xorg-devel mailing list