summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-09-22 12:28:07 -0400
committerChris Michael <cp.michael@samsung.com>2016-09-22 13:33:57 -0400
commitf8f8ec0cbfa5492eb5b801997ce8b0490f84bec9 (patch)
tree8635dee7c065fcc9e4d71f733643724e6847dc99
parente9f041cf2315ea80431bcd1074af8b9d6218f3f0 (diff)
ecore-drm2: Add code to use Atomic for Edid if available
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c40
1 files changed, 37 insertions, 3 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 28d0400086..ebb831988a 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -189,6 +189,28 @@ _output_edid_parse(Ecore_Drm2_Output *output, const uint8_t *data, size_t len)
189 return 0; 189 return 0;
190} 190}
191 191
192#ifdef HAVE_ATOMIC_DRM
193static void
194_output_edid_atomic_find(Ecore_Drm2_Output *output)
195{
196 Ecore_Drm2_Connector_State *cstate;
197 int ret = 0;
198
199 cstate = output->conn_state;
200
201 ret = _output_edid_parse(output, cstate->edid.data, cstate->edid.len);
202 if (!ret)
203 {
204 if (output->edid.pnp[0] != '\0')
205 eina_stringshare_replace(&output->make, output->edid.pnp);
206 if (output->edid.monitor[0] != '\0')
207 eina_stringshare_replace(&output->model, output->edid.monitor);
208 if (output->edid.serial[0] != '\0')
209 eina_stringshare_replace(&output->serial, output->edid.serial);
210 }
211}
212#endif
213
192static void 214static void
193_output_edid_find(Ecore_Drm2_Output *output, const drmModeConnector *conn) 215_output_edid_find(Ecore_Drm2_Output *output, const drmModeConnector *conn)
194{ 216{
@@ -700,7 +722,12 @@ _output_create(Ecore_Drm2_Device *dev, const drmModeRes *res, const drmModeConne
700 722
701 _output_modes_create(dev, output, conn); 723 _output_modes_create(dev, output, conn);
702 724
703 _output_edid_find(output, conn); 725#ifdef HAVE_ATOMIC_DRM
726 if (_ecore_drm2_use_atomic)
727 _output_edid_atomic_find(output);
728 else
729#endif
730 _output_edid_find(output, conn);
704 731
705 if (output->connected) output->enabled = EINA_TRUE; 732 if (output->connected) output->enabled = EINA_TRUE;
706 733
@@ -960,9 +987,16 @@ ecore_drm2_output_edid_get(Ecore_Drm2_Output *output)
960 unsigned char *blob; 987 unsigned char *blob;
961 988
962 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL); 989 EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
963 EINA_SAFETY_ON_NULL_RETURN_VAL(output->edid.blob, NULL);
964 990
965 blob = output->edid.blob; 991#ifdef HAVE_ATOMIC_DRM
992 if (_ecore_drm2_use_atomic)
993 blob = output->conn_state->edid.data;
994 else
995#endif
996 {
997 EINA_SAFETY_ON_NULL_RETURN_VAL(output->edid.blob, NULL);
998 blob = output->edid.blob;
999 }
966 1000
967 edid_str = malloc((128 * 2) + 1); 1001 edid_str = malloc((128 * 2) + 1);
968 if (edid_str) 1002 if (edid_str)