OSDN Git Service

nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.
authorMario Kleiner <mario.kleiner.de@gmail.com>
Fri, 5 Jun 2015 13:36:52 +0000 (15:36 +0200)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 1 Jul 2015 14:22:40 +0000 (15:22 +0100)
commitcdc7aa10386a9526960d6a1121c89d1e2eb17b2b
tree87307764ce9330c592258251c26656a7246a9376
parent16b6fa972d35b1c4047a98bb6aefbd41f1ac2f78
nouveau: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.

The dup'ed fd owned by the nouveau_screen for a device node
must also be used as key for the winsys hash table, instead
of using the original fd passed in for a screen, to make
multi-x-screen ZaphodHeads configurations work on nouveau.

The original fd's lifetime differs from that of the nouveau_screen stored
in the hash. The hash key is the fd, and in order to compare hash entries
we fstat them, so the fd must be around for as long as the screen is.

This is an extension of the fix in commit a59f2bb1 (nouveau: dup fd
before passing it to device).

Cc: "10.3 10.4 10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit a98600b0ebdfc8481c168aae6c5670071e22fc29)
src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c