summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/renderonly/renderonly.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/renderonly/renderonly.c')
-rw-r--r--src/gallium/auxiliary/renderonly/renderonly.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/renderonly/renderonly.c b/src/gallium/auxiliary/renderonly/renderonly.c
index e17c32886d2..f377c368e57 100644
--- a/src/gallium/auxiliary/renderonly/renderonly.c
+++ b/src/gallium/auxiliary/renderonly/renderonly.c
@@ -34,6 +34,7 @@
#include "state_tracker/drm_driver.h"
#include "pipe/p_screen.h"
+#include "util/u_inlines.h"
#include "util/u_memory.h"
struct renderonly *
@@ -65,8 +66,16 @@ renderonly_scanout_for_prime(struct pipe_resource *rsc, struct renderonly *ro)
}
void
-renderonly_scanout_destroy(struct renderonly_scanout *scanout)
+renderonly_scanout_destroy(struct renderonly_scanout *scanout,
+ struct renderonly *ro)
{
+ struct drm_mode_destroy_dumb destroy_dumb = { };
+
+ pipe_resource_reference(&scanout->prime, NULL);
+ if (ro->kms_fd != -1) {
+ destroy_dumb.handle = scanout->handle;
+ ioctl(ro->kms_fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
+ }
FREE(scanout);
}