From ba2275b7ec1ac6943e25a804a48333a70abd78c9 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 27 Apr 2017 15:45:51 -0500 Subject: [PATCH] ecore_drm2: Add ecore_drm2_plane_release to release planes Opposite of plane assign. --- src/lib/ecore_drm2/Ecore_Drm2.h | 10 ++++++++++ src/lib/ecore_drm2/ecore_drm2_plane.c | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index 6f1296d204..1448500d44 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -1008,6 +1008,16 @@ EAPI Ecore_Drm2_Fb *ecore_drm2_fb_dmabuf_import(int fd, int width, int height, i */ EAPI Ecore_Drm2_Plane *ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb); +/** + * Remove a hardware plane from display + * + * @param plane + * + * @ingroup Ecore_Drm2_Plane_Group + * @since 1.20 + */ +EAPI void ecore_drm2_plane_release(Ecore_Drm2_Plane *plane); + /** * Set plane destination values * diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c b/src/lib/ecore_drm2/ecore_drm2_plane.c index 943104fd00..155c932bf5 100644 --- a/src/lib/ecore_drm2/ecore_drm2_plane.c +++ b/src/lib/ecore_drm2/ecore_drm2_plane.c @@ -112,6 +112,16 @@ out: return plane; } +EAPI void +ecore_drm2_plane_release(Ecore_Drm2_Plane *plane) +{ + EINA_SAFETY_ON_NULL_RETURN(plane); + + plane->state->in_use = EINA_FALSE; + plane->output->planes = eina_list_remove(plane->output->planes, plane); + free(plane); +} + EAPI void ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y, int w, int h) {