[PATCHv2 1/2] DRI2: Track DRI2 drawables as resources, not privates
Kristian Høgsberg
krh at bitplanet.net
Thu Apr 15 11:47:51 PDT 2010
2010/4/15 Keith Packard <keithp at keithp.com>:
> On Thu, 15 Apr 2010 14:15:05 -0400, Kristian Høgsberg <krh at bitplanet.net> wrote:
>> 2010/4/15 Keith Packard <keithp at keithp.com>:
>> > On Wed, 14 Apr 2010 20:30:55 -0400, Kristian Høgsberg <krh at bitplanet.net> wrote:
>> >
>> >> Oh, I was thinking I could just allocate the ID, but not actually add
>> >> the Pixmap as a resource. Is that bad form?
>> >
>> > It wouldn't help -- you need FreeResource to be invoked on that XID to
>> > get the other resources with that XID to be freed as well.
>>
>> No, pbuffers are client resources and gets cleaned up when the client
>> exits. The pixmap used behind these scenes is references from the
>> pbuffer and when that goes away, the pixmap goes away. The reason I
>> want to give the pixmap an XID is that DRI2 will create a DRI2
>> drawable and add it as a resource with the XID of the pixmap. That's
>> the only reason the pixmap needs an ID, it gets cleaned up just fine
>> as it is.
>
> So how is the DRI2 drawable going to get cleaned up? From what I
> understand, it gets destroyed when FreeResource is called on the
> drawable ID.
Right, it would linger until the client exits. So I guess I'll have
to actually AddResource the pixmap with the FakeClientID and then use
FreeResource to destroy it instead of pScreen->DestroyPixmap.
Kristian
More information about the xorg-devel
mailing list