diff options
author | Axel Davy <[email protected]> | 2015-01-24 17:58:28 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-02-06 00:07:20 +0100 |
commit | 90585cbc9aef27904efc86dbfbd8743d27a6f599 (patch) | |
tree | ae8b0f9bb6fa90d60a94aeabd3bd11cf808818cd /src/gallium/targets/d3dadapter9 | |
parent | 8b3a9d5c9f54a0c1b1e95cc61214fd69c6777680 (diff) |
gallium/targets/d3dadapter9: Free card device
The drm fd wasn't released, causing a crash
for wine tests on nouveau, which seems to have
a bug when a lot of device descriptors are open.
Reviewed-by: Tiziano Bacocco <[email protected]>
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/targets/d3dadapter9')
-rw-r--r-- | src/gallium/targets/d3dadapter9/drm.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gallium/targets/d3dadapter9/drm.c b/src/gallium/targets/d3dadapter9/drm.c index f054654d96e..cb0c48f12bb 100644 --- a/src/gallium/targets/d3dadapter9/drm.c +++ b/src/gallium/targets/d3dadapter9/drm.c @@ -74,27 +74,28 @@ struct d3dadapter9drm_context { struct d3dadapter9_context base; struct pipe_loader_device *dev, *swdev; + int fd; }; static void drm_destroy( struct d3dadapter9_context *ctx ) { + struct d3dadapter9drm_context *drm = (struct d3dadapter9drm_context *)ctx; + if (ctx->ref) ctx->ref->destroy(ctx->ref); /* because ref is a wrapper around hal, freeing ref frees hal too. */ else if (ctx->hal) ctx->hal->destroy(ctx->hal); -#if !GALLIUM_STATIC_TARGETS - { - struct d3dadapter9drm_context *drm = (struct d3dadapter9drm_context *)ctx; - if (drm->swdev) - pipe_loader_release(&drm->swdev, 1); - if (drm->dev) - pipe_loader_release(&drm->dev, 1); - } +#if !GALLIUM_STATIC_TARGETS + if (drm->swdev) + pipe_loader_release(&drm->swdev, 1); + if (drm->dev) + pipe_loader_release(&drm->dev, 1); #endif + close(drm->fd); FREE(ctx); } @@ -235,6 +236,7 @@ drm_create_adapter( int fd, ctx->base.destroy = drm_destroy; fd = loader_get_user_preferred_fd(fd, &different_device); + ctx->fd = fd; ctx->base.linear_framebuffer = !!different_device; #if GALLIUM_STATIC_TARGETS |