[PATCH] DRI2: use ConfigNotify to re-allocate buffers if root window changes
Kristian Høgsberg
krh at bitplanet.net
Thu Jul 8 12:47:14 PDT 2010
On Thu, Jul 8, 2010 at 3:30 PM, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
> On Thu, 08 Jul 2010 12:26:22 -0700
> Keith Packard <keithp at keithp.com> wrote:
>
>> On Thu, 8 Jul 2010 11:39:01 -0700, Jesse Barnes <jbarnes at virtuousgeek.org> wrote:
>>
>> > If the root window changes size, we need to re-allocate any DRI2
>> > buffers that share the same pixmap so that they'll pick up the new root
>> > pixmap (if the underlying driver ended up creating a new one).
>>
>> Why is this only relevant at the screen level? What happens if a
>> redirected window is resized?
>
> I think the existing code handles that already.
It's the GL child window of redirected pixmap we just talked about in
IRC (shame on me for doing code review over IRC). If the GL window is
a child window of a redirect window that gets resized, we end up in
the same situation: the parent window gets a new window pixmap, but
the dri2 drawable is the same size. It only causes trouble when we're
swapping the window pixmap, that is, page flipping or replacing the
backing pixmap for a redirected window. As long as we go through the
DRI2CopyRegion path, it doesn't matter that the window pixmap is
replaced, the auxillary buffers for the DRI2 window can stay the same
just fine.
So the current code handles it as it is, but only because we don't
swap window pixmaps for redirected windows. If we want to handle
that, we need to check if the window in ConfigureNotify has a DRI2
subwindow and do stuff if so, which doesn't sound like a good
approach. Maybe we're better off hooking pScreen->SetWindowPixmap and
marking the buffers as invalid there.
Kristian
More information about the xorg-devel
mailing list