sna/dri2: Recreate buffer in reuse rather than force recreate
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Jul 2014 07:37:46 +0000 (08:37 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 23 Jul 2014 07:43:02 +0000 (08:43 +0100)
commit70868c7aa881b15b7478f7ee4543fde0268a4ba6
treee016c7b152a2e9c4caefdbf952abfd6b11fab598
parentaa5351dbbe0a50080efee35a3d494b3a20b7c9f6
sna/dri2: Recreate buffer in reuse rather than force recreate

By marking the buffer->attachment as invalid we forced the recreation of
the buffer on the next DRI2GetBuffers. The only small problem with that
was that the client didn't always immediately call DRI2GetBuffers after
the invalidation - and if they did a DRI2CopyRegion with its stale
buffers the unfound attachment would generate a BadValue and kill the
client. So instead of messing around with the attachment, explicitly
recreate the buffer if we attempt to reuse a buffer of the wrong size.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/sna_dri2.c