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

Rob Herring robh at kernel.org
Fri Jul 22 16:22:15 UTC 2016


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 at kernel.org>
Cc: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)
-- 
2.9.2



More information about the mesa-dev mailing list