platform/upstream/efl.git
10 years agoecore_x/xlib/ecore_x_vsync.c uses dlopen and dlsym, but configure.ac
Albin Tonnerre [Tue, 29 Oct 2013 22:25:54 +0000 (23:25 +0100)]
ecore_x/xlib/ecore_x_vsync.c uses dlopen and dlsym, but configure.ac
only checks for this for the XCB variant. This results in linker errors
when using strict linker flags (-Wl,-z,defs)

10 years agoecore/wayland: Using underscore on private functions.
Rafael Antognolli [Tue, 29 Oct 2013 21:32:00 +0000 (19:32 -0200)]
ecore/wayland: Using underscore on private functions.

10 years agoecore/wayland: Oops, initialize member of malloc'ed struct.
Rafael Antognolli [Tue, 29 Oct 2013 21:14:59 +0000 (19:14 -0200)]
ecore/wayland: Oops, initialize member of malloc'ed struct.

10 years agoecore/wayland: Add some getters.
Rafael Antognolli [Tue, 29 Oct 2013 20:40:33 +0000 (18:40 -0200)]
ecore/wayland: Add some getters.

This centralizes the place where we have to wait for the init to have
finished before first using the compositor. It's also part of the later
step of hiding Ecore_Wl_* private structs.

10 years agoOn a focus_in event, if the ecore_evas already has focus, don't resend
Chris Michael [Tue, 29 Oct 2013 08:41:48 +0000 (08:41 +0000)]
On a focus_in event, if the ecore_evas already has focus, don't resend
a focus in. Similar change for focus_out also.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
10 years agoIf mouse is already inside the ecore_evas, then we don't need to call
Chris Michael [Tue, 29 Oct 2013 08:04:05 +0000 (08:04 +0000)]
If mouse is already inside the ecore_evas, then we don't need to call
the mouse_in function of the ecore_evas.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
10 years agoDon't send mouse_up or mouse_down events unless we have a focused
Chris Michael [Tue, 29 Oct 2013 08:01:41 +0000 (08:01 +0000)]
Don't send mouse_up or mouse_down events unless we have a focused
surface

Signed-off-by: Chris Michael <cp.michael@samsung.com>
10 years agoevas/cserve2: Fix error path in evas_cache2_image_writable()
Jean-Philippe Andre [Tue, 29 Oct 2013 06:12:58 +0000 (15:12 +0900)]
evas/cserve2: Fix error path in evas_cache2_image_writable()

Return NULL and check for nullity in the only calling function.

Fixes CID 1039461 (Logically dead code)

10 years agoevas/cserve2: Fix CID 1039286 (Resource leak)
Jean-Philippe Andre [Tue, 29 Oct 2013 06:03:14 +0000 (15:03 +0900)]
evas/cserve2: Fix CID 1039286 (Resource leak)

Close socket in case of connection failure.

10 years agoevas/cserve2: Fix new Coverity issues
Jean-Philippe Andre [Tue, 29 Oct 2013 04:54:15 +0000 (13:54 +0900)]
evas/cserve2: Fix new Coverity issues

Nothing extraordinary here.
Most potential crashes are extremely unlikely.

- Fix CID 1113444

- Fix CID 1113442

- Fix CID 1113441 (Logically dead code, can not be NULL)

- Fix CID 1113440: Explicit null dereferenced

This is actually an impossible situation.
Fixed by checking for nullity and printing out some error
messages instead of just crashing.

- Fix CID 1113439: Dereference after null check

Logically impossible code as both idxpath and datapath
must be either set or null at the same time.
Change the if logic to tell Coverity there's no bug.

- Fix CID 1113438 (Argument cannot be negative)

Fix wrong check of return value from shm_open.

- Fix CID 1113437 (Argument cannot be negative)

Fix wrong check of return value from shm_open.

- Fix CID 1113436 (Dereference null return value)

This case really shouldn't happen.
But the extra check does not hurt.

- Fix CID 1113435 (Dereference before null check)

Check for nullity after map open.

- Fix CID 1113434 (Extra sizeof expression)

Debug buggy debug tool :)

- Fix CID 1113433 (Uninitialized scalar variable)

Insignificant issue: only prints wrong debug logs :)

- Fix CID 1113431 (Uninitialized scalar value)

Check if (!found) only to print out logs. Not a big deal
if found was invalid.

- Fix CID 1039462 (Logically dead code)

10 years agoedje: return Eina_Bool values in setters for dragable confine and event params in...
m.biliavskyi [Tue, 29 Oct 2013 01:23:42 +0000 (10:23 +0900)]
edje: return Eina_Bool values in setters for dragable confine and event params in Edje_Edit API.

Many Edje_Edit API can fail and don't return any error information. This patch start returning
Eina_Bool for setters on dragable confine and event params to catch those error.

Reviewers: cedric

Reviewed By: cedric

CC: seoz
Differential Revision: https://phab.enlightenment.org/D274

Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
10 years agoecore/wayland: Use sync callback to report end of ecore_wl_init().
Rafael Antognolli [Mon, 28 Oct 2013 16:07:25 +0000 (14:07 -0200)]
ecore/wayland: Use sync callback to report end of ecore_wl_init().

At the end of the ecore_wl_init() function, send a sync request to the
server, and add a callback listener to the "done" event. When this event
is received, we are sure that all the registry bind requests done so
far were processed already, and that the registry and globals are
available and can be used.

Now, on the functions that request interfaces or registry, we call
_ecore_wl_init_wait(), which will check if the callback was received
already (that means that all requests inside the init were processed).
If it was not yet, then we wait until receiving that callback, before
returning the requested data.

10 years agoecore/wayland: Add info about other bound interfaces.
Rafael Antognolli [Mon, 28 Oct 2013 16:12:27 +0000 (14:12 -0200)]
ecore/wayland: Add info about other bound interfaces.

Add output, seat, data_device_manager and subcompositor as possible
bound interfaces, on the ECORE_WL_EVENT_INTERFACES_BOUND event info.

10 years agoRevert "change init done bindings."
Rafael Antognolli [Mon, 28 Oct 2013 16:46:40 +0000 (14:46 -0200)]
Revert "change init done bindings."

This reverts commit b87afd1b943b260c92f8493647b7d9cae327656e.

Wrong branch, wrong commit.

10 years agochange init done bindings.
Rafael Antognolli [Mon, 28 Oct 2013 16:07:25 +0000 (14:07 -0200)]
change init done bindings.

10 years agoeina: long forgotten function in Eina_File for Windows.
Cedric Bail [Mon, 28 Oct 2013 10:47:40 +0000 (19:47 +0900)]
eina: long forgotten function in Eina_File for Windows.

10 years agoevas: fix leak of ellipsis object in Evas_Object_Text.
Cedric Bail [Mon, 28 Oct 2013 10:45:46 +0000 (19:45 +0900)]
evas: fix leak of ellipsis object in Evas_Object_Text.

10 years agoevas: fix possible memory leak in the ellipsis code.
Cedric Bail [Mon, 28 Oct 2013 09:44:26 +0000 (18:44 +0900)]
evas: fix possible memory leak in the ellipsis code.

10 years agoeet: help the kernel to actually load the eet file in memory more efficiently.
Cedric Bail [Mon, 28 Oct 2013 09:28:38 +0000 (18:28 +0900)]
eet: help the kernel to actually load the eet file in memory more efficiently.

When you open a theme, it is very likely that most of the data in it will be needed
at some point, that's why it is a good idea to tell it in advance to the kernel so
it could load them if it has some spare ressource.

We can't just blindly turn EINA_FILE_WILLNEED on any file or a wrong eet file would
be loaded in memory when we don't need it. So we shall keep the sequential load until
we are sure that the file is correct and then explicitely tell the kernel that the
rest of the data should be loaded in ram.

10 years agoeina: fix API as we don't and never will touch memory for write in that function.
Cedric Bail [Mon, 28 Oct 2013 09:26:10 +0000 (18:26 +0900)]
eina: fix API as we don't and never will touch memory for write in that function.

10 years agoeina: avoid possible race condition when unreffing an Eina_File.
Cedric Bail [Mon, 28 Oct 2013 09:23:02 +0000 (18:23 +0900)]
eina: avoid possible race condition when unreffing an Eina_File.

10 years agoEvas/cserve2: Merge branch 'devs/jpeg/cserve2'
Jean-Philippe Andre [Mon, 28 Oct 2013 06:50:57 +0000 (15:50 +0900)]
Evas/cserve2: Merge branch 'devs/jpeg/cserve2'

Improve stability, performance and overall support of
evas cserve2.

In particular:
- Implement shared indexes and memory pools to share cserve's
  internal state with all clients. Apps can then scan these
  indexes and avoid waiting for socket responses when loading
  resources.
- Implement crash resiliency in evas. If cserve2 crashes, apps
  can safely reconnect and continue working as if nothing
  happened.
- Implement support for the GL engine (very basic support so
  far, "just works").
- Improve performance by reusing the scalecache logic.

10 years agoevas/cserve2: Merge Glyph_Data and mempool index
Jean-Philippe Andre [Fri, 11 Oct 2013 08:18:42 +0000 (17:18 +0900)]
evas/cserve2: Merge Glyph_Data and mempool index

Glyphs were previously using 3 shared buffers, now reduce to 2:
- Memory pool (mempool) containing the glyph drawable data
- Index table (Shared_Index / array) containing only the
  indexes of the buffers in the mempool
- Glyph_Data table (array) containing the glyphs descriptors
  AS WELL as the buffer indexes.

So, we just merge the two index tables into one by using directly
objects of type Glyph_Data for the referencing of the mempool
buffers.

10 years agoevas/cserve2: Add debug and reduce number of GLYPHS_USED messages
Jean-Philippe Andre [Fri, 11 Oct 2013 06:36:11 +0000 (15:36 +0900)]
evas/cserve2: Add debug and reduce number of GLYPHS_USED messages

One socket message was sent per each glyph used ... which means
a LOT of messages when text is being redrawn.

Reduce this flow of messages by triggering send() only when
50+ items are being used.
Btw, USED is a bit useless as there is no UNUSED equivalent.

Also, slightly improve debug logs.

10 years agoevas/cserve2: Use Eina_Refcount instead of int
Jean-Philippe Andre [Fri, 11 Oct 2013 05:47:07 +0000 (14:47 +0900)]
evas/cserve2: Use Eina_Refcount instead of int

Use the refcount macros instead of manually handling
integers. Not sure if it really helps since the refcounting
in cs2 client is a bit special :)

10 years agoevas/cserve2: prevent unwanted remap of strings table
Jean-Philippe Andre [Fri, 11 Oct 2013 05:31:18 +0000 (14:31 +0900)]
evas/cserve2: prevent unwanted remap of strings table

In the client, string_get() can cause a remapping of the
strings index & mempool. This means that all pointers to
string data are invalid past that call.

Solution: add a safe_get() function that prevents remap
during search. It might prove faster also, but will
return NULL more often.

10 years agoevas/cserve2: catch only SIGINT from cserve2
Jean-Philippe Andre [Fri, 11 Oct 2013 03:07:43 +0000 (12:07 +0900)]
evas/cserve2: catch only SIGINT from cserve2

SIGTERM and SIGQUIT don't need to be caught.
the proper signal to ask cserve2 to exit cleanly is SIGINT.

enlightenment_start (or systemd) should be responsible for
restarting in case of crash / unexpected termination.

cserve2 will not restart if killed with signal SIGINT,
as it will then exit with return code 0 (normal)

10 years agoevas/cserve2: Reduce repacking and resizing of SHM
Jean-Philippe Andre [Thu, 10 Oct 2013 08:15:21 +0000 (17:15 +0900)]
evas/cserve2: Reduce repacking and resizing of SHM

These operations have tons of side effects and it's a lot
easier to just avoid doing them. Now, repacking will always
need to happen as applications will add/delete strings and
items, but the less frequent, the better :)

Also, align most arrays & mempools to 32K instead of the
default page size (4K). This will also reduce resizes.

10 years agoevas/cserve2: Fix font reloading after cserve2 restart.
Jean-Philippe Andre [Thu, 10 Oct 2013 00:26:42 +0000 (09:26 +0900)]
evas/cserve2: Fix font reloading after cserve2 restart.

Well it LOOKS like it's working properly.
Clients can safely keep running after cserve2 crashed and
restarted.

10 years agoevas/cserve2: Add PID to shm filenames
Jean-Philippe Andre [Tue, 8 Oct 2013 08:06:33 +0000 (17:06 +0900)]
evas/cserve2: Add PID to shm filenames

This will help identify new memory pools in case cserve2
restarts and reloads the same glyphs for instance.

10 years agoevas/cserve2: Fix refcount for glyphs & glyph buffers
Jean-Philippe Andre [Mon, 7 Oct 2013 06:59:13 +0000 (15:59 +0900)]
evas/cserve2: Fix refcount for glyphs & glyph buffers

Maybe a little overkill on the iterations (ref/unref),
but at least we can really track down which glyphs are
currently being used.

10 years agoevas/cserve2: Reconnect to cserve2 in case of server crash
Jean-Philippe Andre [Wed, 2 Oct 2013 11:23:14 +0000 (20:23 +0900)]
evas/cserve2: Reconnect to cserve2 in case of server crash

Try to reconnect to cserve2 if the socket connection was lost.
Resend some messages if necessary.

Images reload seems to be working.
Actually, the images don't change over time, so the clients just
keep the previous references to their images.

FONT RELOAD IS NOT WORKING:
- Crashes
- Invalid glyph data
- Infinite loop in _glyph_map_remap_check()

Root cause:
When new glyphs are requested from the server, they are added to
the mempool. So it is necessary to remap the font.
Unfortunately, in case of server reboot, we did not keep the mempool
so the old glyphs that were not requested again will not be valid.

10 years agoevas/cserve2: Implement support for GL engine
Jean-Philippe Andre [Wed, 2 Oct 2013 06:07:25 +0000 (15:07 +0900)]
evas/cserve2: Implement support for GL engine

Simply call the appropriate cache2 functions when possible
and check for usage of cache2 whenever an evas_cache_ function
is called.

This effectively adds cserve2 image (data) load support for the
GL engines. Fonts were already working out-of-the-box.

10 years agoevas/cserve2: Fix CList usage
Jean-Philippe Andre [Wed, 2 Oct 2013 06:05:44 +0000 (15:05 +0900)]
evas/cserve2: Fix CList usage

In some error cases, the list could become a cycle.
Foreach would then loop forever!

10 years agoevas/cserve2: Fix reload of image without load_opts
Jean-Philippe Andre [Tue, 1 Oct 2013 02:59:40 +0000 (11:59 +0900)]
evas/cserve2: Fix reload of image without load_opts

Problem: Images opened without load_opts are reopened
multiple times.
Solution: Use empty load opts when looking for the key.

10 years agoevas/cserve2: Fix scaling error (server side)
Jean-Philippe Andre [Mon, 30 Sep 2013 09:46:49 +0000 (18:46 +0900)]
evas/cserve2: Fix scaling error (server side)

This causes crashes in the client also...

10 years agoevas/cserve2: Fix animated Gifs support with cs2
Jean-Philippe Andre [Fri, 27 Sep 2013 05:46:48 +0000 (14:46 +0900)]
evas/cserve2: Fix animated Gifs support with cs2

cserve2 does not support animated Gifs, as the animated icon
logic doesn't match cserve2 logic.
Also, there is probably no need to cache these into shared
buffers anyways :)

Solution: fallback to normal cache (and delete current entry in
the client)

10 years agoevas/cserve2: Fix invalid file referencing in client
Jean-Philippe Andre [Wed, 25 Sep 2013 09:57:04 +0000 (18:57 +0900)]
evas/cserve2: Fix invalid file referencing in client

Fixes elementary_test "Bg Image":
 - Various load_opts (jpeg geometry) where not handled properly
   by the client.

10 years agoevas/cserve2: Fix scaling options
Jean-Philippe Andre [Tue, 24 Sep 2013 09:46:17 +0000 (18:46 +0900)]
evas/cserve2: Fix scaling options

Be more careful when selecting the original image for scaling.
Most load opts must remain the same, only smooth can be toyed with.
Also, fix alpha when scaling.

10 years agoevas/cserve2: Add alpha flag to Image_data
Jean-Philippe Andre [Tue, 24 Sep 2013 09:18:53 +0000 (18:18 +0900)]
evas/cserve2: Add alpha flag to Image_data

10 years agoevas/cserve2: Use scalecache with cserve2
Jean-Philippe Andre [Mon, 23 Sep 2013 08:51:06 +0000 (17:51 +0900)]
evas/cserve2: Use scalecache with cserve2

Let's reuse the logic from scalecache and call cserve2
functions when the scalecache should be used.
So, now, cserve2 server will not scale any image... This is
too computationally intensive for the server's main thread.

This is not optimal but makes a hell of a lot more sense for
the moment. (since cserve2 manages the SHM segments)

10 years agoevas/cserve2: Add cache hit count on image data
Jean-Philippe Andre [Mon, 9 Sep 2013 04:57:45 +0000 (13:57 +0900)]
evas/cserve2: Add cache hit count on image data

10 years agoevas/cserve2: Fix images indexing (File_Entry stuff)
Jean-Philippe Andre [Fri, 6 Sep 2013 02:53:28 +0000 (11:53 +0900)]
evas/cserve2: Fix images indexing (File_Entry stuff)

High-level problem:
cserve2 does not support load_opts properly when opening an image.
As a result, when (pre)loading a JPEG file with specific load
options (eg. w, h, region and orientation), the image buffer might
have the wrong dimensions.

So, we need to use load_opts when computing file hash key.
And, pass these load options to the loader slave,
and use them while OPENING the image. This will set
properly the geometry.

Fixes test "Preload and Prescale" in elementary_test.

10 years agoevas/cserve2: Drop pre-emptive load of large images
Jean-Philippe Andre [Thu, 5 Sep 2013 08:44:10 +0000 (17:44 +0900)]
evas/cserve2: Drop pre-emptive load of large images

When the image is too large, let's not preload it unless
specifically requested by the application.

Value 320x320 is completely arbitrary.

10 years agoevas/cserve2: Fallback to normal cache for animated gifs
Jean-Philippe Andre [Wed, 4 Sep 2013 07:14:37 +0000 (16:14 +0900)]
evas/cserve2: Fallback to normal cache for animated gifs

Pass around "animated" flag for images that can be animated.
Fallback to local cache if the image is animated.
Implementing support for animated images in cserve2 does
not seem to make a lot of sense considering each frame must
be requested independently in real time,... and to be honest
there doesn't seem to be any valid use case anyway :)

10 years agoevas: Fix potential crash after image preload
Jean-Philippe Andre [Tue, 3 Sep 2013 06:53:08 +0000 (15:53 +0900)]
evas: Fix potential crash after image preload

E17 crashed when running under cserve2.
Not sure about this commit. Also what about the other functions.

10 years agoevas/cserve2: Reuse file entries when possible
Jean-Philippe Andre [Tue, 3 Sep 2013 06:24:27 +0000 (15:24 +0900)]
evas/cserve2: Reuse file entries when possible

For some reason, a new File_Entry was created whenever
a new image is loaded, even if that file was already
opened by the client.

10 years agoevas/cserve2: Reduce debug logs (s/INF/DBG)
Jean-Philippe Andre [Tue, 3 Sep 2013 02:27:27 +0000 (11:27 +0900)]
evas/cserve2: Reduce debug logs (s/INF/DBG)

10 years agoevas/cserve2: Fallback to normal cache for mmap
Jean-Philippe Andre [Mon, 2 Sep 2013 09:53:18 +0000 (18:53 +0900)]
evas/cserve2: Fallback to normal cache for mmap

cserve2 can't handle virtual files (mmap-only), by design.
Proper support can be added later on, but for now we might want
to just fallback to the normal cache functions.

Fixes photocam test

10 years agoevas/cserve2: Fix font hinting
Jean-Philippe Andre [Mon, 2 Sep 2013 07:17:05 +0000 (16:17 +0900)]
evas/cserve2: Fix font hinting

cserve2 was not handling font hints properly in the server side
Add some consistency checks and separate glyphs per hinting value

10 years agoevas/cserve2: Reset pointers to NULL after close
Jean-Philippe Andre [Mon, 2 Sep 2013 01:10:02 +0000 (10:10 +0900)]
evas/cserve2: Reset pointers to NULL after close

10 years agoevas/cserve2: Add TIMEOUT macro for cs2 client
Jean-Philippe Andre [Thu, 29 Aug 2013 07:46:25 +0000 (16:46 +0900)]
evas/cserve2: Add TIMEOUT macro for cs2 client

This will help debugging as we can disable the timeout on demand.

10 years agoevas/cserve2: Fix segfault in cserve2 slave
Jean-Philippe Andre [Tue, 27 Aug 2013 07:03:28 +0000 (16:03 +0900)]
evas/cserve2: Fix segfault in cserve2 slave

Slaves always crash when loading SVG images.
The svg module was simply not a dynamic module.

10 years agoevas/cserve2: Small performance fixes
Jean-Philippe Andre [Tue, 27 Aug 2013 06:35:22 +0000 (15:35 +0900)]
evas/cserve2: Small performance fixes

10 years agoevas/cserve2: Modify usage of EVAS_CSERVE2 env
Jean-Philippe Andre [Tue, 27 Aug 2013 03:47:51 +0000 (12:47 +0900)]
evas/cserve2: Modify usage of EVAS_CSERVE2 env

Check the value of "EVAS_CSERVE2" instead of just checking
if it is defined in the environment. So we can set to 0
to disable.

10 years agoevas/cserve2: Repack strings index when too fragmented
Jean-Philippe Andre [Tue, 27 Aug 2013 02:14:21 +0000 (11:14 +0900)]
evas/cserve2: Repack strings index when too fragmented

10 years agoevas/cserve2: Fix NULL vs. empty string
Jean-Philippe Andre [Tue, 27 Aug 2013 00:56:50 +0000 (09:56 +0900)]
evas/cserve2: Fix NULL vs. empty string

Server side: Some strings were NULL, some other were empty.
Client side was looking for NULL, but the shared index contained
empty key.

10 years agoevas/cserve2: Rename _evas_cache_ to _evas_cache2_
Jean-Philippe Andre [Mon, 26 Aug 2013 10:59:24 +0000 (19:59 +0900)]
evas/cserve2: Rename _evas_cache_ to _evas_cache2_

10 years agoevas/cserve2: Fix crashes in E17/cserve2
Jean-Philippe Andre [Mon, 26 Aug 2013 08:32:09 +0000 (17:32 +0900)]
evas/cserve2: Fix crashes in E17/cserve2

When remapping the glyph data buffer, we need to reposition
the glyph pointers as well.

10 years agoevas/cserve2: Scan glyphs and add to fash
Jean-Philippe Andre [Mon, 26 Aug 2013 07:48:49 +0000 (16:48 +0900)]
evas/cserve2: Scan glyphs and add to fash

This will save (just) a few socket waits.

10 years agoevas/cserve2: Remap glyph mempool if resized
Jean-Philippe Andre [Mon, 26 Aug 2013 06:40:54 +0000 (15:40 +0900)]
evas/cserve2: Remap glyph mempool if resized

10 years agoevas/cserve2: Use only one Glyph_Map per font
Jean-Philippe Andre [Mon, 26 Aug 2013 06:31:52 +0000 (15:31 +0900)]
evas/cserve2: Use only one Glyph_Map per font

In the new cs2 model, only one shared buffer is allocated
for a font, and it resizes on demand.

10 years agoevas/cserve2: Remap indexes when count is wrong
Jean-Philippe Andre [Fri, 23 Aug 2013 09:31:30 +0000 (18:31 +0900)]
evas/cserve2: Remap indexes when count is wrong

When advertised count is wrong, try to remap the index.
This will avoid errors with string_get().

10 years agoevas/cserve2: Fix lag with invalid font glyphs
Jean-Philippe Andre [Fri, 23 Aug 2013 09:01:22 +0000 (18:01 +0900)]
evas/cserve2: Fix lag with invalid font glyphs

10 years agoevas/cserve2: Add valid flag on Image_Data and File_Data
Jean-Philippe Andre [Fri, 23 Aug 2013 06:10:03 +0000 (15:10 +0900)]
evas/cserve2: Add valid flag on Image_Data and File_Data

Images and Files can be discovered by the client scanner before they
are valid (aka. loaded or opened). We want clients to ignore all
shared objects that are not ready yet, as they are in an undefined
state (values and memory might be invalid).

10 years agoevas/cserve2: Remap string entries when size changed
Jean-Philippe Andre [Fri, 23 Aug 2013 05:52:11 +0000 (14:52 +0900)]
evas/cserve2: Remap string entries when size changed

Lots of files can't be found by the client when the strings table
changed, because it was not remapped properly.

10 years agoevas/cserve2: Optimize shared strings
Jean-Philippe Andre [Thu, 22 Aug 2013 07:53:51 +0000 (16:53 +0900)]
evas/cserve2: Optimize shared strings

Shared string indexes are not repacked, since they live in a
memory pool (where the indexes can be reused).
So, the index in the table is equal to their ID. Add initial
test to check if the item at index n has the ID n.

10 years agoevas/cserve2: Add SHM debug tool (CLI)
Jean-Philippe Andre [Thu, 22 Aug 2013 01:43:53 +0000 (10:43 +0900)]
evas/cserve2: Add SHM debug tool (CLI)

Prints out the content or the shared index.
Does not need any socket connection to the server, read-only.

10 years agoevas/cserve2: Add glyph shm names to Font_Data
Jean-Philippe Andre [Thu, 22 Aug 2013 05:55:07 +0000 (14:55 +0900)]
evas/cserve2: Add glyph shm names to Font_Data

10 years agoevas/cserve2: Remove dead code.
Jean-Philippe Andre [Wed, 21 Aug 2013 07:43:20 +0000 (16:43 +0900)]
evas/cserve2: Remove dead code.

10 years agoevas/cserve2: Add proper tags to shm arrays
Jean-Philippe Andre [Wed, 21 Aug 2013 04:51:15 +0000 (13:51 +0900)]
evas/cserve2: Add proper tags to shm arrays

Use tags such as INDX, FONT, IMAG, FILE.
These can help debugging and for robustness, as they will
be visible in the memory dump.

Update generation_id after repack as well

10 years agoevas/cserve2: Fix cserve2_usage tool
Jean-Philippe Andre [Tue, 20 Aug 2013 09:26:02 +0000 (18:26 +0900)]
evas/cserve2: Fix cserve2_usage tool

Also, print shared arrays usage as it is sent as first message
upon connection to the server.

Add fonts to LRU and flush LRU as needed.
Seems to work okay. Could probably be finetuned a bit.

10 years agoevas/cserve2: Client-side scanning of Font Entries
Jean-Philippe Andre [Tue, 20 Aug 2013 04:09:02 +0000 (13:09 +0900)]
evas/cserve2: Client-side scanning of Font Entries

10 years agoevas/cserve2: Store Glyph_Data in shared mempools
Jean-Philippe Andre [Mon, 19 Aug 2013 03:22:19 +0000 (12:22 +0900)]
evas/cserve2: Store Glyph_Data in shared mempools

- Create one Glyph_Data array per Font_Entry
- Copy Font_Source descriptors in shared array
- Copy font entries in shared index
- Send font index path over socket
- Merge Font_Source and Font_Data in shared memory
- Send font index path on client connect
- Repack font index after free
- Pass font shm name to clients

10 years agoevas/cserve2: Add mempool_buffer_offset_get() api
Jean-Philippe Andre [Wed, 14 Aug 2013 04:57:41 +0000 (13:57 +0900)]
evas/cserve2: Add mempool_buffer_offset_get() api

10 years agoevas/cserve2: Store glyphs in shared arrays
Jean-Philippe Andre [Wed, 7 Aug 2013 09:48:00 +0000 (18:48 +0900)]
evas/cserve2: Store glyphs in shared arrays

Also, change the internal structure of glyph listing:
 - Use lists instead of inlists

Switch to use Glyph_Data instead of Glyph_Entry

10 years agoevas/cserve2: Add compile-time log level flag for cserve2
Jean-Philippe Andre [Wed, 7 Aug 2013 06:45:35 +0000 (15:45 +0900)]
evas/cserve2: Add compile-time log level flag for cserve2

DBG and INF messages pollute the logs and performance reports
from valgrind, let's disable them at build-time for better
benchmarking.

Fix other compilation warnings and clean code a bit

10 years agoevas/cserve2: Optimize cserve2_shared_string_del()
Jean-Philippe Andre [Tue, 6 Aug 2013 05:52:12 +0000 (14:52 +0900)]
evas/cserve2: Optimize cserve2_shared_string_del()

eina_hash_del_by_data is very expensive, so let's delete by key
since we can get the original data.

10 years agoevas/cserve2: Add binary search in server side
Jean-Philippe Andre [Fri, 2 Aug 2013 06:27:20 +0000 (15:27 +0900)]
evas/cserve2: Add binary search in server side

10 years agoevas/cserve2: Fix race condition on font load / socket fail
Jean-Philippe Andre [Fri, 2 Aug 2013 06:16:24 +0000 (15:16 +0900)]
evas/cserve2: Fix race condition on font load / socket fail

If the client exits while the server is loading fonts,
the font entry objects are accessed after being freed.

Note: This is not a proper fix. The race condition should still
be fixed, but delaying client deletion a bit might help for a while...

10 years agoevas/cserve2: Fix Eina_File leak at shutdown
Jean-Philippe Andre [Thu, 1 Aug 2013 09:39:38 +0000 (18:39 +0900)]
evas/cserve2: Fix Eina_File leak at shutdown

cserve2_shutdown was not called

10 years agoevas/cserve2: Scan shared indexes in client side
Jean-Philippe Andre [Wed, 31 Jul 2013 11:29:41 +0000 (20:29 +0900)]
evas/cserve2: Scan shared indexes in client side

Read Image descriptors from the shared arrays

But, accessing the shared index can be a bit expensive, so
try to read from the socket before scanning the index,
without blocking.

10 years agoevas/cserve2: Add _shared_index_remap_check()
Jean-Philippe Andre [Wed, 31 Jul 2013 10:31:50 +0000 (19:31 +0900)]
evas/cserve2: Add _shared_index_remap_check()

Check consistency of index header and remap if necessary.

10 years agoevas/cserve2: Share paths of index tables with clients
Jean-Philippe Andre [Mon, 29 Jul 2013 06:41:23 +0000 (15:41 +0900)]
evas/cserve2: Share paths of index tables with clients

- Send paths to all connected clients
- Send paths upon connection from a new client

- Client side:
 - Fast find opened images
 - Fast find loaded images
 - Optimize load by skipping socket wait

Also, remap indexes when needed (file size changed)
When index file grows, the clients are not notified, so they
must constantly check that their mapping matches the current array
size.

10 years agoevas/cserve2: Prepare shared indexes in clients
Jean-Philippe Andre [Mon, 29 Jul 2013 04:08:36 +0000 (13:08 +0900)]
evas/cserve2: Prepare shared indexes in clients

- Move required struct definitions to common evas_cs2.h

- Open/close shm and map arrays to memory
Pretty stupid for now as it will close & reopen the shm files
even when unchanged.

- Check shm size and array header consistency

- Implement message send

- Send messages from server when calling repack()

10 years agoevas/cserve2: Fix image load premultiplication
Jean-Philippe Andre [Thu, 25 Jul 2013 03:31:45 +0000 (12:31 +0900)]
evas/cserve2: Fix image load premultiplication

There was a color problem in elementary_test since elm
sets premul to 0 while expedite sets it to 1 during image load.

10 years agoevas/cserve2: _cserve2_cache_fast_scaling_check()
Jean-Philippe Andre [Wed, 24 Jul 2013 09:32:07 +0000 (18:32 +0900)]
evas/cserve2: _cserve2_cache_fast_scaling_check()

Adapt function to new Data/Entry model.

10 years agoevas/cserve2: Simplify error logs
Jean-Philippe Andre [Wed, 24 Jul 2013 09:17:52 +0000 (18:17 +0900)]
evas/cserve2: Simplify error logs

10 years agoevas/cserve2: Store Image_Data in shared array
Jean-Philippe Andre [Wed, 24 Jul 2013 05:34:35 +0000 (14:34 +0900)]
evas/cserve2: Store Image_Data in shared array

Split image entries into Image_Data and Image_Entry.
Store, find and use Image_Data descriptors from shared array.
Fix some wrong hash table usages.

10 years agoevas/cserve2: binary search in Shared_Array
Jean-Philippe Andre [Wed, 24 Jul 2013 01:59:51 +0000 (10:59 +0900)]
evas/cserve2: binary search in Shared_Array

10 years agoevas/cserve2: Repack File_Data shared array
Jean-Philippe Andre [Tue, 23 Jul 2013 10:30:54 +0000 (19:30 +0900)]
evas/cserve2: Repack File_Data shared array

10 years agoevas/cserve2: Use Shared_Array storage for File_Data
Jean-Philippe Andre [Mon, 22 Jul 2013 07:28:42 +0000 (16:28 +0900)]
evas/cserve2: Use Shared_Array storage for File_Data

File_Entry and File_Data are now two different types,
one being stored in the shared array, the other one
is only a reference counting entry.

10 years agoevas/cserve2: Rename File_Data pointers to fd
Jean-Philippe Andre [Fri, 19 Jul 2013 04:58:56 +0000 (13:58 +0900)]
evas/cserve2: Rename File_Data pointers to fd

The name fe is also used by Font_Entry, slightly confusing

10 years agoevas/cserve2: Use unique id counter
Jean-Philippe Andre [Mon, 22 Jul 2013 06:27:53 +0000 (15:27 +0900)]
evas/cserve2: Use unique id counter

Merge file id and image id into a single entry id.

10 years agoevas/cserve2: Implement shared index and buffers
Jean-Philippe Andre [Thu, 18 Jul 2013 10:39:33 +0000 (19:39 +0900)]
evas/cserve2: Implement shared index and buffers

Only import the C file for now.
Implement the following features:

- Shared Arrays
Store arrays of elements of fixed size in shm.

- Shared Mempool
Store random sized buffers in shm.
These buffers are indexed in a Shared Array and are
referred to using their index only.

- Shared Strings
Store strings in a shm in a way similar to Eina_Stringshare
(except strings are referred to using an int index).

- Include evas_cserve2_index.c to the compilation.
- Declare shared index functions in header file.
- Call init() and shutdown() on the shared index subsystem.
- Add find and foreach functions

10 years agoevas/cserve2: Add functions to resize shm files
Jean-Philippe Andre [Thu, 18 Jul 2013 10:21:58 +0000 (19:21 +0900)]
evas/cserve2: Add functions to resize shm files

- cserve2_shm_segment_request()
Creates a new shm segment (Shm_Handle) from an existing file,
without changing the current mmap.

- cserve2_shm_resize()
Grows the file and remaps in memory (new virtual address).

- cserve2_shm_id_get()
Returns the shm creation ID.

10 years agoevas/cserve2: Prepare usage of shared strings
Jean-Philippe Andre [Thu, 18 Jul 2013 08:54:06 +0000 (17:54 +0900)]
evas/cserve2: Prepare usage of shared strings

+ Add macros to fake usage of future cserve2 strings functions
+ Rename all File_Entry to fe
+ Other costmetic changes

10 years agoevas/cserve2: Add CRIT() macro
Jean-Philippe Andre [Thu, 18 Jul 2013 10:18:24 +0000 (19:18 +0900)]
evas/cserve2: Add CRIT() macro

For easy debugging

10 years agoevas - cover corner case for native surface shared refs on obj delete
Carsten Haitzler (Rasterman) [Mon, 28 Oct 2013 01:26:32 +0000 (10:26 +0900)]
evas - cover corner case for native surface shared refs on obj delete

10 years agoFix formatting
Chris Michael [Sun, 27 Oct 2013 15:44:31 +0000 (15:44 +0000)]
Fix formatting

Signed-off-by: Chris Michael <devilhorns@comcast.net>