summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-14 08:36:57 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-14 08:36:57 -0400
commiteaf2b91a3db1d03e779de224a007813c1be4d7dc (patch)
tree985ccd62a56dff455b84b0cbcdabd4ebf580d68f /src/lib/ecore_drm
parent2cf0ed49ce19ab72d2b00ee87aa84f2a14b0317e (diff)
ecore-drm: Fix segfault if sending output event and output has no current mode
Summary: This fixes a segfault which could happen if we enable an output before setting the output current mode. Now we test for an output having a current_mode, and if not we use the crtc size when sending the output event. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index 276b74f100..3c2c04c6c8 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -42,13 +42,23 @@ _ecore_drm_output_event_send(const Ecore_Drm_Output *output, Eina_Bool plug)
42 if (!(e = calloc(1, sizeof(Ecore_Drm_Event_Output)))) return; 42 if (!(e = calloc(1, sizeof(Ecore_Drm_Event_Output)))) return;
43 e->plug = plug; 43 e->plug = plug;
44 e->id = output->crtc_id; 44 e->id = output->crtc_id;
45 e->w = output->current_mode->width; 45
46 e->h = output->current_mode->height; 46 if (output->current_mode)
47 {
48 e->w = output->current_mode->width;
49 e->h = output->current_mode->height;
50 e->refresh = output->current_mode->refresh;
51 }
52 else if (output->crtc)
53 {
54 e->w = output->crtc->width;
55 e->h = output->crtc->height;
56 }
57
47 e->x = output->x; 58 e->x = output->x;
48 e->y = output->y; 59 e->y = output->y;
49 e->phys_width = output->phys_width; 60 e->phys_width = output->phys_width;
50 e->phys_height = output->phys_height; 61 e->phys_height = output->phys_height;
51 e->refresh = output->current_mode->refresh;
52 e->subpixel_order = output->subpixel; 62 e->subpixel_order = output->subpixel;
53 e->make = eina_stringshare_ref(output->make); 63 e->make = eina_stringshare_ref(output->make);
54 e->model = eina_stringshare_ref(output->model); 64 e->model = eina_stringshare_ref(output->model);