Update to recent ecore_drm2 changes

This commit is contained in:
Derek Foreman 2017-07-21 16:00:26 -05:00
parent dc9879c6ef
commit 50169af1db
3 changed files with 12 additions and 22 deletions

View File

@ -377,7 +377,6 @@ _e_alert_drm_run(void)
static Ecore_Drm2_Device *dev = NULL; static Ecore_Drm2_Device *dev = NULL;
static Ecore_Drm2_Fb *buffer = NULL; static Ecore_Drm2_Fb *buffer = NULL;
static Ecore_Drm2_Output *output = NULL; static Ecore_Drm2_Output *output = NULL;
static int fd = 0;
static int static int
_e_alert_drm_connect(void) _e_alert_drm_connect(void)
@ -396,19 +395,13 @@ _e_alert_drm_connect(void)
return 0; return 0;
} }
dev = ecore_drm2_device_find("seat0", 0); dev = ecore_drm2_device_open("seat0", 0);
if (!dev) if (!dev)
{ {
printf("\tCannot find drm device\n"); printf("\tCannot find drm device\n");
return 0; return 0;
} }
fd = ecore_drm2_device_open(dev);
if (fd < 0)
{
printf("\tCannot open drm device\n");
return 0;
}
if (!ecore_drm2_outputs_create(dev)) if (!ecore_drm2_outputs_create(dev))
{ {
@ -417,7 +410,7 @@ _e_alert_drm_connect(void)
} }
output = ecore_drm2_output_find(dev, 0, 0); output = ecore_drm2_output_find(dev, 0, 0);
if (output) ecore_drm2_output_crtc_size_get(output, &sw, &sh); if (output) ecore_drm2_output_info_get(output, NULL, NULL, &sw, &sh, NULL);
fprintf(stderr, "\tOutput Size: %d %d\n", sw, sh); fprintf(stderr, "\tOutput Size: %d %d\n", sw, sh);
ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
@ -436,7 +429,7 @@ _e_alert_drm_create(void)
fh = 13; fh = 13;
buffer = ecore_drm2_fb_create(fd, sw, sh, 24, 32, DRM_FORMAT_XRGB8888); buffer = ecore_drm2_fb_create(dev, sw, sh, 24, 32, DRM_FORMAT_XRGB8888);
method = evas_render_method_lookup("buffer"); method = evas_render_method_lookup("buffer");
if (method <= 0) if (method <= 0)
@ -504,7 +497,6 @@ _e_alert_drm_shutdown(void)
{ {
ecore_drm2_outputs_destroy(dev); ecore_drm2_outputs_destroy(dev);
ecore_drm2_device_close(dev); ecore_drm2_device_close(dev);
ecore_drm2_device_free(dev);
} }
ecore_drm2_shutdown(); ecore_drm2_shutdown();

View File

@ -80,7 +80,6 @@ _e_crash(void)
{ {
ecore_drm2_outputs_destroy(dev); ecore_drm2_outputs_destroy(dev);
ecore_drm2_device_close(dev); ecore_drm2_device_close(dev);
ecore_drm2_device_free(dev);
} }
ecore_drm2_shutdown(); ecore_drm2_shutdown();
# endif # endif

View File

@ -391,15 +391,14 @@ _drm2_randr_create(void)
{ {
unsigned int refresh; unsigned int refresh;
ecore_drm2_output_geometry_get(output, &s->config.geom.x, ecore_drm2_output_info_get(output,
&s->config.geom.y, NULL, NULL); &s->config.geom.x,
ecore_drm2_output_crtc_size_get(output, &s->config.geom.w, &s->config.geom.y,
&s->config.geom.h); &s->config.mode.w,
ecore_drm2_output_resolution_get(output, &s->config.mode.h,
&s->config.mode.w, &refresh);
&s->config.mode.h, s->config.mode.w = s->config.geom.w;
&refresh); s->config.mode.h = s->config.geom.h;
s->config.mode.refresh = refresh; s->config.mode.refresh = refresh;
s->config.enabled = s->config.enabled =
((s->config.mode.w != 0) && (s->config.mode.h != 0)); ((s->config.mode.w != 0) && (s->config.mode.h != 0));
@ -548,7 +547,7 @@ _drm2_randr_apply(void)
if (!ecore_drm2_output_enabled_get(output)) continue; if (!ecore_drm2_output_enabled_get(output)) continue;
if (ecore_drm2_output_cloned_get(output)) continue; if (ecore_drm2_output_cloned_get(output)) continue;
ecore_drm2_output_geometry_get(output, NULL, NULL, &ow, &oh); ecore_drm2_output_info_get(output, NULL, NULL, &ow, &oh, NULL);
pw += MAX(pw, ow); pw += MAX(pw, ow);
ph = MAX(ph, oh); ph = MAX(ph, oh);
} }