forked from enlightenment/efl
ecore-drm: Delay destroy of output if there is a pending flip
Summary: If an output has a pending page flip, we cannot destroy it until the page flip has completed. This commit adds support to delay destroying an output until the page flip is completed. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
e7538322e9
commit
8d1e57e52e
|
@ -24,7 +24,13 @@ _ecore_drm_device_cb_page_flip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSE
|
||||||
}
|
}
|
||||||
|
|
||||||
output->pending_flip = EINA_FALSE;
|
output->pending_flip = EINA_FALSE;
|
||||||
if (!output->pending_vblank) ecore_drm_output_repaint(output);
|
if (output->pending_destroy)
|
||||||
|
{
|
||||||
|
output->pending_destroy = EINA_FALSE;
|
||||||
|
ecore_drm_output_free(output);
|
||||||
|
}
|
||||||
|
else if (!output->pending_vblank)
|
||||||
|
ecore_drm_output_repaint(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -79,7 +85,7 @@ _ecore_drm_device_cb_idle(void *data)
|
||||||
|
|
||||||
EINA_LIST_FOREACH(dev->outputs, l, output)
|
EINA_LIST_FOREACH(dev->outputs, l, output)
|
||||||
{
|
{
|
||||||
output->need_repaint = EINA_TRUE;
|
if ((!output->enabled) || (!output->need_repaint)) continue;
|
||||||
if (output->repaint_scheduled) continue;
|
if (output->repaint_scheduled) continue;
|
||||||
_ecore_drm_output_repaint_start(output);
|
_ecore_drm_output_repaint_start(output);
|
||||||
}
|
}
|
||||||
|
|
|
@ -594,6 +594,12 @@ _ecore_drm_output_free(Ecore_Drm_Output *output)
|
||||||
/* check for valid output */
|
/* check for valid output */
|
||||||
if (!output) return;
|
if (!output) return;
|
||||||
|
|
||||||
|
if (output->pending_flip)
|
||||||
|
{
|
||||||
|
output->pending_destroy = EINA_TRUE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* delete the backlight struct */
|
/* delete the backlight struct */
|
||||||
if (output->backlight)
|
if (output->backlight)
|
||||||
_ecore_drm_output_backlight_shutdown(output->backlight);
|
_ecore_drm_output_backlight_shutdown(output->backlight);
|
||||||
|
@ -649,6 +655,7 @@ _ecore_drm_output_repaint_start(Ecore_Drm_Output *output)
|
||||||
/* DBG("Output Repaint Start"); */
|
/* DBG("Output Repaint Start"); */
|
||||||
|
|
||||||
if (!output) return;
|
if (!output) return;
|
||||||
|
if (output->pending_destroy) return;
|
||||||
|
|
||||||
if (!output->current)
|
if (!output->current)
|
||||||
{
|
{
|
||||||
|
@ -902,7 +909,8 @@ ecore_drm_output_repaint(Ecore_Drm_Output *output)
|
||||||
Ecore_Drm_Sprite *sprite;
|
Ecore_Drm_Sprite *sprite;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (!output) return;
|
EINA_SAFETY_ON_NULL_RETURN(output);
|
||||||
|
EINA_SAFETY_ON_TRUE_RETURN(output->pending_destroy);
|
||||||
|
|
||||||
/* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */
|
/* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */
|
||||||
|
|
||||||
|
|
|
@ -117,15 +117,10 @@ struct _Ecore_Drm_Output
|
||||||
|
|
||||||
int x, y, phys_width, phys_height;
|
int x, y, phys_width, phys_height;
|
||||||
|
|
||||||
Eina_Bool need_repaint : 1;
|
|
||||||
Eina_Bool repaint_scheduled : 1;
|
|
||||||
|
|
||||||
Eina_Bool pending_flip : 1;
|
|
||||||
Eina_Bool pending_vblank : 1;
|
|
||||||
|
|
||||||
int pipe;
|
int pipe;
|
||||||
const char *make, *model, *name;
|
const char *make, *model, *name;
|
||||||
unsigned int subpixel;
|
unsigned int subpixel;
|
||||||
|
uint16_t gamma;
|
||||||
|
|
||||||
Ecore_Drm_Output_Mode *current_mode;
|
Ecore_Drm_Output_Mode *current_mode;
|
||||||
Eina_List *modes;
|
Eina_List *modes;
|
||||||
|
@ -142,10 +137,13 @@ struct _Ecore_Drm_Output
|
||||||
Ecore_Drm_Fb *dumb[NUM_FRAME_BUFFERS];
|
Ecore_Drm_Fb *dumb[NUM_FRAME_BUFFERS];
|
||||||
Ecore_Drm_Backlight *backlight;
|
Ecore_Drm_Backlight *backlight;
|
||||||
|
|
||||||
uint16_t gamma;
|
|
||||||
|
|
||||||
Eina_Bool enabled : 1;
|
Eina_Bool enabled : 1;
|
||||||
Eina_Bool cloned : 1;
|
Eina_Bool cloned : 1;
|
||||||
|
Eina_Bool need_repaint : 1;
|
||||||
|
Eina_Bool repaint_scheduled : 1;
|
||||||
|
Eina_Bool pending_destroy : 1;
|
||||||
|
Eina_Bool pending_flip : 1;
|
||||||
|
Eina_Bool pending_vblank : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Ecore_Drm_Seat
|
struct _Ecore_Drm_Seat
|
||||||
|
|
Loading…
Reference in New Issue