diff options
author | Christopher Michael <cp.michael@samsung.com> | 2019-04-01 10:28:40 -0400 |
---|---|---|
committer | Christopher Michael <cp.michael@samsung.com> | 2019-04-18 07:21:39 -0400 |
commit | 2aaca58de0889027239df45238c17f046685a9a3 (patch) | |
tree | 97f185924c2deff8a34479774487f466565f7658 /src/lib | |
parent | edd78d18006e94d7fa9bd553bb49d2e4becddd6d (diff) |
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
Diffstat (limited to '')
-rw-r--r-- | src/lib/ecore_drm2/Ecore_Drm2.h | 17 | ||||
-rw-r--r-- | src/lib/ecore_drm2/ecore_drm2_outputs.c | 18 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h index ecf4f4a2bd..6f074fc5ec 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); | |||
1179 | */ | 1179 | */ |
1180 | EAPI Eina_Bool ecore_drm2_output_pending_get(Ecore_Drm2_Output *output); | 1180 | EAPI Eina_Bool ecore_drm2_output_pending_get(Ecore_Drm2_Output *output); |
1181 | 1181 | ||
1182 | /** | ||
1183 | * Set the background color of an output's crtc | ||
1184 | * | ||
1185 | * @param output | ||
1186 | * @param r | ||
1187 | * @param g | ||
1188 | * @param b | ||
1189 | * @param a | ||
1190 | * | ||
1191 | * @return EINA_TRUE on success, EINA_FALSE otherwise | ||
1192 | * | ||
1193 | * @note This requires support from the video driver in order to function | ||
1194 | * | ||
1195 | * @since 1.23 | ||
1196 | */ | ||
1197 | EAPI Eina_Bool ecore_drm2_output_background_color_set(Ecore_Drm2_Output *output, int r, int g, int b, int a); | ||
1198 | |||
1182 | # endif | 1199 | # endif |
1183 | 1200 | ||
1184 | #endif | 1201 | #endif |
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index 7ad6ef8396..a433d54358 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) | |||
1746 | EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL); | 1746 | EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL); |
1747 | return output->relative.to; | 1747 | return output->relative.to; |
1748 | } | 1748 | } |
1749 | |||
1750 | EAPI Eina_Bool | ||
1751 | ecore_drm2_output_background_color_set(Ecore_Drm2_Output *output, int r, int g, int b, int a) | ||
1752 | { | ||
1753 | Ecore_Drm2_Crtc_State *cstate; | ||
1754 | |||
1755 | EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); | ||
1756 | EINA_SAFETY_ON_NULL_RETURN_VAL(output->crtc_state, EINA_FALSE); | ||
1757 | |||
1758 | cstate = output->crtc_state; | ||
1759 | if (cstate->background.id) | ||
1760 | { | ||
1761 | cstate->background.value = (a << 48 | b << 32 | g << 16 | r); | ||
1762 | return _fb_atomic_flip_test(output); | ||
1763 | } | ||
1764 | |||
1765 | return EINA_FALSE; | ||
1766 | } | ||