[PATCH 2/3] Close GPU screens before core screens

Dave Airlie airlied at gmail.com
Sun Aug 12 17:50:41 PDT 2012


On Wed, Aug 8, 2012 at 10:49 AM, Keith Packard <keithp at keithp.com> wrote:
> This should make cleaning up the GPU screens easier as the core
> screens they are associated with will still be around.

Yeah sounds likely, I just felt the symmetry was off doing this going forward,

when we move to all screens being gpu screens and the core screen
being protocol only, then the init is

gpu, gpu, protocol, and teardown would be gpu, gpu, protocol, which
feels wrong to me, but I've no objections to doing this now, and maybe
for 1.14 I'll find the symmetry needs to be protocol, gpu, gpu at init
instead.

Reviewed-by: Dave Airlie <airlied at redhat.com>

>
> Signed-off-by: Keith Packard <keithp at keithp.com>
> ---
>  dix/main.c |   18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/dix/main.c b/dix/main.c
> index 42f517d..fb935c9 100644
> --- a/dix/main.c
> +++ b/dix/main.c
> @@ -331,6 +331,15 @@ main(int argc, char *argv[], char *envp[])
>
>          CloseDownEvents();
>
> +        for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) {
> +            ScreenPtr pScreen = screenInfo.gpuscreens[i];
> +            FreeScratchPixmapsForScreen(pScreen);
> +            (*pScreen->CloseScreen) (pScreen);
> +            dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
> +            free(pScreen);
> +            screenInfo.numGPUScreens = i;
> +        }
> +
>          for (i = screenInfo.numScreens - 1; i >= 0; i--) {
>              FreeScratchPixmapsForScreen(screenInfo.screens[i]);
>              FreeGCperDepth(i);
> @@ -342,15 +351,6 @@ main(int argc, char *argv[], char *envp[])
>              screenInfo.numScreens = i;
>          }
>
> -        for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) {
> -            ScreenPtr pScreen = screenInfo.gpuscreens[i];
> -            FreeScratchPixmapsForScreen(pScreen);
> -            (*pScreen->CloseScreen) (pScreen);
> -            dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
> -            free(pScreen);
> -            screenInfo.numGPUScreens = i;
> -        }
> -
>          ReleaseClientIds(serverClient);
>          dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT);
>          serverClient->devPrivates = NULL;
> --
> 1.7.10.4
>
> _______________________________________________
> 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