[PATCH 2/7] damage: Simplify DamageUnregister

Eric Anholt eric at anholt.net
Tue Sep 3 13:57:47 PDT 2013


Adam Jackson <ajax at redhat.com> writes:

> You can only register one drawable on a given damage, so there's no
> reason to require the caller to specify the drawable, the damage is
> enough.  The implementation would do something fairly horrible if you
> _did_ pass mismatched drawable and damage, so let's avoid the problem
> entirely.
>
> Signed-off-by: Adam Jackson <ajax at redhat.com>


> diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
> index a393747..0b86f01 100644
> --- a/hw/xfree86/modes/xf86Rotate.c
> +++ b/hw/xfree86/modes/xf86Rotate.c
> @@ -272,9 +272,7 @@ xf86RotateDestroy(xf86CrtcPtr crtc)
>              screenDrawable = &pScreen->root->drawable;
>          /* Free damage structure */
>          if (xf86_config->rotation_damage_registered) {
> -            if (screenDrawable)
> -                DamageUnregister(screenDrawable,
> -                        xf86_config->rotation_damage);
> +            DamageUnregister(xf86_config->rotation_damage);
>              xf86_config->rotation_damage_registered = FALSE;
>              DisableLimitedSchedulingLatency();
>          }

This one looked weird.  I think thanks to patch 1, you want to just drop
this unregister, and drop the conditional on the DamageDestroy that
follows.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20130903/cd8cd472/attachment.pgp>


More information about the xorg-devel mailing list