Re: [E-devel] Creating Enlightenment Gadgets

2018-01-13 Thread Derek Foreman
non-technical debate and address one point>


On 2018-01-13 12:37 AM, Carsten Haitzler wrote:

On Fri, 12 Jan 2018 19:48:15 + Mike Blumenkrantz
 said:



On Fri, Jan 12, 2018 at 9:45 AM Carsten Haitzler 
wrote:


On Fri, 12 Jan 2018 13:48:46 + Stephen Houston 
said:


Both of these cases are solved by rendering the buffers (both gl and
software) directly in the outer compositor; see
https://phab.enlightenment.org/T6592 on the gadgets workboard for this task
which is already nearing completion.


that doesn't change anything. some work somewhere has to either copy the data
to video memory every change OR the the gpu will likely have to composite and
thus access data over a bus (eg over pci bus). if it's an embedded system all
memory is equal, but subsurface are going to unlikely help because you'll not
have enough hw layers to assign to a host of gadgets. there will generally
maybe be 2-5 ... maybe on a good day 8 or 10 layers, and these are far better
used for application windows (e.g. separating desktop, active/focused window or
window being moved/dragged, etc. etc.). it's still a gadget rendering to a
buffer THEN that buffer having to be copied again ... always. at all times.


Hey Raster,

The trick here is that a wl_shm or dmabuf will never actually be 
rendered by the *nested* compositor.


The nested compositor will simply created a proxy buffer and use the 
existing "hardware" plane infrastructure to place this on a subsurface 
(I'm calling these virtual hardware planes).  It won't even open the 
file descriptors, it'll just create parent compositor objects for them 
and proxy along placement and damage requests.


There are a few technical hurdles and @optimizations required to get us 
there, but that's the tl;dr.


When finished, this should prevent all "double draw" performance losses 
as well as allowing some surprising tricks like GL clients proxying 
dmabuf GPU rendered buffers through a SW rendering nested compositor to 
a GL rendering parent compositor, which can directly use them as textures.


Thanks,
Derek

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Creating Enlightenment Gadgets

2018-01-15 Thread Derek Foreman

On 2018-01-14 12:37 AM, Carsten Haitzler wrote:

On Sat, 13 Jan 2018 09:06:49 -0600 Derek Foreman  said:




On 2018-01-13 12:37 AM, Carsten Haitzler wrote:

On Fri, 12 Jan 2018 19:48:15 + Mike Blumenkrantz
 said:



On Fri, Jan 12, 2018 at 9:45 AM Carsten Haitzler 
wrote:


On Fri, 12 Jan 2018 13:48:46 + Stephen Houston 
said:


Both of these cases are solved by rendering the buffers (both gl and
software) directly in the outer compositor; see
https://phab.enlightenment.org/T6592 on the gadgets workboard for this task
which is already nearing completion.


that doesn't change anything. some work somewhere has to either copy the
data to video memory every change OR the the gpu will likely have to
composite and thus access data over a bus (eg over pci bus). if it's an
embedded system all memory is equal, but subsurface are going to unlikely
help because you'll not have enough hw layers to assign to a host of
gadgets. there will generally maybe be 2-5 ... maybe on a good day 8 or 10
layers, and these are far better used for application windows (e.g.
separating desktop, active/focused window or window being moved/dragged,
etc. etc.). it's still a gadget rendering to a buffer THEN that buffer
having to be copied again ... always. at all times.


Hey Raster,

The trick here is that a wl_shm or dmabuf will never actually be
rendered by the *nested* compositor.


someone has to render it to the final buffer/screen. either the MAIN compositor
has to do this or it's assigned to a hw layer (thus a hardware compositor does
it). in the end it adds up to an "always there extra buffer or set of buffers
that are swapped". with modules where e is doing all the rendering there is no
such buffer (unless we use map or proxies and force it as a choice). i'm just
pointing out that there is a cost and it's non-free. but it's also "always
there", as opposed to if rendering is done in enlightenment where it can be a
choice turned on and off at will (or on the fly).


The nested compositor will simply created a proxy buffer and use the
existing "hardware" plane infrastructure to place this on a subsurface
(I'm calling these virtual hardware planes).  It won't even open the
file descriptors, it'll just create parent compositor objects for them
and proxy along placement and damage requests.


yup. i got that... but i directly addressed that. the rendering pipeline here
in a wayland sense is:

COPY src texture/image data -> client visible buffer
0buffer swapped/sent to compositor (zero copy)
COPY compositor read buffer -> write/render to compositor backbuffer
0compositor display backbuffer


Yes, true, wl_shm will always take that hit.

Any time we can render into dmabuf instead we can then source the buffer 
directly as a texture if the compositor is using gl, and burn fill rate 
instead of cpu cycles.


This is all damage tracked, of course, for "minimal" updates - but it 
is, as you say, not 100% efficient for bandwidth or for RAM.


What we will lose is:

COPY src texture/image data -> client visible buffer
0buffer swapped/sent to compositor (zero copy)
COPY nested compositor renders
0nested compositor buffer swapped/sent to compositor
COPY compositor read buffer -> write/render to compositor backbuffer
0compositor display backbuffer


where gadgets inside e are:

COPY src texture/image data -> write/render to compositor backbuffer
0compositor display backbuffer

if you have enough hw layers for each and every gadget buffer (which i doubt
given that mostly hw has maybe 2 or 3 layers, sometimes 5 or maybe 8), those
layers would be far more effectively spent on mouse cursor and focused client
windows etc... thus the first pipeline is what will be really happening. yes.
if the buffer gets assigned to a hw layer it's

COPY src texture/image data -> client visible buffer
0buffer swapped/sent to compositor (zero copy)
0compositor assigns buffer to hw layer

though hw layers aren't totally free either. the hw is dma scanning them every
refresh to the screeen in addition to all other hw layers... :) it depends
where your memory is and so on as to how this impacts things.


Right - and most non-rpi hardware I've had my hands on appears to 
support 1 small ARGB plane (cursor) and 1 XRGB capable plane (intended 
for video, also generally supports YUV stuffs).


The lack of ARGB on the full size plane makes it useless for general 
clients, as they usually want to render drop shadows...



There are a few technical hurdles and @optimizations required to get us
there, but that's the tl;dr.

When finished, this should prevent all "double draw" performance losses
as well as allowing some surprising tricks like GL clients proxying
dmabuf GPU rendered buffers through a SW rendering nested compositor to
a GL rendering parent compositor, which can directly use them a

Re: [E-devel] [EGIT] [core/efl] master 01/02: gl_drm: Move the gl symbol check to immediately after display init

2018-03-08 Thread Derek Foreman

On 2018-03-07 11:26 PM, Carsten Haitzler (The Rasterman) wrote:

On Wed, 07 Mar 2018 13:25:27 -0800 Derek Foreman  said:

this brings back memories of problems with checking for extension symbols
before a context is set up. the context may change the symbols (procaddress
returned functions) as for example the same symbol for gles1.1 might vary for
2.0 and then 3.0 ...

i know we've had these issue because that that's why the checks happen after
context init.

are you sure this is right?


I think so, but I'm not sure all of this stuff is working as intended.

As far as I can tell from the spec, we need an initialized display to 
query these strings (or NO_DISPLAY to query client extensions, which we 
really should be doing too). It's the GL_EXTENSIONS, not EGL that need a 
bound context.


It was my commit that split up and moved the gl symbols for this engine 
in commit eda81c6dffd84f so I think I was overly zealous there.  I think 
before that maybe were were using an invalid/no display and getting just 
the client strings, which are quite different.  (We actually should be 
using client strings to determine if we can use eglGetPlatformDisplay)


I've tested here and I get exactly the same string before and after the 
recent change on my intel hardware.  Haven't checked all the procaddress 
pointers.


Other compositors do the same thing (weston), so I think it's right this 
way.


What we probably should be doing is:
query egl client extensions
create display (with platform base if it's in client exts)
init display
query egl extensions
create context (perhaps using IMG's priority ext)
makecurrent
query gl extensions

but I'm having a really hard time understanding the guts of 
evas_gl_symbols() as it seems to expect the EGL_EXTENSIONS string to be 
passed in (it looks for EGL_KHR_image_base), but it also looks for stuff 
like GL_OES_mapbuffer which would be in the gl extension string you 
can't get until you have a context bound.


So am I supposed to call this function twice, once with EGL extensions 
and once with GL extensions?  or strcat the strings (which means I have 
to call after my context is bound?) or ??


Thanks,
Derek


derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f8658d25fa604f885ee23b20e94a2892d340bceb

commit f8658d25fa604f885ee23b20e94a2892d340bceb
Author: Derek Foreman 
Date:   Wed Mar 7 13:11:45 2018 -0600

 gl_drm: Move the gl symbol check to immediately after display init
 
 We don't actually need a context first, just an initialized display.

---
  src/modules/evas/engines/gl_drm/evas_outbuf.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c
b/src/modules/evas/engines/gl_drm/evas_outbuf.c index aff5de87bf..b1235355cc
100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -226,6 +226,8 @@ _evas_outbuf_egl_setup(Outbuf *ob)
  return EINA_FALSE;
   }
  
+   eng_gl_symbols(ob->egl.disp);

+
 if (!eglGetConfigs(ob->egl.disp, NULL, 0, &ncfg) || (ncfg == 0))
   {
  ERR("eglGetConfigs() fail. code=%#x", eglGetError());
@@ -334,8 +336,6 @@ _evas_outbuf_egl_setup(Outbuf *ob)
  goto err;
   }
  
-   eng_gl_symbols(ob->egl.disp);

-
 ob->gl_context = glsym_evas_gl_common_context_new();
 if (!ob->gl_context) goto err;
  


--








--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [EGIT] [core/efl] feature/wayland/multi-output 01/11: ecore-drm2: Re-enable all available outputs

2018-05-08 Thread Derek Foreman
FWIW, I just tried this here on Fedora and it was pretty painless.

This is a *major* improvement over arc diff.

Thanks,
Derek

On 2018-05-04 10:09 AM, Mike Blumenkrantz wrote:
> git-phab is the only thing I'm aware of which handles pushing patchsets to
> phab without merging all the patches into a single patch. What dependencies
> were missing on your distro?
> 
> On Fri, May 4, 2018 at 9:54 AM Christopher Michael 
> wrote:
> 
>> On 05/04/2018 09:27 AM, Mike Blumenkrantz wrote:
>>> Would you mind also pushing this branch to phab for easier reviewing?
>> I've
>>> created some temporary docs for doing this here:
>>> https://phab.enlightenment.org/w/arcanist/
>>>
>>
>> Is there another way to deal with this ?? I tried getting git-phab setup
>> here, but Arch does not readily available all the dependencies needed to
>> install the phabricator python module
>>
>> Just wondering if there was an easier/cleaner way to do this ??
>>
>> Cheers,
>> Chris
>>
>>
>>> On Fri, May 4, 2018 at 7:06 AM Christopher Michael <
>> devilho...@comcast.net>
>>> wrote:
>>>
 devilhorns pushed a commit to branch feature/wayland/multi-output.



>> http://git.enlightenment.org/core/efl.git/commit/?id=67d0042ca2be59b1f673c9ad8f789333108207cf

 commit 67d0042ca2be59b1f673c9ad8f789333108207cf
 Author: Chris Michael 
 Date:   Tue Feb 6 11:50:08 2018 -0500

  ecore-drm2: Re-enable all available outputs
 ---
   src/lib/ecore_drm2/ecore_drm2_outputs.c | 6 --
   1 file changed, 6 deletions(-)

 diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c
 b/src/lib/ecore_drm2/ecore_drm2_outputs.c
 index e39f26a6da..5f332e752d 100644
 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
 +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
 @@ -762,12 +762,6 @@ _output_create(Ecore_Drm2_Device *dev, const
 drmModeRes *res, const drmModeConne

  if (!eina_list_count(dev->outputs))
output->primary = EINA_TRUE;
 -   else
 - {
 -/* temporarily disable other outputs which are not primary */
 -output->connected = EINA_FALSE;
 -output->enabled = EINA_FALSE;
 - }

  dev->outputs = eina_list_append(dev->outputs, output);


 --

>>
>>
>>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [EGIT] [core/efl] feature/wayland/multi-output 01/11: ecore-drm2: Re-enable all available outputs

2018-05-08 Thread Derek Foreman
I just installed the python stuff with "pip" like the git-phab docs
suggest, is pip not available on Arch?

On 2018-05-08 02:29 PM, Christopher Michael wrote:
> Yea, I am sure it would be painless here also if my distro provided
> packages for all the python stuff that this requires. I found some of
> the missing packages inside of the Arch AUR ... but not enough of them
> to make this work :(
> 
> Chris
> 
> On 05/08/2018 12:12 PM, Derek Foreman wrote:
>> FWIW, I just tried this here on Fedora and it was pretty painless.
>>
>> This is a *major* improvement over arc diff.
>>
>> Thanks,
>> Derek
>>
>> On 2018-05-04 10:09 AM, Mike Blumenkrantz wrote:
>>> git-phab is the only thing I'm aware of which handles pushing
>>> patchsets to
>>> phab without merging all the patches into a single patch. What
>>> dependencies
>>> were missing on your distro?
>>>
>>> On Fri, May 4, 2018 at 9:54 AM Christopher Michael
>>> 
>>> wrote:
>>>
>>>> On 05/04/2018 09:27 AM, Mike Blumenkrantz wrote:
>>>>> Would you mind also pushing this branch to phab for easier reviewing?
>>>> I've
>>>>> created some temporary docs for doing this here:
>>>>> https://phab.enlightenment.org/w/arcanist/
>>>>>
>>>>
>>>> Is there another way to deal with this ?? I tried getting git-phab
>>>> setup
>>>> here, but Arch does not readily available all the dependencies
>>>> needed to
>>>> install the phabricator python module
>>>>
>>>> Just wondering if there was an easier/cleaner way to do this ??
>>>>
>>>> Cheers,
>>>> Chris
>>>>
>>>>
>>>>> On Fri, May 4, 2018 at 7:06 AM Christopher Michael <
>>>> devilho...@comcast.net>
>>>>> wrote:
>>>>>
>>>>>> devilhorns pushed a commit to branch feature/wayland/multi-output.
>>>>>>
>>>>>>
>>>>>>
>>>> http://git.enlightenment.org/core/efl.git/commit/?id=67d0042ca2be59b1f673c9ad8f789333108207cf
>>>>
>>>>>>
>>>>>> commit 67d0042ca2be59b1f673c9ad8f789333108207cf
>>>>>> Author: Chris Michael 
>>>>>> Date:   Tue Feb 6 11:50:08 2018 -0500
>>>>>>
>>>>>>   ecore-drm2: Re-enable all available outputs
>>>>>> ---
>>>>>>    src/lib/ecore_drm2/ecore_drm2_outputs.c | 6 --
>>>>>>    1 file changed, 6 deletions(-)
>>>>>>
>>>>>> diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c
>>>>>> b/src/lib/ecore_drm2/ecore_drm2_outputs.c
>>>>>> index e39f26a6da..5f332e752d 100644
>>>>>> --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
>>>>>> +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
>>>>>> @@ -762,12 +762,6 @@ _output_create(Ecore_Drm2_Device *dev, const
>>>>>> drmModeRes *res, const drmModeConne
>>>>>>
>>>>>>   if (!eina_list_count(dev->outputs))
>>>>>>     output->primary = EINA_TRUE;
>>>>>> -   else
>>>>>> - {
>>>>>> -    /* temporarily disable other outputs which are not
>>>>>> primary */
>>>>>> -    output->connected = EINA_FALSE;
>>>>>> -    output->enabled = EINA_FALSE;
>>>>>> - }
>>>>>>
>>>>>>   dev->outputs = eina_list_append(dev->outputs, output);
>>>>>>
>>>>>>
>>>>>> -- 
>>>>>>
>>>>
> 
>>
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [EGIT] [core/efl] feature/security 01/01: edje: Update code to use memcpy as per review

2018-05-10 Thread Derek Foreman
On 2018-05-10 01:50 PM, Carsten Haitzler (The Rasterman) wrote:
> On Thu, 10 May 2018 09:11:48 -0700 Christopher Michael 
> 
> said:
> 
> and this also improves nothing. if anything now it's harder to read as keyl is
> the strlen +2 (with enough pace for :\ on the end) and the buffer is keyl 
> +1...
> so you have to wrap your head around why memcpy is using an odd value for
> length... somestringlen + 1 would make sense (strlen + nul), but now it just
> smells like its a bug (though it's not).

It's actually significantly better than the previous revision for a
couple of reasons, most imporantly that it restores the previous
behaviour of null terminating the string.

This has been discussed in the phabricator differentials mentioned in
the commits.  I think this kind of thing shouldn't be done in a
"feature" branch, but rather a dev one.

You're listed as a reviewer on the differential, so you probably got the
same confusing email I did that gave me the false impression this landed
on master, it has not...

Maybe we can take further review to the relevant phab tickets to keep it
all in one place?

Thanks,
Derek

> come on dh... you know better... :)
> 
>> devilhorns pushed a commit to branch feature/security.
>>
>> http://git.enlightenment.org/core/efl.git/commit/?id=d45812f4ed38a6869822508896cfbeb2dd30ef58
>>
>> commit d45812f4ed38a6869822508896cfbeb2dd30ef58
>> Author: Chris Michael 
>> Date:   Thu May 10 12:11:29 2018 -0400
>>
>> edje: Update code to use memcpy as per review
>> ---
>>  src/bin/edje/edje_cc_out.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
>> index c953b8def3..6f8ef86021 100644
>> --- a/src/bin/edje/edje_cc_out.c
>> +++ b/src/bin/edje/edje_cc_out.c
>> @@ -4184,8 +4184,8 @@ data_process_string(Edje_Part_Collection *pc, const
>> char *prefix, char *s, void key = alloca(keyl + 1);
>> if (!key) return;
>>  
>> -   strncpy(key, prefix, keyl + 1);
>> -   strncat(key, ":\"", strlen(":\""));
>> +   memcpy(key, prefix, keyl - 1);
>> +   strncat(key, ":\"", strlen(":\"") + 1);
>>  
>> quote = 0;
>> escape = 0;
>>
>> -- 
>>
>>
> 
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] [EGIT] [core/efl] master 01/01: Revert "ecore-evas-x: set draw_block until the window receives a configure event"

2018-05-30 Thread Derek Foreman
On 2018-05-29 12:08 PM, Carsten Haitzler (The Rasterman) wrote:
> On Tue, 29 May 2018 10:13:33 -0400 Mike Blumenkrantz
>  said:
> 
>> While it is true that a mail was sent by JackDanielz related to this patch,
>> the elapsed time between that mail and this revert is roughly 1.5 hours on
>> a Saturday afternoon during a federal holiday weekend. If inactivity from a
>> patch author is going to be used as reasoning for a revert, I think that
>> the time period given should be a reasonable one.
> 
> it's the severity of the break. a totally blank screen. impossible to recover
> from without going to a text console and finding a better working revision. 
> when
> a break is severe enough then a revert asap is what needs doing with people
> already finding it and complaining after an hour or so.
> 
>> As stated in the original thread, testing for this patch occurred on a
>> number of machines, all with a similar quirk: modesetting occurs at the
>> start of every session. This happened to work around the issue exhibited in
>> some sessions. It's a bit unlucky, but that's the sort of result that can
>> be expected when there is no unit testing for the component being modified.
> 
> see below...
> 
>> Questioning the review process in your case seems like a bit of a slippery
>> slope considering that the patch was submitted over 3 weeks ago with you as
>> a reviewer, and it was mentioned more than once in another ticket that you
>> were active in at that time.
> 
> i didn't notice it... but my point is that it's quite severe and review didn't
> find it. but a review should involve trying the code out and giving it a test
> for possible failure modes. what kind of review is going on? is it just a scan
> "oh that looks good to me?"... if so what is the point if it's not catching
> problems by at least trying it out (decently)? this also goes for just
> compiling the code.
> 
> whilst i was checking some older revisions i found a commit that went through
> review, was approved AND pushed... and it didn't compile because it was
> missing a ) - not even in an ifdef for some specific os or display system. it
> never compiled. sure. a few commits after was another reviewed patch that 
> fixed
> this. what kind of review is going on that lets basic stuff like this through
> (you and cedric were not involved with this one)? this was a few weeks ago.

This happened to me recently, so you're probably citing my patches here.
I made a last minute "trivial" change to a patch set and screwed it up.
It slipped past review, and it landed that way. My bad. 100%

However, review and testing aren't strictly the same thing.  Reviewers
shouldn't have to ensure code compiles without warnings - compilers are
excellent tools for that, and the author of the code is expected to have
run one. A reviewer is supposed to look for high level issues and
goodness of fit (does this match project style, should this code be in
the project at all).

There are far worse problems than build breaks.  In general a build
break is fairly easy to resolve, and usually the person responsible will
fix it as quickly as possible (though there of course are times when
that is not the case).

EFL contains a large amount of idiosyncratic code, and quite frequently
fixing an obvious bug will unmask multiple other bugs.  At that point
EFL blame culture kicks in and the author is accused of being a
"borker", that their patches are terrible, that they have destroyed [key
functionality] etc etc.

The point of code review isn't to stop 100% of build breaks - it's to
reduce the chance that unmaintainable flaky code lands by having peers
review it to provide opinions.  Perhaps one of the reviewers will
remember some savage hack in another part of the tree that's going to
fall over now.

"Basic testing" in E/EFL is essentially undefined as there are so many
different engines, gadgets, possible monitor layouts, target GPUs, etc
etc etc, that something that manifests in 0 seconds for you might never
happen at all for me unless I remember to fiddle with options, turn on
things I don't usually use, or whatever.  Without more comprehensive
automated testing every developer becomes responsible for an intractable
amount of "basic testing".

tl;dr. yup, I broke the build for a couple of hours a few weeks ago with
a "reviewed" patch - I'm really sorry about that.  To use that as proof
that review isn't worthwhile or not rigorous seems very shortsighted.

Thanks,
Derek

>> Had the commit log for this revert been only "this patch causes this
>> regression" with a simple description of the issue, it's unlikely that this
>> mail would exist. Instead, however, it seems like this revert was being
>> used to bash both patch review and testing--something which makes little
>> sense considering that you declined to attempt either when it was
>> explicitly requested of you. I don't think it's fair for you to
>> (indirectly) criticize Cedric for trying to do the work that you did not do.
> 
> th

Re: [E-devel] EFL Freeze

2018-06-08 Thread Derek Foreman
On 2018-06-08 10:22 AM, Daniel Kolesa wrote:
> On Fri, Jun 8, 2018, at 17:17, Mike Blumenkrantz wrote:
>> Hello,
>>
>> Stefan is off for this entire month, so let's try organizing the release a
>> bit while he's gone!
>>
>> We had previously agreed to start the freeze "after Cedric's branches
>> merged". That branch was merged some time ago, and it seems we are already
>> in bug fixing mode.
>>
>> After speaking a bit with bu5hm4n/Marcel, who has been handling a lot of
>> the bug fixing, I propose the following:
>>
>> * We consider the freeze to have started as of last Friday (1 June 2018),
>> and proceed from there.
>> * During the freeze period, all newly-submitted features (ie. anything
>> submitted on or after the freeze start date) must go through patch review
>> and receive 2+ approvals from core developers; if employed by Samsung, the
>> developers must not work for the same office.
>> * Feature patches submitted prior to the freeze date which are still under
>> review and have received review comments prior to the freeze date can be
>> merged/landed through normal patch review.
>>
>> Marcel has also been working on improvements to our bug handling workflow
>> which will be explained in a forthcoming mail. I believe that these methods
>> should enable us to be in a good position to execute a release on or near
>> the time of Stefan's return.
>>
>> If nobody disagrees with the basic premise of beginning the freeze,
>> https://phab.enlightenment.org/T6926 is a great place to start looking for
>> things to work on.
>>
> 
> +1

+1

Thanks,
Derek

> D5
> 
>>
>> regards,
>>
>> Mike
>> --
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> ___
>> enlightenment-devel mailing list
>> enlightenment-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] EFL Freeze

2018-06-08 Thread Derek Foreman
On 2018-06-08 11:44 AM, Christopher Michael wrote:
> On 06/08/2018 11:17 AM, Mike Blumenkrantz wrote:
>> Hello,
>>
>> Stefan is off for this entire month, so let's try organizing the
>> release a
>> bit while he's gone!
>>
>> We had previously agreed to start the freeze "after Cedric's branches
>> merged". That branch was merged some time ago, and it seems we are
>> already
>> in bug fixing mode.
>>
>> After speaking a bit with bu5hm4n/Marcel, who has been handling a lot of
>> the bug fixing, I propose the following:
>>
>> * We consider the freeze to have started as of last Friday (1 June 2018),
>> and proceed from there.
>> * During the freeze period, all newly-submitted features (ie. anything
>> submitted on or after the freeze start date) must go through patch review
>> and receive 2+ approvals from core developers; if employed by Samsung,
>> the
>> developers must not work for the same office.
> 
> I was under the impression that one of the points of a freeze is that no
> new features could be added and we can focus on bug fixes. Your mention
> of newly-submitted features "after the freeze start date" is a little
> misleading

I read that as a way to handle any potential features already in the
review queue that didn't beat the retro-active freeze date.

Though, there was one time when I've had to add API during freeze to fix
a major wayland related bug.

My opinion, fwiw, is that features proposed after June 1 would need a
very strong justification at this point, and anything after today would
have to be an exceptional situation (absolutely required to fix a bug or
massive oversight, a showstopper).

Thanks,
Derek

>> * Feature patches submitted prior to the freeze date which are still
>> under
>> review and have received review comments prior to the freeze date can be
>> merged/landed through normal patch review.
>>
>> Marcel has also been working on improvements to our bug handling workflow
>> which will be explained in a forthcoming mail. I believe that these
>> methods
>> should enable us to be in a good position to execute a release on or near
>> the time of Stefan's return.
>>
>> If nobody disagrees with the basic premise of beginning the freeze,
>> https://phab.enlightenment.org/T6926 is a great place to start looking
>> for
>> things to work on.
>>
> 
> No disagreements here.
> 
> Cheers,
> Chris
> 
>>
>> regards,
>>
>> Mike
> 
> 
> 
> --
> 
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] More new project tags

2018-06-20 Thread Derek Foreman
Hello,

I've just added two new project tags:
"Performance" for tracking performance problems and regressions

"Refactoring" to help try to track the copy+paste abuse in various parts of
the tree and help us clean up a bit.

Thanks,
Derek
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] EFL 1.21.0 alpha1 released

2018-07-10 Thread Derek Foreman
I've created a phab ticket for this at T7120 and am testing a fix for it
now.

On 2018-07-10 12:36 AM, Simon Lees wrote:
>
> On 06/07/18 23:57, Stefan Schmidt wrote:
>> This alpha release for 1.21 starts the freeze period and stabilization
>> phase for the 1.21 release cycle. There are still problems to fix and we
>> appreciate any tester of this to let us know about problems seen. This
>> goes for packaging, testing with efl based applications, integration
>> into your systems, etc.
>>
>> http://download.enlightenment.org/rel/libs/efl/efl-1.21.0-alpha1.tar.xz
>> fd27ff6ee75438f761cc50a182f20caf92f324f58a4258c404815a71521a43d7
>>
>  OK I got past the missing file, but now it hangs on creating
> docs, it think.
>  anyone have success building 1.21.0 alpha 1 from the snapshot
> tar.gz?
>  the tar.xz on the main site news section is missing a file so
> it doesnt compile at all.
>  AJSlye, missing files in the first tarball is pretty common,
> its just normally I build test and find the missing files rather then
> you :-)
>  it's missing window_v6.x
>  frrom src/lib/ecore_wl2/
>  ok i'll ping stefan when he's up
>
>
>
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>
>
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] Goodbye

2019-02-14 Thread Derek Foreman
As some of you already know, today is my last day working for Samsung, and
I no longer have a financial incentive to contribute to EFL.

One of my primary reasons for leaving this position is that it was tied to
a continued requirement to work on EFL, and I've grown weary of doing that,
so I won't be lingering as a community developer.

Over the years there have been times when I've felt EFL was on the cusp of
outgrowing its hobby project roots and making a shift towards grown-up
standards (incorporating peer review, CI, a push for better documentation),
followed by events that felt like major setbacks on that path.  Some days
it felt like we were reducing the insurmountable mountain of technical
debt, and other days hopelessly watching it increase.

EFL is currently in a situation where leadership is frequently at odds with
the majority of contributors, and this leads to developers finding
themselves worrying that work they've been paid to do (and maybe sometimes
have even done well) will be unilaterally reverted, possibly with threats
of commit right revocation. This makes contributing pointlessly stressful,
and drives developers away.

I hope I've left my small corners of the project a little better than I
found them, and I thank you all for an opportunity to contribute.  I've met
some excellent people in my time here, and hope to keep in touch.  I'll
still be around on all the regular IRC servers, feel free to contact me*.

Best of luck,
Derek

* Just not about EFL.  Ever.  Seriously.

___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/enlightenment] enlightenment-0.21 02/28: Fix wayland clients not deleting when they're hidden

2016-08-17 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=18cef43716f68046c37d0d04eb9ee9905edb6248

commit 18cef43716f68046c37d0d04eb9ee9905edb6248
Author: Derek Foreman 
Date:   Thu Jul 21 13:09:12 2016 -0500

Fix wayland clients not deleting when they're hidden

We kept an extra reference for wayland clients and dropped it on their final
render to stop crashes.  However, if they're not on screen at the time of
their deletion this reference still needed to be dropped.

Fixes clients remaining on the deskmirror after dying on another desktop.
---
 src/bin/e_comp_wl.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index c5ddf32..dbf6b48 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -2471,6 +2471,13 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, 
E_Client *ec)
 
if (ec->internal_elm_win)
  evas_object_hide(ec->frame);
+
+   /* WL clients take an extra ref at startup so they don't get deleted while
+* visible.  Since we drop that in the render loop we need to make sure
+* it's dropped here if the client isn't going to be rendered.
+*/
+   if (!e_pixmap_is_x(ec->pixmap) && ec->hidden) e_object_unref(E_OBJECT(ec));
+
_e_comp_wl_focus_check();
 }
 

-- 




[EGIT] [core/enlightenment] enlightenment-0.21 15/28: Fix wayland extension global creation

2016-08-17 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=0af35c2470c894a20019562af094fa66c84b76f0

commit 0af35c2470c894a20019562af094fa66c84b76f0
Author: Derek Foreman 
Date:   Wed Jul 27 13:44:16 2016 -0500

Fix wayland extension global creation

The globals are singletons, but the bindings are per wl_client.
---
 src/bin/e_comp_wl.h|  6 +++---
 src/bin/e_comp_wl_extensions.c | 19 +--
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h
index 1dd47f2..9580e43 100644
--- a/src/bin/e_comp_wl.h
+++ b/src/bin/e_comp_wl.h
@@ -97,17 +97,17 @@ typedef struct E_Comp_Wl_Extension_Data
 {
struct
{
-  struct wl_resource *global;
+  struct wl_global *global;
   struct wl_client *client;
   void (*read_pixels)(E_Comp_Wl_Output *output, void *pixels);
} screenshooter;
 struct
 {
-   struct wl_resource *global;
+   struct wl_global *global;
 } session_recovery;
struct
{
-   struct wl_resource *global;
+   struct wl_global *global;
} www;
 } E_Comp_Wl_Extension_Data;
 
diff --git a/src/bin/e_comp_wl_extensions.c b/src/bin/e_comp_wl_extensions.c
index 446f2ef..4f5fac8 100644
--- a/src/bin/e_comp_wl_extensions.c
+++ b/src/bin/e_comp_wl_extensions.c
@@ -221,11 +221,6 @@ static const struct www_interface _e_www_interface =
 
 #define GLOBAL_BIND_CB(NAME, IFACE, ...) \
 static void \
-_e_comp_wl_##NAME##_cb_unbind(struct wl_resource *resource EINA_UNUSED) \
-{ \
-   e_comp_wl->extensions->NAME.global = NULL; \
-} \
-static void \
 _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void *data EINA_UNUSED, 
uint32_t version EINA_UNUSED, uint32_t id) \
 { \
struct wl_resource *res; \
@@ -237,8 +232,7 @@ _e_comp_wl_##NAME##_cb_bind(struct wl_client *client, void 
*data EINA_UNUSED, ui
 return;\
  }\
 \
-   e_comp_wl->extensions->NAME.global = res; \
-   wl_resource_set_implementation(res, &_e_##NAME##_interface, NULL, 
_e_comp_wl_##NAME##_cb_unbind);\
+   wl_resource_set_implementation(res, &_e_##NAME##_interface, NULL, NULL);\
 }
 
 GLOBAL_BIND_CB(session_recovery, zwp_e_session_recovery_interface)
@@ -248,12 +242,16 @@ GLOBAL_BIND_CB(www, www_interface)
 
 #define GLOBAL_CREATE_OR_RETURN(NAME, IFACE) \
do { \
-  if (!wl_global_create(e_comp_wl->wl.disp, &(IFACE), 1, \
-NULL, _e_comp_wl_##NAME##_cb_bind)) \
+  struct wl_global *global; \
+\
+  global = wl_global_create(e_comp_wl->wl.disp, &(IFACE), 1, \
+NULL, _e_comp_wl_##NAME##_cb_bind); \
+  if (!global) \
 { \
ERR("Could not add %s to wayland globals", #IFACE); \
return EINA_FALSE; \
 } \
+  e_comp_wl->extensions->NAME.global = global; \
} while (0)
 
 static Eina_Bool
@@ -275,6 +273,8 @@ _dmabuf_add(void *data EINA_UNUSED, int type EINA_UNUSED, 
void *event)
 EINTERN Eina_Bool
 e_comp_wl_extensions_init(void)
 {
+   e_comp_wl->extensions = E_NEW(E_Comp_Wl_Extension_Data, 1);
+
/* try to add session_recovery to wayland globals */
GLOBAL_CREATE_OR_RETURN(session_recovery, zwp_e_session_recovery_interface);
GLOBAL_CREATE_OR_RETURN(screenshooter, screenshooter_interface);
@@ -285,6 +285,5 @@ e_comp_wl_extensions_init(void)
e_client_hook_add(E_CLIENT_HOOK_MOVE_BEGIN, 
_e_comp_wl_extensions_client_move_begin, NULL);
e_client_hook_add(E_CLIENT_HOOK_MOVE_END, 
_e_comp_wl_extensions_client_move_end, NULL);
 
-   e_comp_wl->extensions = E_NEW(E_Comp_Wl_Extension_Data, 1);
return EINA_TRUE;
 }

-- 




[EGIT] [core/efl] master 02/02: wayland_egl: Fix rendering on systems without buffer age

2016-08-17 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7828d0e0720cee1fb3098bba50f718796de64989

commit 7828d0e0720cee1fb3098bba50f718796de64989
Author: Derek Foreman 
Date:   Wed Aug 17 16:22:54 2016 -0500

wayland_egl: Fix rendering on systems without buffer age

If buffer age isn't present we really want to return MODE_FULL, but we were
previously returning MODE_AUTO.

On recent mali drivers this resulted in accidental partial updates leading
to incorrect rendering.
---
 src/modules/evas/engines/wayland_egl/evas_wl_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c 
b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
index a0ac4fa..710202f 100644
--- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c
+++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
@@ -388,6 +388,7 @@ eng_outbuf_swap_mode_get(Outbuf *ob)
 return swap_mode;
  }
 
+   if (ob->swap_mode == MODE_AUTO) return MODE_FULL;
return ob->swap_mode;
 }
 

-- 




[EGIT] [core/efl] master 01/02: wayland_egl: Remove swap_mode from engine info

2016-08-17 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6ce113791e9681e940c3c8aa1a57d4781dfd6c9e

commit 6ce113791e9681e940c3c8aa1a57d4781dfd6c9e
Author: Derek Foreman 
Date:   Wed Aug 17 16:21:29 2016 -0500

wayland_egl: Remove swap_mode from engine info

This was never set anywhere and always defaulted to 0, or AUTO
---
 .../engines/wayland_egl/Evas_Engine_Wayland_Egl.h  |  1 -
 src/modules/evas/engines/wayland_egl/evas_engine.c | 37 +-
 2 files changed, 1 insertion(+), 37 deletions(-)

diff --git a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h 
b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
index 54dee26..204e286 100644
--- a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
+++ b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
@@ -43,7 +43,6 @@ struct _Evas_Engine_Info_Wayland_Egl
 
Eina_Bool vsync : 1;
Eina_Bool indirect : 1;
-   unsigned char swap_mode : 4;
 
Eina_Bool wobbling : 1;
Eina_Bool www_avail : 1;
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c 
b/src/modules/evas/engines/wayland_egl/evas_engine.c
index c79bcf6..8ccc4e1 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -558,42 +558,7 @@ eng_setup(Evas *evas, void *info)
  (!strcasecmp(s, "4")))
   swap_mode = MODE_QUADRUPLE;
  }
-   else
- {
-// in most gl implementations - egl and glx here that we care about the TEND
-// to either swap or copy backbuffer and front buffer, but strictly that is
-// not true. technically backbuffer content is totally undefined after a swap
-// and thus you MUST re-render all of it, thus MODE_FULL
-swap_mode = MODE_FULL;
-// BUT... reality is that lmost every implementation copies or swaps so
-// triple buffer mode can be used as it is a superset of double buffer and
-// copy (though using those explicitly is more efficient). so let's play with
-// triple buffer mdoe as a default and see.
-//re->mode = MODE_TRIPLE;
-// XXX: note - the above seems to break on some older intel chipsets and
-// drivers. it seems we CANT depend on backbuffer staying around. bugger!
-switch (inf->swap_mode)
-  {
-   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_FULL:
- swap_mode = MODE_FULL;
- break;
-   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_COPY:
- swap_mode = MODE_COPY;
- break;
-   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_DOUBLE:
- swap_mode = MODE_DOUBLE;
- break;
-   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_TRIPLE:
- swap_mode = MODE_TRIPLE;
- break;
-   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_QUADRUPLE:
- swap_mode = MODE_QUADRUPLE;
- break;
-   default:
- swap_mode = MODE_AUTO;
- break;
-  }
- }
+   else swap_mode = MODE_AUTO;
 
if (!(re = epd->engine.data.output))
  {

-- 




Re: [E-devel] [EGIT] [core/efl] master 01/02: wayland_egl: Remove swap_mode from engine info

2016-08-18 Thread Derek Foreman
On 18/08/16 02:28 AM, Carsten Haitzler (The Rasterman) wrote:
> On Wed, 17 Aug 2016 14:24:40 -0700 Derek Foreman  
> said:
> 
> are you sure you want to remove this? enlightenment for gl_x11 has options to
> force a specific swap mode via engine options. sure it wasn't implemented for
> wayland but it's a useful debug tool... especially when a driver gets buffer
> age wrong and you have to force it to some sane mode (like invalidate all)
> again... :)

You can still do that with an env var, but previously there were two
ways to do it:
a) env var
b) variable in the engine info with no API to set it

I was temporarily confused by the second when trying to figure out why
the swap mode was wrong on exynos, and discovered that all this complex
machinery was in place simply to set MODE_AUTO because the variable
could only ever be 0 (which it was initialized to at allocation).

I think keeping the env var method is good enough?

Thanks,
Derek

>> derekf pushed a commit to branch master.
>>
>> http://git.enlightenment.org/core/efl.git/commit/?id=6ce113791e9681e940c3c8aa1a57d4781dfd6c9e
>>
>> commit 6ce113791e9681e940c3c8aa1a57d4781dfd6c9e
>> Author: Derek Foreman 
>> Date:   Wed Aug 17 16:21:29 2016 -0500
>>
>> wayland_egl: Remove swap_mode from engine info
>> 
>> This was never set anywhere and always defaulted to 0, or AUTO
>> ---
>>  .../engines/wayland_egl/Evas_Engine_Wayland_Egl.h  |  1 -
>>  src/modules/evas/engines/wayland_egl/evas_engine.c | 37
>> +- 2 files changed, 1 insertion(+), 37 deletions(-)
>>
>> diff --git a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
>> b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h index
>> 54dee26..204e286 100644
>> --- a/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
>> +++ b/src/modules/evas/engines/wayland_egl/Evas_Engine_Wayland_Egl.h
>> @@ -43,7 +43,6 @@ struct _Evas_Engine_Info_Wayland_Egl
>>  
>> Eina_Bool vsync : 1;
>> Eina_Bool indirect : 1;
>> -   unsigned char swap_mode : 4;
>>  
>> Eina_Bool wobbling : 1;
>> Eina_Bool www_avail : 1;
>> diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c
>> b/src/modules/evas/engines/wayland_egl/evas_engine.c index c79bcf6..8ccc4e1
>> 100644
>> --- a/src/modules/evas/engines/wayland_egl/evas_engine.c
>> +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
>> @@ -558,42 +558,7 @@ eng_setup(Evas *evas, void *info)
>>   (!strcasecmp(s, "4")))
>>swap_mode = MODE_QUADRUPLE;
>>   }
>> -   else
>> - {
>> -// in most gl implementations - egl and glx here that we care about the TEND
>> -// to either swap or copy backbuffer and front buffer, but strictly that is
>> -// not true. technically backbuffer content is totally undefined after a 
>> swap
>> -// and thus you MUST re-render all of it, thus MODE_FULL
>> -swap_mode = MODE_FULL;
>> -// BUT... reality is that lmost every implementation copies or swaps so
>> -// triple buffer mode can be used as it is a superset of double buffer and
>> -// copy (though using those explicitly is more efficient). so let's play 
>> with
>> -// triple buffer mdoe as a default and see.
>> -//re->mode = MODE_TRIPLE;
>> -// XXX: note - the above seems to break on some older intel chipsets and
>> -// drivers. it seems we CANT depend on backbuffer staying around. bugger!
>> -switch (inf->swap_mode)
>> -  {
>> -   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_FULL:
>> - swap_mode = MODE_FULL;
>> - break;
>> -   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_COPY:
>> - swap_mode = MODE_COPY;
>> - break;
>> -   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_DOUBLE:
>> - swap_mode = MODE_DOUBLE;
>> - break;
>> -   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_TRIPLE:
>> - swap_mode = MODE_TRIPLE;
>> - break;
>> -   case EVAS_ENGINE_WAYLAND_EGL_SWAP_MODE_QUADRUPLE:
>> - swap_mode = MODE_QUADRUPLE;
>> - break;
>> -   default:
>> - swap_mode = MODE_AUTO;
>> - break;
>> -  }
>> - }
>> +   else swap_mode = MODE_AUTO;
>>  
>> if (!(re = epd->engine.data.output))
>>   {
>>
>> -- 
>>
>>
> 
> 


--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 01/01: wayland_shm: Fix dmabuf orientation

2016-08-19 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=20f9acdf19736ed237a06a097807a3b3ca08c3c1

commit 20f9acdf19736ed237a06a097807a3b3ca08c3c1
Author: Derek Foreman 
Date:   Fri Aug 19 14:51:55 2016 -0500

wayland_shm: Fix dmabuf orientation

So apparently when dmabuf support went into weston it went in with a
Y axis inversion that has since been corrected.

This updates our code to match.
---
 src/modules/evas/engines/wayland_shm/evas_dmabuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c 
b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
index f0dea42..7f73047 100644
--- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
@@ -638,7 +638,7 @@ _evas_dmabuf_buffer_init(Dmabuf_Surface *s, int w, int h)
Dmabuf_Buffer *out;
struct zwp_linux_buffer_params_v1 *dp;
Buffer_Manager *bm = _buffer_manager_get();
-   uint32_t flags = ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT;
+   uint32_t flags = 0;
 
if (!bm) return NULL;
 

-- 




[EGIT] [core/efl] master 01/02: engines: Add a damage_region_set callback

2016-08-19 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0c21a926a322f810352a654b82455a41e85f06b2

commit 0c21a926a322f810352a654b82455a41e85f06b2
Author: Derek Foreman 
Date:   Fri Aug 19 14:14:38 2016 -0500

engines: Add a damage_region_set callback

To properly implement EGL_KHR_partial_update we need to know the buffer
damage before any drawing operations take place.  Add a new callback to
software_generic that takes place after combining of surface damage and
swap mode when we actually have this available.

Note: This means the three copy pasta implementations of
EGL_KHR_partial_update scattered around the tree are all wrong.  bummer.
---
 src/modules/evas/engines/buffer/evas_engine.c | 1 +
 src/modules/evas/engines/drm/evas_engine.c| 1 +
 src/modules/evas/engines/gl_drm/evas_engine.c | 1 +
 src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h  | 2 ++
 src/modules/evas/engines/gl_x11/evas_engine.c | 1 +
 .../evas/engines/software_generic/Evas_Engine_Software_Generic.h  | 4 
 src/modules/evas/engines/software_generic/evas_engine.c   | 2 ++
 src/modules/evas/engines/software_x11/evas_engine.c   | 3 +++
 src/modules/evas/engines/wayland_egl/evas_engine.c| 1 +
 src/modules/evas/engines/wayland_egl/evas_engine.h| 1 +
 src/modules/evas/engines/wayland_shm/evas_engine.c| 3 ++-
 11 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/buffer/evas_engine.c 
b/src/modules/evas/engines/buffer/evas_engine.c
index 791be8b..021f7c5 100644
--- a/src/modules/evas/engines/buffer/evas_engine.c
+++ b/src/modules/evas/engines/buffer/evas_engine.c
@@ -97,6 +97,7 @@ _output_setup(int w,
  
evas_buffer_outbuf_buf_rot_get,
  
evas_buffer_outbuf_reconfigure,
  NULL,
+ NULL,
  
evas_buffer_outbuf_buf_new_region_for_update,
  
evas_buffer_outbuf_buf_push_updated_region,
  
evas_buffer_outbuf_buf_free_region_for_update,
diff --git a/src/modules/evas/engines/drm/evas_engine.c 
b/src/modules/evas/engines/drm/evas_engine.c
index 6aecbc6..0499a96 100644
--- a/src/modules/evas/engines/drm/evas_engine.c
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -26,6 +26,7 @@ _render_engine_setup(Evas_Engine_Info_Drm *info, int w, int h)
  _outbuf_rotation_get,
  _outbuf_reconfigure,
  NULL,
+ NULL,
  _outbuf_update_region_new,
  _outbuf_update_region_push,
  _outbuf_update_region_free,
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c 
b/src/modules/evas/engines/gl_drm/evas_engine.c
index 1b42497..fecbb87 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -949,6 +949,7 @@ eng_setup(Evas *evas, void *in)
 evas_outbuf_rot_get,
 evas_outbuf_reconfigure,
 
evas_outbuf_update_region_first_rect,
+NULL,
 evas_outbuf_update_region_new,
 evas_outbuf_update_region_push,
 evas_outbuf_update_region_free,
diff --git a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h 
b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
index e5743ee..8118812 100644
--- a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
+++ b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h
@@ -45,6 +45,7 @@ evas_render_engine_gl_generic_init(Render_Engine_GL_Generic 
*re,
Outbuf_Get_Rot outbuf_get_rot,
Outbuf_Reconfigure outbuf_reconfigure,
Outbuf_Region_First_Rect 
outbuf_region_first_rect,
+   Outbuf_Damage_Region_Set 
outbuf_damage_region_set,
Outbuf_New_Region_For_Update 
outbuf_new_region_for_update,
Outbuf_Push_Updated_Region 
outbuf_push_updated_region

[EGIT] [core/efl] master 02/02: wayland_egl: Fix EGL_KHR_Partial_Update usage

2016-08-19 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0774088c90a5eb45367cb7dfef18b74e29b1b1dd

commit 0774088c90a5eb45367cb7dfef18b74e29b1b1dd
Author: Derek Foreman 
Date:   Fri Aug 19 14:22:46 2016 -0500

wayland_egl: Fix EGL_KHR_Partial_Update usage

Use the new damage region set callback to do partial updates that actually
work.  Fixes gl rendering on mali.

@fix
---
 src/modules/evas/engines/wayland_egl/evas_engine.c |  2 +-
 .../evas/engines/wayland_egl/evas_wl_main.c| 32 --
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c 
b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 157dd2d..9d4260d 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -591,7 +591,7 @@ eng_setup(Evas *evas, void *info)
 eng_outbuf_rotation_get,
 eng_outbuf_reconfigure,
 eng_outbuf_region_first_rect,
-NULL,
+eng_outbuf_damage_region_set,
 eng_outbuf_update_region_new,
 eng_outbuf_update_region_push,
 eng_outbuf_update_region_free,
diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c 
b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
index 710202f..b265d7f 100644
--- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c
+++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
@@ -384,11 +384,10 @@ eng_outbuf_swap_mode_get(Outbuf *ob)
 
 if ((int)age != ob->prev_age) swap_mode = MODE_FULL;
 ob->prev_age = age;
- 
+
 return swap_mode;
  }
 
-   if (ob->swap_mode == MODE_AUTO) return MODE_FULL;
return ob->swap_mode;
 }
 
@@ -444,18 +443,24 @@ _convert_glcoords(int *result, Outbuf *ob, int x, int y, 
int w, int h)
  }
 }
 
-static void
-_damage_rect_set(Outbuf *ob, int x, int y, int w, int h)
+void
+eng_outbuf_damage_region_set(Outbuf *ob, Tilebuf_Rect *damage)
 {
-   int rects[4];
-
-   if ((x == 0) && (y == 0) &&
-   (((w == ob->gl_context->w) && (h == ob->gl_context->h)) ||
-   ((h == ob->gl_context->w) && (w == ob->gl_context->h
- return;
+   if (glsym_eglSetDamageRegionKHR)
+ {
+Tilebuf_Rect *tr;
+int *rect, *rects, count;
 
-   _convert_glcoords(rects, ob, x, y, w, h);
-   glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, 1);
+count = eina_inlist_count(EINA_INLIST_GET(damage));
+rects = alloca(sizeof(int) * 4 * count);
+rect = rects;
+EINA_INLIST_FOREACH(damage, tr)
+  {
+ _convert_glcoords(rect, ob, tr->x, tr->y, tr->w, tr->h);
+ rect += 4;
+  }
+glsym_eglSetDamageRegionKHR(ob->egl_disp, ob->egl_surface[0], rects, 
count);
+ }
 }
 
 void *
@@ -470,9 +475,6 @@ eng_outbuf_update_region_new(Outbuf *ob, int x, int y, int 
w, int h, int *cx EIN
 ob->gl_context->master_clip.y = y;
 ob->gl_context->master_clip.w = w;
 ob->gl_context->master_clip.h = h;
-
-if (glsym_eglSetDamageRegionKHR)
-  _damage_rect_set(ob, x, y, w, h);
  }
 
return ob->gl_context->def_surface;

-- 




[EGIT] [core/efl] master 01/01: evas_engines: Update remaining enges for damage_region_set callback

2016-08-22 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a71b688b1045f285688c612271c97faf412731e8

commit a71b688b1045f285688c612271c97faf412731e8
Author: Derek Foreman 
Date:   Mon Aug 22 08:39:44 2016 -0500

evas_engines: Update remaining enges for damage_region_set callback

I missed several engines when I changed this.

Make sure they all build.
---
 src/modules/evas/engines/eglfs/evas_engine.c  | 1 +
 src/modules/evas/engines/gl_sdl/evas_engine.c | 1 +
 src/modules/evas/engines/software_ddraw/evas_engine.c | 1 +
 src/modules/evas/engines/software_gdi/evas_engine.c   | 1 +
 4 files changed, 4 insertions(+)

diff --git a/src/modules/evas/engines/eglfs/evas_engine.c 
b/src/modules/evas/engines/eglfs/evas_engine.c
index 50fe3fb..630cd9c 100644
--- a/src/modules/evas/engines/eglfs/evas_engine.c
+++ b/src/modules/evas/engines/eglfs/evas_engine.c
@@ -787,6 +787,7 @@ eng_setup(Evas *evas, void *in)
 evas_outbuf_rot_get,
 evas_outbuf_reconfigure,
 
evas_outbuf_update_region_first_rect,
+NULL,
 evas_outbuf_update_region_new,
 evas_outbuf_update_region_push,
 evas_outbuf_update_region_free,
diff --git a/src/modules/evas/engines/gl_sdl/evas_engine.c 
b/src/modules/evas/engines/gl_sdl/evas_engine.c
index 5bb1acd..99ebf13 100644
--- a/src/modules/evas/engines/gl_sdl/evas_engine.c
+++ b/src/modules/evas/engines/gl_sdl/evas_engine.c
@@ -310,6 +310,7 @@ eng_setup(Evas *eo_e, void *in)
_outbuf_get_rot,
_outbuf_reconfigure,
_outbuf_region_first_rect,
+   NULL,
_outbuf_new_region_for_update,
_outbuf_push_updated_region,
_outbuf_free_region_for_update,
diff --git a/src/modules/evas/engines/software_ddraw/evas_engine.c 
b/src/modules/evas/engines/software_ddraw/evas_engine.c
index 3cf8f76..c18340b 100644
--- a/src/modules/evas/engines/software_ddraw/evas_engine.c
+++ b/src/modules/evas/engines/software_ddraw/evas_engine.c
@@ -47,6 +47,7 @@ _output_setup(int  width,
  
evas_software_ddraw_outbuf_rot_get,
  
evas_software_ddraw_outbuf_reconfigure,
  NULL,
+ NULL,
  
evas_software_ddraw_outbuf_new_region_for_update,
  
evas_software_ddraw_outbuf_push_updated_region,
  
evas_software_ddraw_outbuf_free_region_for_update,
diff --git a/src/modules/evas/engines/software_gdi/evas_engine.c 
b/src/modules/evas/engines/software_gdi/evas_engine.c
index 2135e12..9c00347 100644
--- a/src/modules/evas/engines/software_gdi/evas_engine.c
+++ b/src/modules/evas/engines/software_gdi/evas_engine.c
@@ -53,6 +53,7 @@ _output_setup(int  width,
  
evas_software_gdi_outbuf_rot_get,
  
evas_software_gdi_outbuf_reconfigure,
  NULL,
+ NULL,
  
evas_software_gdi_outbuf_new_region_for_update,
  
evas_software_gdi_outbuf_push_updated_region,
  
evas_software_gdi_outbuf_free_region_for_update,

-- 




[EGIT] [core/efl] master 01/01: wayland_egl: Destroy gl context if engine info updated with NULL wl_surface

2016-08-23 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ae83b96030206dd8dbdc6a0605ef4b7e850ddc93

commit ae83b96030206dd8dbdc6a0605ef4b7e850ddc93
Author: Derek Foreman 
Date:   Tue Aug 23 12:16:09 2016 -0500

wayland_egl: Destroy gl context if engine info updated with NULL wl_surface

We set the wayland surface to NULL in engine info, then destroy the wayland
surface later.  The GL stack tries to render to the destroyed surface and
dies.

If we destroy the GL surface when we set the engine info (before we destroy
the wayland surface)it stops the GL stack from doing bad wayland calls.

This fixes a crash on exit, or when any window closes when using mali GL
drivers.  Surprisingly, Mesa was tolerant of this.
---
 src/modules/evas/engines/wayland_egl/evas_engine.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c 
b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 9d4260d..a85c593 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -635,6 +635,16 @@ eng_setup(Evas *evas, void *info)
  {
 re = epd->engine.data.output;
 ob = eng_get_ob(re);
+
+if (!inf->info.surface && (ob->egl_surface[0] != EGL_NO_SURFACE))
+  {
+ eglDestroySurface(ob->egl_disp, ob->egl_surface[0]);
+ eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
+EGL_NO_CONTEXT);
+ ob->egl_surface[0] = EGL_NO_SURFACE;
+ return 1;
+  }
+
 if ((ob) && (_re_wincheck(ob)))
   {
  ob->info = inf;

-- 




[EGIT] [core/efl] master 01/01: evas: Try harder to create the render thread

2016-08-24 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e0c1f4a2a7866109c651c956b182d5fe7b33b5d4

commit e0c1f4a2a7866109c651c956b182d5fe7b33b5d4
Author: Derek Foreman 
Date:   Wed Aug 24 14:20:17 2016 -0500

evas: Try harder to create the render thread

It's entirely possible that a system doesn't have a cpu 0, so
when we try to pin all our render threads onto processor 0 we
may fail.

This results in some very connfusing build breakage when
edje_cc hangs up because its render thread didn't start.

So, if starting the thread with affinity fails, let's try without
affinity.

(This is trivial to reproduce - just use sysfs to turn off cpu0
after boot.)

@fix
---
 src/lib/evas/common/evas_thread_render.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/common/evas_thread_render.c 
b/src/lib/evas/common/evas_thread_render.c
index 21214ac..623e40e 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -137,7 +137,9 @@ evas_thread_init(void)
   CRI("Could not create draw thread condition");
 if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0,
   evas_thread_worker_func, NULL))
-  CRI("Could not create draw thread");
+  if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, -1,
+evas_thread_worker_func, NULL))
+CRI("Could not create draw thread");
 }
 
 void

-- 




[EGIT] [core/enlightenment] master 01/01: Don't send keyboard leave events to unfocused clients

2016-08-26 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=c5282454698a947e00428642f0bb2ba8348b366b

commit c5282454698a947e00428642f0bb2ba8348b366b
Author: Derek Foreman 
Date:   Fri Aug 26 12:05:58 2016 -0500

Don't send keyboard leave events to unfocused clients

This fixes a problem when focus moves between two xwayland clients.

My testing of gtk applications shows no regressions, bug if xdg_shell
popups start behaving oddly again, look here first.
---
 src/bin/e_comp_wl.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 7e982ed..010caa9 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -2448,11 +2448,7 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, 
E_Client *ec)
 ec->parent->modal = NULL;
  }
 
-   /* FIXME: We should probably test if ec really has keyboard
-* focus, but this at least catches GTK's silly habit of creating
-* a surface, never attaching anything to it, then deleting it.
-*/
-   if (ec->visible)_e_comp_wl_keyboard_leave(ec);
+   if ((ec == e_client_focused_get()) && ec->visible) 
_e_comp_wl_keyboard_leave(ec);
 
wl_signal_emit(&ec->comp_data->destroy_signal, &ec->comp_data->surface);
 

-- 




[EGIT] [core/efl] master 15/20: ecore_drm2: Add a page flip completion call

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b4cbf860b9d483f7ad7a50c672a000927cb2b39f

commit b4cbf860b9d483f7ad7a50c672a000927cb2b39f
Author: Derek Foreman 
Date:   Wed Sep 7 22:24:45 2016 -0500

ecore_drm2: Add a page flip completion call

Add a function for ecore_evas_drm to call after a page flip happens so
ecore_drm2 can track busy status for fbs itself (including for the fb
that's currently being flipped to scanout)

Also, call the completion function from ecore_evas_drm
---
 src/lib/ecore_drm2/Ecore_Drm2.h| 15 
 src/lib/ecore_drm2/ecore_drm2_fb.c | 27 +++---
 src/lib/ecore_drm2/ecore_drm2_private.h|  2 +-
 .../ecore_evas/engines/drm/ecore_evas_drm.c|  2 ++
 4 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 0a8411f..013abb0 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -768,6 +768,9 @@ EAPI void ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, 
Eina_Rectangle *rects, unsigned
 /**
  * Schedule a pageflip to the given Ecore_Drm2_Fb
  *
+ * The caller is responsible for running a page flip handler
+ * and calling ecore_drm2_fb_flip_complete() when it completes.
+ *
  * @param fb
  * @param output
  *
@@ -779,6 +782,18 @@ EAPI void ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, 
Eina_Rectangle *rects, unsigned
 EAPI int ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output);
 
 /**
+ * Must be called by a page flip handler when the flip completes.
+ *
+ * @param output
+ *
+ * @return Whether there's an undisplayed buffer still in the queue.
+ *
+ * @ingroup Ecore_Drm2_Fb_Group
+ * @since 1.18
+ */
+EAPI Eina_Bool ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output);
+
+/**
  * Return the Ecore_Drm2_Fb's busy status
  *
  * @param fb
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index b56486e..f660f05 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -223,6 +223,19 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle 
*rects, unsigned int count
 #endif
 }
 
+EAPI Eina_Bool
+ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
+{
+   if (output->current) output->current->busy = EINA_FALSE;
+   output->current = output->pending;
+   output->pending = NULL;
+
+   /* In case they were the same buffer... */
+   if (output->current) output->current->busy = EINA_TRUE;
+
+   return !!output->next;
+}
+
 EAPI int
 ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
 {
@@ -233,6 +246,13 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 
if (!output->enabled) return -1;
 
+   if (output->pending)
+ {
+if (output->next) output->next->busy = EINA_FALSE;
+output->next = fb;
+if (output->next) output->next->busy = EINA_TRUE;
+return 0;
+ }
if (!fb) fb = output->next;
 
/* So we can generate a tick by flipping to the current fb */
@@ -262,7 +282,9 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
  return ret;
   }
 
+if (output->current) output->current->busy = EINA_FALSE;
 output->current = fb;
+output->current->busy = EINA_TRUE;
 output->next = NULL;
 
 return 0;
@@ -284,9 +306,8 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 return 0;
  }
 
-   if (output->current) output->current->busy = EINA_FALSE;
-   output->current = fb;
-   fb->busy = EINA_TRUE;
+   output->pending = fb;
+   output->pending->busy = EINA_TRUE;
return 0;
 }
 
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h 
b/src/lib/ecore_drm2/ecore_drm2_private.h
index 8c16c04..96acfa4 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -138,7 +138,7 @@ struct _Ecore_Drm2_Output
 
drmModeCrtcPtr ocrtc;
 
-   Ecore_Drm2_Fb *current, *next;
+   Ecore_Drm2_Fb *current, *next, *pending;
 
Eina_Matrix4 matrix, inverse;
Ecore_Drm2_Transform transform;
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 9b456b7..90a3444 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -639,6 +639,8 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame 
EINA_UNUSED, unsigned int se
ee = data;
edata = ee->engine.data;
 
+   ecore_drm2_fb_flip_complete(edata->output);
+
next = ecore_drm2_output_next_fb_get(edata->output);
if (next)
  {

-- 




[EGIT] [core/efl] master 18/20: ecore_drm2: simplify API to get latest FB

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cc29a25c47bf12b4a3fc94396cc5c39e6d3e7739

commit cc29a25c47bf12b4a3fc94396cc5c39e6d3e7739
Author: Derek Foreman 
Date:   Thu Sep 8 11:40:11 2016 -0500

ecore_drm2: simplify API to get latest FB

What we've always wanted when getting the "current" FB is to get
the most recently submit one - this may be current, next, or pending.

Replace ecore_drm2_output_current_fb_get() with a function that gets the
most recent one - ecore_drm2_output_latest_fb_get().  Now callers don't
have to check the next buffer themselves first, and we don't have to
add an API for pending.
---
 src/lib/ecore_drm2/Ecore_Drm2.h | 12 
 src/lib/ecore_drm2/ecore_drm2_outputs.c |  6 --
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 013abb0..ee5f54e 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -456,16 +456,20 @@ EAPI unsigned int 
ecore_drm2_output_crtc_get(Ecore_Drm2_Output *output);
 EAPI Ecore_Drm2_Fb *ecore_drm2_output_next_fb_get(Ecore_Drm2_Output *output);
 
 /**
- * Return the current Ecore_Drm2_Fb used on a given output
+ * Return the most recently set Ecore_Drm2_Fb for a given output
+ *
+ * This may be the currently scanned out buffer, a buffer currently being
+ * flipped to scanout, or a buffer that has been submit but may not
+ * actually ever hit scanout at all.
  *
  * @param output
  *
- * @return The current Ecore_Drm2_Fb used on this output, or NULL otherwise
+ * @return The latest Ecore_Drm2_Fb submit for this output, or NULL otherwise
  *
  * @ingroup Ecore_Drm2_Output_Group
- * @since 1.18
+ * @since 1.19
  */
-EAPI Ecore_Drm2_Fb *ecore_drm2_output_current_fb_get(Ecore_Drm2_Output 
*output);
+EAPI Ecore_Drm2_Fb *ecore_drm2_output_latest_fb_get(Ecore_Drm2_Output *output);
 
 /**
  * Set the next Ecore_Drm2_Fb to be used on a given output
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c 
b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index fda51f3..fc7e2eb 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -945,10 +945,12 @@ ecore_drm2_output_next_fb_set(Ecore_Drm2_Output *output, 
Ecore_Drm2_Fb *fb)
 }
 
 EAPI Ecore_Drm2_Fb *
-ecore_drm2_output_current_fb_get(Ecore_Drm2_Output *output)
+ecore_drm2_output_latest_fb_get(Ecore_Drm2_Output *output)
 {
EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
-   return output->current;
+   if (output->pending) return output->pending;
+   if (output->current) return output->current;
+   return output->next;
 }
 
 EAPI void

-- 




[EGIT] [core/efl] master 01/20: ee_drm: Fix max buffer age

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1591e095d5e834a67bd270019068c6b6edf6bfba

commit 1591e095d5e834a67bd270019068c6b6edf6bfba
Author: Derek Foreman 
Date:   Wed Sep 7 21:19:30 2016 -0500

ee_drm: Fix max buffer age

The highest possible buffer age should actually be 4, not the number of
available buffers.
---
 src/modules/evas/engines/drm/evas_outbuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index e26fea7..aec09ff 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -408,7 +408,7 @@ _outbuf_fb_assign(Outbuf *ob)
 if ((ob->priv.ofb[i].valid) && (ob->priv.ofb[i].drawn))
   {
  ob->priv.ofb[i].age++;
- if (ob->priv.ofb[i].age > ob->priv.num)
+ if (ob->priv.ofb[i].age > 4)
{
   ob->priv.ofb[i].age = 0;
   ob->priv.ofb[i].drawn = EINA_FALSE;

-- 




[EGIT] [core/efl] master 16/20: ecore_evas_drm: Use pageflips, not vblanks, to drive animation

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0f534dc3bd12daaf7ae840c5a303a5aff0da1acf

commit 0f534dc3bd12daaf7ae840c5a303a5aff0da1acf
Author: Derek Foreman 
Date:   Fri Sep 2 15:38:32 2016 -0500

ecore_evas_drm: Use pageflips, not vblanks, to drive animation

This should sort some timing problems.
---
 .../ecore_evas/engines/drm/ecore_evas_drm.c| 49 +++---
 1 file changed, 15 insertions(+), 34 deletions(-)

diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 90a3444..d8709d6 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -55,6 +55,7 @@ typedef struct _Ecore_Evas_Engine_Drm_Data
Ecore_Fd_Handler *hdlr;
Ecore_Drm2_Device *dev;
Ecore_Drm2_Output *output;
+   Eina_Bool pending : 1;
Eina_Bool ticking : 1;
 } Ecore_Evas_Engine_Drm_Data;
 
@@ -611,55 +612,36 @@ _cb_drm_event(void *data, Ecore_Fd_Handler *hdlr 
EINA_UNUSED)
 }
 
 static void
-_tick_schedule(int fd, Ecore_Evas *ee)
-{
-   Ecore_Evas_Engine_Drm_Data *edata;
-
-   edata = ee->engine.data;
-   if (!edata->ticking) return;
-
-   drmVBlank vbl =
- {
-.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT,
-.request.sequence = 1,
-.request.signal = (unsigned long)ee,
- };
-
-   /* FIXME: On some systems this can fail, breaking ticking forever. */
-   drmWaitVBlank(fd, &vbl);
-}
-
-static void
 _cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int 
sec EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data)
 {
Ecore_Evas *ee;
Ecore_Evas_Engine_Drm_Data *edata;
-   Ecore_Drm2_Fb *next;
+   int ret;
 
ee = data;
edata = ee->engine.data;
 
-   ecore_drm2_fb_flip_complete(edata->output);
+   ret = ecore_drm2_fb_flip_complete(edata->output);
+
+   edata->pending = EINA_FALSE;
 
-   next = ecore_drm2_output_next_fb_get(edata->output);
-   if (next)
+   if (edata->ticking)
  {
-ecore_drm2_output_next_fb_set(edata->output, NULL);
-ecore_drm2_fb_flip(next, edata->output);
+ecore_evas_animator_tick(ee, NULL);
+ecore_drm2_fb_flip(NULL, edata->output);
  }
+   else if (ret) ecore_drm2_fb_flip(NULL, edata->output);
 }
 
 static void
-_cb_vblank(int fd, unsigned int frame EINA_UNUSED, unsigned int sec 
EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data)
+_drm_evas_changed(Ecore_Evas *ee, Eina_Bool changed)
 {
-   Ecore_Evas *ee;
Ecore_Evas_Engine_Drm_Data *edata;
 
-   ee = data;
-   edata = ee->engine.data;
+   if (changed) return;
 
-   ecore_evas_animator_tick(ee, NULL);
-   if (edata->ticking) _tick_schedule(fd, ee);
+   edata = ee->engine.data;
+   if (edata->ticking && !edata->pending) ecore_drm2_fb_flip(NULL, 
edata->output);
 }
 
 static void
@@ -669,7 +651,7 @@ _drm_animator_register(Ecore_Evas *ee)
 
edata = ee->engine.data;
edata->ticking = EINA_TRUE;
-   _tick_schedule(edata->fd, ee);
+   if (!edata->pending) ecore_drm2_fb_flip(NULL, edata->output);
 }
 
 static void
@@ -760,7 +742,7 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
_drm_animator_register, // animator_register
_drm_animator_unregister, // animator_unregister
 
-   NULL // evas_changed
+   _drm_evas_changed, // evas_changed
 };
 
 static Ecore_Evas *
@@ -906,7 +888,6 @@ _ecore_evas_new_internal(const char *device, int x, int y, 
int w, int h, Eina_Bo
/* setup vblank handler */
memset(&edata->ctx, 0, sizeof(edata->ctx));
edata->ctx.version = DRM_EVENT_CONTEXT_VERSION;
-   edata->ctx.vblank_handler = _cb_vblank;
edata->ctx.page_flip_handler = _cb_pageflip;
 
edata->hdlr =

-- 




[EGIT] [core/efl] master 05/20: ecore_drm2: Add busy status to ecore_drm2_fb

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d8c9f8ef17b0e52ec6e7d07ac33b5a54777d0de7

commit d8c9f8ef17b0e52ec6e7d07ac33b5a54777d0de7
Author: Derek Foreman 
Date:   Fri Sep 2 12:17:01 2016 -0500

ecore_drm2: Add busy status to ecore_drm2_fb

We've been tracking this in the outbuf code, but that logic is going to
be moved into ecore_evas_drm to use the new ticking paradigm.
---
 src/lib/ecore_drm2/Ecore_Drm2.h | 23 +++
 src/lib/ecore_drm2/ecore_drm2_fb.c  | 12 
 src/lib/ecore_drm2/ecore_drm2_private.h |  1 +
 3 files changed, 36 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 3de7999..ce9340f 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -779,6 +779,29 @@ EAPI void ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, 
Eina_Rectangle *rects, unsigned
  */
 EAPI int ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output, void 
*data);
 
+/**
+ * Return the Ecore_Drm2_Fb's busy status
+ *
+ * @param fb
+ *
+ * @return The busy status
+ *
+ * @ingroup Ecore_Drm2_Fb_Group
+ * @since 1.19
+ */
+EAPI Eina_Bool ecore_drm2_fb_busy_get(Ecore_Drm2_Fb *fb);
+
+/**
+ * Change the Ecore_Drm2_Fb's busy status
+ *
+ * @param fb
+ * @param busy The new busy status
+ *
+ * @ingroup Ecore_Drm2_Fb_Group
+ * @since 1.19
+ */
+EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy);
+
 # endif
 
 #endif
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index f91a477..6ac0dde 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -272,3 +272,15 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output, void *data)
output->current = fb;
return 0;
 }
+
+EAPI Eina_Bool
+ecore_drm2_fb_busy_get(Ecore_Drm2_Fb *fb)
+{
+   return fb->busy;
+}
+
+EAPI void
+ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy)
+{
+   fb->busy = busy;
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h 
b/src/lib/ecore_drm2/ecore_drm2_private.h
index e3a9c90..05f7102 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -94,6 +94,7 @@ struct _Ecore_Drm2_Fb
uint32_t format;
 
Eina_Bool gbm : 1;
+   Eina_Bool busy : 1;
 
void *mmap;
 };

-- 




[EGIT] [core/efl] master 17/20: ee_drm: simplify flipping

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ace55231a3b92fd46ae3be9ef6b0379538fe7927

commit ace55231a3b92fd46ae3be9ef6b0379538fe7927
Author: Derek Foreman 
Date:   Wed Sep 7 22:25:43 2016 -0500

ee_drm: simplify flipping

We no longer have to track draw and display buffers - the display buffer
is completely handled by ecore_evas_drm's busy tracking.
---
 src/modules/evas/engines/drm/evas_engine.h | 2 +-
 src/modules/evas/engines/drm/evas_outbuf.c | 5 +
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/modules/evas/engines/drm/evas_engine.h 
b/src/modules/evas/engines/drm/evas_engine.h
index 3a5c3c2..f125379 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -58,7 +58,7 @@ struct _Outbuf
struct
  {
 int num;
-Outbuf_Fb ofb[4], *draw, *display;
+Outbuf_Fb ofb[4], *draw;
 Ecore_Drm2_Output *output;
 Eina_List *pending;
 Eina_Rectangle *rects;
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index 01394d0..c3f6c4e 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -18,9 +18,7 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, 
unsigned int count)
if (!ofb) return;
 
ecore_drm2_fb_dirty(ofb->fb, rects, count);
-   if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output) == 0)
- ob->priv.display = ofb;
-
+   ecore_drm2_fb_flip(ofb->fb, ob->priv.output);
ofb->drawn = EINA_TRUE;
ofb->age = 0;
 
@@ -231,7 +229,6 @@ _outbuf_fb_wait(Outbuf *ob)
 */
for (i = 0; i < ob->priv.num; i++)
  {
-if (&ob->priv.ofb[i] == ob->priv.display) continue;
 if (ecore_drm2_fb_busy_get(ob->priv.ofb[i].fb)) continue;
 if (ob->priv.ofb[i].valid && (ob->priv.ofb[i].age > best_age))
   {

-- 




[EGIT] [core/efl] master 03/20: ecore_evas_drm: check for libglapi presence first

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=31de16d40840381cf9d425441cd55c3b1d57301c

commit 31de16d40840381cf9d425441cd55c3b1d57301c
Author: Derek Foreman 
Date:   Thu Sep 1 14:53:47 2016 -0500

ecore_evas_drm: check for libglapi presence first

Minor refactor
---
 src/modules/ecore_evas/engines/drm/ecore_evas_drm.c | 11 +++
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 59278aa..eef1bda 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -796,6 +796,9 @@ ecore_evas_gl_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUS
Ecore_Evas_Engine_Drm_Data *edata;
int method, mw, mh;
 
+   dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
+   if (dlerror()) return NULL;
+
method = evas_render_method_lookup("gl_drm");
if (!method) return NULL;
 
@@ -817,14 +820,6 @@ ecore_evas_gl_drm_new_internal(const char *device, 
unsigned int parent EINA_UNUS
edata->bpp = 32; // FIXME: Remove hardcode
edata->format = DRM_FORMAT_XRGB;
 
-   dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
-   if (dlerror())
- {
-free(edata);
-free(ee);
-return NULL;
- }
-
if (_ecore_evas_drm_init(edata, device) < 1)
  {
 free(edata);

-- 




[EGIT] [core/efl] master 10/20: evas_engines: Add a redraws_clear callback

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5eec34812efa5b73ed18d71871e87a997928d214

commit 5eec34812efa5b73ed18d71871e87a997928d214
Author: Derek Foreman 
Date:   Tue Sep 6 17:01:37 2016 -0500

evas_engines: Add a redraws_clear callback

This gives us a callback from the main thread after outbuf_flush occurs -
this is useful to get timing right on the drm and wayland engines.
---
 src/modules/evas/engines/buffer/evas_engine.c | 1 +
 src/modules/evas/engines/drm/evas_engine.c| 1 +
 src/modules/evas/engines/eglfs/evas_engine.c  | 1 +
 src/modules/evas/engines/fb/evas_engine.c | 1 +
 src/modules/evas/engines/gl_cocoa/evas_engine.c   | 1 +
 src/modules/evas/engines/gl_drm/evas_engine.c | 1 +
 src/modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h  | 2 ++
 src/modules/evas/engines/gl_sdl/evas_engine.c | 1 +
 src/modules/evas/engines/gl_x11/evas_engine.c | 1 +
 src/modules/evas/engines/software_ddraw/evas_engine.c | 1 +
 src/modules/evas/engines/software_gdi/evas_engine.c   | 1 +
 .../evas/engines/software_generic/Evas_Engine_Software_Generic.h  | 4 
 src/modules/evas/engines/software_generic/evas_engine.c   | 1 +
 src/modules/evas/engines/software_x11/evas_engine.c   | 3 +++
 src/modules/evas/engines/wayland_egl/evas_engine.c| 1 +
 src/modules/evas/engines/wayland_shm/evas_engine.c| 1 +
 16 files changed, 22 insertions(+)

diff --git a/src/modules/evas/engines/buffer/evas_engine.c 
b/src/modules/evas/engines/buffer/evas_engine.c
index 021f7c5..bef4a45 100644
--- a/src/modules/evas/engines/buffer/evas_engine.c
+++ b/src/modules/evas/engines/buffer/evas_engine.c
@@ -103,6 +103,7 @@ _output_setup(int w,
  
evas_buffer_outbuf_buf_free_region_for_update,
  NULL,
  
evas_buffer_outbuf_buf_switch_buffer,
+ NULL,
  evas_buffer_outbuf_buf_free,
  w, h))
  goto on_error;
diff --git a/src/modules/evas/engines/drm/evas_engine.c 
b/src/modules/evas/engines/drm/evas_engine.c
index 0499a96..e28037d 100644
--- a/src/modules/evas/engines/drm/evas_engine.c
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -32,6 +32,7 @@ _render_engine_setup(Evas_Engine_Info_Drm *info, int w, int h)
  _outbuf_update_region_free,
  NULL,
  _outbuf_flush,
+ NULL,
  _outbuf_free,
  ob->w, ob->h))
  goto init_err;
diff --git a/src/modules/evas/engines/eglfs/evas_engine.c 
b/src/modules/evas/engines/eglfs/evas_engine.c
index 630cd9c..c881f29 100644
--- a/src/modules/evas/engines/eglfs/evas_engine.c
+++ b/src/modules/evas/engines/eglfs/evas_engine.c
@@ -793,6 +793,7 @@ eng_setup(Evas *evas, void *in)
 evas_outbuf_update_region_free,
 NULL,
 evas_outbuf_flush,
+NULL,
 evas_outbuf_free,
 evas_outbuf_use,
 evas_outbuf_gl_context_get,
diff --git a/src/modules/evas/engines/fb/evas_engine.c 
b/src/modules/evas/engines/fb/evas_engine.c
index f78e7a1..9457485 100644
--- a/src/modules/evas/engines/fb/evas_engine.c
+++ b/src/modules/evas/engines/fb/evas_engine.c
@@ -53,6 +53,7 @@ _output_setup(int w, int h, int rot, int vt, int dev, int 
refresh)
  
evas_fb_outbuf_fb_free_region_for_update,
  NULL,
  NULL,
+ NULL,
  evas_fb_outbuf_fb_free,
  
evas_fb_outbuf_fb_get_width(ob),
  
evas_fb_outbuf_fb_get_height(ob)))
diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c 
b/src/modules/evas/engines/gl_cocoa/evas_engine.c
index 2031166..585323a 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_engine.c
+++ b/src/modules/evas/engines/gl

[EGIT] [core/efl] master 12/20: ee_drm: Get page flips out of the render thread

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=95a00b8e496839c4976259692fb7c308f7a850dc

commit 95a00b8e496839c4976259692fb7c308f7a850dc
Author: Derek Foreman 
Date:   Wed Sep 7 21:31:08 2016 -0500

ee_drm: Get page flips out of the render thread

Now that we have redraws_clear exposed through software generic, we can
use that to do the final buffer swap from the main thread instead of doing
it in outbuf_flush which runs from the render thread.

This becomes more important later when other call sites in the main thread
will perform buffer flips.
---
 src/modules/evas/engines/drm/evas_engine.c |  2 +-
 src/modules/evas/engines/drm/evas_engine.h |  3 +++
 src/modules/evas/engines/drm/evas_outbuf.c | 24 +---
 3 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/src/modules/evas/engines/drm/evas_engine.c 
b/src/modules/evas/engines/drm/evas_engine.c
index e28037d..d712093 100644
--- a/src/modules/evas/engines/drm/evas_engine.c
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -32,7 +32,7 @@ _render_engine_setup(Evas_Engine_Info_Drm *info, int w, int h)
  _outbuf_update_region_free,
  NULL,
  _outbuf_flush,
- NULL,
+ _outbuf_redraws_clear,
  _outbuf_free,
  ob->w, ob->h))
  goto init_err;
diff --git a/src/modules/evas/engines/drm/evas_engine.h 
b/src/modules/evas/engines/drm/evas_engine.h
index 94ddcf4..3a5c3c2 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -61,6 +61,8 @@ struct _Outbuf
 Outbuf_Fb ofb[4], *draw, *display;
 Ecore_Drm2_Output *output;
 Eina_List *pending;
+Eina_Rectangle *rects;
+unsigned int rect_count;
  } priv;
 
Eina_Bool alpha : 1;
@@ -76,5 +78,6 @@ void *_outbuf_update_region_new(Outbuf *ob, int x, int y, int 
w, int h, int *cx,
 void _outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, 
int w, int h);
 void _outbuf_update_region_free(Outbuf *ob, RGBA_Image *update);
 void _outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode 
render_mode);
+void _outbuf_redraws_clear(Outbuf *ob);
 
 #endif
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index b62d952..01394d0 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -494,17 +494,20 @@ _outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects 
EINA_UNUSED, Evas_Render_Mode rend
 {
Eina_Rectangle *r;
RGBA_Image *img;
-   unsigned int n = 0, i = 0;
+   unsigned int i = 0;
 
if (render_mode == EVAS_RENDER_MODE_ASYNC_INIT) return;
 
+   if (ob->priv.rect_count) free(ob->priv.rects);
+
/* get number of pending writes */
-   n = eina_list_count(ob->priv.pending);
-   if (n == 0) return;
+   ob->priv.rect_count = eina_list_count(ob->priv.pending);
+   if (ob->priv.rect_count == 0) return;
 
/* allocate rectangles */
-   r = alloca(n * sizeof(Eina_Rectangle));
-   if (!r) return;
+   ob->priv.rects = malloc(ob->priv.rect_count * sizeof(Eina_Rectangle));
+   if (!ob->priv.rects) return;
+   r = ob->priv.rects;
 
/* loop the pending writes */
EINA_LIST_FREE(ob->priv.pending, img)
@@ -562,7 +565,14 @@ _outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects EINA_UNUSED, 
Evas_Render_Mode rend
 
 i++;
  }
+}
+
+void
+_outbuf_redraws_clear(Outbuf *ob)
+{
+   if (!ob->priv.rect_count) return;
 
-   /* force a buffer swap */
-   _outbuf_buffer_swap(ob, r, n);
+   _outbuf_buffer_swap(ob, ob->priv.rects, ob->priv.rect_count);
+   free(ob->priv.rects);
+   ob->priv.rect_count = 0;
 }

-- 




[EGIT] [core/efl] master 08/20: ee_drm: Move all ticking into ecore_evas_drm and use new tick system

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=794798f55906d3704955ac3f108340eafdb06256

commit 794798f55906d3704955ac3f108340eafdb06256
Author: Derek Foreman 
Date:   Fri Sep 2 14:47:49 2016 -0500

ee_drm: Move all ticking into ecore_evas_drm and use new tick system

Combines all the gl_drm and drm ticking code into one set in
ecore_evas_drm and uses the new evas tick register/unregister callbacks
to set it up.
---
 .../ecore_evas/engines/drm/ecore_evas_drm.c| 117 ++-
 src/modules/evas/engines/drm/evas_engine.h |   3 -
 src/modules/evas/engines/drm/evas_outbuf.c | 130 +
 src/modules/evas/engines/gl_drm/evas_engine.c  |  40 ---
 src/modules/evas/engines/gl_drm/evas_engine.h  |   4 -
 src/modules/evas/engines/gl_drm/evas_outbuf.c  |  80 +
 6 files changed, 117 insertions(+), 257 deletions(-)

diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 8289a76..e53ffda 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -19,6 +19,8 @@
 # include 
 #endif
 
+#include 
+
 #ifdef EAPI
 # undef EAPI
 #endif
@@ -49,14 +51,17 @@ typedef struct _Ecore_Evas_Engine_Drm_Data
int x, y, w, h;
int depth, bpp;
unsigned int format;
+   drmEventContext ctx;
+   Ecore_Fd_Handler *hdlr;
Ecore_Drm2_Device *dev;
Ecore_Drm2_Output *output;
+   Eina_Bool ticking : 1;
 } Ecore_Evas_Engine_Drm_Data;
 
 static int _drm_init_count = 0;
 
 static int
-_ecore_evas_drm_init(Ecore_Evas_Engine_Drm_Data *edata, const char *device)
+_ecore_evas_drm_init(Ecore_Evas *ee, Ecore_Evas_Engine_Drm_Data *edata, const 
char *device)
 {
if (++_drm_init_count != 1) return _drm_init_count;
 
@@ -92,8 +97,8 @@ _ecore_evas_drm_init(Ecore_Evas_Engine_Drm_Data *edata, const 
char *device)
  }
 
edata->output = ecore_drm2_output_find(edata->dev, edata->x, edata->y);
-   if (!edata->output)
- WRN("Could not find output at %d %d", edata->x, edata->y);
+   if (edata->output) ecore_drm2_output_user_data_set(edata->output, ee);
+   else WRN("Could not find output at %d %d", edata->x, edata->y);
 
ecore_event_evas_init();
 
@@ -586,6 +591,97 @@ _ecore_evas_drm_interface_new(void)
return iface;
 }
 
+static Eina_Bool
+_cb_drm_event(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
+{
+   Ecore_Evas *ee;
+   Ecore_Evas_Engine_Drm_Data *edata;
+   int ret;
+
+   ee = data;
+   edata = ee->engine.data;
+   ret = drmHandleEvent(edata->fd, &edata->ctx);
+   if (ret)
+ {
+WRN("drmHandleEvent failed to read an event");
+return EINA_FALSE;
+ }
+
+   return EINA_TRUE;
+}
+
+static void
+_tick_schedule(int fd, Ecore_Evas *ee)
+{
+   Ecore_Evas_Engine_Drm_Data *edata;
+
+   edata = ee->engine.data;
+   if (!edata->ticking) return;
+
+   drmVBlank vbl =
+ {
+.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT,
+.request.sequence = 1,
+.request.signal = (unsigned long)ee,
+ };
+
+   /* FIXME: On some systems this can fail, breaking ticking forever. */
+   drmWaitVBlank(fd, &vbl);
+}
+
+static void
+_cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int 
sec EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data)
+{
+   Ecore_Evas *ee;
+   Ecore_Evas_Engine_Drm_Data *edata;
+   Ecore_Drm2_Fb *current, *next;
+
+   ee = data;
+   edata = ee->engine.data;
+
+   current = ecore_drm2_output_current_fb_get(edata->output);
+   if (current) ecore_drm2_fb_busy_set(current, EINA_FALSE);
+
+   next = ecore_drm2_output_next_fb_get(edata->output);
+   if (next)
+ {
+ecore_drm2_output_next_fb_set(edata->output, NULL);
+ecore_drm2_fb_flip(next, edata->output);
+ }
+}
+
+static void
+_cb_vblank(int fd, unsigned int frame EINA_UNUSED, unsigned int sec 
EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data)
+{
+   Ecore_Evas *ee;
+   Ecore_Evas_Engine_Drm_Data *edata;
+
+   ee = data;
+   edata = ee->engine.data;
+
+   ecore_evas_animator_tick(ee, NULL);
+   if (edata->ticking) _tick_schedule(fd, ee);
+}
+
+static void
+_drm_animator_register(Ecore_Evas *ee)
+{
+   Ecore_Evas_Engine_Drm_Data *edata;
+
+   edata = ee->engine.data;
+   edata->ticking = EINA_TRUE;
+   _tick_schedule(edata->fd, ee);
+}
+
+static void
+_drm_animator_unregister(Ecore_Evas *ee)
+{
+   Ecore_Evas_Engine_Drm_Data *edata;
+
+   edata = ee->engine.data;
+   edata->ticking = EINA_FALSE;
+}
+
 static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
 {
_drm_free,
@@ -662,8 +758,8 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
 
NULL, // aux_hints_set
 
-   NULL, // animator_register
-   NULL, // animator_unregister
+   _drm_animator_re

[EGIT] [core/efl] master 04/20: ecore_evas_drm: Refactor common code

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=316ca09b0d705bf38c5cc0dda066351116807cd7

commit 316ca09b0d705bf38c5cc0dda066351116807cd7
Author: Derek Foreman 
Date:   Fri Sep 2 11:07:17 2016 -0500

ecore_evas_drm: Refactor common code

ecore_evas_gl_drm_new_internal and ecore_Evas_drm_new_internal are huge
functions differing in very few lines.  Combined them.
---
 .../ecore_evas/engines/drm/ecore_evas_drm.c| 163 +
 1 file changed, 39 insertions(+), 124 deletions(-)

diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index eef1bda..8289a76 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -668,16 +668,18 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func 
=
NULL // evas_changed
 };
 
-EAPI Ecore_Evas *
-ecore_evas_drm_new_internal(const char *device, unsigned int parent 
EINA_UNUSED, int x, int y, int w, int h)
+static Ecore_Evas *
+_ecore_evas_new_internal(const char *device, int x, int y, int w, int h, 
Eina_Bool gl)
 {
Ecore_Evas *ee;
-   Evas_Engine_Info_Drm *einfo;
Ecore_Evas_Interface_Drm *iface;
Ecore_Evas_Engine_Drm_Data *edata;
int method, mw, mh;
+   void *tinfo;
+
+   if (gl) method = evas_render_method_lookup("gl_drm");
+   else method = evas_render_method_lookup("drm");
 
-   method = evas_render_method_lookup("drm");
if (!method) return NULL;
 
ee = calloc(1, sizeof(Ecore_Evas));
@@ -707,7 +709,9 @@ ecore_evas_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUSED,
 
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
 
-   ee->driver = "drm";
+   if (gl) ee->driver = "gl_drm";
+   else ee->driver = "drm";
+
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_evas_drm_engine_func;
ee->engine.data = edata;
 
@@ -730,7 +734,7 @@ ecore_evas_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUSED,
ee->prop.withdrawn = EINA_TRUE;
ee->alpha = EINA_FALSE;
 
-   ee->can_async_render = 1;
+   ee->can_async_render = !gl;
if (getenv("ECORE_EVAS_FORCE_SYNC_RENDER"))
  ee->can_async_render = 0;
 
@@ -744,9 +748,18 @@ ecore_evas_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUSED,
  evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST,
  _drm_render_updates, ee);
 
-   einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas);
-   if (einfo)
+   tinfo = evas_engine_info_get(ee->evas);
+   if (tinfo && gl)
  {
+char *num;
+Evas_Engine_Info_GL_Drm *einfo = tinfo;
+
+einfo->info.vsync = EINA_TRUE;
+
+num = getenv("EVAS_DRM_VSYNC");
+if ((num) && (!atoi(num)))
+  einfo->info.vsync = EINA_FALSE;
+
 einfo->info.fd = edata->fd;
 einfo->info.bpp = edata->bpp;
 einfo->info.depth = edata->depth;
@@ -759,123 +772,9 @@ ecore_evas_drm_new_internal(const char *device, unsigned 
int parent EINA_UNUSED,
  goto eng_err;
   }
  }
-
-   ee->prop.window = ecore_drm2_output_crtc_get(edata->output);
-   ecore_drm2_device_window_set(edata->dev, ee->prop.window);
-
-   ecore_evas_data_set(ee, "device", edata->dev);
-
-   _ecore_evas_register(ee);
-   ecore_event_window_register(ee->prop.window, ee, ee->evas,
-   
(Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
-   
(Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
-   
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
-   
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
-   _ecore_event_window_direct_cb_set(ee->prop.window, 
_ecore_evas_input_direct_cb);
-
-   ecore_drm2_output_crtc_size_get(edata->output, &mw, &mh);
-
-   ecore_drm2_device_calibrate(edata->dev, mw, mh);
-   ecore_drm2_device_pointer_max_set(edata->dev, mw, mh);
-   ecore_drm2_device_pointer_warp(edata->dev, mw / 2, mh / 2);
-
-   return ee;
-
-eng_err:
-   ecore_evas_free(ee);
-   return NULL;
-}
-
-#ifdef BUILD_ECORE_EVAS_GL_DRM
-EAPI Ecore_Evas *
-ecore_evas_gl_drm_new_internal(const char *device, unsigned int parent 
EINA_UNUSED, int x, int y, int w, int h)
-{
-   Ecore_Evas *ee;
-   Evas_Engine_Info_GL_Drm *einfo;
-   Ecore_Evas_Interface_Drm *iface;
-   Ecore_Evas_Engine_Drm_Data *edata;
-   int method, mw, mh;
-
-   dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL);
-   if (dlerror()) return NULL;
-
-   method = evas_render_method_lookup("gl_drm");
-   if (!method) return NULL;
-
-   ee = calloc(1, sizeof(Ecore_Evas));
-   if (!ee) retur

[EGIT] [core/efl] master 02/20: evas_engines: Add fn_evas_changed callback

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=398771bf8afb0399184854b87b30b4a58c1d2aa3

commit 398771bf8afb0399184854b87b30b4a58c1d2aa3
Author: Derek Foreman 
Date:   Tue Aug 30 15:47:17 2016 -0500

evas_engines: Add fn_evas_changed callback

To allow using the pageflip completion event to drive timing in the DRM
engine we need to know as soon as possible that a render has been after
a render has been considered if it will cause a page flip or not.

The fn_evas_changed callback sends this information.
---
 src/lib/ecore_evas/ecore_evas.c | 7 +++
 src/lib/ecore_evas/ecore_evas_buffer.c  | 2 ++
 src/lib/ecore_evas/ecore_evas_ews.c | 2 ++
 src/lib/ecore_evas/ecore_evas_private.h | 2 ++
 src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c | 4 +++-
 src/modules/ecore_evas/engines/drm/ecore_evas_drm.c | 4 +++-
 src/modules/ecore_evas/engines/extn/ecore_evas_extn.c   | 6 +-
 src/modules/ecore_evas/engines/fb/ecore_evas_fb.c   | 4 +++-
 src/modules/ecore_evas/engines/psl1ght/ecore_evas_psl1ght.c | 4 +++-
 src/modules/ecore_evas/engines/sdl/ecore_evas_sdl.c | 4 +++-
 src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c | 4 +++-
 src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c | 4 +++-
 src/modules/ecore_evas/engines/win32/ecore_evas_win32.c | 4 +++-
 src/modules/ecore_evas/engines/x/ecore_evas_x.c | 4 +++-
 14 files changed, 45 insertions(+), 10 deletions(-)

diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 769855d..72e4699 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -175,6 +175,13 @@ _ecore_evas_idle_enter(void *data EINA_UNUSED)
   {
  if (ee->engine.func->fn_render)
rend |= ee->engine.func->fn_render(ee);
+  /*
+   * Some engines that generate their own ticks based on hardware
+   * events need to know that render has been considered, and
+   * whether it will actually generate a new image or not
+   */
+ if (ee->engine.func->fn_evas_changed)
+   ee->engine.func->fn_evas_changed(ee, rend);
   }
 #ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG
 if ((ee->in_async_render) && (ee->async_render_start <= 0.0))
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c 
b/src/lib/ecore_evas/ecore_evas_buffer.c
index 795f5b7..deb2387 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -606,6 +606,8 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
 
  NULL, // fn_animator_register
  NULL, // fn_animator_unregister
+
+ NULL, // fn_evas_changed
 };
 
 static void *
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c 
b/src/lib/ecore_evas/ecore_evas_ews.c
index 904c504..6f90654 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -719,6 +719,8 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
 
  NULL, // fn_animator_register
  NULL, // fn_animator_unregister
+
+ NULL, // fn_evas_changed
 };
 
 void
diff --git a/src/lib/ecore_evas/ecore_evas_private.h 
b/src/lib/ecore_evas/ecore_evas_private.h
index 4eaa369..ee75fd0 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -156,6 +156,8 @@ struct _Ecore_Evas_Engine_Func
 
void (*fn_animator_register)  (Ecore_Evas *ee);
void (*fn_animator_unregister)(Ecore_Evas *ee);
+
+   void (*fn_evas_changed)(Ecore_Evas *ee, Eina_Bool changed);
 };
 
 struct _Ecore_Evas_Interface
diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c 
b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
index 0624212..98dca01 100644
--- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
+++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c
@@ -673,7 +673,9 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
 
 NULL, // fn_aux_hints_set
 NULL, // fn_animator_register
-NULL  // fn_animator_unregister
+NULL, // fn_animator_unregister
+
+NULL, // fn_evas_changed
   };
 
 static Ecore_Cocoa_Window *
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index 0ba8968..59278aa 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -663,7 +663,9 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
NULL, // aux_hints_set
 
NULL, // animator_register
-   NULL // animator_unregister
+   NULL, // animator_unregister
+
+   NULL // evas_changed
 };
 
 EAPI Ecore_Evas *
diff --

[EGIT] [core/efl] master 14/20: ecore_drm2: distinguish real flip failure from flip deferral

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=33043ff1ebb78aee92700459cda70745bedcaeb6

commit 33043ff1ebb78aee92700459cda70745bedcaeb6
Author: Derek Foreman 
Date:   Wed Sep 7 22:16:10 2016 -0500

ecore_drm2: distinguish real flip failure from flip deferral

If we try to flip too soon we get EBUSY and should queue up the buffer
for later presentation.  Only the other errors need to be dealt with
elsewhere.
---
 src/lib/ecore_drm2/ecore_drm2_fb.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 1c1c947..b56486e 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -271,14 +271,18 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
ret =
  drmModePageFlip(fb->fd, output->crtc_id, fb->id,
  DRM_MODE_PAGE_FLIP_EVENT, output->user_data);
-   if (ret < 0)
+   if ((ret < 0) && (errno != EBUSY))
  {
 DBG("Pageflip Failed for Crtc %u on Connector %u: %m",
 output->crtc_id, output->conn_id);
-output->next = fb;
-fb->busy = EINA_TRUE;
 return ret;
  }
+   else if (ret < 0)
+ {
+output->next = fb;
+output->next->busy = EINA_TRUE;
+return 0;
+ }
 
if (output->current) output->current->busy = EINA_FALSE;
output->current = fb;

-- 




[EGIT] [core/efl] master 13/20: ecore_drm2: make flip to NULL buffer mean something

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3be2630a3050dab9f73a181324813bda727ed0fd

commit 3be2630a3050dab9f73a181324813bda727ed0fd
Author: Derek Foreman 
Date:   Wed Sep 7 22:13:34 2016 -0500

ecore_drm2: make flip to NULL buffer mean something

When triple buffering we'll have a buffer in ecore_drm2's "next" position.
Until now we've had to query it from the engine then try to re post it.

Also, when generating ticks we need to flip to the current buffer when no
changes have been made to get another callback.

Now a NULL fb to fb_flip will either flip to next, if available, or current
if there's nothing new to flip to.
---
 src/lib/ecore_drm2/ecore_drm2_fb.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 36de500..1c1c947 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -228,18 +228,25 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 {
int ret = 0;
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(fb, -1);
EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1);
EINA_SAFETY_ON_NULL_RETURN_VAL(output->current_mode, -1);
 
if (!output->enabled) return -1;
 
+   if (!fb) fb = output->next;
+
+   /* So we can generate a tick by flipping to the current fb */
+   if (!fb) fb = output->current;
+
if (output->next)
  {
 output->next->busy = EINA_FALSE;
 output->next = NULL;
  }
 
+   /* If we don't have an fb to set by now, BAIL! */
+   if (!fb) return -1;
+
if ((!output->current) ||
(output->current->stride != fb->stride))
  {

-- 




[EGIT] [core/efl] master 09/20: ecore_drm2: Implicitly set buffer busy status when flipping

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ce7991b9934d469419d3a3982d30329184cc287e

commit ce7991b9934d469419d3a3982d30329184cc287e
Author: Derek Foreman 
Date:   Fri Sep 2 15:24:24 2016 -0500

ecore_drm2: Implicitly set buffer busy status when flipping

This simplifies other code that shouldn't need to deal with this.
---
 src/lib/ecore_drm2/ecore_drm2_fb.c |  8 ++-
 .../ecore_evas/engines/drm/ecore_evas_drm.c|  5 +
 src/modules/evas/engines/drm/evas_outbuf.c | 26 +-
 3 files changed, 9 insertions(+), 30 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 3160e5c..36de500 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -235,7 +235,10 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
if (!output->enabled) return -1;
 
if (output->next)
- WRN("Fb reused too soon, tearing may be visible");
+ {
+output->next->busy = EINA_FALSE;
+output->next = NULL;
+ }
 
if ((!output->current) ||
(output->current->stride != fb->stride))
@@ -266,10 +269,13 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 DBG("Pageflip Failed for Crtc %u on Connector %u: %m",
 output->crtc_id, output->conn_id);
 output->next = fb;
+fb->busy = EINA_TRUE;
 return ret;
  }
 
+   if (output->current) output->current->busy = EINA_FALSE;
output->current = fb;
+   fb->busy = EINA_TRUE;
return 0;
 }
 
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index e53ffda..9b456b7 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -634,14 +634,11 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame 
EINA_UNUSED, unsigned int se
 {
Ecore_Evas *ee;
Ecore_Evas_Engine_Drm_Data *edata;
-   Ecore_Drm2_Fb *current, *next;
+   Ecore_Drm2_Fb *next;
 
ee = data;
edata = ee->engine.data;
 
-   current = ecore_drm2_output_current_fb_get(edata->output);
-   if (current) ecore_drm2_fb_busy_set(current, EINA_FALSE);
-
next = ecore_drm2_output_next_fb_get(edata->output);
if (next)
  {
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index 891be79..97e4f10 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -8,43 +8,19 @@
 #define GREEN_MASK 0x00ff00
 #define BLUE_MASK 0xff
 
-Outbuf_Fb *
-_outbuf_fb_find(Outbuf *ob, Ecore_Drm2_Fb *key)
-{
-   int i;
-
-   for (i = 0; i < ob->priv.num; i++)
- if (key == ob->priv.ofb[i].fb) return &ob->priv.ofb[i];
-
-   return NULL;
-}
-
 static void
 _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count)
 {
/* Ecore_Drm2_Plane *plane; */
-   Outbuf_Fb *ofb, *next_ofb;
-   Ecore_Drm2_Fb *next;
+   Outbuf_Fb *ofb;
 
ofb = ob->priv.draw;
if (!ofb) return;
 
-   /* If there's a next buffer set, we just dump it back into
-* the available buffers and it becomes a dropped frame
-*/
-   next = ecore_drm2_output_next_fb_get(ob->priv.output);
-   if (next)
- {
-next_ofb = _outbuf_fb_find(ob, next);
-ecore_drm2_fb_busy_set(next_ofb->fb, EINA_FALSE);
-ecore_drm2_output_next_fb_set(ob->priv.output, NULL);
- }
-
ecore_drm2_fb_dirty(ofb->fb, rects, count);
if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output) == 0)
  ob->priv.display = ofb;
 
-   ecore_drm2_fb_busy_set(ofb->fb, EINA_TRUE);
ofb->drawn = EINA_TRUE;
ofb->age = 0;
 

-- 




[EGIT] [core/efl] master 19/20: ecore_drm2: Remove get/set for next fb

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=255b990055ceb13724ca217c7d8c8cc23373b2bb

commit 255b990055ceb13724ca217c7d8c8cc23373b2bb
Author: Derek Foreman 
Date:   Thu Sep 8 11:41:03 2016 -0500

ecore_drm2: Remove get/set for next fb

We no longer needs these at all.
---
 src/lib/ecore_drm2/Ecore_Drm2.h | 23 ---
 src/lib/ecore_drm2/ecore_drm2_outputs.c | 14 --
 2 files changed, 37 deletions(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index ee5f54e..598d831 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -444,18 +444,6 @@ EAPI void ecore_drm2_output_geometry_get(Ecore_Drm2_Output 
*output, int *x, int
 EAPI unsigned int ecore_drm2_output_crtc_get(Ecore_Drm2_Output *output);
 
 /**
- * Return the next Ecore_Drm2_Fb to be used on a given output
- *
- * @param output
- *
- * @return The next Ecore_Drm2_Fb which is scheduled to to be flipped, or NULL 
otherwise
- *
- * @ingroup Ecore_Drm2_Output_Group
- * @since 1.18
- */
-EAPI Ecore_Drm2_Fb *ecore_drm2_output_next_fb_get(Ecore_Drm2_Output *output);
-
-/**
  * Return the most recently set Ecore_Drm2_Fb for a given output
  *
  * This may be the currently scanned out buffer, a buffer currently being
@@ -472,17 +460,6 @@ EAPI Ecore_Drm2_Fb 
*ecore_drm2_output_next_fb_get(Ecore_Drm2_Output *output);
 EAPI Ecore_Drm2_Fb *ecore_drm2_output_latest_fb_get(Ecore_Drm2_Output *output);
 
 /**
- * Set the next Ecore_Drm2_Fb to be used on a given output
- *
- * @param output
- * @param fb
- *
- * @ingroup Ecore_Drm2_Output_Group
- * @since 1.18
- */
-EAPI void ecore_drm2_output_next_fb_set(Ecore_Drm2_Output *output, 
Ecore_Drm2_Fb *fb);
-
-/**
  * Get the size of the crtc for a given output
  *
  * @param output
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c 
b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index fc7e2eb..3f32092 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -931,20 +931,6 @@ ecore_drm2_output_crtc_get(Ecore_Drm2_Output *output)
 }
 
 EAPI Ecore_Drm2_Fb *
-ecore_drm2_output_next_fb_get(Ecore_Drm2_Output *output)
-{
-   EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);
-   return output->next;
-}
-
-EAPI void
-ecore_drm2_output_next_fb_set(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *fb)
-{
-   EINA_SAFETY_ON_NULL_RETURN(output);
-   output->next = fb;
-}
-
-EAPI Ecore_Drm2_Fb *
 ecore_drm2_output_latest_fb_get(Ecore_Drm2_Output *output)
 {
EINA_SAFETY_ON_NULL_RETURN_VAL(output, NULL);

-- 




[EGIT] [core/efl] master 11/20: ee_drm: Improve next buffer selection algorithm

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=79409757c6493738c21015708a1ba5178942ad94

commit 79409757c6493738c21015708a1ba5178942ad94
Author: Derek Foreman 
Date:   Wed Sep 7 21:25:32 2016 -0500

ee_drm: Improve next buffer selection algorithm

When triple buffering it's possible that we'll only need two buffers at
a time for long durations.  When we finally call upon a third buffer it
hasn't been used recently enough to do a partial redraw.

By picking the oldest available buffer when multiple buffers are free we
can increase the likelihood of doing partial redraws.
---
 src/modules/evas/engines/drm/evas_outbuf.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index 97e4f10..b62d952 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -224,15 +224,23 @@ _outbuf_reconfigure(Outbuf *ob, int w, int h, int 
rotation, Outbuf_Depth depth)
 static Outbuf_Fb *
 _outbuf_fb_wait(Outbuf *ob)
 {
-   int i = 0;
+   int i = 0, best = -1, best_age = -1;
 
+   /* We pick the oldest available buffer to avoid using the same two
+* repeatedly and then having the third be stale when we need it
+*/
for (i = 0; i < ob->priv.num; i++)
  {
 if (&ob->priv.ofb[i] == ob->priv.display) continue;
 if (ecore_drm2_fb_busy_get(ob->priv.ofb[i].fb)) continue;
-if (ob->priv.ofb[i].valid) return &(ob->priv.ofb[i]);
+if (ob->priv.ofb[i].valid && (ob->priv.ofb[i].age > best_age))
+  {
+ best = i;
+ best_age = ob->priv.ofb[i].age;
+  }
  }
 
+   if (best >= 0) return &(ob->priv.ofb[best]);
return NULL;
 }
 

-- 




[EGIT] [core/efl] master 07/20: ecore_drm2: Add a function to set the pageflip callback data once

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=3d39c1e9b8647aebb12d4edfe426ec88e361c70d

commit 3d39c1e9b8647aebb12d4edfe426ec88e361c70d
Author: Derek Foreman 
Date:   Fri Sep 2 13:59:12 2016 -0500

ecore_drm2: Add a function to set the pageflip callback data once

Instead of passing the user data for the page flip callback every time,
set it just once.

This will make it easier to push tick logic into ecore_evas_drm, as there
will be a transitional period where page flips are driven in two places
that don't have access to the same pointers.
---
 src/lib/ecore_drm2/Ecore_Drm2.h   | 14 --
 src/lib/ecore_drm2/ecore_drm2_fb.c|  4 ++--
 src/lib/ecore_drm2/ecore_drm2_outputs.c   |  6 ++
 src/lib/ecore_drm2/ecore_drm2_private.h   |  2 ++
 src/modules/evas/engines/drm/evas_outbuf.c|  6 --
 src/modules/evas/engines/gl_drm/evas_outbuf.c |  5 +++--
 6 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index ce9340f..0a8411f 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -770,14 +770,13 @@ EAPI void ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, 
Eina_Rectangle *rects, unsigned
  *
  * @param fb
  * @param output
- * @param data
  *
  * @return The result of drmModePageFlip function call
  *
  * @ingroup Ecore_Drm2_Fb_Group
  * @since 1.18
  */
-EAPI int ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output, void 
*data);
+EAPI int ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output);
 
 /**
  * Return the Ecore_Drm2_Fb's busy status
@@ -802,6 +801,17 @@ EAPI Eina_Bool ecore_drm2_fb_busy_get(Ecore_Drm2_Fb *fb);
  */
 EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy);
 
+/**
+ * Set the user data for the output's page flip handler
+ *
+ * @param output The output to update user data for
+ * @param data The new user data pointer
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.19
+ */
+EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
+
 # endif
 
 #endif
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 6ac0dde..3160e5c 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -224,7 +224,7 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle 
*rects, unsigned int count
 }
 
 EAPI int
-ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output, void *data)
+ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output)
 {
int ret = 0;
 
@@ -260,7 +260,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output, void *data)
 
ret =
  drmModePageFlip(fb->fd, output->crtc_id, fb->id,
- DRM_MODE_PAGE_FLIP_EVENT, data);
+ DRM_MODE_PAGE_FLIP_EVENT, output->user_data);
if (ret < 0)
  {
 DBG("Pageflip Failed for Crtc %u on Connector %u: %m",
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c 
b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index a48170c..fda51f3 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1208,3 +1208,9 @@ next:
 
return ret;
 }
+
+EAPI void
+ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data)
+{
+   o->user_data = data;
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h 
b/src/lib/ecore_drm2/ecore_drm2_private.h
index 05f7102..8c16c04 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -151,6 +151,8 @@ struct _Ecore_Drm2_Output
 
Eina_List *planes;
 
+   void *user_data;
+
Eina_Bool connected : 1;
Eina_Bool primary : 1;
Eina_Bool cloned : 1;
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index e2f0c2e..3ae032e 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -97,7 +97,7 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame 
EINA_UNUSED, unsigned int se
if (next)
  {
 ecore_drm2_output_next_fb_set(ob->priv.output, NULL);
-ecore_drm2_fb_flip(next, ob->priv.output, ob);
+ecore_drm2_fb_flip(next, ob->priv.output);
  }
 }
 
@@ -140,7 +140,7 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, 
unsigned int count)
  }
 
ecore_drm2_fb_dirty(ofb->fb, rects, count);
-   if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output, ob) == 0)
+   if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output) == 0)
  ob->priv.display = ofb;
 
ecore_drm2_fb_busy_set(ofb->fb, EINA_TRUE);
@@ -256,6 +256,8 @@ _outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h)
ob->ctx.vblank_handler = _cb_vblank;
ob->ctx.page_flip_handler = _cb_pageflip;
 
+   ecore_drm2_output_user_data_se

[EGIT] [core/enlightenment] master 01/01: bump ecore_drm2 dependency, update to latest beta API

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=dc2bad0fcda063ee72b35beb3954cc2fc1eb94ba

commit dc2bad0fcda063ee72b35beb3954cc2fc1eb94ba
Author: Derek Foreman 
Date:   Thu Sep 8 11:51:36 2016 -0500

bump ecore_drm2 dependency, update to latest beta API
---
 configure.ac| 10 +++---
 src/bin/e_alert_main.c  |  2 +-
 src/modules/wl_drm/e_mod_main.c |  8 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/configure.ac b/configure.ac
index ec14351..e35493c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -94,6 +94,10 @@ AC_DEFINE(HAVE_ENVIRON, 1, [Have environ var])
 efl_version="1.17.0"
 AC_SUBST(efl_version)
 
+#We use ecore_drm2 beta API
+efl_ecore_drm2_version="1.18.99"
+AC_SUBST(efl_ecore_drm2_version)
+
 AC_CHECK_HEADERS([sys/timerfd.h sys/ptrace.h arpa/inet.h netinet/in.h])
 
 dnl AC_CHECK_HEADERS(X11/extensions/shape.h,, AC_MSG_ERROR([Cannot find 
X11/extensions/shape.h. Make sure your CFLAGS environment variable contains 
include lines for the location of this file]))
@@ -763,9 +767,9 @@ WL_DRM=false
 define([CHECK_MODULE_WL_DRM],
 [
   if test "x${have_wayland}" = "xyes" ; then
-PKG_CHECK_EXISTS([ecore-drm2 >= $efl_version], [have_ecore_drm2="yes"], 
[have_ecore_drm2="no"])
+PKG_CHECK_EXISTS([ecore-drm2 >= $efl_ecore_drm2_version], 
[have_ecore_drm2="yes"], [have_ecore_drm2="no"])
 if test "x${have_ecore_drm2}" = "xyes"; then
-  AC_E_CHECK_PKG(WL_DRM, [ ecore-drm2 >= $efl_version ecore >= 
$efl_version eina >= $efl_version ],
+  AC_E_CHECK_PKG(WL_DRM, [ ecore-drm2 >= $efl_ecore_drm2_version ecore >= 
$efl_version eina >= $efl_version ],
 [
   WL_DRM=true
   AC_DEFINE_UNQUOTED([HAVE_DRM2],[1],[enable ecore-drm2 support])
@@ -901,7 +905,7 @@ if test "x${have_wayland}" = "xyes"; then
   e_alert_requires="\
 $e_alert_requires \
 ecore-input >= ${efl_version} \
-ecore-drm2 >= ${efl_version} \
+ecore-drm2 >= ${efl_ecore_drm2_version} \
 evas >= ${efl_version}"
 else
   e_alert_requires="\
diff --git a/src/bin/e_alert_main.c b/src/bin/e_alert_main.c
index c0cb3c6..7317896 100644
--- a/src/bin/e_alert_main.c
+++ b/src/bin/e_alert_main.c
@@ -456,7 +456,7 @@ _e_alert_drm_display(void)
updates = evas_render_updates(canvas);
evas_render_updates_free(updates);
 
-   ecore_drm2_fb_flip(buffer, output, NULL);
+   ecore_drm2_fb_flip(buffer, output);
 }
 
 static void
diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 5f50f2d..1052c62 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -788,12 +788,8 @@ _drm2_read_pixels(E_Comp_Wl_Output *output, void *pixels)
out = ecore_drm2_output_find(dev, output->x, output->y);
if (!out) return;
 
-   fb = ecore_drm2_output_next_fb_get(out);
-   if (!fb)
- {
-fb = ecore_drm2_output_current_fb_get(out);
-if (!fb) return;
- }
+   fb = ecore_drm2_output_latest_fb_get(out);
+   if (!fb) return;
 
data = ecore_drm2_fb_data_get(fb);
fstride = ecore_drm2_fb_stride_get(fb);

-- 




[EGIT] [core/efl] master 20/20: ee_gl_drm: Stop calling fb_dirty

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=088c9675efc791d3fb2d6c79d24fec53f6fcfabd

commit 088c9675efc791d3fb2d6c79d24fec53f6fcfabd
Author: Derek Foreman 
Date:   Thu Sep 8 13:21:32 2016 -0500

ee_gl_drm: Stop calling fb_dirty

So yeah, fb_dirty is for marking dirty regions when rendering
directly into the front buffer attached for scanout on a manually
updated display.  Absolutely none of those things apply here, so
let's stop doing it.
---
 src/modules/evas/engines/gl_drm/evas_outbuf.c | 26 ++
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c 
b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index 0737c57..fb16c29 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -77,7 +77,7 @@ _evas_outbuf_fb_get(Outbuf *ob, struct gbm_bo *bo)
 }
 
 static void
-_evas_outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count)
+_evas_outbuf_buffer_swap(Outbuf *ob)
 {
Ecore_Drm2_Fb *fb;
 
@@ -101,7 +101,6 @@ _evas_outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, 
unsigned int count)
fb = _evas_outbuf_fb_get(ob, ob->priv.bo[0]);
if (fb)
  {
-ecore_drm2_fb_dirty(fb, rects, count);
 ecore_drm2_fb_flip(fb, ob->priv.output);
 
 /* Ecore_Drm2_Plane *plane; */
@@ -763,28 +762,7 @@ evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, 
Evas_Render_Mode render_mode)
if (ob->info->callback.post_swap)
  ob->info->callback.post_swap(ob->info->callback.data, ob->evas);
 
-   if (rects)
- {
-Tilebuf_Rect *r;
-Eina_Rectangle *res;
-int num, i = 0;
-
-num = eina_inlist_count(EINA_INLIST_GET(rects));
-res = alloca(sizeof(Eina_Rectangle) * num);
-EINA_INLIST_FOREACH(EINA_INLIST_GET(rects), r)
-  {
- res[i].x = r->x;
- res[i].y = r->y;
- res[i].w = r->w;
- res[i].h = r->h;
- i++;
-  }
-
-_evas_outbuf_buffer_swap(ob, res, num);
- }
-   else
- //Flush GL Surface data to Framebuffer
- _evas_outbuf_buffer_swap(ob, NULL, 0);
+   _evas_outbuf_buffer_swap(ob);
 
 end:
//TODO: Need render unlock after drm page flip?

-- 




[EGIT] [core/efl] master 06/20: ee_drm: use the ecore_drm2_fb busy bit

2016-09-08 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cfd172c64bf021c70b9c31adae25f7edb09d6eec

commit cfd172c64bf021c70b9c31adae25f7edb09d6eec
Author: Derek Foreman 
Date:   Fri Sep 2 12:18:06 2016 -0500

ee_drm: use the ecore_drm2_fb busy bit

Use the new busy getter/setter on the fb instead of keeping state in the
outbuf
---
 src/modules/evas/engines/drm/evas_engine.h |  1 -
 src/modules/evas/engines/drm/evas_outbuf.c | 12 +---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/modules/evas/engines/drm/evas_engine.h 
b/src/modules/evas/engines/drm/evas_engine.h
index 1bfe40e..3733610 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -48,7 +48,6 @@ typedef struct _Outbuf_Fb
 
Eina_Bool valid : 1;
Eina_Bool drawn : 1;
-   Eina_Bool busy : 1;
 } Outbuf_Fb;
 
 struct _Outbuf
diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index aec09ff..e2f0c2e 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -91,7 +91,7 @@ _cb_pageflip(int fd EINA_UNUSED, unsigned int frame 
EINA_UNUSED, unsigned int se
ob = data;
 
ofb = ob->priv.display;
-   if (ofb) ofb->busy = EINA_FALSE;
+   if (ofb) ecore_drm2_fb_busy_set(ofb->fb, EINA_FALSE);
 
next = ecore_drm2_output_next_fb_get(ob->priv.output);
if (next)
@@ -135,7 +135,7 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, 
unsigned int count)
if (next)
  {
 next_ofb = _outbuf_fb_find(ob, next);
-next_ofb->busy = EINA_FALSE;
+ecore_drm2_fb_busy_set(next_ofb->fb, EINA_FALSE);
 ecore_drm2_output_next_fb_set(ob->priv.output, NULL);
  }
 
@@ -143,7 +143,7 @@ _outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, 
unsigned int count)
if (ecore_drm2_fb_flip(ofb->fb, ob->priv.output, ob) == 0)
  ob->priv.display = ofb;
 
-   ofb->busy = EINA_TRUE;
+   ecore_drm2_fb_busy_set(ofb->fb, EINA_TRUE);
ofb->drawn = EINA_TRUE;
ofb->age = 0;
 
@@ -192,7 +192,6 @@ _outbuf_fb_create(Outbuf *ob, Outbuf_Fb *ofb)
if (!ofb->fb) return EINA_FALSE;
 
ofb->age = 0;
-   ofb->busy = EINA_FALSE;
ofb->drawn = EINA_FALSE;
ofb->valid = EINA_TRUE;
 
@@ -206,7 +205,6 @@ _outbuf_fb_destroy(Outbuf_Fb *ofb)
 
memset(ofb, 0, sizeof(*ofb));
ofb->valid = EINA_FALSE;
-   ofb->busy = EINA_FALSE;
ofb->drawn = EINA_FALSE;
ofb->age = 0;
 }
@@ -370,7 +368,7 @@ _outbuf_fb_wait(Outbuf *ob)
 for (i = 0; i < ob->priv.num; i++)
   {
  if (&ob->priv.ofb[i] == ob->priv.display) continue;
- if (ob->priv.ofb[i].busy) continue;
+ if (ecore_drm2_fb_busy_get(ob->priv.ofb[i].fb)) continue;
  if (ob->priv.ofb[i].valid) return &(ob->priv.ofb[i]);
   }
 
@@ -394,7 +392,7 @@ _outbuf_fb_assign(Outbuf *ob)
   {
  if (ob->priv.ofb[i].valid)
{
-  ob->priv.ofb[i].busy = 0;
+  ecore_drm2_fb_busy_set(ob->priv.ofb[i].fb, EINA_FALSE);
   ob->priv.ofb[i].age = 0;
   ob->priv.ofb[i].drawn = EINA_FALSE;
}

-- 




[EGIT] [core/efl] master 02/04: ecore_drm2: Add release handlers for buffers

2016-09-09 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=30d14779a6ea6c8c3b80c03fff71dc260a97c6f3

commit 30d14779a6ea6c8c3b80c03fff71dc260a97c6f3
Author: Derek Foreman 
Date:   Fri Sep 9 13:31:20 2016 -0500

ecore_drm2: Add release handlers for buffers

Allow the engine to register a callback for buffer release.  This lets us
do appropriate buffer bookkeeping (for example, gbm locking) in the
engine.
---
 src/lib/ecore_drm2/Ecore_Drm2.h | 16 
 src/lib/ecore_drm2/ecore_drm2_fb.c  | 16 ++--
 src/lib/ecore_drm2/ecore_drm2_outputs.c |  7 +++
 src/lib/ecore_drm2/ecore_drm2_private.h |  2 ++
 4 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 99a2e9a..587f17f 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -61,6 +61,8 @@ typedef struct _Ecore_Drm2_Event_Activate
 EAPI extern int ECORE_DRM2_EVENT_OUTPUT_CHANGED;
 EAPI extern int ECORE_DRM2_EVENT_ACTIVATE;
 
+typedef void (*Ecore_Drm2_Release_Handler)(void *data, Ecore_Drm2_Fb *b);
+
 /**
  * @file
  * @brief Ecore functions for dealing with drm, virtual terminals
@@ -809,6 +811,20 @@ EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, 
Eina_Bool busy);
 EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
 
 /**
+ * Register a callback for the buffer release handler
+ *
+ * When a flip completes ecore_drm2 may release a buffer.  Use this callback
+ * if you need to do bookkeeping or locking on buffer release.
+ *
+ * @param output The output to register the callback on
+ * @param handler The function to handle the callback
+ * @param data The user data to pass to the callback
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.19
+ */
+EAPI void ecore_drm2_output_release_handler_set(Ecore_Drm2_Output *output, 
Ecore_Drm2_Release_Handler handler, void *data);
+
+/**
  * Get the Framebuffer's gbm buffer object
  *
  * @param fb The framebuffer to query
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index d772768..aedef9f 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -224,16 +224,20 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle 
*rects, unsigned int count
 #endif
 }
 
+static void _release_buffer(Ecore_Drm2_Output *output, Ecore_Drm2_Fb *b)
+{
+   b->busy = EINA_FALSE;
+   if (output->release_cb) output->release_cb(output->release_data, b);
+}
+
 EAPI Eina_Bool
 ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
 {
-   if (output->current) output->current->busy = EINA_FALSE;
+   if (output->current && (output->current != output->pending))
+ _release_buffer(output, output->current);
output->current = output->pending;
output->pending = NULL;
 
-   /* In case they were the same buffer... */
-   if (output->current) output->current->busy = EINA_TRUE;
-
return !!output->next;
 }
 
@@ -249,7 +253,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 
if (output->pending)
  {
-if (output->next) output->next->busy = EINA_FALSE;
+if (output->next) _release_buffer(output, output->next);
 output->next = fb;
 if (output->next) output->next->busy = EINA_TRUE;
 return 0;
@@ -283,7 +287,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
  return ret;
   }
 
-if (output->current) output->current->busy = EINA_FALSE;
+if (output->current) _release_buffer(output, output->current);
 output->current = fb;
 output->current->busy = EINA_TRUE;
 output->next = NULL;
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c 
b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 3f32092..dff7461 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1202,3 +1202,10 @@ ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, 
void *data)
 {
o->user_data = data;
 }
+
+EAPI void
+ecore_drm2_output_release_handler_set(Ecore_Drm2_Output *o, 
Ecore_Drm2_Release_Handler cb, void *data)
+{
+   o->release_data = data;
+   o->release_cb = cb;
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h 
b/src/lib/ecore_drm2/ecore_drm2_private.h
index d78d011..bce5ede 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -154,6 +154,8 @@ struct _Ecore_Drm2_Output
Eina_List *planes;
 
void *user_data;
+   Ecore_Drm2_Release_Handler release_cb;
+   void *release_data;
 
Eina_Bool connected : 1;
Eina_Bool primary : 1;

-- 




[EGIT] [core/efl] master 01/04: ecore_drm2: Store gbm_bo for Fbs and add a getter function for it

2016-09-09 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0722eae9601745949b46c1f9e4a46c018276f572

commit 0722eae9601745949b46c1f9e4a46c018276f572
Author: Derek Foreman 
Date:   Fri Sep 9 13:18:41 2016 -0500

ecore_drm2: Store gbm_bo for Fbs and add a getter function for it

This will aid with proper locking in gl_drm later
---
 src/lib/ecore_drm2/Ecore_Drm2.h   | 14 +-
 src/lib/ecore_drm2/ecore_drm2_fb.c|  9 -
 src/lib/ecore_drm2/ecore_drm2_private.h   |  2 ++
 src/modules/evas/engines/gl_drm/evas_outbuf.c |  2 +-
 4 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 598d831..99a2e9a 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -686,7 +686,7 @@ EAPI Eina_Bool 
ecore_drm2_output_possible_crtc_get(Ecore_Drm2_Output *output, un
  */
 EAPI Ecore_Drm2_Fb *ecore_drm2_fb_create(int fd, int width, int height, int 
depth, int bpp, unsigned int format);
 
-EAPI Ecore_Drm2_Fb *ecore_drm2_fb_gbm_create(int fd, int width, int height, 
int depth, int bpp, unsigned int format, unsigned int handle, unsigned int 
stride);
+EAPI Ecore_Drm2_Fb *ecore_drm2_fb_gbm_create(int fd, int width, int height, 
int depth, int bpp, unsigned int format, unsigned int handle, unsigned int 
stride, void *bo);
 
 /**
  * Destroy a framebuffer object
@@ -808,6 +808,18 @@ EAPI void ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, 
Eina_Bool busy);
  */
 EAPI void ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
 
+/**
+ * Get the Framebuffer's gbm buffer object
+ *
+ * @param fb The framebuffer to query
+ *
+ * @return The gbm bo for the framebuffer
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.19
+ */
+EAPI void *ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *fb);
+
 # endif
 
 #endif
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index f660f05..d772768 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -106,7 +106,7 @@ err:
 }
 
 EAPI Ecore_Drm2_Fb *
-ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, 
unsigned int format, unsigned int handle, unsigned int stride)
+ecore_drm2_fb_gbm_create(int fd, int width, int height, int depth, int bpp, 
unsigned int format, unsigned int handle, unsigned int stride, void *bo)
 {
struct drm_mode_map_dumb marg;
Ecore_Drm2_Fb *fb;
@@ -118,6 +118,7 @@ ecore_drm2_fb_gbm_create(int fd, int width, int height, int 
depth, int bpp, unsi
if (!fb) return NULL;
 
fb->gbm = EINA_TRUE;
+   fb->gbm_bo = bo;
 
fb->fd = fd;
fb->w = width;
@@ -322,3 +323,9 @@ ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy)
 {
fb->busy = busy;
 }
+
+EAPI void *
+ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *f)
+{
+   return f->gbm_bo;
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h 
b/src/lib/ecore_drm2/ecore_drm2_private.h
index 96acfa4..d78d011 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -93,6 +93,8 @@ struct _Ecore_Drm2_Fb
uint32_t stride, size;
uint32_t format;
 
+   void *gbm_bo;
+
Eina_Bool gbm : 1;
Eina_Bool busy : 1;
 
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c 
b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index fb16c29..fb75313 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -64,7 +64,7 @@ _evas_outbuf_fb_get(Outbuf *ob, struct gbm_bo *bo)
 
fb =
  ecore_drm2_fb_gbm_create(ob->fd, w, h, ob->depth, ob->bpp,
-  format, hdl, stride);
+  format, hdl, stride, bo);
if (!fb)
  {
 ERR("Failed to create FBO");

-- 




[EGIT] [core/efl] master 04/04: gl_drm_ee: Remove repulsive hack and do proper gbm buffer accounting

2016-09-09 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=95bb942aa7ff16e6aab2dd52971044874dc06077

commit 95bb942aa7ff16e6aab2dd52971044874dc06077
Author: Derek Foreman 
Date:   Fri Sep 9 13:35:22 2016 -0500

gl_drm_ee: Remove repulsive hack and do proper gbm buffer accounting

We no longer need this hack as we now have a way to properly handle the
buffer locking in the engine, and don't currently deal with multi-head.
---
 src/modules/evas/engines/gl_drm/evas_engine.h |  2 +-
 src/modules/evas/engines/gl_drm/evas_outbuf.c | 40 +++
 2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/src/modules/evas/engines/gl_drm/evas_engine.h 
b/src/modules/evas/engines/gl_drm/evas_engine.h
index 6ad81df..75fa705 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.h
+++ b/src/modules/evas/engines/gl_drm/evas_engine.h
@@ -103,7 +103,6 @@ struct _Outbuf
 
struct 
  {
-struct gbm_bo *bo[2];
 Ecore_Drm2_Output *output;
  } priv;
 
@@ -130,6 +129,7 @@ void *evas_outbuf_update_region_new(Outbuf *ob, int x, int 
y, int w, int h, int
 void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int 
y, int w, int h);
 void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update);
 void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode 
render_mode);
+void evas_outbuf_release_fb(void *, void *);
 
 Evas_Engine_GL_Context* evas_outbuf_gl_context_get(Outbuf *ob);
 void *evas_outbuf_egl_display_get(Outbuf *ob);
diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c 
b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index fb75313..0823aff 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -76,29 +76,31 @@ _evas_outbuf_fb_get(Outbuf *ob, struct gbm_bo *bo)
return fb;
 }
 
+void
+_evas_outbuf_release_fb(void *ob_v, Ecore_Drm2_Fb *fb)
+{
+   struct gbm_bo *bo;
+   Outbuf *ob;
+
+   ob = ob_v;
+   bo = ecore_drm2_fb_bo_get(fb);
+   gbm_surface_release_buffer(ob->surface, bo);
+}
+
 static void
 _evas_outbuf_buffer_swap(Outbuf *ob)
 {
-   Ecore_Drm2_Fb *fb;
+   struct gbm_bo *bo;
+   Ecore_Drm2_Fb *fb = NULL;
 
-   /* Repulsive hack:  Right now we don't actually have a proper way to retire
-* buffers because the ticker and the flip handler are out of sync, the
-* flip handler is per output, fbs are submit to multiple outputs and may
-* be denied (and re-queued) by any output they're supposed to be on.
-* This will all be magically fixed when evas supports multiple target
-* regions, but until then we do this:
-* always have 2 buffers locked
-*/
-   if (ob->priv.bo[1]) gbm_surface_release_buffer(ob->surface, ob->priv.bo[1]);
-   ob->priv.bo[1] = ob->priv.bo[0];
-   ob->priv.bo[0] = gbm_surface_lock_front_buffer(ob->surface);
-   if (!ob->priv.bo[0])
- {
-WRN("Could not lock front buffer: %m");
-return;
+   bo = gbm_surface_lock_front_buffer(ob->surface);
+   if (!bo)
+ {
+ecore_drm2_output_fb_release(ob->priv.output);
+bo = gbm_surface_lock_front_buffer(ob->surface);
  }
+   if (bo) fb = _evas_outbuf_fb_get(ob, bo);
 
-   fb = _evas_outbuf_fb_get(ob, ob->priv.bo[0]);
if (fb)
  {
 ecore_drm2_fb_flip(fb, ob->priv.output);
@@ -390,6 +392,10 @@ evas_outbuf_new(Evas_Engine_Info_GL_Drm *info, int w, int 
h, Render_Engine_Swap_
ob->format = info->info.format;
ob->priv.output = info->info.output;
 
+   ecore_drm2_output_release_handler_set(ob->priv.output,
+ _evas_outbuf_release_fb,
+ ob);
+
/* if ((num = getenv("EVAS_GL_DRM_VSYNC"))) */
/*   ob->vsync = atoi(num); */
 

-- 




[EGIT] [core/efl] master 03/04: ecore_drm2: Add ecore_drm2_output_fb_release way to force buffer release

2016-09-09 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=21ad56aa32ead4391e44875f4f59b57b1b81cb87

commit 21ad56aa32ead4391e44875f4f59b57b1b81cb87
Author: Derek Foreman 
Date:   Fri Sep 9 13:33:15 2016 -0500

ecore_drm2: Add ecore_drm2_output_fb_release way to force buffer release

Adds an api to attempt to release an fb from an output.  This will try
to first free any queued but not display buffers, which may harmlessly
give us a render target.

However, if that fails it will try to get buffers that have been sent to
scanout, which can lead to tearing.
---
 src/lib/ecore_drm2/Ecore_Drm2.h| 14 ++
 src/lib/ecore_drm2/ecore_drm2_fb.c | 29 +
 2 files changed, 43 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 587f17f..a1c5a5b 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -825,6 +825,20 @@ EAPI void 
ecore_drm2_output_user_data_set(Ecore_Drm2_Output *o, void *data);
 EAPI void ecore_drm2_output_release_handler_set(Ecore_Drm2_Output *output, 
Ecore_Drm2_Release_Handler handler, void *data);
 
 /**
+ * Try to force a framebuffer release for an output
+ *
+ * This tries to release the next, pending, or current buffer from
+ * the output.  If successful there will be a release callback to
+ * the registered handler, and the fb will no longer be flagged busy.
+ *
+ * @param output The output to force release
+ *
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.19
+ */
+EAPI void ecore_drm2_output_fb_release(Ecore_Drm2_Output *o);
+
+/**
  * Get the Framebuffer's gbm buffer object
  *
  * @param fb The framebuffer to query
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index aedef9f..0cbd4be 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -328,6 +328,35 @@ ecore_drm2_fb_busy_set(Ecore_Drm2_Fb *fb, Eina_Bool busy)
fb->busy = busy;
 }
 
+EAPI void
+ecore_drm2_output_fb_release(Ecore_Drm2_Output *o)
+{
+   if (o->next)
+ {
+_release_buffer(o, o->next);
+o->next = NULL;
+return;
+ }
+
+   WRN("Buffer release request when no next buffer");
+   /* If we have to release these we're going to see tearing.
+* Try to reclaim in decreasing order of visual awfulness
+*/
+   if (o->current)
+ {
+_release_buffer(o, o->current);
+o->current = NULL;
+return;
+ }
+
+   if (o->pending)
+ {
+_release_buffer(o, o->pending);
+o->pending = NULL;
+return;
+ }
+}
+
 EAPI void *
 ecore_drm2_fb_bo_get(Ecore_Drm2_Fb *f)
 {

-- 




[EGIT] [core/enlightenment] master 01/01: Fix error print when wl_wl fails to start

2016-09-13 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=def99a337f7dba89ddd6c8bf3b7a19e241d8dea9

commit def99a337f7dba89ddd6c8bf3b7a19e241d8dea9
Author: Derek Foreman 
Date:   Tue Sep 13 10:32:37 2016 -0500

Fix error print when wl_wl fails to start

Probably copypastad from wl_drm, very confusing.
---
 src/modules/wl_wl/e_mod_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/wl_wl/e_mod_main.c b/src/modules/wl_wl/e_mod_main.c
index ad1162f..f385745 100644
--- a/src/modules/wl_wl/e_mod_main.c
+++ b/src/modules/wl_wl/e_mod_main.c
@@ -53,7 +53,7 @@ e_modapi_init(E_Module *m)
   }
 else
   {
- fprintf(stderr, "Could not create ecore_evas_drm canvas");
+ fprintf(stderr, "Could not create wayland canvas");
  return NULL;
   }
  }

-- 




Re: [E-devel] [RFC] EFL Multi-seat

2016-09-14 Thread Derek Foreman
On 14/09/16 10:59 AM, Guilherme Íscaro wrote:
> Hey Christopher, some comments were answered by k-s. I will add some
> thoughts.
> 
> On Tue, Sep 13, 2016 at 8:15 PM, Christopher Michael > wrote:
> 
>> Hi Gustavo,
>>
>> Quite a few inlined comments below, so please read whole email :)
>>
>> On 09/13/2016 06:00 PM, Bruno Dilly wrote:
>>> Hi folks,
>>>
>>> We’re working on improve EFL to support multi-seat in the same
>> application
>>> window.
>>>
>>> For make it doable, we’re considering the following approaches:
>>>
>>>-
>>>
>>>When using Wayland (Weston compositor) just get seat information from
>> it
>>>-
>>>
>>
>> What about the Enlightenment wayland compositor ??
>>
>>>When using X11 or FB, use VNC server to gather multiple seats mapped
>> to
>>>remote clients
>>>
>>>
>>> To make it possible, the following changes on Evas, Ecore_Evas, Ecore and
>>> Ecore_Wl2 APIs are proposed. Please let us read your comments about it
>> =)
>>>
>>> After this work is done we’ll support it on Edje, but it’s not covered by
>>> this discussion (we’ll send another RFC if it seems required at the
>> time).
>>>
>>> Some tests and PoC were written on this repository:
>>>
>>> https://github.com/profusion/multi-seat-tests/
>>>
>>> Also could somebody please help us creating dev accounts for Iscaro and
>> me?
>>
>> Uhhh, you should already have a dev account...
>>
>>> So we could create dev branches and avoid keeping our work on external
>>> repositories and making our workflow a bit more straightforward?
>>>
>>> Thanks in advance
>>>
>>>
>>> = Changes on Evas =
>>>
>>>-
>>>
>>>_Evas_Public_Data should contain a hash indexed by seat of focused
>>>Evas_Objects. From “pd->focused” to “pd->focused[seat]”.
>>>-
>>>
>>>A function similar to evas_object_top_at_pointer_get(const Evas *e)
>>>should be added. This new function will receive the Efl_Input_Device
>> (the
>>>seat) as argument. The old function should return the top Evas_Object
>>>according to the default seat
>>>-
>>
>> I don't think using Efl_Input_Device as "the seat" is a good idea here.
>> A single seat can have multiple input devices (pointer, keyboard, etc).
>> Efl_Input_Device (to me) implies a single input device (ie: a single
>> pointer, single keyboard, etc). Whereas a "seat" can have multiple
>> devices attached...
>>
> 
> Well, we decided to use an Efl_Input_Device because it already exists a
> class that refers to a seat. In our idea every input (mouse, and keyboard)
> would have as parent the seat that it belongs to.
> 
> 
>>
>>>
>>>evas_canvas_focus_get() should return the object focused by the
>> default
>>>seat.
>>
>> IMO, this is not going to entirely work. In Wayland, you can have
>> "pointer focus", "keyboard focus", "touch focus", etc, etc ... a single
>> object focused by the "default" seat is not likely to cover everything.
>>
>> Pointer One on Seat One could be focused Object One, while Pointer Two
>> on Seat One could be focusing a different object but on the same canvas.
>> The function evas_canvas_focus_get should likely take some parameters
>> here...perhaps the seat ? Perhaps the pointer ? Not 100% sure, just
>> tossing out thoughts...
>>
> 
> In this case where someone has two mices (for example) in the same seat,
> why not consider that the user just changed the focus from object one to
> object two ?

Before taking me too seriously, please understand that I know more about
wayland than EFL, and don't really follow X details and what-not...
Sorry if I'm repeating things people already know.

Under wayland each seat can only have one "pointer", one "keyboard" and
one "touch" object.

The pointer for seat "One" will be moved by all the mice in seat "One"
as if they were a single device.  So the problem we're discussing here
simply can't happen.  The seat can have 1000 mice but it can only ever
have one pointer (and thus one pointer focus)  Seat "Two"'s pointer can,
of course, focus something else entirely, or the same thing seat "One"'s
pointer is focusing.

Similarly, two keyboards in the same seat act as a single keyboard (the
important bit here is that all their modifiers are combined, as is their
map of down keys - banging on the "a" key on keyboard two while it's
held down on keyboard one will do nothing at all).

Wayland does have separate focus for pointer, keyboard, and touch within
a seat - and there's no "seat focus" at all.

Thanks for listening to my rambling, really nice to see this progressing!

Derek


> 
>>
>>>-
>>>
>>>evas_canvas_pointer_canvas_xy_get() Should return the XY from the
>>>default seat.
>>>-
>>>
>>>evas_canvas_seat_pointer_canvas_xy_get() - Same thing as
>>>evas_canvas_pointer_canvas_xy_get(), however it returns the XY based
>> on the
>>>seat.
>>>-
>>>
>>>evas_object_focus_set() - Will set/unset the focus only for the
>> default
>>>seat.
>>>-
>>>
>>>evas_object_focus_by_seat_set() should be added
>>>-

Re: [E-devel] [RFC] EFL Multi-seat

2016-09-15 Thread Derek Foreman
On 15/09/16 10:51 AM, Gustavo Sverzut Barbieri wrote:
> On Wed, Sep 14, 2016 at 3:42 PM, Derek Foreman  wrote:
>> Wayland does have separate focus for pointer, keyboard, and touch within
>> a seat - and there's no "seat focus" at all.
> 
> Ok, that helps so we'll basically add focus per device, since your
> previous explanation that there is a single pointer/keyboard/touch per
> seat, it should work nice. For us it avoids one "parent lookup" to
> figure out the seat of a given device :-)
> 
> BUT one thing that we need to understand is the relation between
> pointer/touch and keyboard focus, this is particularly important so we
> plan a solution that works for legacy EFL (or any toolkit that has a
> single focused object).
> 
> Usually we have one focused object (ie:  text entry). Clicking or
> taping (touch) it, will focus. Then typing at the keyboard will send
> keys there. If you use the keyboard to cycle focus (ie: Tab), then
> that object previously focused by pointer/touch is unfocused and a new
> one is focused.
> 
> If pointer and touch are not changing that focus where keyboard send
> key presses... what are they use? This is why we're planning per-seat
> focus: be click, tap or "Tab", change the focused object where the
> next key press will be delivered.

Well, in wayland "activation" (window is "focused" and decorates itself
as such) is sent separately from input events.  Pointer focus generally
means the pointer is inside a window - whether that activates the window
or not is up to the compositor (focus follows mouse vs click to focus, etc)

On weston, when you mouse into a window it will receive a pointer enter
event (and have pointer focus) before it receives any pointer motion
events - but it won't be activated unless you click.  Weston also sets
the keyboard focus when you click.

But I'm talking about how the compositor delivers events, not how
applications use them (pointer, touch, keyboard may focus on difference
surfaces in wayland... but how an application focuses widgets on its
canvas is entirely up to the application?)

Wayland doesn't know anything about "widget focus".  That's up to the
application to define.

> The idea of multi-seat here is to allow 2 users to simultaneously use
> the same application window, like 2 text entries, each user would be
> sending text to his own entry (we're not attempting to do multi-user
> edit of the same text-entry, as that will be much more complex given
> Evas textblock).

I think it's probably completely reasonable to think of a seat as having
a focus at this level.

> Another use is to allow 2 users to interact with different edje drag
> parts, or in a game you can control 2 players at once.

A shame libinput doesn't do anything for gamepads.  I'll assume that's
outside of the scope of this work. :)

> --
> ___
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 03/05: render_thread: Attempt to set affinity to a random fast core

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a17ac66f0a0b089dde0b2e550523b0d59ec97f52

commit a17ac66f0a0b089dde0b2e550523b0d59ec97f52
Author: Derek Foreman 
Date:   Thu Sep 15 16:05:25 2016 -0500

render_thread: Attempt to set affinity to a random fast core

We've been pinning the render thread for every EFL process to core 0.
This is a bit silly in the first place, but some big.LITTLE arm systems,
such as exynos 5422, have the LITTLE cores first.

On those systems we put all the render threads on a slow core.

This attempts to fix that by using a random core from the pool of fast
cores.

If we can't determine which cores are fast (ie: we're not on a
linux kernel with cpufreq enabled) then we'll continue doing what we've
always done.
---
 src/lib/evas/common/evas_thread_render.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/common/evas_thread_render.c 
b/src/lib/evas/common/evas_thread_render.c
index 623e40e..562ef29 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -1,4 +1,5 @@
 #include "evas_common_private.h"
+#include "eina_cpu_private.h"
 
 #include 
 
@@ -125,6 +126,8 @@ out:
 void
 evas_thread_init(void)
 {
+int core;
+
 if (init_count++) return;
 
 eina_threads_init();
@@ -135,7 +138,9 @@ evas_thread_init(void)
   CRI("Could not create draw thread lock");
 if (!eina_condition_new(&evas_thread_queue_condition, 
&evas_thread_queue_lock))
   CRI("Could not create draw thread condition");
-if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0,
+
+core = _eina_cpu_fast_core_get();
+if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, core,
   evas_thread_worker_func, NULL))
   if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, -1,
 evas_thread_worker_func, NULL))

-- 




[EGIT] [core/efl] master 02/05: eina_cpu: Add an internal api for getting a random fast core

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=13da63d26052b2839f2605fe20193a0da7fcea84

commit 13da63d26052b2839f2605fe20193a0da7fcea84
Author: Derek Foreman 
Date:   Thu Sep 15 16:02:10 2016 -0500

eina_cpu: Add an internal api for getting a random fast core

In a big.LITTLE ARM system cores can have different capabilities.  This
gives an internal API that randomly returns the core id of any of the
system's fastest cores.

On systems where all cores are the same, it will return any available core.

If we don't have cpufreq support we just return 0
---
 src/Makefile_Eina.am|   1 +
 src/lib/eina/eina_cpu.c | 106 
 src/lib/eina/eina_cpu_private.h |  35 +
 3 files changed, 142 insertions(+)

diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am
index 020052a..b442635 100644
--- a/src/Makefile_Eina.am
+++ b/src/Makefile_Eina.am
@@ -58,6 +58,7 @@ lib/eina/eina_trash.h \
 lib/eina/eina_iterator.h \
 lib/eina/eina_main.h \
 lib/eina/eina_cpu.h \
+lib/eina/eina_cpu_private.h \
 lib/eina/eina_inline_cpu.x \
 lib/eina/eina_sched.h \
 lib/eina/eina_tiler.h \
diff --git a/src/lib/eina/eina_cpu.c b/src/lib/eina/eina_cpu.c
index e6b9921..fe39861 100644
--- a/src/lib/eina/eina_cpu.c
+++ b/src/lib/eina/eina_cpu.c
@@ -49,12 +49,20 @@
 #include "eina_log.h"
 #include "eina_cpu.h"
 
+#include 
+
+#include "eina_cpu_private.h"
+
 /**
 *  Local *
 **/
 
 static void _eina_page_size(void);
 
+static int fastest_core_speed = 0;
+static int slowest_core_speed = INT_MAX;
+static Eina_Hash *cpu_hash = NULL;
+
 /* FIXME this ifdefs should be replaced */
 #if defined(__i386__) || defined(__x86_64__)
 /* We save ebx and restore it to be PIC compatible */
@@ -151,6 +159,9 @@ eina_cpu_init(void)
 Eina_Bool
 eina_cpu_shutdown(void)
 {
+   eina_hash_free(cpu_hash);
+   cpu_hash = NULL;
+   fastest_core_speed = 0;
return EINA_TRUE;
 }
 
@@ -286,3 +297,98 @@ void eina_cpu_count_internal(void)
else
  _cpu_count = _eina_cpu_count_internal();
 }
+
+static void
+eina_cpu_map_init(void)
+{
+   fastest_core_speed = -1;
+
+#if defined (__linux__) || defined(__GLIBC__)
+   Eina_Iterator *it;
+   Eina_Strbuf *fname;
+   const Eina_File_Direct_Info *f_info;
+
+   it = eina_file_stat_ls("/sys/devices/system/cpu/cpufreq");
+   if (!it) return;
+
+   cpu_hash = eina_hash_int32_new(free);
+
+   fname = eina_strbuf_new();
+   EINA_ITERATOR_FOREACH(it, f_info)
+ {
+if ((f_info->type == EINA_FILE_DIR) &&
+eina_str_has_prefix(f_info->path,
+"/sys/devices/system/cpu/cpufreq/policy"))
+  {
+ FILE *f;
+ int num, speed;
+
+ eina_strbuf_append_printf(fname, "%s%s", f_info->path, 
"/cpuinfo_max_freq");
+ f = fopen(eina_strbuf_string_get(fname), "r");
+ eina_strbuf_reset(fname);
+ if (!f) goto err;
+ speed = -1;
+ num = fscanf(f, "%d", &speed);
+ fclose(f);
+ if ((num != 1) || (speed == -1)) goto err;
+
+ slowest_core_speed = MIN(speed, slowest_core_speed);
+ fastest_core_speed = MAX(speed, fastest_core_speed);
+
+ eina_strbuf_append_printf(fname, "%s%s", f_info->path, 
"/affected_cpus");
+ f = fopen(eina_strbuf_string_get(fname), "r");
+ eina_strbuf_reset(fname);
+ if (!f) goto err;
+ do
+   {
+  int core;
+  uint64_t *corelist;
+  num = fscanf(f, "%d", &core);
+  if ((num == EOF) || (core > 63)) break;
+
+  corelist = eina_hash_find(cpu_hash, &speed);
+  if (!corelist)
+{
+   corelist = malloc(sizeof(*corelist));
+   if (!corelist) goto err;
+   *corelist = 1 << core;
+   eina_hash_add(cpu_hash, &speed, corelist);
+}
+  *corelist |= 1 << core;
+   } while (num != EOF);
+ fclose(f);
+  }
+ }
+err:
+   eina_strbuf_free(fname);
+   eina_iterator_free(it);
+#endif
+}
+
+EAPI int
+_eina_cpu_fast_core_get(void)
+{
+#if defined (__linux__) || defined(__GLIBC__)
+   uint64_t *corelist;
+   uint64_t cores;
+   int bit, place = 0;
+
+   if (fastest_core_speed == -1) return -1;
+
+   if (fastest_core_speed == 0) eina_cpu_map_init();
+
+   corelist = eina_hash_

[EGIT] [core/efl] master 04/05: eina_thread: Don't ensure affinity core is lower than number of cpus

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0f98e1c6d324a7d17b6e7bdb7b1b41d3a2db9954

commit 0f98e1c6d324a7d17b6e7bdb7b1b41d3a2db9954
Author: Derek Foreman 
Date:   Thu Sep 15 16:09:00 2016 -0500

eina_thread: Don't ensure affinity core is lower than number of cpus

CPUs can be turned off after boot leading to a sparse mapping of core ids.

For example, if I turn off the first four cores on an exynos 5422 (these
are the low speed cores) then the high speed cores are still numbered 4-7
but there are only 4 cores present.

In that situation using affinity_core % num_cpus will prevent ever being
able to set affinity at all.

Just remove the pointless check and let the user set whatever core id they
want.
---
 src/lib/eina/eina_thread.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c
index 5002a42..f698092 100644
--- a/src/lib/eina/eina_thread.c
+++ b/src/lib/eina/eina_thread.c
@@ -70,12 +70,9 @@ _eina_thread_create(Eina_Thread *t, int affinity, void 
*(*func)(void *data), voi
  {
 #ifdef EINA_HAVE_PTHREAD_AFFINITY
 cpu_set_t cpu;
-int cpunum;
-
-cpunum = eina_cpu_count();
 
 CPU_ZERO(&cpu);
-CPU_SET(affinity % cpunum, &cpu);
+CPU_SET(affinity, &cpu);
 pthread_attr_setaffinity_np(&attr, sizeof(cpu), &cpu);
 #endif
  }

-- 




[EGIT] [core/efl] master 01/05: eina: Actually call eina_cpu_init() and eina_cpu_shutdown()

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1881b0d34302b8c29d4b086715eeda9e576ee60a

commit 1881b0d34302b8c29d4b086715eeda9e576ee60a
Author: Derek Foreman 
Date:   Fri Sep 16 10:58:36 2016 -0500

eina: Actually call eina_cpu_init() and eina_cpu_shutdown()

Without calling eina_cpu_init() the eina_cpu_features bits aren't
properly set up.

Let's call it and see if anything exciting happens.
---
 src/lib/eina/eina_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c
index 7238002..2827992 100644
--- a/src/lib/eina/eina_main.c
+++ b/src/lib/eina/eina_main.c
@@ -303,6 +303,7 @@ eina_init(void)
   }
  }
 
+   eina_cpu_init();
eina_cpu_count_internal();
 
eina_log_timing(_eina_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
@@ -339,6 +340,7 @@ eina_shutdown(void)
  _mt_enabled = 0;
   }
 #endif
+eina_cpu_shutdown();
  }
 
return _eina_main_count;

-- 




[EGIT] [core/efl] master 05/05: eina_cpu: Detect NEON if available

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a453599d26336ada2d2e09a86c8baf994b4cae8c

commit a453599d26336ada2d2e09a86c8baf994b4cae8c
Author: Derek Foreman 
Date:   Fri Sep 16 13:05:56 2016 -0500

eina_cpu: Detect NEON if available

We may have a few conditionals around that think this has actually been
set at some point, let's surprise them by actually doing that.
---
 configure.ac|  2 ++
 src/lib/eina/eina_cpu.c | 21 -
 2 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 924ceaa..d0b9962 100644
--- a/configure.ac
+++ b/configure.ac
@@ -449,6 +449,8 @@ sys/types.h \
 sys/param.h \
 sys/mman.h \
 netinet/in.h \
+sys/auxv.h \
+asm/hwcap.h \
 ])
 
 EFL_CHECK_PATH_MAX
diff --git a/src/lib/eina/eina_cpu.c b/src/lib/eina/eina_cpu.c
index fe39861..1de86d8 100644
--- a/src/lib/eina/eina_cpu.c
+++ b/src/lib/eina/eina_cpu.c
@@ -53,6 +53,11 @@
 
 #include "eina_cpu_private.h"
 
+#if defined(HAVE_SYS_AUXV_H) && defined(HAVE_ASM_HWCAP_H) && defined(__arm__) 
&& defined(__linux__)
+# include 
+# include 
+#endif
+
 /**
 *  Local *
 **/
@@ -129,6 +134,19 @@ void _x86_simd(Eina_Cpu_Features *features)
 }
 #endif
 
+#if defined(HAVE_SYS_AUXV_H) && defined(HAVE_ASM_HWCAP_H) && defined(__arm__) 
&& defined(__linux__)
+static void
+_arm_cpu_features(Eina_Cpu_Features *features)
+{
+   unsigned long aux;
+
+   aux = getauxval(AT_HWCAP);
+
+   if (aux & HWCAP_NEON)
+ *features |= EINA_CPU_NEON;
+}
+#endif
+
 /**
 * Global *
 **/
@@ -147,8 +165,9 @@ eina_cpu_init(void)
 {
 #if defined(__i386__) || defined(__x86_64__)
_x86_simd(&eina_cpu_features);
+#elif defined(HAVE_SYS_AUXV_H) && defined(HAVE_ASM_HWCAP_H) && 
defined(__arm__) && defined(__linux__)
+   _arm_cpu_features(&eina_cpu_features);
 #endif
-   // FIXME: Handle NEON and friends
 
// Figure out the page size for this system
_eina_page_size();

-- 




[EGIT] [core/efl] master 01/01: eina_cpu: Fix broken E_API macro

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=60f3f5fbfd8b60aceedeafd279eab51ccd78c72f

commit 60f3f5fbfd8b60aceedeafd279eab51ccd78c72f
Author: Derek Foreman 
Date:   Fri Sep 16 15:56:46 2016 -0500

eina_cpu: Fix broken E_API macro

Oops, I cut and paste it from a wrong file.

Thanks to Vincent Torri for the quick catch.
---
 src/lib/eina/eina_cpu_private.h | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/lib/eina/eina_cpu_private.h b/src/lib/eina/eina_cpu_private.h
index 667f0a7..e114b01 100644
--- a/src/lib/eina/eina_cpu_private.h
+++ b/src/lib/eina/eina_cpu_private.h
@@ -6,7 +6,7 @@
 #endif
 
 #ifdef _WIN32
-# ifdef EFL_ECORE_BUILD
+# ifdef EFL_EINA_BUILD
 #  ifdef DLL_EXPORT
 #   define EAPI __declspec(dllexport)
 #  else
@@ -14,18 +14,25 @@
 #  endif /* ! DLL_EXPORT */
 # else
 #  define EAPI __declspec(dllimport)
-# endif /* ! EFL_ECORE_BUILD */
+# endif /* ! EFL_EINA_BUILD */
+# define EAPI_WEAK
 #else
 # ifdef __GNUC__
 #  if __GNUC__ >= 4
 #   define EAPI __attribute__ ((visibility("default")))
+#   define EAPI_WEAK __attribute__ ((weak))
 #  else
 #   define EAPI
+#   define EAPI_WEAK
 #  endif
 # else
+/**
+ * @def EAPI
+ * @brief Used to export functions(by changing visibility).
+ */
 #  define EAPI
 # endif
-#endif /* ! _WIN32 */
+#endif
 
 EAPI int _eina_cpu_fast_core_get(void);
 

-- 




[EGIT] [core/efl] master 01/01: evas-drm: update drm engine recovery from all buffers used

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a4fa55692549f498d032df24dd50c72d2aec39e1

commit a4fa55692549f498d032df24dd50c72d2aec39e1
Author: Derek Foreman 
Date:   Fri Sep 16 16:12:22 2016 -0500

evas-drm: update drm engine recovery from all buffers used

Use the relatively new buffer release API to free up buffers instead
of immediately going nuclear and blowing away all buffer ages.
---
 src/modules/evas/engines/drm/evas_outbuf.c | 17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/src/modules/evas/engines/drm/evas_outbuf.c 
b/src/modules/evas/engines/drm/evas_outbuf.c
index c3f6c4e..cea01ed 100644
--- a/src/modules/evas/engines/drm/evas_outbuf.c
+++ b/src/modules/evas/engines/drm/evas_outbuf.c
@@ -247,21 +247,10 @@ _outbuf_fb_assign(Outbuf *ob)
int i;
 
ob->priv.draw = _outbuf_fb_wait(ob);
-
-   if (!ob->priv.draw)
+   while (!ob->priv.draw)
  {
-WRN("No Free Buffers. Dropping a frame");
-for (i = 0; i < ob->priv.num; i++)
-  {
- if (ob->priv.ofb[i].valid)
-   {
-  ecore_drm2_fb_busy_set(ob->priv.ofb[i].fb, EINA_FALSE);
-  ob->priv.ofb[i].age = 0;
-  ob->priv.ofb[i].drawn = EINA_FALSE;
-   }
-  }
-
-return EINA_FALSE;
+ecore_drm2_fb_release(ob->priv.output);
+ob->priv.draw = _outbuf_fb_wait(ob);
  }
 
for (i = 0; i < ob->priv.num; i++)

-- 




[EGIT] [core/efl] master 01/01: Revert "eina: Actually call eina_cpu_init() and eina_cpu_shutdown()"

2016-09-16 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=c98bb97ff059d6922af64af278cae8427a6f62db

commit c98bb97ff059d6922af64af278cae8427a6f62db
Author: Derek Foreman 
Date:   Fri Sep 16 19:39:38 2016 -0500

Revert "eina: Actually call eina_cpu_init() and eina_cpu_shutdown()"

This reverts commit 1881b0d34302b8c29d4b086715eeda9e576ee60a.

This is called from an array constructed with pre-processor macros and
I didn't notice.
---
 src/lib/eina/eina_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c
index 2827992..7238002 100644
--- a/src/lib/eina/eina_main.c
+++ b/src/lib/eina/eina_main.c
@@ -303,7 +303,6 @@ eina_init(void)
   }
  }
 
-   eina_cpu_init();
eina_cpu_count_internal();
 
eina_log_timing(_eina_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
@@ -340,7 +339,6 @@ eina_shutdown(void)
  _mt_enabled = 0;
   }
 #endif
-eina_cpu_shutdown();
  }
 
return _eina_main_count;

-- 




Re: [E-devel] [EGIT] [core/efl] master 03/05: render_thread: Attempt to set affinity to a random fast core

2016-09-19 Thread Derek Foreman
On 19/09/16 05:08 AM, Carsten Haitzler (The Rasterman) wrote:
> On Mon, 19 Sep 2016 11:07:15 +0200 Stefan Schmidt  
> said:
> 
>> Hello.
>>
>> On 16/09/16 21:11, Derek Foreman wrote:
>>> derekf pushed a commit to branch master.
>>>
>>> http://git.enlightenment.org/core/efl.git/commit/?id=a17ac66f0a0b089dde0b2e550523b0d59ec97f52
>>>
>>> commit a17ac66f0a0b089dde0b2e550523b0d59ec97f52
>>> Author: Derek Foreman 
>>> Date:   Thu Sep 15 16:05:25 2016 -0500
>>>
>>> render_thread: Attempt to set affinity to a random fast core
>>>
>>> We've been pinning the render thread for every EFL process to core 0.
>>> This is a bit silly in the first place, but some big.LITTLE arm systems,
>>> such as exynos 5422, have the LITTLE cores first.
>>>
>>> On those systems we put all the render threads on a slow core.
>>>
>>> This attempts to fix that by using a random core from the pool of fast
>>> cores.
>>>
>>> If we can't determine which cores are fast (ie: we're not on a
>>> linux kernel with cpufreq enabled) then we'll continue doing what we've
>>> always done.
>>
>> I had to revert this patch as it broke all efl builds for me. Locally 
>> and on Jenkins. Edje_cc segfaulted on the in tree edc files. Error 
>> message is in the revert commit message.
>>
>>  From the description here this change would still be needed but in a 
>> non breaking way. :)
> 
> how about simply removing the pinning (affinity) entirely?
> 
I thought about that...  The render thread's still going to take a
performance hit if it bounces from processor to processor much (it's
probably pathologically bad for cache invalidation?)

Also, if it bounces around on the "LITTLE" cores on a big.LITTLE system
it'll have really bad performance characteristics...

There's a group working on improving the scheduler to better handle non
uniform multi-processor systems, so eventually we shouldn't need this
anymore, but I think for now it's generally a win.

--
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/efl] master 01/01: eina_cpu: Fix error handling in eina_cpu_fast_core_get

2016-09-19 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=bd1de560a1403a3e549938ae244f2f04f7e0b990

commit bd1de560a1403a3e549938ae244f2f04f7e0b990
Author: Derek Foreman 
Date:   Mon Sep 19 09:23:59 2016 -0500

eina_cpu: Fix error handling in eina_cpu_fast_core_get

I introduced a crash on linux systems where the cpufreq directory
doesn't exist.  This fixes it.
---
 src/lib/eina/eina_cpu.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lib/eina/eina_cpu.c b/src/lib/eina/eina_cpu.c
index 1de86d8..b5e6b90 100644
--- a/src/lib/eina/eina_cpu.c
+++ b/src/lib/eina/eina_cpu.c
@@ -396,6 +396,9 @@ _eina_cpu_fast_core_get(void)
 
if (fastest_core_speed == 0) eina_cpu_map_init();
 
+   /* Check again now that it's actually set up */
+   if (fastest_core_speed == -1) return -1;
+
corelist = eina_hash_find(cpu_hash, &fastest_core_speed);
cores = *corelist;
bit = rand() % __builtin_popcount(cores);

-- 




[EGIT] [core/efl] master 01/01: render_thread: Attempt to set affinity to a random fast core

2016-09-19 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=541b72dcb2aa7a0a09c6b57603da2800d8caac01

commit 541b72dcb2aa7a0a09c6b57603da2800d8caac01
Author: Derek Foreman 
Date:   Mon Sep 19 09:39:35 2016 -0500

render_thread: Attempt to set affinity to a random fast core

We've been pinning the render thread for every EFL process to core 0.
This is a bit silly in the first place, but some big.LITTLE arm systems,
such as exynos 5422, have the LITTLE cores first.

On those systems we put all the render threads on a slow core.

This attempts to fix that by using a random core from the pool of fast
cores.

If we can't determine which cores are fast (ie: we're not on a
linux kernel with cpufreq enabled) then we'll continue doing what we've
always done - pin to core 0.
---
 src/lib/evas/common/evas_thread_render.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/lib/evas/common/evas_thread_render.c 
b/src/lib/evas/common/evas_thread_render.c
index 623e40e..3489c5a 100644
--- a/src/lib/evas/common/evas_thread_render.c
+++ b/src/lib/evas/common/evas_thread_render.c
@@ -1,4 +1,5 @@
 #include "evas_common_private.h"
+#include "eina_cpu_private.h"
 
 #include 
 
@@ -125,6 +126,7 @@ out:
 void
 evas_thread_init(void)
 {
+int core;
 if (init_count++) return;
 
 eina_threads_init();
@@ -135,7 +137,13 @@ evas_thread_init(void)
   CRI("Could not create draw thread lock");
 if (!eina_condition_new(&evas_thread_queue_condition, 
&evas_thread_queue_lock))
   CRI("Could not create draw thread condition");
-if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, 0,
+
+core = _eina_cpu_fast_core_get();
+/* Keep previous behaviour of pinning to core 0 if finding a fast
+ * core fails.
+ */
+if (core < 0) core = 0;
+if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, core,
   evas_thread_worker_func, NULL))
   if (!eina_thread_create(&evas_thread_worker, EINA_THREAD_NORMAL, -1,
 evas_thread_worker_func, NULL))

-- 




[EGIT] [core/efl] master 01/01: eina_cpu: Fix coverity defects in eina_cpu_map_init

2016-09-19 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9799d45ee7ecc9667fe079ab8121ca9da008db3e

commit 9799d45ee7ecc9667fe079ab8121ca9da008db3e
Author: Derek Foreman 
Date:   Mon Sep 19 10:34:44 2016 -0500

eina_cpu: Fix coverity defects in eina_cpu_map_init

Fixes a potential fd leak on failure and wrong core to
speed mapping on systems with > 31 cpu cores

CID: 1362860
CID: 1362859
CID: 1362857
---
 src/lib/eina/eina_cpu.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/eina/eina_cpu.c b/src/lib/eina/eina_cpu.c
index b5e6b90..9f4ab4b 100644
--- a/src/lib/eina/eina_cpu.c
+++ b/src/lib/eina/eina_cpu.c
@@ -323,6 +323,7 @@ eina_cpu_map_init(void)
fastest_core_speed = -1;
 
 #if defined (__linux__) || defined(__GLIBC__)
+   FILE *f = NULL;
Eina_Iterator *it;
Eina_Strbuf *fname;
const Eina_File_Direct_Info *f_info;
@@ -339,7 +340,6 @@ eina_cpu_map_init(void)
 eina_str_has_prefix(f_info->path,
 "/sys/devices/system/cpu/cpufreq/policy"))
   {
- FILE *f;
  int num, speed;
 
  eina_strbuf_append_printf(fname, "%s%s", f_info->path, 
"/cpuinfo_max_freq");
@@ -349,6 +349,7 @@ eina_cpu_map_init(void)
  speed = -1;
  num = fscanf(f, "%d", &speed);
  fclose(f);
+ f = NULL;
  if ((num != 1) || (speed == -1)) goto err;
 
  slowest_core_speed = MIN(speed, slowest_core_speed);
@@ -370,15 +371,17 @@ eina_cpu_map_init(void)
 {
corelist = malloc(sizeof(*corelist));
if (!corelist) goto err;
-   *corelist = 1 << core;
+   *corelist = 1LL << core;
eina_hash_add(cpu_hash, &speed, corelist);
 }
-  *corelist |= 1 << core;
+  *corelist |= 1LL << core;
} while (num != EOF);
  fclose(f);
+ f = NULL;
   }
  }
 err:
+   if (f) fclose(f);
eina_strbuf_free(fname);
eina_iterator_free(it);
 #endif

-- 




[EGIT] [core/efl] master 01/01: eina_cpu, evas: Remove _eina_cpu_fast_core_get, don't set render thread affinity

2016-09-20 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e2875cefc49768f919919fbfa478f81570168688

commit e2875cefc49768f919919fbfa478f81570168688
Author: Derek Foreman 
Date:   Tue Sep 20 11:33:33 2016 -0500

eina_cpu, evas: Remove _eina_cpu_fast_core_get, don't set render thread 
affinity

We've decided it would be best to just let the scheduler do its job.
---
 src/Makefile_Eina.am |   1 -
 src/lib/eina/eina_cpu.c  | 117 ---
 src/lib/eina/eina_cpu_private.h  |  42 ---
 src/lib/evas/common/evas_thread_render.c |  13 +---
 4 files changed, 2 insertions(+), 171 deletions(-)

diff --git a/src/Makefile_Eina.am b/src/Makefile_Eina.am
index 96ff376..22ade8f 100644
--- a/src/Makefile_Eina.am
+++ b/src/Makefile_Eina.am
@@ -58,7 +58,6 @@ lib/eina/eina_trash.h \
 lib/eina/eina_iterator.h \
 lib/eina/eina_main.h \
 lib/eina/eina_cpu.h \
-lib/eina/eina_cpu_private.h \
 lib/eina/eina_inline_cpu.x \
 lib/eina/eina_sched.h \
 lib/eina/eina_tiler.h \
diff --git a/src/lib/eina/eina_cpu.c b/src/lib/eina/eina_cpu.c
index 9f4ab4b..3ec9204 100644
--- a/src/lib/eina/eina_cpu.c
+++ b/src/lib/eina/eina_cpu.c
@@ -49,25 +49,12 @@
 #include "eina_log.h"
 #include "eina_cpu.h"
 
-#include 
-
-#include "eina_cpu_private.h"
-
-#if defined(HAVE_SYS_AUXV_H) && defined(HAVE_ASM_HWCAP_H) && defined(__arm__) 
&& defined(__linux__)
-# include 
-# include 
-#endif
-
 /**
 *  Local *
 **/
 
 static void _eina_page_size(void);
 
-static int fastest_core_speed = 0;
-static int slowest_core_speed = INT_MAX;
-static Eina_Hash *cpu_hash = NULL;
-
 /* FIXME this ifdefs should be replaced */
 #if defined(__i386__) || defined(__x86_64__)
 /* We save ebx and restore it to be PIC compatible */
@@ -178,9 +165,6 @@ eina_cpu_init(void)
 Eina_Bool
 eina_cpu_shutdown(void)
 {
-   eina_hash_free(cpu_hash);
-   cpu_hash = NULL;
-   fastest_core_speed = 0;
return EINA_TRUE;
 }
 
@@ -316,104 +300,3 @@ void eina_cpu_count_internal(void)
else
  _cpu_count = _eina_cpu_count_internal();
 }
-
-static void
-eina_cpu_map_init(void)
-{
-   fastest_core_speed = -1;
-
-#if defined (__linux__) || defined(__GLIBC__)
-   FILE *f = NULL;
-   Eina_Iterator *it;
-   Eina_Strbuf *fname;
-   const Eina_File_Direct_Info *f_info;
-
-   it = eina_file_stat_ls("/sys/devices/system/cpu/cpufreq");
-   if (!it) return;
-
-   cpu_hash = eina_hash_int32_new(free);
-
-   fname = eina_strbuf_new();
-   EINA_ITERATOR_FOREACH(it, f_info)
- {
-if ((f_info->type == EINA_FILE_DIR) &&
-eina_str_has_prefix(f_info->path,
-"/sys/devices/system/cpu/cpufreq/policy"))
-  {
- int num, speed;
-
- eina_strbuf_append_printf(fname, "%s%s", f_info->path, 
"/cpuinfo_max_freq");
- f = fopen(eina_strbuf_string_get(fname), "r");
- eina_strbuf_reset(fname);
- if (!f) goto err;
- speed = -1;
- num = fscanf(f, "%d", &speed);
- fclose(f);
- f = NULL;
- if ((num != 1) || (speed == -1)) goto err;
-
- slowest_core_speed = MIN(speed, slowest_core_speed);
- fastest_core_speed = MAX(speed, fastest_core_speed);
-
- eina_strbuf_append_printf(fname, "%s%s", f_info->path, 
"/affected_cpus");
- f = fopen(eina_strbuf_string_get(fname), "r");
- eina_strbuf_reset(fname);
- if (!f) goto err;
- do
-   {
-  int core;
-  uint64_t *corelist;
-  num = fscanf(f, "%d", &core);
-  if ((num == EOF) || (core > 63)) break;
-
-  corelist = eina_hash_find(cpu_hash, &speed);
-  if (!corelist)
-{
-   corelist = malloc(sizeof(*corelist));
-   if (!corelist) goto err;
-   *corelist = 1LL << core;
-   eina_hash_add(cpu_hash, &speed, corelist);
-}
-  *corelist |= 1LL << core;
-   } while (num != EOF);
- fclose(f);
- f = NULL;
-  }
- }
-err:
-   if (f) fclose(f);
-   eina_strbuf_free(fname);
-   eina_iterator_free(it);
-#endif
-}
-
-EAPI int
-_eina_cpu_fast_core_get(void)
-{
-#if defined (__linux__) || defined(__GLIBC__)
-   uint64_t *corelist;
-   uint64_t cores;
-   int bit, place = 0;
-
-   if (fastest_core_spee

[EGIT] [core/enlightenment] master 01/01: Fix xwayland binary location detection

2016-09-21 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=47cdbdb5af1d6029538beeab22c2b632866a574c

commit 47cdbdb5af1d6029538beeab22c2b632866a574c
Author: Derek Foreman 
Date:   Mon Sep 19 15:24:58 2016 -0500

Fix xwayland binary location detection

We were trying to find it with pkg-config and failing, try
AC_PATH_PROG instead
---
 configure.ac | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index e35493c..0e5f3be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -788,12 +788,16 @@ define([CHECK_MODULE_XWAYLAND],
 [
   if test "x${have_wayland}" = "xyes"; then
 AC_E_CHECK_PKG(XWAYLAND, [ ecore-x >= ${efl_version} ecore-audio >= 
${efl_version}  ], [HAVE_XWAYLAND_DEPS=true], [HAVE_XWAYLAND_DEPS=false])
-EFL_WITH_BIN([Xwayland], [Xwayland], [Xwayland])
-if test -z "x${Xwayland}" ; then
-  HAVE_XWAYLAND_DEPS=false
+AC_ARG_WITH(Xwayland, AS_HELP_STRING([--with-Xwayland=PATH], [Path to 
Xwayland]), [Xwayland_with="$withval"], [Xwayland_with="yes"])
+if test "x${Xwayland_with}" != "xyes"; then
+  xwayland=$Xwayland_with
+  AC_SUBST(xwayland)
+else
+  AC_PATH_PROG(xwayland, Xwayland, "no")
+fi
+if test "x${xwayland}" == "xno"; then
+  AC_MSG_ERROR([Xwayland enabled but not found.])
 fi
-  else
-HAVE_XWAYLAND_DEPS=false
   fi
 ])
 AM_CONDITIONAL([HAVE_XWAYLAND], [test "x${HAVE_XWAYLAND}" != "xno"])

-- 




[EGIT] [core/enlightenment] master 01/02: Don't kill self during shutdown

2016-09-21 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=494f76b0ab7f5b2c51ab7721a3f5c34750e0fef0

commit 494f76b0ab7f5b2c51ab7721a3f5c34750e0fef0
Author: Derek Foreman 
Date:   Wed Sep 21 16:42:31 2016 -0500

Don't kill self during shutdown

When Xwayland is running we end up with a client with the same pid
as the compositor in the client list.  We need to avoid killing that
client, as it will interrupt the proper shutdown procedure.

fix T4439
---
 src/bin/e_client.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 20d18ac..a09680e 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -4578,6 +4578,7 @@ e_client_act_kill_begin(E_Client *ec)
if (!ec->zone) return;
if (ec->internal) return;
if (ec->lock_close) return;
+   if (ec->netwm.pid == getpid()) return;
if ((ec->netwm.pid > 1) && (e_config->kill_process))
  {
 kill(ec->netwm.pid, SIGINT);

-- 




[EGIT] [core/enlightenment] master 02/02: NULL out xwayland fd handlers after deleting them

2016-09-21 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=22a99c5b5a2a0d93a0fb5f1e7364055e2ecbc613

commit 22a99c5b5a2a0d93a0fb5f1e7364055e2ecbc613
Author: Derek Foreman 
Date:   Wed Sep 21 16:45:04 2016 -0500

NULL out xwayland fd handlers after deleting them

This fixes a valgrind error that can happen when we accidentally
free these again later because they still had non-NULL values.
---
 src/modules/xwayland/e_mod_main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/modules/xwayland/e_mod_main.c 
b/src/modules/xwayland/e_mod_main.c
index f19fee3..f8eb1f5 100644
--- a/src/modules/xwayland/e_mod_main.c
+++ b/src/modules/xwayland/e_mod_main.c
@@ -247,6 +247,8 @@ fail:
   ecore_main_fd_handler_del(exs->abs_hdlr);
 if (exs->unx_hdlr)
   ecore_main_fd_handler_del(exs->unx_hdlr);
+exs->abs_hdlr = NULL;
+exs->unx_hdlr = NULL;
 break;
   case -1:
 ERR("Failed to fork: %m");

-- 




[EGIT] [core/efl] master 14/15: ecore-drm2: Merge initial modesetting with atomic flip code

2016-09-22 Thread Derek Foreman
devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=de5305e2243f8b2cde7ab04e629422a1c0f8a6c0

commit de5305e2243f8b2cde7ab04e629422a1c0f8a6c0
Author: Derek Foreman 
Date:   Thu Sep 22 13:20:13 2016 -0500

ecore-drm2: Merge initial modesetting with atomic flip code
---
 src/lib/ecore_drm2/ecore_drm2_fb.c | 23 ++-
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 0127519..0ba6680 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -357,7 +357,8 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
  {
 Ecore_Drm2_Plane_State *pstate;
 uint32_t flags =
-  DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT;
+  DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT |
+  DRM_MODE_ATOMIC_ALLOW_MODSET;
 
 pstate = output->plane_state;
 
@@ -373,26 +374,6 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 pstate->cw.value = output->current_mode->width;
 pstate->ch.value = output->current_mode->height;
 
-if ((!output->current) ||
-(output->current->stride != fb->stride))
-  {
- flags = DRM_MODE_ATOMIC_ALLOW_MODESET;
-
- ret = _fb_atomic_flip(output, pstate, flags);
- if (ret < 0)
-   {
-  ERR("\tCrtc: %d FB: %d", output->crtc_id, fb->id);
-  return ret;
-   }
-
- if (output->current) _release_buffer(output, output->current);
- output->current = fb;
- output->current->busy = EINA_TRUE;
- output->next = NULL;
-
- return 0;
-  }
-
 ret = _fb_atomic_flip(output, pstate, flags);
 if ((ret < 0) && (errno != EBUSY))
   {

-- 




[EGIT] [core/efl] master 01/01: drm: Fix typoe

2016-09-22 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=af82abb57a77a0f64ef5a691b9da9457257c5577

commit af82abb57a77a0f64ef5a691b9da9457257c5577
Author: Derek Foreman 
Date:   Thu Sep 22 14:52:14 2016 -0500

drm: Fix typoe

DRM_MODE_ATOMIC_ALLOW_MODSET should have been _MODESET
---
 src/lib/ecore_drm2/ecore_drm2_fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 0ba6680..95bf8c1 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -358,7 +358,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 Ecore_Drm2_Plane_State *pstate;
 uint32_t flags =
   DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT |
-  DRM_MODE_ATOMIC_ALLOW_MODSET;
+  DRM_MODE_ATOMIC_ALLOW_MODESET;
 
 pstate = output->plane_state;
 

-- 




[EGIT] [core/enlightenment] master 01/01: Add myself to the AUTHORS file

2016-09-22 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=900517b80f1521d7d98c90195b87b612a36539fa

commit 900517b80f1521d7d98c90195b87b612a36539fa
Author: Derek Foreman 
Date:   Tue Sep 13 13:34:52 2016 -0500

Add myself to the AUTHORS file

 #glorious
---
 AUTHORS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/AUTHORS b/AUTHORS
index 3ce4036..df69cde 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -59,3 +59,4 @@ Jake Yoon (Jaeseok Yoon) 
 Luis de Bethencourt (luisbg) 
 bu5hm4n (Marcel Hollerbach) 
 simotek (Simon Lees) 
+Derek Foreman 

-- 




[EGIT] [core/enlightenment] master 02/03: Add the capability to auto-generate protocol code and headers

2016-09-26 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=b7d37e9d517398a369e6ecd2b60ccb638b3d3464

commit b7d37e9d517398a369e6ecd2b60ccb638b3d3464
Author: Derek Foreman 
Date:   Fri Sep 23 15:11:40 2016 -0500

Add the capability to auto-generate protocol code and headers

We'd like to drop all the generated files and keep just the xml files.

This is a step in that direction but we've been naming things irregularly
and some of our checked in generated code doesn't have an associated xml
yet, so this'll be a bit of a process.
---
 src/bin/Makefile.mk | 37 +
 1 file changed, 37 insertions(+)

diff --git a/src/bin/Makefile.mk b/src/bin/Makefile.mk
index d39ef15..c2500bb 100644
--- a/src/bin/Makefile.mk
+++ b/src/bin/Makefile.mk
@@ -228,6 +228,8 @@ src/bin/e_comp_wl_input.h \
 src/bin/e_comp_wl.h
 endif
 
+enlightenment_gen_src =
+MAINTAINERCLEANFILES += $(enlightenment_gen_src)
 
 enlightenment_src = \
 src/bin/e_about.c \
@@ -394,6 +396,36 @@ src/bin/e_xsettings.c
 endif
 
 if HAVE_WAYLAND
+#Stolen from weston's Makefile.am and modified for Enlightenment
+.SECONDEXPANSION:
+
+define protostability
+$(if $(findstring unstable,$1),unstable,stable)
+endef
+
+define protoname
+$(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
+endef
+
+%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call 
protostability,$$*)/$$(call protoname,$$*)/$$*.xml
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
+
+%-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call 
protostability,$$*)/$$(call protoname,$$*)/$$*.xml
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < 
$< > $@
+
+%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call 
protostability,$$*)/$$(call protoname,$$*)/$$*.xml
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < 
$< > $@
+
+%-protocol.c : $(top_srcdir)/src/protocol/$(notdir $$*).xml
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
+
+%-server-protocol.h : $(top_srcdir)/src/protocol/$(notdir $$*).xml
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < 
$< > $@
+
+%-client-protocol.h : $(top_srcdir)/src/protocol/$(notdir $$*).xml
+   $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < 
$< > $@
+#End of weston stuff
+
 enlightenment_src += \
 src/bin/generated/linux-dmabuf-unstable-v1-server-protocol.h \
 src/bin/generated/linux-dmabuf-unstable-v1-protocol.c \
@@ -408,6 +440,9 @@ src/bin/e_comp_wl_input.c \
 src/bin/e_comp_wl_dmabuf.c \
 src/bin/e_comp_wl.c \
 src/bin/e_comp_wl_extensions.c
+
+enlightenment_gen_src +=
+
 endif
 
 src_bin_enlightenment_CPPFLAGS = $(E_CPPFLAGS) -DE_LOGGING=1 @WAYLAND_CFLAGS@ 
@WAYLAND_EGL_CFLAGS@ @ECORE_X_CFLAGS@
@@ -415,6 +450,8 @@ src_bin_enlightenment_SOURCES = \
 src/bin/e_main.c \
 $(enlightenment_src)
 
+nodist_src_bin_enlightenment_SOURCES = $(enlightenment_gen_src)
+
 src_bin_enlightenment_LDFLAGS = -export-dynamic
 src_bin_enlightenment_LDADD = @e_libs@ @dlopen_libs@ @cf_libs@ @VALGRIND_LIBS@ 
@WAYLAND_LIBS@ @WL_DRM_LIBS@ @WAYLAND_EGL_LIBS@ -lm @SHM_OPEN_LIBS@ 
@ECORE_X_LIBS@
 

-- 




[EGIT] [core/enlightenment] master 01/03: Find wayland protocols and wayland scanner at configure time

2016-09-26 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=992e3b257b8bde0717649cf4dc65a86283205da7

commit 992e3b257b8bde0717649cf4dc65a86283205da7
Author: Derek Foreman 
Date:   Mon Sep 12 15:31:10 2016 -0500

Find wayland protocols and wayland scanner at configure time
---
 configure.ac | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index ce87097..ead2cb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -682,10 +682,19 @@ AC_MSG_CHECKING([whether wayland EGL support is enabled])
 AC_MSG_RESULT([${e_cv_want_wayland_egl}])
 
 if test "x${e_cv_want_wayland_only}" != "xno" ;then
-  PKG_CHECK_MODULES([WAYLAND], [ecore-wl2 >= 1.18 wayland-server >= 1.11.0 
wayland-client >= 1.11.0 xkbcommon uuid],
+  PKG_CHECK_MODULES([WAYLAND], [ecore-wl2 >= 1.18 wayland-server >= 1.11.0 
wayland-client >= 1.11.0 wayland-protocols >= 1.7 wayland-scanner >= 1.11.0 
xkbcommon uuid],
 [
   have_wayland=yes
   have_wayland_dep=true
+  AC_ARG_VAR([wayland_scanner], [The wayland-scanner executable])
+  AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+  if test x$wayland_scanner = x; then
+PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
+wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner 
wayland-scanner`
+  fi
+  ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir 
wayland-protocols`
+  AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+
   AC_DEFINE_UNQUOTED([HAVE_WAYLAND],[1],[enable wayland support])
 ])
 else

-- 




[EGIT] [core/enlightenment] master 01/01: Don't require dmabuf buffers to be writeable

2017-05-30 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=4fca111eb5c607451720ad406c9da57d3ebc26b5

commit 4fca111eb5c607451720ad406c9da57d3ebc26b5
Author: Derek Foreman 
Date:   Fri May 19 16:47:57 2017 -0500

Don't require dmabuf buffers to be writeable

Compositor doesn't need to write to this buffer, and most clients won't
allocate them in a way that the compositor can.  Relax the test criteria.
---
 src/bin/e_pixmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index a59c696b8..f1c07442a 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -1081,7 +1081,7 @@ e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
 
/* This is only legit for ARGB */
size = dmabuf->attributes.height * dmabuf->attributes.stride[0];
-   data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, 
dmabuf->attributes.fd[0], 0);
+   data = mmap(NULL, size, PROT_READ, MAP_SHARED, dmabuf->attributes.fd[0], 0);
if (data == MAP_FAILED) return EINA_FALSE;
munmap(data, size);
 

-- 




Re: [E-devel] Disabled all Jenkins builds (to see if that helps server stability)

2017-06-01 Thread Derek Foreman

Hi,

git's still down, phab's still greeting me with the ridiculously 
rude/embarrassing message that seems to imply that it's the fault of the 
person trying to connect that something's wrong. (Gee, a spanking, thanks!)


Our server problems are a continually annoying barrier to work, and the 
thought process around debugging them seems fairly baffling - even if 
disabling jenkins makes things stumble along for a while it's surely not 
a real fix for anything?


Jenkins runs in userspace, userspace problems shouldn't be able to 
cripple a server.  And whatever we may think jenkins is doing to cause a 
problem can be done by any other userspace program.  Other threads seem 
to blame a mysterious kernel bug nobody else can trigger - do we think 
Jenkins is aggravating that for us and us alone?


Turning it off appears to provide zero information as to what the real 
problem is and costs us useful functionality.


At what point do we consider, say, applying for freedesktop.org hosting? 
 I'm sure I'm going to see arguments that they don't provide something 
we need, however right now we have exactly no functional services.  No 
web, no phab, no git.  Our mailing list continues to work because 
someone else hosts it for us.


At least having a stable git repository is critical to getting work done 
and allowing users/packagers/whoever to get the software - we can still 
run less important services ourselves and have them fail without 
blocking everyone.


Thanks,
Derek

(And could someone *please* change that stupid "SPANK SPANK SPANK" 
message?  Is that really what we want potential users to see during our 
perpetual server outtages?)


On 31/05/17 06:14 PM, Carsten Haitzler (The Rasterman) wrote:

On Wed, 31 May 2017 21:08:05 +0100 Bertrand Jacquin  said:


On 31/05/2017 13:21, Stefan Schmidt wrote:

Hello.

On 05/29/2017 12:41 PM, Stefan Schmidt wrote:

Hello.

Once again I had problems with the E server being over capacity and
returning 503 when accessing phab.

I often heard claims that the load of Jenkins jobs trigger the bug we
see here. To actually see if the load due to Jenkins jobs is related
to this I now disabled all build triggers on Jenkins. That means no
Jenkins jobs are going to run until I enable these again. be more
careful with your commits.

Right now the last builds are being performed and after that we should
have no new ones.

I will go an re-enable them again if we either see the same server
instabilities without Jenkins running (which proves in my book hat
Jenkins is not the culprit) or in something like 2 or 3 weeks even if
we have no server problems. In the later case we will have to see what
to do.


And phab 503 again. Without any Jenkins jobs running at all. The last
one have been running two days ago.

Beber, you still think Jenkins is to blame?

I will leave it disabled for a few more days to see how that goes.


Yes, this is still my main believe as of today due to qemu layer. We
won't be able to take any conclusion before I've been able to reboot the
physical host after Jenkins build were disabled, this will be done by
tomorrow.

Thanks for disabling the job, that will definitely help to understand
what to blame.
I may be wrong of course, but at least we'll know.


everything is down now... no phab. no e.org. no git. i literally can't do
anything. i'm relying on phab for some patch review discussions (gl thread).
:( i'm not touching e5 so you can poke around and look...


Cheers,
Bertrand

--
Bertrand

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel







--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[EGIT] [core/enlightenment] master 01/01: Fix wl_drm session activation callback

2017-06-02 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=5ce8bf3992fd0bce2cb59adce79688777a0ed255

commit 5ce8bf3992fd0bce2cb59adce79688777a0ed255
Author: Derek Foreman 
Date:   Fri Jun 2 13:49:06 2017 -0500

Fix wl_drm session activation callback

The code intended to force evas to redraw when we switch back from
another virtual console is failing to do so.  Remove it and replace
it with simpler code that successfully forces a redraw.
---
 src/modules/wl_drm/e_mod_main.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 32c5ebaba..979af8c89 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -58,13 +58,7 @@ _e_mod_drm_cb_activate(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event
 session_state = EINA_TRUE;
 
 ecore_evas_show(e_comp->ee);
-E_CLIENT_FOREACH(ec)
-  {
- if (ec->visible && (!ec->input_only))
-   e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
-  }
-e_comp_render_queue();
-e_comp_shape_queue_block(0);
+evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
 ecore_event_add(E_EVENT_COMPOSITOR_ENABLE, NULL, NULL, NULL);
  }
else

-- 




[EGIT] [core/enlightenment] master 01/01: Fix wl_drm session (de)activation callback

2017-06-02 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=239101d95f23f020631a992c849f2c2f12646157

commit 239101d95f23f020631a992c849f2c2f12646157
Author: Derek Foreman 
Date:   Fri Jun 2 13:59:42 2017 -0500

Fix wl_drm session (de)activation callback

I missed this in my last commit - we probably shouldn't be calling
e_comp_render_queue or e_comp_shape_queue_block() after hiding the
ecore_evas anyway - and by removing the e_comp_shape_queue_block()
in the activation callback I made things asymmetrical.  Ungood.
---
 src/modules/wl_drm/e_mod_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 979af8c89..69cb243f0 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -71,8 +71,6 @@ _e_mod_drm_cb_activate(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event
 evas_font_cache_flush(e_comp->evas);
 evas_render_dump(e_comp->evas);
 
-e_comp_render_queue();
-e_comp_shape_queue_block(1);
 ecore_event_add(E_EVENT_COMPOSITOR_DISABLE, NULL, NULL, NULL);
  }
 

-- 




[EGIT] [core/efl] master 01/05: ecore_drm2: Rename _release_buffer and make it private instead of static

2017-06-02 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=df0595ebc0fb2de8940864748ea128925ae54ea6

commit df0595ebc0fb2de8940864748ea128925ae54ea6
Author: Derek Foreman 
Date:   Fri Jun 2 11:36:51 2017 -0500

ecore_drm2: Rename _release_buffer and make it private instead of static

Other files in ecore_drm2 need to release buffers too.
---
 src/lib/ecore_drm2/ecore_drm2_fb.c  | 22 --
 src/lib/ecore_drm2/ecore_drm2_private.h |  1 +
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 59e2c5a214..ea6fcec194 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -243,8 +243,8 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle 
*rects, unsigned int count
 #endif
 }
 
-static void
-_release_buffer(Ecore_Drm2_Output *output, Ecore_Drm2_Output_State *s)
+void
+_ecore_drm2_fb_buffer_release(Ecore_Drm2_Output *output, 
Ecore_Drm2_Output_State *s)
 {
if (output->release_cb) output->release_cb(output->release_data, s->fb);
_ecore_drm2_fb_deref(s->fb);
@@ -264,7 +264,7 @@ ecore_drm2_fb_flip_complete(Ecore_Drm2_Output *output)
EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE);
 
if (output->current.fb && (output->current.fb != output->pending.fb))
- _release_buffer(output, &output->current);
+ _ecore_drm2_fb_buffer_release(output, &output->current);
 
output->current.fb = output->pending.fb;
output->pending.fb = NULL;
@@ -464,7 +464,8 @@ _fb_flip(Ecore_Drm2_Output *output)
  return ret;
   }
 
-if (output->current.fb) _release_buffer(output, &output->current);
+if (output->current.fb)
+  _ecore_drm2_fb_buffer_release(output, &output->current);
 output->current.fb = fb;
 _ecore_drm2_fb_ref(output->current.fb);
 output->next.fb = NULL;
@@ -543,7 +544,8 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
 
if (output->pending.fb)
  {
-if (output->next.fb) _release_buffer(output, &output->next);
+if (output->next.fb)
+  _ecore_drm2_fb_buffer_release(output, &output->next);
 output->next.fb = fb;
 return 0;
  }
@@ -557,7 +559,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
if (!fb) fb = output->current.fb;
 
if (output->next.fb)
- _release_buffer(output, &output->next);
+ _ecore_drm2_fb_buffer_release(output, &output->next);
 
/* If we don't have an fb to set by now, BAIL! */
if (!fb) return -1;
@@ -572,7 +574,7 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output 
*output)
if (ret)
  {
 if (output->prep.fb != output->current.fb)
-  _release_buffer(output, &output->prep);
+  _ecore_drm2_fb_buffer_release(output, &output->prep);
 return ret;
  }
output->pending.fb = output->prep.fb;
@@ -600,7 +602,7 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool panic)
 
if (o->next.fb)
  {
-_release_buffer(o, &o->next);
+_ecore_drm2_fb_buffer_release(o, &o->next);
 return EINA_TRUE;
  }
if (!panic) return EINA_FALSE;
@@ -615,13 +617,13 @@ ecore_drm2_fb_release(Ecore_Drm2_Output *o, Eina_Bool 
panic)
 */
if (o->current.fb)
  {
-_release_buffer(o, &o->current);
+_ecore_drm2_fb_buffer_release(o, &o->current);
 return EINA_TRUE;
  }
 
if (o->pending.fb)
  {
-_release_buffer(o, &o->pending);
+_ecore_drm2_fb_buffer_release(o, &o->pending);
 return EINA_TRUE;
  }
 
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h 
b/src/lib/ecore_drm2/ecore_drm2_private.h
index a7e3766d59..abf8b97ffb 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -841,6 +841,7 @@ struct _Ecore_Drm2_Device
 Eina_Bool _fb_atomic_flip_test(Ecore_Drm2_Output *output);
 void _ecore_drm2_fb_ref(Ecore_Drm2_Fb *);
 void _ecore_drm2_fb_deref(Ecore_Drm2_Fb *);
+void _ecore_drm2_fb_buffer_release(Ecore_Drm2_Output *output, 
Ecore_Drm2_Output_State *s);
 
 /* extern int (*sym_drmClose)(int fd); */
 /* extern int (*sym_drmWaitVBlank)(int fd, drmVBlank *vbl); */

-- 




[EGIT] [core/efl] master 03/05: ecore_drm2: Fix dpms shutdown while disabling outputs

2017-06-02 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9d583b3fdbed686642dbc0d96d1e417485ca0077

commit 9d583b3fdbed686642dbc0d96d1e417485ca0077
Author: Derek Foreman 
Date:   Fri Jun 2 11:39:34 2017 -0500

ecore_drm2: Fix dpms shutdown while disabling outputs

We need to set output->enabled to disabled *after* dpms takes place or set
it to enabled *before* dpms takes place.  We can't just set it at the
start of the function or one of enable/disable will hit the dpms path
with a disabled display.
---
 src/lib/ecore_drm2/ecore_drm2_outputs.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c 
b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index b288679503..39fb8471cc 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1237,16 +1237,19 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output 
*output, Eina_Bool enabled)
 
if (!output->connected) return;
if (output->enabled == enabled) return;
-   output->enabled = enabled;
 
if (output->enabled)
- ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON);
+ {
+output->enabled = enabled;
+ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON);
+ }
else
  {
 if (_ecore_drm2_use_atomic)
   ecore_drm2_fb_flip(NULL, output);
 
 ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF);
+output->enabled = enabled;
 
 if (output->current.fb)
   _ecore_drm2_fb_buffer_release(output, &output->current);

-- 




[EGIT] [core/efl] master 02/05: ecore_drm2: Properly release buffers on output disable

2017-06-02 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0df7299526db2b361fbe37d554f4b590b78b5b91

commit 0df7299526db2b361fbe37d554f4b590b78b5b91
Author: Derek Foreman 
Date:   Fri Jun 2 11:38:01 2017 -0500

ecore_drm2: Properly release buffers on output disable

Give back all buffers, and do it through the release mechanism that can
fire a callback into the engine.

Previously we just leaked one and left the rest.
---
 src/lib/ecore_drm2/ecore_drm2_outputs.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c 
b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 60e4f8e7d8..b288679503 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -1247,8 +1247,15 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, 
Eina_Bool enabled)
   ecore_drm2_fb_flip(NULL, output);
 
 ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF);
-output->current.fb = NULL;
-/* output->next.fb = NULL; */
+
+if (output->current.fb)
+  _ecore_drm2_fb_buffer_release(output, &output->current);
+
+if (output->next.fb)
+  _ecore_drm2_fb_buffer_release(output, &output->next);
+
+if (output->pending.fb)
+  _ecore_drm2_fb_buffer_release(output, &output->pending);
  }
 
_output_event_send(output);

-- 




[EGIT] [core/efl] master 05/05: ecore_evas_drm: Send a spurious pageflip when showing a canvas

2017-06-02 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=cc708064979314a94971fa00668ae14e6d1cab43

commit cc708064979314a94971fa00668ae14e6d1cab43
Author: Derek Foreman 
Date:   Fri Jun 2 14:19:39 2017 -0500

ecore_evas_drm: Send a spurious pageflip when showing a canvas

This is a quick and harmless hack to make sure we don't come back to a
dead compositor on a vc switch.

A proper fix will follow eventually, I promise.

Really.  Would I lie?
---
 src/modules/ecore_evas/engines/drm/ecore_evas_drm.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c 
b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index c4446c11bd..b0e0ff41b9 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -319,6 +319,8 @@ _drm_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, 
Evas_Coord y)
 static void
 _drm_show(Ecore_Evas *ee)
 {
+   Ecore_Evas_Engine_Drm_Data *edata;
+
if ((!ee) || (ee->visible)) return;
 
ee->should_be_visible = 1;
@@ -344,6 +346,14 @@ _drm_show(Ecore_Evas *ee)
 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
  }
if (ee->func.fn_show) ee->func.fn_show(ee);
+
+   edata = ee->engine.data;
+   /* HACK: sometimes we still have an animator ticking when we vc switch
+* so for now we just fire off a flip here to kick it when we come back.
+* This is just papering over a bug for now until I have time to track
+* it down properly. :(
+*/
+   ecore_drm2_fb_flip(NULL, edata->output);
 }
 
 static void

-- 




[EGIT] [core/efl] master 04/05: ecore_drm2: Don't try to disable all devices when session deactivates

2017-06-02 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=280c82fdd4af1e9d9446983627a9db992b9ba348

commit 280c82fdd4af1e9d9446983627a9db992b9ba348
Author: Derek Foreman 
Date:   Fri Jun 2 13:19:58 2017 -0500

ecore_drm2: Don't try to disable all devices when session deactivates

We get this callback after we've lost the drm device to logind, so
deactivating stuff here will just generate a lot of ERR messages
and break our internal book-keeping.

Instead, we just turn on DPMS on session activation instead of trying
to go through the output enable path (that will bail if it's already
enabled)

This could potentially result in a display that's enabled and DPMS
off being switched back on during session activation - if that's a real
problem we can restore the previous dpms state instead...

@fix T5483
---
 src/lib/ecore_drm2/ecore_drm2_device.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c 
b/src/lib/ecore_drm2/ecore_drm2_device.c
index 41d2128604..2a1680c1d7 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -22,8 +22,9 @@ _cb_session_active(void *data, int type EINA_UNUSED, void 
*event)
ev = event;
device = data;
 
-   EINA_LIST_FOREACH(device->outputs, l, output)
- ecore_drm2_output_enabled_set(output, ev->active);
+   if (ev->active)
+ EINA_LIST_FOREACH(device->outputs, l, output)
+   ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON);
 
ea = calloc(1, sizeof(Ecore_Drm2_Event_Activate));
if (!ea) return ECORE_CALLBACK_RENEW;

-- 




[EGIT] [core/efl] master 01/01: ecore_drm2: Fix error handling in _output_dpms_atomic_set

2017-06-05 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e24670b1e2b720ea732517af1767214e41774779

commit e24670b1e2b720ea732517af1767214e41774779
Author: Derek Foreman 
Date:   Mon Jun 5 16:22:08 2017 -0500

ecore_drm2: Fix error handling in _output_dpms_atomic_set

This was skipping the error path on failure and setting some state as if
it was successful.  Then the next attempt at a page flip was actually
setting this state.

So _output_dpms_atomic_set (which has always been broken) wasn't actually
the function that successfully disabled dpms.

This is confounding attempts to debug why dpms isn't coming back on
properly.

Now it won't turn *off* either, because it really never should have.

Ref T5462
---
 src/lib/ecore_drm2/ecore_drm2_outputs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c 
b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 39fb8471cc..263fccd30d 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -450,6 +450,7 @@ _output_dpms_atomic_set(Ecore_Drm2_Output *output, int 
level)
  {
 ERR("Could not set dpms property: %m");
 ret = EINA_FALSE;
+goto err;
  }
 
cstate->dpms.value = level;

-- 




[EGIT] [core/enlightenment] master 02/02: Stop misuing EVAS_NATIVE_SURFACE_VERSION macro

2017-06-06 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=4a40614f2f885ac33e806a807d0df84cf9e5300e

commit 4a40614f2f885ac33e806a807d0df84cf9e5300e
Author: Derek Foreman 
Date:   Tue Jun 6 16:22:57 2017 -0500

Stop misuing EVAS_NATIVE_SURFACE_VERSION macro

We should be stating the version the code supports, not the version
that the EFL version we compiled against supports.
---
 src/bin/e_pixmap.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 0d68b6951..ca0f8381e 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -17,6 +17,8 @@
 # include "e_comp_x.h"
 #endif
 
+#define E_SUPPORTED_NATIVE_SURFACE_VERSION 4
+
 #include 
 
 static Eina_Hash *pixmaps[2] = {NULL};
@@ -704,7 +706,7 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ns, EINA_FALSE);
 
-   ns->version = EVAS_NATIVE_SURFACE_VERSION;
+   ns->version = E_SUPPORTED_NATIVE_SURFACE_VERSION;
switch (cp->type)
  {
   case E_PIXMAP_TYPE_X:
@@ -1061,7 +1063,7 @@ e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
  {
 Eina_Bool ret;
 ns.type = EVAS_NATIVE_SURFACE_WL_DMABUF;
-ns.version = EVAS_NATIVE_SURFACE_VERSION;
+ns.version = E_SUPPORTED_NATIVE_SURFACE_VERSION;
 ns.data.wl_dmabuf.attr = &dmabuf->attributes;
 ns.data.wl_dmabuf.resource = NULL;
 test = evas_object_image_add(e_comp->evas);

-- 




[EGIT] [core/enlightenment] master 01/02: Remove some duplicate operations

2017-06-06 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=52c379f4b25cd71c79ec2ab19c14e5aa9ba9cbe7

commit 52c379f4b25cd71c79ec2ab19c14e5aa9ba9cbe7
Author: Derek Foreman 
Date:   Tue Jun 6 16:15:22 2017 -0500

Remove some duplicate operations

the native surface version was set outside of the switch statement,
so we don't need to re-set it to the same thing here.
---
 src/bin/e_pixmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index f1c07442a..0d68b6951 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -721,7 +721,6 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
 if (cp->buffer->dmabuf_buffer)
   {
  ns->type = EVAS_NATIVE_SURFACE_WL_DMABUF;
- ns->version = EVAS_NATIVE_SURFACE_VERSION;
 
  ns->data.wl_dmabuf.attr = &cp->buffer->dmabuf_buffer->attributes;
  ns->data.wl_dmabuf.resource = cp->buffer->resource;
@@ -731,7 +730,6 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
 else if (!cp->buffer->shm_buffer)
   {
  ns->type = EVAS_NATIVE_SURFACE_WL;
- ns->version = EVAS_NATIVE_SURFACE_VERSION;
  ns->data.wl.legacy_buffer = cp->buffer->resource;
  ret = EINA_TRUE;
   }

-- 




[EGIT] [core/enlightenment] master 01/01: Revert "Stop misuing EVAS_NATIVE_SURFACE_VERSION macro"

2017-06-06 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=b37acd6e39a8cd730ff114a8cb5550acecccd138

commit b37acd6e39a8cd730ff114a8cb5550acecccd138
Author: Derek Foreman 
Date:   Tue Jun 6 16:42:01 2017 -0500

Revert "Stop misuing EVAS_NATIVE_SURFACE_VERSION macro"

This reverts commit 4a40614f2f885ac33e806a807d0df84cf9e5300e.

Apparently this macro is unlike similar macros in other libraries
that have more sensible semantics.
---
 src/bin/e_pixmap.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index ca0f8381e..0d68b6951 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -17,8 +17,6 @@
 # include "e_comp_x.h"
 #endif
 
-#define E_SUPPORTED_NATIVE_SURFACE_VERSION 4
-
 #include 
 
 static Eina_Hash *pixmaps[2] = {NULL};
@@ -706,7 +704,7 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ns, EINA_FALSE);
 
-   ns->version = E_SUPPORTED_NATIVE_SURFACE_VERSION;
+   ns->version = EVAS_NATIVE_SURFACE_VERSION;
switch (cp->type)
  {
   case E_PIXMAP_TYPE_X:
@@ -1063,7 +1061,7 @@ e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
  {
 Eina_Bool ret;
 ns.type = EVAS_NATIVE_SURFACE_WL_DMABUF;
-ns.version = E_SUPPORTED_NATIVE_SURFACE_VERSION;
+ns.version = EVAS_NATIVE_SURFACE_VERSION;
 ns.data.wl_dmabuf.attr = &dmabuf->attributes;
 ns.data.wl_dmabuf.resource = NULL;
 test = evas_object_image_add(e_comp->evas);

-- 




[EGIT] [core/enlightenment] master 02/02: clean up some code

2017-06-07 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=2bd4a9dc85ff3a8de035a7a45181457eb8550284

commit 2bd4a9dc85ff3a8de035a7a45181457eb8550284
Author: Derek Foreman 
Date:   Wed Jun 7 12:12:16 2017 -0500

clean up some code

remove write-only variable in the pixmap struct
---
 src/bin/e_pixmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 0d68b6951..29f8529b2 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -46,7 +46,6 @@ struct _E_Pixmap
 
 #ifdef HAVE_WAYLAND
E_Comp_Wl_Buffer *buffer;
-   E_Comp_Wl_Buffer *native_buffer;
E_Comp_Wl_Buffer *held_buffer;
struct wl_listener buffer_destroy_listener;
struct wl_listener held_buffer_destroy_listener;
@@ -724,7 +723,6 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
 
  ns->data.wl_dmabuf.attr = &cp->buffer->dmabuf_buffer->attributes;
  ns->data.wl_dmabuf.resource = cp->buffer->resource;
- cp->native_buffer = cp->buffer;
  ret = EINA_TRUE;
   }
 else if (!cp->buffer->shm_buffer)

-- 




[EGIT] [core/enlightenment] master 01/02: Fix unused var compiler warning in wl_drm

2017-06-07 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=71f70ad8a52f359c6ab1628f6c5a33f568e66c8a

commit 71f70ad8a52f359c6ab1628f6c5a33f568e66c8a
Author: Derek Foreman 
Date:   Wed Jun 7 12:11:31 2017 -0500

Fix unused var compiler warning in wl_drm

Unused variable after my session activation cleanup
---
 src/modules/wl_drm/e_mod_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 69cb243f0..c99baa3dd 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -52,8 +52,6 @@ _e_mod_drm_cb_activate(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event
 
if (ev->active)
  {
-E_Client *ec;
-
 if (session_state) goto end;
 session_state = EINA_TRUE;
 

-- 




[EGIT] [core/enlightenment] enlightenment-0.21 08/18: Don't require dmabuf buffers to be writeable

2017-06-09 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=f76fb2d558f145b3d348d8b0e2242787bf5eee51

commit f76fb2d558f145b3d348d8b0e2242787bf5eee51
Author: Derek Foreman 
Date:   Fri May 19 16:47:57 2017 -0500

Don't require dmabuf buffers to be writeable

Compositor doesn't need to write to this buffer, and most clients won't
allocate them in a way that the compositor can.  Relax the test criteria.
---
 src/bin/e_pixmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 2849e598d..ad368e4b1 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -1084,7 +1084,7 @@ e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
 
/* This is only legit for ARGB */
size = dmabuf->attributes.height * dmabuf->attributes.stride[0];
-   data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, 
dmabuf->attributes.fd[0], 0);
+   data = mmap(NULL, size, PROT_READ, MAP_SHARED, dmabuf->attributes.fd[0], 0);
if (data == MAP_FAILED) return EINA_FALSE;
munmap(data, size);
 

-- 




[EGIT] [core/enlightenment] enlightenment-0.21 14/18: clean up some code

2017-06-09 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=f006caaee71ac18b3e5661a0c461c0e313a058bf

commit f006caaee71ac18b3e5661a0c461c0e313a058bf
Author: Derek Foreman 
Date:   Wed Jun 7 12:12:16 2017 -0500

clean up some code

remove write-only variable in the pixmap struct
---
 src/bin/e_pixmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 3989057ec..4f9a8e4ce 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -46,7 +46,6 @@ struct _E_Pixmap
 
 #ifdef HAVE_WAYLAND
E_Comp_Wl_Buffer *buffer;
-   E_Comp_Wl_Buffer *native_buffer;
E_Comp_Wl_Buffer *held_buffer;
struct wl_listener buffer_destroy_listener;
struct wl_listener held_buffer_destroy_listener;
@@ -724,7 +723,6 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
 
  ns->data.wl_dmabuf.attr = &cp->buffer->dmabuf_buffer->attributes;
  ns->data.wl_dmabuf.resource = cp->buffer->resource;
- cp->native_buffer = cp->buffer;
  ret = EINA_TRUE;
   }
 else if (!cp->buffer->shm_buffer)

-- 




[EGIT] [core/enlightenment] enlightenment-0.21 10/18: Fix wl_drm session (de)activation callback

2017-06-09 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=db46a8557cc5fa7939854b75238532252c423a49

commit db46a8557cc5fa7939854b75238532252c423a49
Author: Derek Foreman 
Date:   Fri Jun 2 13:59:42 2017 -0500

Fix wl_drm session (de)activation callback

I missed this in my last commit - we probably shouldn't be calling
e_comp_render_queue or e_comp_shape_queue_block() after hiding the
ecore_evas anyway - and by removing the e_comp_shape_queue_block()
in the activation callback I made things asymmetrical.  Ungood.
---
 src/modules/wl_drm/e_mod_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index f78386418..2593448b3 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -75,8 +75,6 @@ _e_mod_drm_cb_activate(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event
 evas_font_cache_flush(e_comp->evas);
 evas_render_dump(e_comp->evas);
 
-e_comp_render_queue();
-e_comp_shape_queue_block(1);
 ecore_event_add(E_EVENT_COMPOSITOR_DISABLE, NULL, NULL, NULL);
  }
 

-- 




[EGIT] [core/enlightenment] enlightenment-0.21 12/18: Remove some duplicate operations

2017-06-09 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=4088e035c6df08bee4b8e037b610d38e22b8d67e

commit 4088e035c6df08bee4b8e037b610d38e22b8d67e
Author: Derek Foreman 
Date:   Tue Jun 6 16:15:22 2017 -0500

Remove some duplicate operations

the native surface version was set outside of the switch statement,
so we don't need to re-set it to the same thing here.
---
 src/bin/e_pixmap.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index ad368e4b1..3989057ec 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -721,7 +721,6 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
 if (cp->buffer->dmabuf_buffer)
   {
  ns->type = EVAS_NATIVE_SURFACE_WL_DMABUF;
- ns->version = EVAS_NATIVE_SURFACE_VERSION;
 
  ns->data.wl_dmabuf.attr = &cp->buffer->dmabuf_buffer->attributes;
  ns->data.wl_dmabuf.resource = cp->buffer->resource;
@@ -731,7 +730,6 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
 else if (!cp->buffer->shm_buffer)
   {
  ns->type = EVAS_NATIVE_SURFACE_WL;
- ns->version = EVAS_NATIVE_SURFACE_VERSION;
  ns->data.wl.legacy_buffer = cp->buffer->resource;
  ret = EINA_TRUE;
   }

-- 




[EGIT] [core/enlightenment] enlightenment-0.21 13/18: Fix unused var compiler warning in wl_drm

2017-06-09 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=7396c05b5235fb1b060f022dd02c0b7b38269284

commit 7396c05b5235fb1b060f022dd02c0b7b38269284
Author: Derek Foreman 
Date:   Wed Jun 7 12:11:31 2017 -0500

Fix unused var compiler warning in wl_drm

Unused variable after my session activation cleanup
---
 src/modules/wl_drm/e_mod_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 2593448b3..f3116c580 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -56,8 +56,6 @@ _e_mod_drm_cb_activate(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event
 
if (ev->active)
  {
-E_Client *ec;
-
 if (session_state) goto end;
 session_state = EINA_TRUE;
 

-- 




[EGIT] [core/enlightenment] enlightenment-0.21 09/18: Fix wl_drm session activation callback

2017-06-09 Thread Derek Foreman
discomfitor pushed a commit to branch enlightenment-0.21.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=b8b5cb6d77f596b9c7340782dca881810a14d2e7

commit b8b5cb6d77f596b9c7340782dca881810a14d2e7
Author: Derek Foreman 
Date:   Fri Jun 2 13:49:06 2017 -0500

Fix wl_drm session activation callback

The code intended to force evas to redraw when we switch back from
another virtual console is failing to do so.  Remove it and replace
it with simpler code that successfully forces a redraw.
---
 src/modules/wl_drm/e_mod_main.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/modules/wl_drm/e_mod_main.c b/src/modules/wl_drm/e_mod_main.c
index 0c80e8d40..f78386418 100644
--- a/src/modules/wl_drm/e_mod_main.c
+++ b/src/modules/wl_drm/e_mod_main.c
@@ -62,13 +62,7 @@ _e_mod_drm_cb_activate(void *data EINA_UNUSED, int type 
EINA_UNUSED, void *event
 session_state = EINA_TRUE;
 
 ecore_evas_show(e_comp->ee);
-E_CLIENT_FOREACH(ec)
-  {
- if (ec->visible && (!ec->input_only))
-   e_comp_object_damage(ec->frame, 0, 0, ec->w, ec->h);
-  }
-e_comp_render_queue();
-e_comp_shape_queue_block(0);
+evas_damage_rectangle_add(e_comp->evas, 0, 0, e_comp->w, e_comp->h);
 ecore_event_add(E_EVENT_COMPOSITOR_ENABLE, NULL, NULL, NULL);
  }
else

-- 




[EGIT] [core/enlightenment] master 01/01: Clear the native surface structure before initializing it

2017-06-23 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=e6f17dee5d6ae504b4565afc7e5f9033cd597e22

commit e6f17dee5d6ae504b4565afc7e5f9033cd597e22
Author: Derek Foreman 
Date:   Thu Jun 22 14:05:24 2017 -0500

Clear the native surface structure before initializing it

Since the native surface "API" is isomorphic with pain and suffering, we
should be extra careful when we touch it.
---
 src/bin/e_pixmap.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 29f8529b2..0ddd646b9 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -703,6 +703,17 @@ e_pixmap_native_surface_init(E_Pixmap *cp, 
Evas_Native_Surface *ns)
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
EINA_SAFETY_ON_NULL_RETURN_VAL(ns, EINA_FALSE);
 
+   /* This structure is stack automatic in the caller, so it's all
+* uninitialized. Clear it to 0 so we don't have uninit data for
+* variables only present in a newer version of native surface
+* than this code was written for.
+*
+* The other option would be to set ns->version to whatever version
+* this code was actually written against, but I've been told all
+* native surface users are expected to set ns->version to the
+* version provided in the headers (EVAS_NATIVE_SURFACE_VERSION)
+*/
+   memset(ns, 0, sizeof(*ns));
ns->version = EVAS_NATIVE_SURFACE_VERSION;
switch (cp->type)
  {

-- 




[EGIT] [core/efl] master 05/19: ecore_drm2: Stop using the old per output release callbacks

2017-06-23 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=0d1082f947cbed5d29edb8ff653cdf0789a1d7c8

commit 0d1082f947cbed5d29edb8ff653cdf0789a1d7c8
Author: Derek Foreman 
Date:   Thu Jun 15 13:03:16 2017 -0500

ecore_drm2: Stop using the old per output release callbacks
---
 src/lib/ecore_drm2/ecore_drm2_fb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index bd81889308..ddd7c3e5dc 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -242,13 +242,12 @@ ecore_drm2_fb_dirty(Ecore_Drm2_Fb *fb, Eina_Rectangle 
*rects, unsigned int count
 #endif
 }
 
+/* perhaps output is no longer a necessary parameter for this function */
 void
-_ecore_drm2_fb_buffer_release(Ecore_Drm2_Output *output, 
Ecore_Drm2_Output_State *s)
+_ecore_drm2_fb_buffer_release(Ecore_Drm2_Output *output EINA_UNUSED, 
Ecore_Drm2_Output_State *s)
 {
Ecore_Drm2_Fb *fb = s->fb;
 
-   if (output->release_cb) output->release_cb(output->release_data, s->fb);
-
if (fb->status_handler)
  fb->status_handler(fb, ECORE_DRM2_FB_STATUS_RELEASE, fb->status_data);
 

-- 




[EGIT] [core/efl] master 04/19: gl_drm ee: Move to new per fb status callbacks

2017-06-23 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4d058ad3230c520d8a09614a109909cb6195330c

commit 4d058ad3230c520d8a09614a109909cb6195330c
Author: Derek Foreman 
Date:   Thu Jun 15 13:02:21 2017 -0500

gl_drm ee: Move to new per fb status callbacks

Switch over to the per fb status callbacks as the old per output api is
about to be removed.
---
 src/modules/evas/engines/gl_drm/evas_outbuf.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/modules/evas/engines/gl_drm/evas_outbuf.c 
b/src/modules/evas/engines/gl_drm/evas_outbuf.c
index 63cdb07a69..69fe64cb1f 100644
--- a/src/modules/evas/engines/gl_drm/evas_outbuf.c
+++ b/src/modules/evas/engines/gl_drm/evas_outbuf.c
@@ -45,12 +45,14 @@ _evas_outbuf_fb_cb_destroy(struct gbm_bo *bo EINA_UNUSED, 
void *data)
 }
 
 void
-_evas_outbuf_release_fb(void *ob_v, Ecore_Drm2_Fb *fb)
- {
+_evas_outbuf_release_fb(Ecore_Drm2_Fb *fb, Ecore_Drm2_Fb_Status status, void 
*data)
+{
struct gbm_bo *bo;
Outbuf *ob;
 
-   ob = ob_v;
+   if (status != ECORE_DRM2_FB_STATUS_RELEASE) return;
+
+   ob = data;
bo = ecore_drm2_fb_bo_get(fb);
gbm_surface_release_buffer(ob->surface, bo);
 }
@@ -81,6 +83,8 @@ _evas_outbuf_fb_get(Outbuf *ob, struct gbm_bo *bo)
 return NULL;
  }
 
+   ecore_drm2_fb_status_handler_set(fb, _evas_outbuf_release_fb, ob);
+
gbm_bo_set_user_data(bo, fb, _evas_outbuf_fb_cb_destroy);
 
return fb;
@@ -400,10 +404,6 @@ evas_outbuf_new(Evas_Engine_Info_GL_Drm *info, int w, int 
h, Render_Engine_Swap_
ob->format = info->info.format;
ob->priv.output = info->info.output;
 
-   ecore_drm2_output_release_handler_set(ob->priv.output,
- _evas_outbuf_release_fb,
- ob);
-
/* if ((num = getenv("EVAS_GL_DRM_VSYNC"))) */
/*   ob->vsync = atoi(num); */
 

-- 




[EGIT] [core/efl] master 12/19: ecore_drm2: Add callbacks for plane assign/release

2017-06-23 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5f2d4e75ab9d778ca6deeae7eabe3f406a4bdb3c

commit 5f2d4e75ab9d778ca6deeae7eabe3f406a4bdb3c
Author: Derek Foreman 
Date:   Fri Jun 16 16:30:39 2017 -0500

ecore_drm2: Add callbacks for plane assign/release

E will need these to gate wayland buffer releases.
---
 src/lib/ecore_drm2/Ecore_Drm2.h   | 2 ++
 src/lib/ecore_drm2/ecore_drm2_plane.c | 9 +
 2 files changed, 11 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index 37a67b1e04..2d0779a4c9 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -43,6 +43,8 @@ typedef enum _Ecore_Drm2_Fb_Status
ECORE_DRM2_FB_STATUS_SCANOUT_OFF = 2,
ECORE_DRM2_FB_STATUS_RELEASE = 4,
ECORE_DRM2_FB_STATUS_DELETED = 8,
+   ECORE_DRM2_FB_STATUS_PLANE_ASSIGN = 16,
+   ECORE_DRM2_FB_STATUS_PLANE_RELEASE = 32,
 } Ecore_Drm2_Fb_Status;
 
 /* opaque structure to represent a drm device */
diff --git a/src/lib/ecore_drm2/ecore_drm2_plane.c 
b/src/lib/ecore_drm2/ecore_drm2_plane.c
index cc79bff1dd..796302dc1f 100644
--- a/src/lib/ecore_drm2/ecore_drm2_plane.c
+++ b/src/lib/ecore_drm2/ecore_drm2_plane.c
@@ -124,6 +124,10 @@ out:
DBG("FB %d assigned to Plane %d", fb->id, pstate->obj_id);
output->planes = eina_list_append(output->planes, plane);
 
+   if (fb->status_handler)
+ fb->status_handler(fb,
+ECORE_DRM2_FB_STATUS_PLANE_ASSIGN,
+fb->status_data);
return plane;
 }
 
@@ -143,6 +147,11 @@ ecore_drm2_plane_release(Ecore_Drm2_Plane *plane)
plane->dead = EINA_TRUE;
plane->state->in_use = EINA_FALSE;
_fb_atomic_flip_test(plane->output);
+
+   if (fb->status_handler)
+ fb->status_handler(fb,
+ECORE_DRM2_FB_STATUS_PLANE_RELEASE,
+fb->status_data);
 }
 
 EAPI void

-- 




[EGIT] [core/efl] master 19/19: gl_drm: Implement hardware plane support

2017-06-23 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=33b50238d2d54e77c23f42c00c6bfafc9a9a1080

commit 33b50238d2d54e77c23f42c00c6bfafc9a9a1080
Author: Derek Foreman 
Date:   Thu Jun 22 12:48:45 2017 -0500

gl_drm: Implement hardware plane support

Adds the ability for gl_drm to place native surfaces on hardware planes.
---
 src/modules/evas/engines/gl_drm/evas_engine.c | 115 ++
 1 file changed, 115 insertions(+)

diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c 
b/src/modules/evas/engines/gl_drm/evas_engine.c
index 428b22b064..2e0fea8868 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -20,6 +20,12 @@
 
 #define EVAS_GL_UPDATE_TILE_SIZE 16
 
+struct scanout_handle
+{
+   Evas_Native_Scanout_Handler handler;
+   void *data;
+};
+
 /* external variables */
 int _evas_engine_gl_drm_log_dom = -1;
 int _extn_have_buffer_age = 1;
@@ -587,6 +593,25 @@ _re_winfree(Render_Engine *re)
evas_outbuf_unsurf(eng_get_ob(re));
 }
 
+static Ecore_Drm2_Fb *
+drm_import_simple_dmabuf(int fd, struct dmabuf_attributes *attributes)
+{
+   unsigned int stride[4] = { 0 };
+   int dmabuf_fd[4] = { 0 };
+   int i;
+
+   for (i = 0; i < attributes->n_planes; i++)
+ {
+stride[i] = attributes->stride[i];
+dmabuf_fd[i] = attributes->fd[i];
+ }
+
+   return ecore_drm2_fb_dmabuf_import(fd, attributes->width,
+  attributes->height, 32, 32,
+  attributes->format, stride,
+  dmabuf_fd, attributes->n_planes);
+}
+
 /* Code from weston's gl-renderer... */
 static EGLImageKHR
 gl_import_simple_dmabuf(EGLDisplay display, struct dmabuf_attributes 
*attributes)
@@ -716,6 +741,94 @@ _native_cb_unbind(void *image)
 }
 
 static void
+_eng_fb_release(Ecore_Drm2_Fb *fb EINA_UNUSED, Ecore_Drm2_Fb_Status status, 
void *data)
+{
+   struct scanout_handle *sh;
+
+   sh = data;
+   if (status == ECORE_DRM2_FB_STATUS_DELETED)
+ {
+free(sh);
+return;
+ }
+
+   if (!sh->handler) return;
+
+   switch (status)
+ {
+  case ECORE_DRM2_FB_STATUS_SCANOUT_ON:
+sh->handler(sh->data, EVAS_NATIVE_SURFACE_STATUS_SCANOUT_ON);
+break;
+  case ECORE_DRM2_FB_STATUS_SCANOUT_OFF:
+sh->handler(sh->data, EVAS_NATIVE_SURFACE_STATUS_SCANOUT_OFF);
+break;
+  case ECORE_DRM2_FB_STATUS_PLANE_ASSIGN:
+sh->handler(sh->data, EVAS_NATIVE_SURFACE_STATUS_PLANE_ASSIGN);
+break;
+  case ECORE_DRM2_FB_STATUS_PLANE_RELEASE:
+sh->handler(sh->data, EVAS_NATIVE_SURFACE_STATUS_PLANE_RELEASE);
+break;
+  default:
+ERR("Unhandled framebuffer status");
+ }
+}
+
+static void *
+eng_image_plane_assign(void *data, void *image, int x, int y)
+{
+   Render_Engine *re;
+   Outbuf *ob;
+   Evas_GL_Image *img;
+   Native *n;
+   Ecore_Drm2_Fb *fb = NULL;
+   Ecore_Drm2_Plane *plane = NULL;
+   struct scanout_handle *g;
+
+   EINA_SAFETY_ON_NULL_RETURN_VAL(image, EINA_FALSE);
+
+   re = (Render_Engine *)data;
+   EINA_SAFETY_ON_NULL_RETURN_VAL(re, EINA_FALSE);
+
+   ob = eng_get_ob(re);
+   EINA_SAFETY_ON_NULL_RETURN_VAL(ob, EINA_FALSE);
+
+   img = image;
+   n = img->native.data;
+
+   /* Perhaps implementable on other surface types, but we're
+* sticking to this one for now */
+   if (n->ns.type != EVAS_NATIVE_SURFACE_WL_DMABUF) return NULL;
+
+   fb = drm_import_simple_dmabuf(re->fd, &n->ns_data.wl_surface_dmabuf.attr);
+
+   if (!fb) return NULL;
+
+   g = calloc(1, sizeof(struct scanout_handle));
+   if (!g) goto out;
+
+   g->handler = n->ns.data.wl_dmabuf.scanout.handler;
+   g->data = n->ns.data.wl_dmabuf.scanout.data;
+   ecore_drm2_fb_status_handler_set(fb, _eng_fb_release, g);
+
+   /* Fail or not, we're going to drop that fb and let refcounting get rid of
+* it later
+*/
+   plane = ecore_drm2_plane_assign(ob->priv.output, fb, x, y);
+
+out:
+   ecore_drm2_fb_discard(fb);
+   return plane;
+}
+
+static void
+eng_image_plane_release(void *data EINA_UNUSED, void *image EINA_UNUSED, void 
*plin)
+{
+   Ecore_Drm2_Plane *plane = plin;
+
+   ecore_drm2_plane_release(plane);
+}
+
+ static void
 _native_cb_free(void *image)
 {
Evas_GL_Image *img;
@@ -1393,6 +1506,8 @@ module_open(Evas_Module *em)
EVAS_API_OVERRIDE(image_native_set, &func, eng_);
EVAS_API_OVERRIDE(image_native_init, &func, eng_);
EVAS_API_OVERRIDE(image_native_shutdown, &func, eng_);
+   EVAS_API_OVERRIDE(image_plane_assign, &func, eng_);
+   EVAS_API_OVERRIDE(image_plane_release, &func, eng_);
 
/* Mesa's EGL driver loads wayland egl by default. (called by 
eglGetProcaddr() )
 * implicit env set (EGL_PLATFORM=drm) prevent that. */

-- 




[EGIT] [core/efl] master 02/19: ecore_drm2: Add ecore_drm2_fb_status_handler_set

2017-06-23 Thread Derek Foreman
derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=a3eed7865a4508c3fe52c3b022216008801b5506

commit a3eed7865a4508c3fe52c3b022216008801b5506
Author: Derek Foreman 
Date:   Thu Jun 15 12:55:03 2017 -0500

ecore_drm2: Add ecore_drm2_fb_status_handler_set

The old per output release handler is no longer complicated enough.  In
the near future we'll need to be able to tell an engine that its fb has
been placed on scanout via hardware plane, or removed from a hardware
plane.

It's simpler to provide that information as well as release information
through a single callback.
---
 src/lib/ecore_drm2/Ecore_Drm2.h | 25 +
 src/lib/ecore_drm2/ecore_drm2_fb.c  |  7 +++
 src/lib/ecore_drm2/ecore_drm2_private.h |  3 +++
 3 files changed, 35 insertions(+)

diff --git a/src/lib/ecore_drm2/Ecore_Drm2.h b/src/lib/ecore_drm2/Ecore_Drm2.h
index f5768e3584..cae2c4a263 100644
--- a/src/lib/ecore_drm2/Ecore_Drm2.h
+++ b/src/lib/ecore_drm2/Ecore_Drm2.h
@@ -37,6 +37,13 @@ typedef enum _Ecore_Drm2_Rotation
ECORE_DRM2_ROTATION_REFLECT_Y = 32
 } Ecore_Drm2_Rotation;
 
+typedef enum _Ecore_Drm2_Fb_Status
+{
+   ECORE_DRM2_FB_STATUS_SCANOUT_ON = 1,
+   ECORE_DRM2_FB_STATUS_SCANOUT_OFF = 2,
+   ECORE_DRM2_FB_STATUS_RELEASE = 4,
+} Ecore_Drm2_Fb_Status;
+
 /* opaque structure to represent a drm device */
 typedef struct _Ecore_Drm2_Device Ecore_Drm2_Device;
 
@@ -85,6 +92,7 @@ EAPI extern int ECORE_DRM2_EVENT_OUTPUT_CHANGED;
 EAPI extern int ECORE_DRM2_EVENT_ACTIVATE;
 
 typedef void (*Ecore_Drm2_Release_Handler)(void *data, Ecore_Drm2_Fb *b);
+typedef void (*Ecore_Drm2_Fb_Status_Handler)(Ecore_Drm2_Fb *b, 
Ecore_Drm2_Fb_Status status, void *data);
 
 /**
  * @file
@@ -1061,6 +1069,23 @@ EAPI void 
ecore_drm2_plane_destination_set(Ecore_Drm2_Plane *plane, int x, int y
  */
 EAPI Eina_Bool ecore_drm2_plane_fb_set(Ecore_Drm2_Plane *plane, Ecore_Drm2_Fb 
*fb);
 
+/**
+ * Register a callback for buffer status updates
+ *
+ * When a flip completes ecore_drm2 may release a buffer.  Use this callback
+ * if you need to do bookkeeping or locking on buffer release.
+ *
+ * Additionally, an fb may be placed on scanout or removed from scanout by
+ * evas.  When this happens a compositor needs to ensure the buffers aren't
+ * released back to a client while they're on scanout.
+ *
+ * @param fb The fb to register the callback on
+ * @param handler The function to handle the callback
+ * @param data The user data to pass to the callback
+ * @ingroup Ecore_Drm2_Output_Group
+ * @since 1.20
+ */
+EAPI void ecore_drm2_fb_status_handler_set(Ecore_Drm2_Fb *fb, 
Ecore_Drm2_Fb_Status_Handler handler, void *data);
 # endif
 
 #endif
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c 
b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 56b397ece8..b97634d1a4 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -670,3 +670,10 @@ fail:
free(fb);
return NULL;
 }
+
+EAPI void
+ecore_drm2_fb_status_handler_set(Ecore_Drm2_Fb *fb, 
Ecore_Drm2_Fb_Status_Handler handler, void *data)
+{
+   fb->status_handler = handler;
+   fb->status_data = data;
+}
diff --git a/src/lib/ecore_drm2/ecore_drm2_private.h 
b/src/lib/ecore_drm2/ecore_drm2_private.h
index 6270b2d7a4..c335095c77 100644
--- a/src/lib/ecore_drm2/ecore_drm2_private.h
+++ b/src/lib/ecore_drm2/ecore_drm2_private.h
@@ -162,6 +162,9 @@ struct _Ecore_Drm2_Fb
void *gbm_bo;
void *mmap;
 
+   Ecore_Drm2_Fb_Status_Handler status_handler;
+   void *status_data;
+
Eina_Bool gbm : 1;
Eina_Bool dmabuf : 1;
Eina_Bool dead : 1;

-- 




  1   2   3   4   5   6   >