[Mesa-dev,v4,04/11] pipe-loader-drm: use pipe_screen_unreference to destroy screen

Submitted by Rob Herring on July 22, 2016, 4:22 p.m.

Details

Message ID 20160722162222.21871-5-robh@kernel.org
State New
Headers show
Series "Common pipe screen ref counting" ( rev: 4 ) in Mesa

Not browsing as part of any series.

Commit Message

Rob Herring July 22, 2016, 4:22 p.m.
Use pipe_screen_unreference as it will call pipe_screen->destroy() when
the pipe_screen is no longer referenced.

The pipe_screen referencing is done within create_screen() functions
as drivers (like amdgpu) may have special needs for ref counting.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
---
 src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
index 554e59a..2edb291 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c
@@ -45,6 +45,7 @@ 
 #include "util/u_memory.h"
 #include "util/u_dl.h"
 #include "util/u_debug.h"
+#include "util/u_screen.h"
 
 #define DRM_RENDER_NODE_DEV_NAME_FORMAT "%s/renderD%d"
 #define DRM_RENDER_NODE_MAX_NODES 63
@@ -275,7 +276,7 @@  pipe_loader_drm_release(struct pipe_loader_device **dev)
    struct pipe_loader_drm_device *ddev = pipe_loader_drm_device(*dev);
    struct pipe_screen *pscreen = ddev->base.pscreen;
 
-   pscreen->destroy(pscreen);
+   pipe_screen_unreference(pscreen);
 
 #ifndef GALLIUM_STATIC_TARGETS
    if (ddev->lib)