[PATCH 3/4] glamor: Make glamor_destroy_textured_pixmap idempotent

Michel Dänzer michel at daenzer.net
Thu Dec 11 19:27:12 PST 2014


On 12.12.2014 04:23, Keith Packard wrote:
> Michel Dänzer <michel at daenzer.net> writes:
> 
>> From: Michel Dänzer <michel.daenzer at amd.com>
>>
>> For robustness against drivers which may call both
>> glamor_(egl_)destroy_textured_pixmap and glamor_destroy_pixmap.
>>
>> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
>> ---
>>  glamor/glamor.c     | 1 +
>>  glamor/glamor_fbo.c | 2 --
>>  2 files changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/glamor/glamor.c b/glamor/glamor.c
>> index cbd0e02..d1aa1cf 100644
>> --- a/glamor/glamor.c
>> +++ b/glamor/glamor.c
>> @@ -226,6 +226,7 @@ glamor_destroy_textured_pixmap(PixmapPtr pixmap)
>>              glamor_egl_destroy_pixmap_image(pixmap);
>>  #endif
>>              glamor_pixmap_destroy_fbo(pixmap_priv);
>> +            glamor_set_pixmap_private(pixmap, NULL);
>>          }
>>      }
>>  }
>> diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c
>> index 4273826..d2aabb2 100644
>> --- a/glamor/glamor_fbo.c
>> +++ b/glamor/glamor_fbo.c
>> @@ -540,8 +540,6 @@ glamor_pixmap_destroy_fbo(glamor_pixmap_private *priv)
>>          if (fbo)
>>              glamor_destroy_fbo(fbo);
>>      }
>> -
>> -    free(priv);
> 
> With this patch, 1/4 is no longer necessary, I think, as
> glamor_pixmap_destroy_fbo no longer frees the pixmap private?
> 
> It doesn't actually matter, I just wondered if I was following things
> here.

Yeah, this series reflects the steps I took untangling the mess I
discovered while trying to follow your advice to call
glamor_destroy_pixmap() from the radeon driver.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 173 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20141212/8d28bcf1/attachment-0001.sig>


More information about the xorg-devel mailing list