ecore_drm2: Add API to update the fb for a plane

This commit is contained in:
Derek Foreman 2017-04-28 15:30:34 -05:00
parent c98a9b06c6
commit ab8ec5ed5f
2 changed files with 30 additions and 0 deletions

View File

@ -1032,6 +1032,20 @@ EAPI void ecore_drm2_plane_release(Ecore_Drm2_Plane *plane);
*/
EAPI void ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y, int w, int h);
/**
* Set plane frame buffer
*
* @param plane
* @param fb
*
* @return whether the plane state has been successfully changed or not
*
* @ingroup Ecore_Drm2_Plane_Group
* @since 1.20
*/
EAPI Eina_Bool ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb);
# endif
#endif

View File

@ -142,3 +142,19 @@ ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y, int w, i
_fb_atomic_flip_test(plane->output);
}
EAPI Eina_Bool
ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb *fb)
{
uint32_t fallback_id;
EINA_SAFETY_ON_NULL_RETURN_VAL(plane, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE);
fallback_id = plane->state->fid.value;
plane->state->fid.value = fb->id;
if (_fb_atomic_flip_test(plane->output)) return EINA_TRUE;
plane->state->fid.value = fallback_id;
return EINA_FALSE;
}