fix warnings in async render code.. and well.. warn about it - it

crashes for me in expedite with 4 cores on x86 at random points. looks
like it's bitrotting. though it was relatively tentative to begin with.



SVN revision: 53856
This commit is contained in:
Carsten Haitzler 2010-10-25 11:27:17 +00:00
parent 79ec0e7975
commit 3a9d3268d2
6 changed files with 59 additions and 61 deletions

View File

@ -774,15 +774,12 @@ another core in the meantime allowing for higher framerates with
software rendering, using more cpu resources that are available on
modern multi-core cpu's.
This has been tested on x86 desktop and laptop cpu's with 2 and 4
cores and it works well, but there seem to be some issues on tested
multi-core ARM platforms like the nvidia tegra2. The source of issue is
unknown but you will notice rendering bugs with missing content or
incorrectly drawn content. This requires you also set the environment
variable EVAS_RENDER_MODE to "non-blocking" to enable it at runtime,
as the compile-time enable simply sets up the feature to be ready to
work. The runtime switch actually turns it on. If you don't plan to
use this feature, don't enable it in the build as there is a general
This is buggy! it will likely cause crashes and rendering corruption.
Do not enable it unless you plan to actually work on it. This requires you
also set the environment variable EVAS_RENDER_MODE to "non-blocking" to
enable it at runtime, as the compile-time enable simply sets up the feature
to be ready to work. The runtime switch actually turns it on. If you don't
plan to use this feature, don't enable it in the build as there is a general
performance hit of maintaining this feature at all, so beware that
enabling it for single core systems will likely take a performance hit.

View File

@ -1834,7 +1834,7 @@ evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace)
MAGIC_CHECK_END();
#ifdef EVAS_FRAME_QUEUING
if (o->cur.cspace != cspace)
if ((Evas_Colorspace)o->cur.cspace != cspace)
{
if (o->engine_data)
evas_common_pipe_op_image_flush(o->engine_data);

View File

@ -63,6 +63,10 @@ EAPI int evas_common_font_query_char_coords (RGBA_Font *fn, con
EAPI int evas_common_font_query_char_at_coords (RGBA_Font *fn, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
EAPI int evas_common_font_query_last_up_to_pos (RGBA_Font *fn, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props, int x, int y);
#ifdef EVAS_FRAME_QUEUING
EAPI void evas_common_font_draw_finish(void);
#endif
void evas_common_font_load_init(void);
void evas_common_font_load_shutdown(void);

View File

@ -31,16 +31,14 @@ evas_common_surface_dealloc(Evas_Surface *surface)
{
Evas_Surface *d_surface;
while(surface)
while (surface)
{
d_surface = surface;
surface = (Evas_Surface *)eina_inlist_remove(EINA_INLIST_GET(surface), EINA_INLIST_GET(d_surface));
LKL(d_surface->im->cache_entry.ref_fq_del);
d_surface->im->cache_entry.ref_fq[1]++;
LKU(d_surface->im->cache_entry.ref_fq_del);
free(d_surface);
}
}
@ -51,7 +49,7 @@ evas_common_surface_add(Evas_Frame *frame, Evas_Surface *surface)
}
static Evas_Frame *
evas_common_frame_alloc()
evas_common_frame_alloc(void)
{
Evas_Frame *frame;
@ -73,16 +71,16 @@ evas_common_frame_add(Evas_FrameQ *frameq, Evas_Frame *frame)
Evas_Frame *temp_frame;
LKL(frameq->mutex);
while(eina_inlist_count(EINA_INLIST_GET(frameq->frames)) >= frameq->frameq_sz)
while ((int)eina_inlist_count(EINA_INLIST_GET(frameq->frames)) >= frameq->frameq_sz)
{
/* wait a worker thread finish previous frame */
pthread_cond_wait(&(frameq->cond_done), &(frameq->mutex));
}
}
frameq->frames = (Evas_Frame *) eina_inlist_append(EINA_INLIST_GET(frameq->frames), EINA_INLIST_GET(frame));
// this frame need not to be scheduled for flushing time
EINA_INLIST_FOREACH(EINA_INLIST_GET(frameq->frames), temp_frame)
{
{
if (!temp_frame->ready)
{
break;
@ -97,7 +95,7 @@ evas_common_frame_add(Evas_FrameQ *frameq, Evas_Frame *frame)
}
EAPI Evas_Surface *
evas_common_frameq_new_surface (void *surface, int x, int y, int w, int h)
evas_common_frameq_new_surface(void *surface, int x, int y, int w, int h)
{
return evas_common_surface_alloc(surface, x, y, w, h);
}
@ -110,9 +108,9 @@ evas_common_frameq_add_surface(Evas_Surface *surface)
EAPI void
evas_common_frameq_set_frame_data(void *data,
void (*fn_output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h),
void (*fn_output_flush) (void *data),
void (*fn_output_set_priv)(void *data, void *cur, void *prev))
void (*fn_output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h),
void (*fn_output_flush) (void *data),
void (*fn_output_set_priv)(void *data, void *cur, void *prev))
{
if (gframeq.cur_frame)
{
@ -124,7 +122,7 @@ evas_common_frameq_set_frame_data(void *data,
}
EAPI void
evas_common_frameq_prepare_frame()
evas_common_frameq_prepare_frame(void)
{
if (!gframeq.cur_frame )
{
@ -133,7 +131,7 @@ evas_common_frameq_prepare_frame()
}
EAPI void
evas_common_frameq_ready_frame()
evas_common_frameq_ready_frame(void)
{
if (gframeq.cur_frame)
{
@ -144,7 +142,7 @@ evas_common_frameq_ready_frame()
EAPI void
evas_common_frameq_init()
evas_common_frameq_init(void)
{
gframeq.frames = NULL;
pthread_cond_init(&(gframeq.cond_new), NULL);
@ -156,7 +154,7 @@ evas_common_frameq_init()
}
EAPI void
evas_common_frameq_destroy()
evas_common_frameq_destroy(void)
{
#if 0 // let them destroyed indirectly with program exit
LKL(gframeq.mutex);
@ -172,7 +170,7 @@ evas_common_frameq_destroy()
}
EAPI void
evas_common_frameq_flush()
evas_common_frameq_flush(void)
{
if (! evas_common_frameq_enabled())
return;
@ -188,19 +186,19 @@ evas_common_frameq_flush()
EAPI void
evas_common_frameq_flush_ready ()
evas_common_frameq_flush_ready(void)
{
return;
}
EAPI int
evas_common_frameq_get_frameq_sz()
evas_common_frameq_get_frameq_sz(void)
{
return gframeq.frameq_sz;
}
EAPI int
evas_common_frameq_enabled()
evas_common_frameq_enabled(void)
{
return gframeq.initialised;
}
@ -528,13 +526,14 @@ _IQ_insert(long long ready_time, long long last_interval)
}
static long long
_IQ_delete()
_IQ_delete(void)
{
struct iq_node oldest;
if (_IQ_empty()) return 0;
oldest = _IQ[_IQ_head];
_IQ_head = ++_IQ_head % INTERVAL_QSIZE;
if (--_IQ_length == 0)
_IQ_head = (_IQ_head + 1) % INTERVAL_QSIZE;
if ((--_IQ_length) == 0)
{
_IQ_init();
}
@ -548,7 +547,7 @@ _IQ_delete()
}
static long long
get_max_interval()
get_max_interval(void)
{
int i;
long long max = LLONG_MIN;
@ -576,11 +575,10 @@ tv_to_long_long(struct timeval *tv)
}
static long long
evas_common_frameq_schedule_flush_time(
int frameq_sz, int thread_no,
long long last_ready_time, long long current_ready_time,
long long last_flush_time, int ready_frames_num,
int dont_schedule)
evas_common_frameq_schedule_flush_time(int frameq_sz, int thread_no,
long long last_ready_time, long long current_ready_time,
long long last_flush_time, int ready_frames_num,
int dont_schedule)
{
// to get each time and to do others
long long current_time = 0LL;
@ -706,10 +704,8 @@ evas_common_frameq_thread_post(void *data)
Evas_FrameQ *frameq;
Evas_Frame *frame;
Evas_Surface *surface;
RGBA_Pipe *p;
Thinfo *thinfo;
Evas_Frameq_Thread_Info *fq_info;
RGBA_Pipe_Thread_Info p_info;
Eina_List *pending_writes = NULL;
Eina_List *prev_pending_writes = NULL;
@ -856,7 +852,7 @@ evas_common_pipe_begin(RGBA_Image *im)
#ifdef EVAS_FRAME_QUEUING
EAPI void
evas_common_frameq_begin()
evas_common_frameq_begin(void)
{
#ifdef BUILD_PTHREAD
int i;
@ -866,7 +862,7 @@ evas_common_frameq_begin()
if (!gframeq.initialised)
{
int cpunum, set_cpu_affinity;
int cpunum, set_cpu_affinity = 0;
cpunum = eina_cpu_count();
gframeq.thread_num = cpunum;
@ -926,7 +922,7 @@ evas_common_frameq_begin()
}
EAPI void
evas_common_frameq_finish()
evas_common_frameq_finish(void)
{
int i;
@ -957,23 +953,20 @@ evas_common_frameq_finish()
EAPI void
evas_common_pipe_flush(RGBA_Image *im)
{
RGBA_Pipe *p;
int i;
if (!im->cache_entry.pipe) return;
#ifndef EVAS_FRAME_QUEUING
#ifdef BUILD_PTHREAD
if (thread_num > 1)
{
/* sync worker threads */
/* sync worker threads */
pthread_barrier_wait(&(thbarrier[1]));
}
else
#endif
{
RGBA_Pipe *p;
int i;
/* process pipe - 1 thead */
for (p = im->cache_entry.pipe; p; p = (RGBA_Pipe *)(EINA_INLIST_GET(p))->next)
{
@ -1047,8 +1040,7 @@ evas_common_pipe_rectangle_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_
}
EAPI void
evas_common_pipe_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
int x, int y, int w, int h)
evas_common_pipe_rectangle_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h)
{
RGBA_Pipe_Op *op;
@ -1092,7 +1084,7 @@ evas_common_pipe_line_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Threa
EAPI void
evas_common_pipe_line_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
int x0, int y0, int x1, int y1)
int x0, int y0, int x1, int y1)
{
RGBA_Pipe_Op *op;
@ -1148,7 +1140,7 @@ evas_common_pipe_poly_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Threa
EAPI void
evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
RGBA_Polygon_Point *points, int x, int y)
RGBA_Polygon_Point *points, int x, int y)
{
RGBA_Pipe_Op *op;
RGBA_Polygon_Point *pts = NULL, *p, *pp;
@ -1238,7 +1230,7 @@ evas_common_pipe_text_draw_do(RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Threa
EAPI void
evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc,
RGBA_Font *fn, int x, int y, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props)
RGBA_Font *fn, int x, int y, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props)
{
RGBA_Pipe_Op *op;

View File

@ -9,7 +9,7 @@ typedef struct _Thinfo
pthread_t thread_id;
pthread_barrier_t *barrier;
RGBA_Pipe_Thread_Info *info;
#ifdef EVAS_FRAME_QUEUING
# ifdef EVAS_FRAME_QUEUING
void *fq_info;
#endif
} Thinfo;
@ -69,14 +69,19 @@ typedef struct _Evas_Frameq_Thread_Info Evas_Frameq_Thread_Info;
EAPI Evas_Surface *evas_common_frameq_new_surface(void *surface, int x, int y, int w, int h);
EAPI void evas_common_frameq_add_surface(Evas_Surface *surface);
EAPI void evas_common_frameq_set_frame_data(void *data,
void (*fn_output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h),
void (*fn_output_flush) (void *data),
void (*fn_output_set_priv)(void *data, void *cur, void *prev));
void (*fn_output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h),
void (*fn_output_flush) (void *data),
void (*fn_output_set_priv)(void *data, void *cur, void *prev));
EAPI void evas_common_frameq_prepare_frame(void);
EAPI void evas_common_frameq_ready_frame(void);
EAPI void evas_common_frameq_init(void);
EAPI void evas_common_frameq_destroy(void);
EAPI void evas_common_frameq_flush(void);
EAPI void evas_common_frameq_flush_ready(void);
EAPI int evas_common_frameq_get_frameq_sz(void);
EAPI int evas_common_frameq_enabled(void);
EAPI void evas_common_frameq_begin(void);
EAPI void evas_common_frameq_finish(void);
#endif
/* image rendering pipelines... new optional system - non-immediate and
@ -90,6 +95,7 @@ EAPI void evas_common_pipe_poly_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGB
EAPI void evas_common_pipe_text_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int x, int y, const Eina_Unicode *text, const Evas_BiDi_Props *intl_props);
EAPI void evas_common_pipe_image_load(RGBA_Image *im);
EAPI void evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, int smooth, int src_region_x, int src_region_y, int src_region_w, int src_region_h, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h);
EAPI void evas_common_pipe_map4_begin(RGBA_Image *root);
EAPI void evas_common_pipe_map4_draw(RGBA_Image *src, RGBA_Image *dst,
RGBA_Draw_Context *dc, RGBA_Map_Point *p,
int smooth, int level);

View File

@ -1089,9 +1089,8 @@ evas_software_xlib_outbuf_alpha_get(Outbuf *buf)
#ifdef EVAS_FRAME_QUEUING
void
evas_software_xlib_outbuf_set_priv(Outbuf *buf, void *cur, void *prev)
evas_software_xlib_outbuf_set_priv(Outbuf *buf, void *cur, void *prev __UNUSED__)
{
buf->priv.pending_writes = (Eina_List *)cur;
}
#endif