[PATCH 17/36] privates: remove asserts that stop dynamic increasing of privates size.

Alex Deucher alexdeucher at gmail.com
Mon Jul 2 14:06:36 PDT 2012


On Mon, Jul 2, 2012 at 6:13 AM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> These asserts stop us increasing the size of privates after create screen
> resources has been called, however for dynamic screens we need to be able
> to increase private size as new drivers are loaded.
>
> In theory any object allocated by an older driver won't try and use newer
> privates and any object allocated by a new driver should be okay.
>
> pixmaps are a bit of an exception as they have their own allocator path,
> but the next patch will fix that up.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  dix/privates.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/dix/privates.c b/dix/privates.c
> index c2bdeae..af6d327 100644
> --- a/dix/privates.c
> +++ b/dix/privates.c
> @@ -210,8 +210,9 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
>           */
>          for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++)
>              if (xselinux_private[t]) {
> -                if (!allocated_early[t])
> -                    assert(!keys[t].created);
> +                if (!allocated_early[t]) {
> +                  /*                    assert(!keys[t].created);*/
> +                }

Any reason to not just remove these altogether?  If so, maybe add a
comment as to why they are commented out?

Alex

>                  else if (!allocated_early[t] (dixReallocPrivates, bytes))
>                      return FALSE;
>              }
> @@ -233,8 +234,9 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
>      }
>      else {
>          /* Resize if we can, or make sure nothing's allocated if we can't */
> -        if (!allocated_early[type])
> -            assert(!keys[type].created);
> +        if (!allocated_early[type]) {
> +          /*            assert(!keys[type].created);*/
> +        }
>          else if (!allocated_early[type] (dixReallocPrivates, bytes))
>              return FALSE;
>          offset = keys[type].offset;
> --
> 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