efl/legacy/evas/src/modules/engines/software_x11/evas_engine.h

128 lines
5.2 KiB
C
Raw Normal View History

2002-11-08 00:02:15 -08:00
#ifndef EVAS_ENGINE_H
#define EVAS_ENGINE_H
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/XShm.h>
#include <sys/ipc.h>
#include <sys/shm.h>
2002-11-08 00:02:15 -08:00
typedef struct _Outbuf Outbuf;
typedef struct _Outbuf_Region Outbuf_Region;
2002-11-08 00:02:15 -08:00
typedef struct _X_Output_Buffer X_Output_Buffer;
typedef enum _Outbuf_Depth Outbuf_Depth;
enum _Outbuf_Depth
{
OUTBUF_DEPTH_NONE,
OUTBUF_DEPTH_INHERIT,
OUTBUF_DEPTH_RGB_16BPP_565_565_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_555_555_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_444_444_DITHERED,
OUTBUF_DEPTH_RGB_16BPP_565_444_DITHERED,
OUTBUF_DEPTH_RGB_32BPP_888_8888,
OUTBUF_DEPTH_LAST
};
struct _Outbuf
{
Outbuf_Depth depth;
int w, h;
int rot;
int onebuf;
2005-05-21 19:49:50 -07:00
2002-11-08 00:02:15 -08:00
struct {
Convert_Pal *pal;
struct {
Display *disp;
Window win;
Pixmap mask;
Visual *vis;
Colormap cmap;
int depth;
int shm;
GC gc;
GC gcm;
unsigned char swap : 1;
unsigned char bit_swap : 1;
2002-11-08 00:02:15 -08:00
} x;
struct {
DATA32 r, g, b;
} mask;
/* 1 big buffer for updates - flush on idle_flush */
RGBA_Image *onebuf;
Evas_List *onebuf_regions;
/* a list of pending regions to write to the target */
Evas_List *pending_writes;
e: 1. configure/build changes to allow cross-compiling painlessly 2. pager module namespace changes - this was still dirty afdter the namespace cleanup, so clean it up 3. add a powersave subsystem - doesnt have an "automatic" way to turn on and off right now, this i think is best provided by modules (that do things like monitor acpi status's (eg close lid of laptop), AC power status etc. etc. this allows e to nicely defer "power" expensive actions to avoid disk spinups etc. 4. move to use the new ecore poller system - discussed long ago as part of power management/saving issues. now it exists 5. add a canvas idle flush call that helsp cope with the new shm greedy software x11 engine stuff 6. use the new powersave subsystem where appropriate 7. fix non-zeroed/initted memory access in e_fm_main 8. fix mem leak for e menus 9. remove ipc handlers for changed/removed config values 10. use animaotr not timer for menu scrolls - then menu scrolls obey the fps config 11. fix up timer/poll happienss of cursor idle stuff 12. remove avoid damage from popups for now - causing problems 13. change battery and temp readouts to b e shorter so they fit 14. pager can emit signals on focus change for mini-windows now 15. temperature module now uses a slave process and uses stdin/out to talk to it and get output - this makes e smoother as in my expereicne i found getting the temp on my laptop actually took like 200ms so e "hang" for 200ms while reading the acpi files - so now the subprocess does it and just writesa back to e when it gets it. ecore: 1. add ecore_pollers. see the documentation on them in doxygen comments :) 2. fix timers to only go off when they have to - bug there that made e's select time out a LOT more than it needed to. defensive coding hid the problem. now fixed. e should be much more power friendly now. 3. formatting/niceness in ecore_exe stuff 4. some comments on comments with SIGIO ideas vs. select 5. add call to be able to add an idle enterer at the start of the list of them, not just the end (as has been the default) 6. fix ecore_evas to support auto evas idler calls after 0.5 secs of idle in all canvases - and to do it right 7. if argb destination - set the shape EVENT shape (to mask out events in transparent regions much like shape does withotu translucency) 8. in ecore_x add support for the event shape evas: 1. fix cache to work properly and not just always fill up (as it seemed to like to think cahce useage dropped below 0 when it didnt and thus just over-fill) 2. software x11 engine now ONLY uses shm segments - no ximages over the socket. this ximage hack was there to avoid the 2 round trips involved in setting up an shm image - now i mitigated that wih an shm image cache pool. it keeps shm images around and repurposes them for new update regions if appropriate. this means many fewer shm creates (about 1/100th the number) and since we recycle the memory less 0 memory page filling by the kernel - in the end, i recorded about a 10-20% speedup over the old software x11 engine. simple tests i have seen up to 120% speedups. idle flush now does something - it frees all the cached shm segments. it has a hard-coded limit of 4mb worth of shm segments (or 32 segments - whichever comes first) to keep around. once can never complain much about speedups methinks :). also evas will defer sync until the NEXT frame is written - this means evas can calculate the next frame of data while x dma's/copies the images to the screen at the same time (if you hve a dual core or multi-cpu machnike or your xserver is able to use DMA to copy image data to the screen/video ram then this should see a decent speedup). SVN revision: 33448
2008-01-10 23:33:57 -08:00
/* a list of previous frame pending regions to write to the target */
Evas_List *prev_pending_writes;
2005-05-21 19:49:50 -07:00
unsigned char mask_dither : 1;
unsigned char destination_alpha : 1;
unsigned char debug : 1;
unsigned char synced : 1;
2002-11-08 00:02:15 -08:00
} priv;
};
struct _Outbuf_Region
{
X_Output_Buffer *xob, *mxob;
int x, y, w, h;
};
struct _X_Output_Buffer
{
Display *display;
XImage *xim;
XShmSegmentInfo *shm_info;
e: 1. configure/build changes to allow cross-compiling painlessly 2. pager module namespace changes - this was still dirty afdter the namespace cleanup, so clean it up 3. add a powersave subsystem - doesnt have an "automatic" way to turn on and off right now, this i think is best provided by modules (that do things like monitor acpi status's (eg close lid of laptop), AC power status etc. etc. this allows e to nicely defer "power" expensive actions to avoid disk spinups etc. 4. move to use the new ecore poller system - discussed long ago as part of power management/saving issues. now it exists 5. add a canvas idle flush call that helsp cope with the new shm greedy software x11 engine stuff 6. use the new powersave subsystem where appropriate 7. fix non-zeroed/initted memory access in e_fm_main 8. fix mem leak for e menus 9. remove ipc handlers for changed/removed config values 10. use animaotr not timer for menu scrolls - then menu scrolls obey the fps config 11. fix up timer/poll happienss of cursor idle stuff 12. remove avoid damage from popups for now - causing problems 13. change battery and temp readouts to b e shorter so they fit 14. pager can emit signals on focus change for mini-windows now 15. temperature module now uses a slave process and uses stdin/out to talk to it and get output - this makes e smoother as in my expereicne i found getting the temp on my laptop actually took like 200ms so e "hang" for 200ms while reading the acpi files - so now the subprocess does it and just writesa back to e when it gets it. ecore: 1. add ecore_pollers. see the documentation on them in doxygen comments :) 2. fix timers to only go off when they have to - bug there that made e's select time out a LOT more than it needed to. defensive coding hid the problem. now fixed. e should be much more power friendly now. 3. formatting/niceness in ecore_exe stuff 4. some comments on comments with SIGIO ideas vs. select 5. add call to be able to add an idle enterer at the start of the list of them, not just the end (as has been the default) 6. fix ecore_evas to support auto evas idler calls after 0.5 secs of idle in all canvases - and to do it right 7. if argb destination - set the shape EVENT shape (to mask out events in transparent regions much like shape does withotu translucency) 8. in ecore_x add support for the event shape evas: 1. fix cache to work properly and not just always fill up (as it seemed to like to think cahce useage dropped below 0 when it didnt and thus just over-fill) 2. software x11 engine now ONLY uses shm segments - no ximages over the socket. this ximage hack was there to avoid the 2 round trips involved in setting up an shm image - now i mitigated that wih an shm image cache pool. it keeps shm images around and repurposes them for new update regions if appropriate. this means many fewer shm creates (about 1/100th the number) and since we recycle the memory less 0 memory page filling by the kernel - in the end, i recorded about a 10-20% speedup over the old software x11 engine. simple tests i have seen up to 120% speedups. idle flush now does something - it frees all the cached shm segments. it has a hard-coded limit of 4mb worth of shm segments (or 32 segments - whichever comes first) to keep around. once can never complain much about speedups methinks :). also evas will defer sync until the NEXT frame is written - this means evas can calculate the next frame of data while x dma's/copies the images to the screen at the same time (if you hve a dual core or multi-cpu machnike or your xserver is able to use DMA to copy image data to the screen/video ram then this should see a decent speedup). SVN revision: 33448
2008-01-10 23:33:57 -08:00
Visual *visual;
void *data;
e: 1. configure/build changes to allow cross-compiling painlessly 2. pager module namespace changes - this was still dirty afdter the namespace cleanup, so clean it up 3. add a powersave subsystem - doesnt have an "automatic" way to turn on and off right now, this i think is best provided by modules (that do things like monitor acpi status's (eg close lid of laptop), AC power status etc. etc. this allows e to nicely defer "power" expensive actions to avoid disk spinups etc. 4. move to use the new ecore poller system - discussed long ago as part of power management/saving issues. now it exists 5. add a canvas idle flush call that helsp cope with the new shm greedy software x11 engine stuff 6. use the new powersave subsystem where appropriate 7. fix non-zeroed/initted memory access in e_fm_main 8. fix mem leak for e menus 9. remove ipc handlers for changed/removed config values 10. use animaotr not timer for menu scrolls - then menu scrolls obey the fps config 11. fix up timer/poll happienss of cursor idle stuff 12. remove avoid damage from popups for now - causing problems 13. change battery and temp readouts to b e shorter so they fit 14. pager can emit signals on focus change for mini-windows now 15. temperature module now uses a slave process and uses stdin/out to talk to it and get output - this makes e smoother as in my expereicne i found getting the temp on my laptop actually took like 200ms so e "hang" for 200ms while reading the acpi files - so now the subprocess does it and just writesa back to e when it gets it. ecore: 1. add ecore_pollers. see the documentation on them in doxygen comments :) 2. fix timers to only go off when they have to - bug there that made e's select time out a LOT more than it needed to. defensive coding hid the problem. now fixed. e should be much more power friendly now. 3. formatting/niceness in ecore_exe stuff 4. some comments on comments with SIGIO ideas vs. select 5. add call to be able to add an idle enterer at the start of the list of them, not just the end (as has been the default) 6. fix ecore_evas to support auto evas idler calls after 0.5 secs of idle in all canvases - and to do it right 7. if argb destination - set the shape EVENT shape (to mask out events in transparent regions much like shape does withotu translucency) 8. in ecore_x add support for the event shape evas: 1. fix cache to work properly and not just always fill up (as it seemed to like to think cahce useage dropped below 0 when it didnt and thus just over-fill) 2. software x11 engine now ONLY uses shm segments - no ximages over the socket. this ximage hack was there to avoid the 2 round trips involved in setting up an shm image - now i mitigated that wih an shm image cache pool. it keeps shm images around and repurposes them for new update regions if appropriate. this means many fewer shm creates (about 1/100th the number) and since we recycle the memory less 0 memory page filling by the kernel - in the end, i recorded about a 10-20% speedup over the old software x11 engine. simple tests i have seen up to 120% speedups. idle flush now does something - it frees all the cached shm segments. it has a hard-coded limit of 4mb worth of shm segments (or 32 segments - whichever comes first) to keep around. once can never complain much about speedups methinks :). also evas will defer sync until the NEXT frame is written - this means evas can calculate the next frame of data while x dma's/copies the images to the screen at the same time (if you hve a dual core or multi-cpu machnike or your xserver is able to use DMA to copy image data to the screen/video ram then this should see a decent speedup). SVN revision: 33448
2008-01-10 23:33:57 -08:00
int w, h, bpl;
int psize;
};
2002-11-08 00:02:15 -08:00
/****/
void evas_software_x11_x_init (void);
2002-11-08 00:02:15 -08:00
void evas_software_x11_x_write_mask_line (Outbuf *buf, X_Output_Buffer *xob, DATA32 *src, int w, int y);
int evas_software_x11_x_can_do_shm (Display *d);
X_Output_Buffer *evas_software_x11_x_output_buffer_new (Display *d, Visual *v, int depth, int w, int h, int try_shm, void *data);
void evas_software_x11_x_output_buffer_free (X_Output_Buffer *xob, int sync);
void evas_software_x11_x_output_buffer_paste (X_Output_Buffer *xob, Drawable d, GC gc, int x, int y, int sync);
DATA8 *evas_software_x11_x_output_buffer_data (X_Output_Buffer *xob, int *bytes_per_line_ret);
int evas_software_x11_x_output_buffer_depth (X_Output_Buffer *xob);
int evas_software_x11_x_output_buffer_byte_order (X_Output_Buffer *xob);
int evas_software_x11_x_output_buffer_bit_order (X_Output_Buffer *xob);
2005-05-21 19:49:50 -07:00
void evas_software_x11_x_color_init (void);
Convert_Pal *evas_software_x11_x_color_allocate (Display *disp, Colormap cmap, Visual *vis, Convert_Pal_Mode colors);
void evas_software_x11_x_color_deallocate (Display *disp, Colormap cmap, Visual *vis, Convert_Pal *pal);
2005-05-21 19:49:50 -07:00
void evas_software_x11_outbuf_init (void);
void evas_software_x11_outbuf_free (Outbuf *buf);
2002-11-08 00:02:15 -08:00
Outbuf *evas_software_x11_outbuf_setup_x (int w, int h, int rot, Outbuf_Depth depth, Display *disp, Drawable draw, Visual *vis, Colormap cmap, int x_depth, int grayscale, int max_colors, Pixmap mask, int shape_dither, int destination_alpha);
2002-11-08 00:02:15 -08:00
RGBA_Image *evas_software_x11_outbuf_new_region_for_update (Outbuf *buf, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
void evas_software_x11_outbuf_free_region_for_update (Outbuf *buf, RGBA_Image *update);
void evas_software_x11_outbuf_flush (Outbuf *buf);
void evas_software_x11_outbuf_idle_flush (Outbuf *buf);
void evas_software_x11_outbuf_push_updated_region (Outbuf *buf, RGBA_Image *update, int x, int y, int w, int h);
void evas_software_x11_outbuf_reconfigure (Outbuf *buf, int w, int h, int rot, Outbuf_Depth depth);
int evas_software_x11_outbuf_get_width (Outbuf *buf);
int evas_software_x11_outbuf_get_height (Outbuf *buf);
Outbuf_Depth evas_software_x11_outbuf_get_depth (Outbuf *buf);
int evas_software_x11_outbuf_get_rot (Outbuf *buf);
void evas_software_x11_outbuf_drawable_set (Outbuf *buf, Drawable draw);
void evas_software_x11_outbuf_mask_set (Outbuf *buf, Pixmap mask);
void evas_software_x11_outbuf_rotation_set (Outbuf *buf, int rot);
2005-05-21 19:49:50 -07:00
void evas_software_x11_outbuf_debug_set (Outbuf *buf, int debug);
void evas_software_x11_outbuf_debug_show (Outbuf *buf, Drawable draw, int x, int y, int w, int h);
2005-05-21 19:49:50 -07:00
2002-11-08 00:02:15 -08:00
#endif