make pipe renderer separate to thread support - off by default.

SVN revision: 39740
This commit is contained in:
Carsten Haitzler 2009-03-27 01:48:58 +00:00
parent 3335fef2aa
commit 1a224311d6
10 changed files with 61 additions and 13 deletions

View File

@ -394,9 +394,9 @@ AC_CHECK_HEADERS(pthread.h sched.h,
], ],
[ build_pthreads="no" ] [ build_pthreads="no" ]
) )
### disable pthreads by default for now - some wierd deadlock issue with
# barriers (makes no sense) #######################################
#build_pthreads="no" ## Pthread
AC_MSG_CHECKING(whether to build pthread code) AC_MSG_CHECKING(whether to build pthread code)
AC_ARG_ENABLE(pthreads, AC_ARG_ENABLE(pthreads,
AC_HELP_STRING([--enable-pthreads], [enable threaded rendering]), AC_HELP_STRING([--enable-pthreads], [enable threaded rendering]),
@ -428,6 +428,27 @@ AC_ARG_ENABLE(pthreads,
] ]
) )
#######################################
## Pipe Renderer
build_pipe_render="no"
AC_MSG_CHECKING(whether to build Threaded Pipe Rendering support)
AC_ARG_ENABLE(pipe-render,
AC_HELP_STRING([--enable-pipe-render], [enable threaded pipe rendering support]),
[ build_pipe_render=$enableval ]
)
AC_MSG_RESULT($build_pipe_render)
AC_MSG_CHECKING(whether we can build Threaded Pipe Rendering support)
if test \( "x$build_pipe_render" = "xyes" -o "x$build_pipe_render" = "xauto" \); then
AC_MSG_RESULT(yes)
AC_DEFINE(BUILD_PIPE_RENDER, 1, [Build pipe render support])
build_pipe_render="yes"
need_pthreads="yes"
else
AC_MSG_RESULT(no)
build_pipe_render="no"
fi
####################################### #######################################
## Async events ## Async events
build_async_events="auto" build_async_events="auto"
@ -1097,6 +1118,7 @@ echo " NEON....................: $build_cpu_neon"
echo " Thread Support..........: $build_pthreads" echo " Thread Support..........: $build_pthreads"
echo " MAGIC_DEBUG.............: $want_evas_magic_debug" echo " MAGIC_DEBUG.............: $want_evas_magic_debug"
echo echo
echo "Threaded Pipe Rendering...: $build_pipe_render"
echo "Async Events..............: $build_async_events" echo "Async Events..............: $build_async_events"
echo "Async Image Preload.......: $build_async_preload" echo "Async Image Preload.......: $build_async_preload"
echo echo

View File

@ -140,7 +140,9 @@ _evas_common_rgba_image_delete(Image_Entry *ie)
{ {
RGBA_Image *im = (RGBA_Image *) ie; RGBA_Image *im = (RGBA_Image *) ie;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_free(im); evas_common_pipe_free(im);
#endif
evas_common_rgba_image_scalecache_shutdown(&im->cache_entry); evas_common_rgba_image_scalecache_shutdown(&im->cache_entry);
if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module); if (ie->info.module) evas_module_unref((Evas_Module *)ie->info.module);
/* memset the image to 0x99 because i recently saw a segv where an /* memset the image to 0x99 because i recently saw a segv where an

View File

@ -4,6 +4,7 @@
#include "evas_common.h" #include "evas_common.h"
#ifdef BUILD_PIPE_RENDER
static RGBA_Pipe *evas_common_pipe_add(RGBA_Pipe *pipe, RGBA_Pipe_Op **op); static RGBA_Pipe *evas_common_pipe_add(RGBA_Pipe *pipe, RGBA_Pipe_Op **op);
static void evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op); static void evas_common_pipe_draw_context_copy(RGBA_Draw_Context *dc, RGBA_Pipe_Op *op);
static void evas_common_pipe_op_free(RGBA_Pipe_Op *op); static void evas_common_pipe_op_free(RGBA_Pipe_Op *op);
@ -670,3 +671,4 @@ evas_common_pipe_image_draw(RGBA_Image *src, RGBA_Image *dst,
op->free_func = evas_common_pipe_op_image_free; op->free_func = evas_common_pipe_op_image_free;
evas_common_pipe_draw_context_copy(dc, op); evas_common_pipe_draw_context_copy(dc, op);
} }
#endif

View File

@ -78,6 +78,10 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#ifndef BUILD_PTHREAD
#undef BUILD_PIPE_RENDER
#endif
#ifdef BUILD_PTHREAD #ifdef BUILD_PTHREAD
#ifndef __USE_GNU #ifndef __USE_GNU
@ -287,9 +291,11 @@ typedef struct _Engine_Image_Entry Engine_Image_Entry;
typedef struct _Evas_Cache_Target Evas_Cache_Target; typedef struct _Evas_Cache_Target Evas_Cache_Target;
typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts; typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts;
#ifdef BUILD_PIPE_RENDER
typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op; typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op;
typedef struct _RGBA_Pipe RGBA_Pipe; typedef struct _RGBA_Pipe RGBA_Pipe;
typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info; typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
#endif
typedef struct _RGBA_Image RGBA_Image; typedef struct _RGBA_Image RGBA_Image;
typedef struct _RGBA_Image_Span RGBA_Image_Span; typedef struct _RGBA_Image_Span RGBA_Image_Span;
typedef struct _RGBA_Draw_Context RGBA_Draw_Context; typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
@ -543,6 +549,7 @@ struct _RGBA_Draw_Context
Evas_Bool anti_alias : 1; Evas_Bool anti_alias : 1;
}; };
#ifdef BUILD_PIPE_RENDER
struct _RGBA_Pipe_Op struct _RGBA_Pipe_Op
{ {
RGBA_Draw_Context context; RGBA_Draw_Context context;
@ -595,6 +602,7 @@ struct _RGBA_Pipe_Thread_Info
RGBA_Image *im; RGBA_Image *im;
int x, y, w, h; int x, y, w, h;
}; };
#endif
struct _RGBA_Image struct _RGBA_Image
{ {
@ -611,7 +619,9 @@ struct _RGBA_Image
} info; } info;
void *extended_info; void *extended_info;
#ifdef BUILD_PIPE_RENDER
RGBA_Pipe *pipe; RGBA_Pipe *pipe;
#endif
int ref; int ref;
/* unsigned char scale; */ /* unsigned char scale; */
@ -1111,8 +1121,10 @@ Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
#include "../engines/common/evas_draw.h" #include "../engines/common/evas_draw.h"
/****/ /****/
#include "../engines/common/evas_pipe.h" #ifdef BUILD_PIPE_RENDER
# include "../engines/common/evas_pipe.h"
#endif
void evas_font_dir_cache_free(void); void evas_font_dir_cache_free(void);
/****/ /****/

View File

@ -297,8 +297,10 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int
Render_Engine *re; Render_Engine *re;
re = (Render_Engine *)data; re = (Render_Engine *)data;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_begin(surface); evas_common_pipe_begin(surface);
evas_common_pipe_flush(surface); evas_common_pipe_flush(surface);
#endif
evas_buffer_outbuf_buf_push_updated_region(re->ob, surface, x, y, w, h); evas_buffer_outbuf_buf_push_updated_region(re->ob, surface, x, y, w, h);
evas_buffer_outbuf_buf_free_region_for_update(re->ob, surface); evas_buffer_outbuf_buf_free_region_for_update(re->ob, surface);
evas_common_cpu_end_opt(); evas_common_cpu_end_opt();

View File

@ -222,8 +222,10 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int
Render_Engine *re; Render_Engine *re;
re = (Render_Engine *)data; re = (Render_Engine *)data;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_begin(surface); evas_common_pipe_begin(surface);
evas_common_pipe_flush(surface); evas_common_pipe_flush(surface);
#endif
evas_fb_outbuf_fb_push_updated_region(re->ob, surface, x, y, w, h); evas_fb_outbuf_fb_push_updated_region(re->ob, surface, x, y, w, h);
evas_fb_outbuf_fb_free_region_for_update(re->ob, surface); evas_fb_outbuf_fb_free_region_for_update(re->ob, surface);
evas_common_cpu_end_opt(); evas_common_cpu_end_opt();

View File

@ -282,8 +282,10 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int
Render_Engine *re; Render_Engine *re;
re = (Render_Engine *)data; re = (Render_Engine *)data;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_begin(surface); evas_common_pipe_begin(surface);
evas_common_pipe_flush(surface); evas_common_pipe_flush(surface);
#endif
evas_software_ddraw_outbuf_push_updated_region(re->ob, surface, x, y, w, h); evas_software_ddraw_outbuf_push_updated_region(re->ob, surface, x, y, w, h);
evas_software_ddraw_outbuf_free_region_for_update(re->ob, surface); evas_software_ddraw_outbuf_free_region_for_update(re->ob, surface);
evas_common_cpu_end_opt(); evas_common_cpu_end_opt();

View File

@ -142,7 +142,7 @@ eng_context_render_op_get(void *data __UNUSED__, void *context)
static void static void
eng_rectangle_draw(void *data __UNUSED__, void *context, void *surface, int x, int y, int w, int h) eng_rectangle_draw(void *data __UNUSED__, void *context, void *surface, int x, int y, int w, int h)
{ {
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_rectangle_draw(surface, context, x, y, w, h); evas_common_pipe_rectangle_draw(surface, context, x, y, w, h);
else else
@ -156,7 +156,7 @@ eng_rectangle_draw(void *data __UNUSED__, void *context, void *surface, int x, i
static void static void
eng_line_draw(void *data __UNUSED__, void *context, void *surface, int x1, int y1, int x2, int y2) eng_line_draw(void *data __UNUSED__, void *context, void *surface, int x1, int y1, int x2, int y2)
{ {
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_line_draw(surface, context, x1, y1, x2, y2); evas_common_pipe_line_draw(surface, context, x1, y1, x2, y2);
else else
@ -182,7 +182,7 @@ eng_polygon_points_clear(void *data __UNUSED__, void *context __UNUSED__, void *
static void static void
eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon) eng_polygon_draw(void *data __UNUSED__, void *context, void *surface, void *polygon)
{ {
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_poly_draw(surface, context, polygon); evas_common_pipe_poly_draw(surface, context, polygon);
else else
@ -276,7 +276,7 @@ eng_gradient2_linear_render_post(void *data __UNUSED__, void *linear_gradient __
static void static void
eng_gradient2_linear_draw(void *data __UNUSED__, void *context, void *surface, void *linear_gradient, int x, int y, int w, int h) eng_gradient2_linear_draw(void *data __UNUSED__, void *context, void *surface, void *linear_gradient, int x, int y, int w, int h)
{ {
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_grad2_draw(surface, context, x, y, w, h, linear_gradient); evas_common_pipe_grad2_draw(surface, context, x, y, w, h, linear_gradient);
else else
@ -343,7 +343,7 @@ eng_gradient2_radial_render_post(void *data __UNUSED__, void *radial_gradient __
static void static void
eng_gradient2_radial_draw(void *data __UNUSED__, void *context, void *surface, void *radial_gradient, int x, int y, int w, int h) eng_gradient2_radial_draw(void *data __UNUSED__, void *context, void *surface, void *radial_gradient, int x, int y, int w, int h)
{ {
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_grad2_draw(surface, context, x, y, w, h, radial_gradient); evas_common_pipe_grad2_draw(surface, context, x, y, w, h, radial_gradient);
else else
@ -476,7 +476,7 @@ eng_gradient_render_post(void *data __UNUSED__, void *gradient __UNUSED__)
static void static void
eng_gradient_draw(void *data __UNUSED__, void *context, void *surface, void *gradient, int x, int y, int w, int h) eng_gradient_draw(void *data __UNUSED__, void *context, void *surface, void *gradient, int x, int y, int w, int h)
{ {
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_grad_draw(surface, context, x, y, w, h, gradient); evas_common_pipe_grad_draw(surface, context, x, y, w, h, gradient);
else else
@ -744,7 +744,7 @@ eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image,
src_x, src_y, src_w, src_h, src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h); dst_x, dst_y, dst_w, dst_h);
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_image_draw(im, surface, context, smooth, evas_common_pipe_image_draw(im, surface, context, smooth,
src_x, src_y, src_w, src_h, src_x, src_y, src_w, src_h,
@ -890,7 +890,7 @@ eng_font_char_at_coords_get(void *data __UNUSED__, void *font, const char *text,
static void static void
eng_font_draw(void *data __UNUSED__, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const char *text) eng_font_draw(void *data __UNUSED__, void *context, void *surface, void *font, int x, int y, int w __UNUSED__, int h __UNUSED__, int ow __UNUSED__, int oh __UNUSED__, const char *text)
{ {
#ifdef BUILD_PTHREAD #ifdef BUILD_PIPE_RENDER
if (cpunum > 1) if (cpunum > 1)
evas_common_pipe_text_draw(surface, context, font, x, y, text); evas_common_pipe_text_draw(surface, context, font, x, y, text);
else else

View File

@ -237,8 +237,10 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int
Evas_Engine_Info_Software_Qtopia *info; Evas_Engine_Info_Software_Qtopia *info;
re = (Render_Engine *)data; re = (Render_Engine *)data;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_begin(surface); evas_common_pipe_begin(surface);
evas_common_pipe_flush(surface); evas_common_pipe_flush(surface);
#endif
evas_qtopia_outbuf_software_qtopia_push_updated_region(re->ob, surface, x, y, w, h); evas_qtopia_outbuf_software_qtopia_push_updated_region(re->ob, surface, x, y, w, h);
evas_qtopia_outbuf_software_qtopia_free_region_for_update(re->ob, surface); evas_qtopia_outbuf_software_qtopia_free_region_for_update(re->ob, surface);
evas_common_cpu_end_opt(); evas_common_cpu_end_opt();

View File

@ -584,8 +584,10 @@ eng_output_redraws_next_update_push(void *data, void *surface, int x, int y, int
Render_Engine *re; Render_Engine *re;
re = (Render_Engine *)data; re = (Render_Engine *)data;
#ifdef BUILD_PIPE_RENDER
evas_common_pipe_begin(surface); evas_common_pipe_begin(surface);
evas_common_pipe_flush(surface); evas_common_pipe_flush(surface);
#endif
re->outbuf_push_updated_region(re->ob, surface, x, y, w, h); re->outbuf_push_updated_region(re->ob, surface, x, y, w, h);
re->outbuf_free_region_for_update(re->ob, surface); re->outbuf_free_region_for_update(re->ob, surface);
evas_common_cpu_end_opt(); evas_common_cpu_end_opt();