From: Christopher Michael Date: Mon, 1 Apr 2019 14:28:40 +0000 (-0400) Subject: ecore-drm2: Add API function to set crtc background color X-Git-Tag: submit/tizen/20190424.060632~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfca8f337cd7766f42023561f030446b7fd277d1;p=platform%2Fupstream%2Fefl.git ecore-drm2: Add API function to set crtc background color This patch adds a new API function we can be called in order to set the crtc background color of a given output. @feature --- diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index ecf4f4a..6f074fc 100644 --- a/src/lib/ecore_drm2/Ecore_Drm2.h +++ b/src/lib/ecore_drm2/Ecore_Drm2.h @@ -1179,6 +1179,23 @@ EAPI int ecore_drm2_device_fd_get(Ecore_Drm2_Device *device); */ EAPI Eina_Bool ecore_drm2_output_pending_get(Ecore_Drm2_Output *output); +/** + * Set the background color of an output's crtc + * + * @param output + * @param r + * @param g + * @param b + * @param a + * + * @return EINA_TRUE on success, EINA_FALSE otherwise + * + * @note This requires support from the video driver in order to function + * + * @since 1.23 + */ +EAPI Eina_Bool ecore_drm2_output_background_color_set(Ecore_Drm2_Output *output, int r, int g, int b, int a); + # endif #endif diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 7ad6ef8..a433d54 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1746,3 +1746,21 @@ ecore_drm2_output_relative_to_get(Ecore_Drm2_Output *output) EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL); return output->relative.to; } + +EAPI Eina_Bool +ecore_drm2_output_background_color_set(Ecore_Drm2_Output *output, int r, int g, int b, int a) +{ + Ecore_Drm2_Crtc_State *cstate; + + EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(output->crtc_state, EINA_FALSE); + + cstate = output->crtc_state; + if (cstate->background.id) + { + cstate->background.value = (a << 48 | b << 32 | g << 16 | r); + return _fb_atomic_flip_test(output); + } + + return EINA_FALSE; +}