ecore_drm2: Require x and y value in plane assign

Saves us a flip test, and gaurantees that we're always testing with a
reasonable x, y and not something leftover from a previous assignment.
This commit is contained in:
Derek Foreman 2017-05-03 10:51:14 -05:00
parent 1d3ad70888
commit 699ed066ea
4 changed files with 10 additions and 4 deletions

View File

@ -1006,7 +1006,7 @@ EAPI Ecore_Drm2_Fb *ecore_drm2_fb_dmabuf_import(int fd, int width, int height, i
* @ingroup Ecore_Drm2_Plane_Group
* @since 1.20
*/
EAPI Ecore_Drm2_Plane *ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb);
EAPI Ecore_Drm2_Plane *ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb, int x, int y);
/**
* Remove a hardware plane from display

View File

@ -39,7 +39,7 @@ _plane_cursor_size_get(int fd, int *width, int *height)
}
EAPI Ecore_Drm2_Plane *
ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb)
ecore_drm2_plane_assign(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb, int x, int y)
{
Eina_List *l;
Ecore_Drm2_Plane *plane;
@ -102,6 +102,11 @@ out:
pstate->sw.value = fb->w << 16;
pstate->sh.value = fb->h << 16;
pstate->cx.value = x;
pstate->cy.value = y;
pstate->cw.value = fb->w;
pstate->ch.value = fb->h;
plane->state = pstate;
plane->type = pstate->type.value;
plane->output = output;

View File

@ -20,7 +20,7 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count)
ecore_drm2_fb_dirty(ofb->fb, rects, count);
if (!ob->priv.plane)
ob->priv.plane = ecore_drm2_plane_assign(ob->priv.output, ofb->fb);
ob->priv.plane = ecore_drm2_plane_assign(ob->priv.output, ofb->fb, 0, 0);
else ecore_drm2_plane_fb_set(ob->priv.plane, ofb->fb);
ecore_drm2_fb_flip(ofb->fb, ob->priv.output);

View File

@ -103,8 +103,9 @@ _evas_outbuf_buffer_swap(Outbuf *ob)
if (fb)
{
if (!ob->priv.plane)
ob->priv.plane = ecore_drm2_plane_assign(ob->priv.output, fb);
ob->priv.plane = ecore_drm2_plane_assign(ob->priv.output, fb, 0, 0);
else ecore_drm2_plane_fb_set(ob->priv.plane, fb);
ecore_drm2_fb_flip(fb, ob->priv.output);
/* Ecore_Drm2_Plane *plane; */