ecore-drm2: Remove old atomic flipping code

As we are refactoring the usage of hardware planes and atomic commits,
we need to remove the old usage of atomic flipping for ecore_drm2_fb
because atomic flipping will be handled differently.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2017-03-27 09:27:19 -04:00
parent 43104a7268
commit 0a647f9fce
1 changed files with 66 additions and 186 deletions

View File

@ -15,79 +15,6 @@ _fb2_create(Ecore_Drm2_Fb *fb)
return EINA_TRUE;
}
#ifdef HAVE_ATOMIC_DRM
static int
_fb_atomic_flip(Ecore_Drm2_Output *output, Ecore_Drm2_Plane_State *pstate, uint32_t flags)
{
int ret = 0;
drmModeAtomicReq *req = NULL;
Ecore_Drm2_Crtc_State *cstate;
req = sym_drmModeAtomicAlloc();
if (!req) return -1;
sym_drmModeAtomicSetCursor(req, 0);
cstate = output->crtc_state;
ret = sym_drmModeAtomicAddProperty(req, cstate->obj_id, cstate->mode.id,
cstate->mode.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, cstate->obj_id, cstate->active.id,
cstate->active.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->cid.id, pstate->cid.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->fid.id, pstate->fid.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->sx.id, pstate->sx.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->sy.id, pstate->sy.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->sw.id, pstate->sw.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->sh.id, pstate->sh.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->cx.id, pstate->cx.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->cy.id, pstate->cy.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->cw.id, pstate->cw.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicAddProperty(req, pstate->obj_id,
pstate->ch.id, pstate->ch.value);
if (ret < 0) goto err;
ret = sym_drmModeAtomicCommit(output->fd, req, flags, output->user_data);
if (ret < 0) ERR("Failed to commit Atomic FB Flip: %m");
else ret = 0;
err:
sym_drmModeAtomicFree(req);
return ret;
}
#endif
EAPI Ecore_Drm2_Fb *
ecore_drm2_fb_create(int fd, int width, int height, int depth, int bpp, unsigned int format)
{
@ -304,6 +231,8 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
EAPI int
ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
{
Eina_Bool repeat;
int count = 0;
int ret = 0;
EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1);
@ -332,54 +261,6 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
/* If we don't have an fb to set by now, BAIL! */
if (!fb) return -1;
#ifdef HAVE_ATOMIC_DRM
if (_ecore_drm2_use_atomic)
{
Ecore_Drm2_Plane_State *pstate;
uint32_t flags =
DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT |
DRM_MODE_ATOMIC_ALLOW_MODESET;
pstate = output->plane_state;
pstate->cid.value = output->crtc_id;
pstate->fid.value = fb->id;
pstate->sx.value = 0;
pstate->sy.value = 0;
pstate->sw.value = fb->w << 16;
pstate->sh.value = fb->h << 16;
pstate->cx.value = output->x;
pstate->cy.value = output->y;
pstate->cw.value = output->current_mode->width;
pstate->ch.value = output->current_mode->height;
ret = _fb_atomic_flip(output, pstate, flags);
if ((ret < 0) && (errno != EBUSY))
{
ERR("Atomic Pageflip Failed for Crtc %u on Connector %u: %m",
output->crtc_id, output->conn_id);
return ret;
}
else if (ret < 0)
{
output->next = fb;
if (output->next) output->next->busy = EINA_TRUE;
return 0;
}
output->pending = fb;
output->pending->busy = EINA_TRUE;
return 0;
}
else
#endif
{
Eina_Bool repeat;
int count = 0;
if ((!output->current) ||
(output->current->strides[0] != fb->strides[0]))
{
@ -462,7 +343,6 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
output->pending->busy = EINA_TRUE;
return 0;
}
}
EAPI Eina_Bool
ecore_drm2_fb_busy_get(Ecore_Drm2_Fb *fb)