Commit Graph

1884 Commits

Author SHA1 Message Date
Derek Foreman 8ff59b2c55 ecore_drm2: Pass Ecore_Drm2_Device instead of fd to most functions
Intended to simplify the upcoming commit that merges device find and
device open into a single function that returns a device.

The fd is something callers shouldn't really need to get their hands on,
right now there are still a few places where it's needed, but those will
be gone soon too.
2017-08-09 14:56:58 -05:00
Mike Blumenkrantz bc28c4b579 evas wayland: always create gl context when non-existent 2017-08-07 10:50:08 -04:00
Mike Blumenkrantz 77c4ee161d evas wayland: call makecurrent before querying gl attrs
fix T5845
2017-08-07 10:50:08 -04:00
Derek Foreman d4e69af383 wayland-shm: Set CLOEXEC for dmabuf
Stop leaking the render node fd to child processes.
2017-07-31 10:55:47 -05:00
Carsten Haitzler a0ed0483fc evas gl gnenric engine - dont check w and h ptrs - will never be null
analyser unhappiness.

found by PVS studio
2017-07-29 12:06:20 +09:00
Mike Blumenkrantz 93bac8ce4a wayland: stop creating 1x1 surfaces on init
fix T5226

 #IGot99TicketsBut1x1AintOne
2017-07-21 16:17:54 -04:00
Mike Blumenkrantz 9a56b267cd evas sw x11: formatting 2017-07-21 16:17:53 -04:00
Derek Foreman 736c63be34 gl_drm: half fix eglGetPlatformDisplayEXT usage
Just because the #define is present doesn't mean the extension is, so we're
BAILing on egl completely on some systems for no good reason at all. (saw
this on an SGX stack)

This is still wrong.  I don't want to try too hard until after the upcoming
release, though.

We should actually be testing for the presence of client extensions before
attempting to do any of this.  It's entirely possible that a gl stack will
return bogus functions for these from eglGetProcAddress
2017-07-21 14:34:50 -05:00
Jean-Philippe Andre 7bb14727af evas: Fix a crash in emotion with GL
Ooops! When mapping for writing we can't use the same code
path as when tofree is true. This restores the path for image
writing. This basically fixes rage with GL engine.

See also 45c8e5e983
2017-07-20 16:43:52 +09:00
Jean-Philippe Andre d6c95d1e4b evas gl: Rename secsym_ to eglsym_
eglDestroyImage has nothing to do with SEC...
This is a cosmetic change.
2017-07-20 13:31:34 +09:00
Jean-Philippe Andre 0c78783045 evas gl: Check EGL version before using dlsym
A recent commit broke texture_from_pixmap for NVIDIA EGL
(again), because eglCreateImage is a symbol in libEGL.so
but isn't in fact implemented by the driver.

That's because eglCreateImage() is exposed by libglvnd but
the underlying EGL implementation is NVIDIA and its version
is only 1.4, not 1.5 (where the API was introduced as core).

Instead of reverting the patch, it's better to cover our
bases properly and use dlsym() only if the version is right.

Note that GetProcAddress() may return garbage function
pointers for ALL functions as dynamic virtual functions may
be created on the fly by libglvnd. So it is absolutely
necessary to check the extension string as well.

See 0255f14dc2
2017-07-20 13:31:15 +09:00
Derek Foreman ef9bd41831 gl_common: extsn is no longer unused
Also, we should throw an error when it's NULL, since it's important
for finding symbols for extended egl/gl.
2017-07-19 13:05:53 -05:00
Derek Foreman 0255f14dc2 gl_common: Prefer unextended eglCreateImage
eglCreateImage is objectively better than eglCreateImageKHR - it allows
attributes large enough to hold pointer values.  We should use it when
available and only use the older extension version as fallback.

Also, eglCreateImage is core EGL functionality so don't depend on extensions
to be present to use it.  Theoretically we should be testing for
EGL version >= 1.5 but it's probably safe not to.
2017-07-19 12:24:19 -05:00
Derek Foreman d31f5038e2 gl_common: Remove fallback hack for wayland
This was only necessary due to bugs in the wayland_egl and gl_drm engine
that have been corrected.

Wayland has no bizarre requirements making this necessary.
2017-07-19 12:09:33 -05:00
Derek Foreman eda81c6dff gl_drm: Defer gl symbol lookups until they're possible
See previous commit for details.
2017-07-19 12:02:03 -05:00
Derek Foreman c7fe083a57 wayland_egl: Defer gl symbol lookups until they're possible
Commit 2e6587a14b adds a gl extension string to glsym_evas_gl_symbols()
to prevent using functions that are provided by extensions that aren't
available in the current gl context.

However, we can't query the extension strings until after we create an egl
context.

Split the regular symbol lookup stuff from the gl symbol lookup stuff so
we can query at the appropriate time.
2017-07-19 12:00:07 -05:00
Derek Foreman 86377caa0e wayland_egl: de-wtf the eglGetProcAddress prototype 2017-07-19 11:44:00 -05:00
Derek Foreman 7fd66e84d9 gl_drm: de-wtf the eglGetProcAddress prototype
This doesn't seem to serve any purpose other than rigorous proof that
typecasts can make literally anything compile.
2017-07-19 11:43:25 -05:00
Derek Foreman 855f59da8d gl_common: Stop looking for eglCreate/DestroyImageOES
These aren't a thing.  the GL_OES_EGL_image_base extension doesn't exist
and the GL_OES_EGL_image extension doesn't extend egl, because it's a gl
extension.

So let's stop being the only google match for these nonsense strings.
2017-07-19 10:33:06 -05:00
Jean-Philippe Andre 897d81acb1 evas engine gl: Add missing image unlock
This is a rare error path. Unlikely and not very important as
the lock/unlock doesn't actually perform any meaningful operation.
2017-07-19 13:59:42 +09:00
Jean Guyomarc'h 2f9cbb3a35 evas-gl_cocoa: fix compilation
Booo for commit 2e6587a14b.
2017-07-16 17:26:41 +02:00
Carsten Haitzler 2e6587a14b evas gl - fix compositing/native surface with egl/gles after glvnd
this fixes an issue that has cropped up in the past few months - only
nvidia drivers with egl/gles in x11... and compositing won't work
(native surface) and the introduction of libglvnd

it's a combination of libglvnd lying that it has symbols it can't
later find, new features to get core functions via procaddress that we
hadn't migrated to use AND use preferring core functions that libglvnd
will expose, so switching to KHR extensions by preference. we also
need to symmetrically use destroy image khr too...

oddly enough using procaddress purely for create/destroy image makes
wayland fail ... sofor now i'm taking advantage of the fact that
wayland has no extensions string passed in at the moment and still
doing dlsym... this is odd though.

@fix
2017-07-16 15:56:02 +09:00
Uma Devika d4ab6ff90a Evas and Eolian : Freed string buffer
Summary:
Summary : String buffer returned by eina_strbuf_new() is not freed in some cases

@Fix

Signed-off-by: Uma Devika <u.bodapati@samsung.com>

Reviewers: cedric, tasn, jpeg, raster, singh.amitesh

Subscribers: tanwar.umesh07, yashu21985, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5000
2017-07-07 13:22:53 +09:00
Jean-Philippe Andre b0caec04fb drm: Fix compilation warnings 2017-07-03 16:23:41 +09:00
Derek Foreman 81420d76e0 software_generic: Improve dmabuf validity tests
Now that upper layers set load errors this can be less gruesome.

Also, add some checks that were in E here where they belong.
2017-06-30 14:54:12 -05:00
Derek Foreman b8165098dc gl_drm: Improve dmabuf validity test
Now that higher layers are setting load errors this can be less gruesome.
2017-06-30 14:52:54 -05:00
Derek Foreman fbb676584e drm: Implement hardware plane support
Adds the ability for drm to place native surfaces on harware planes.

ref 33b50238d2
2017-06-29 17:20:23 -05:00
Derek Foreman dc3873c8db software_generic: fix eng_image_native_get
This has been a stub for a long time, but now we have a native_set, so
we should have a native_get too.

This is required for hw plane usage on the software engine.
2017-06-29 17:20:23 -05:00
Derek Foreman 944a4065e8 gl_drm: Check dmabuf attribute version before trusting attributes
We shouldn't do anything with a dmabuf structure until confirming the
version matches the one we know.
2017-06-29 16:12:35 -05:00
Derek Foreman 2e0e017b87 software_generic: Check dmabuf attribute version during set
We should check here instead of only at time of usage.
2017-06-29 16:11:45 -05:00
Derek Foreman 892bfe7c98 dmabuf: Make a define for the version of the dmabuf attribute struct
I should've done this in the first place, and the version checks are
starting to spread out a bit.
2017-06-29 13:51:07 -05:00
Jean-Philippe Andre 1ef1c04f42 gl_drm: Fix a few compilation warnings
warning: expression which evaluates to zero treated as a null
pointer constant of type 'void *' [-Wnon-literal-null-conversion]
2017-06-29 16:02:36 +09:00
Derek Foreman 33b50238d2 gl_drm: Implement hardware plane support
Adds the ability for gl_drm to place native surfaces on hardware planes.
2017-06-23 08:15:42 -05:00
Derek Foreman 7e2c8c1cbd software_generic: Add plane assign/release function pointers
Functions to assign a plane for a native surface, and release a plane
that's been assigned to a native surface.

These are empty for now as they'll need to be overridden in any backend
that can handle planes.
2017-06-23 08:15:42 -05:00
Derek Foreman 4d058ad323 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.
2017-06-23 08:15:40 -05:00
Derek Foreman bd0774206f gl_drm ee: move release fb callback
No functional change, just code motion.
2017-06-23 08:15:40 -05:00
Chris Michael 2aa9538f73 evas-gl-drm: Fix uninitialized variable
Small patch to fix an uninitialized variable when using
eglGetConfigAttrib()

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-08 10:01:52 -04:00
Chris Michael faf6041ca7 evas-gl-drm: Be sure to initialize ncfg variable
This could lead to an uninitialized variable or use of ncfg variable
without a value.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-08 10:01:52 -04:00
Thiep Ha 4f77bb2f5a evas_map: support map with number of points as multiples of 4
Currently, in evas map, we only support map with 4 points.
This patch adds support for map with number of points as
multiples of 4.

@feature
2017-06-08 16:53:45 +09:00
Chris Michael 45656ccb80 evas-gl-drm: Fix potential memory leak
If/When we exit _evas_outbuf_egl_setup function, we should be freeing
the allocated cfgs variable else we leak it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-07 12:38:12 -04:00
Cedric BAIL fd38c09735 evas: reuse code for colorspace logic by using switch case statement fallthrough. 2017-06-05 12:07:57 -07:00
Cedric BAIL 447a9056d0 evas: use switch case statement fallthrough to handle colorspace logic reuse. 2017-06-05 12:07:57 -07:00
Jean-Philippe Andre ebb9cad1ed evas gl: Add an env var to debug GLSL version issues
Set this env var to "300 es" to test GLSL 300 ES as shader
version. This is for brokenshakles.

Example:
  export EVAS_GL_GET_PROGRAM_BINARY=0
  export EVAS_GL_SHADER_GLSL_VERSION="300 es"
  export ELM_ACCEL=gl
  elementary_test
2017-05-30 11:15:41 +09:00
Derek Foreman a5fae67e9c dmabuf: Drop requirement that buffer be writeable
We don't need to write to it, and some clients don't create their buffers
in a way that we can.

@fix
2017-05-19 16:59:27 -05:00
Derek Foreman 1c60ac3bc9 ee_drm: Remove some commented out code
I think this was intended as a reminder to do something that's already
been done.  Or something.
2017-05-12 17:51:34 -05:00
Derek Foreman edcbff59b7 ecore_drm2: refcount fbs
Removes the previous "busy" flag, as now we might have an fb attached to
multiple outputs at once, and need to be careful to destroy them only
after they've been removed from all outputs.

Removed the old "busy_set" API which nothing used, and renames fb_destroy
to fb_discard to make it more clear that it's not immediately destroyed.

It's all beta api, so I can do this.
2017-05-12 17:51:34 -05:00
Cedric BAIL 69b941f018 evas: simplify fb engine. 2017-05-12 15:24:45 -07:00
Cedric BAIL a660ee9e19 evas: simplify buffer engine. 2017-05-12 15:24:45 -07:00
Cedric BAIL 35e54acc46 evas: stat introducing a concept of engine and output in the backend. 2017-05-12 15:24:45 -07:00
Jean-Philippe Andre 7e2e6e8aa4 evas gl: Fix typo and revert hack (GLES 3.1)
Omg... Thanks Daekwang Ryu for pointing me to my error. I remember
struggling a lot with this OpenGL API and libGLdispatch (glvnd) when
in fact this was all just a typo in the code.

GLES 3.1 and the upcoming 3.2 support need a proper test case...

See c68a409874

@fix
2017-05-12 16:34:38 +09:00