Commit Graph

85 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
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 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
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
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 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 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
Cedric BAIL 35e54acc46 evas: stat introducing a concept of engine and output in the backend. 2017-05-12 15:24:45 -07:00
Derek Foreman 2653fd3fda gl_drm: Fix rendering problems with dmabuf
Somehow this long standing bug wasn't obvious until wayland 1.13.0 made
some additions to an opaque structure.

This changed the frequency that new buffers came to us with the exact
same pointer value of a buffer that had just been freed.

This shortcut in eng_image_native_set has always been wrong - we need to
proceed to the end to make sure we pick up new dmabuf attributes.
2017-05-10 16:24:11 -05:00
Derek Foreman a4ed205071 gl_drm:Rename import_simple_dmabuf to gl_import_simple_dmabuf
There's also an ecore_drm2 function to import dmabuf as fb, so it's a
little less confusing to be a little more explicit here.
2017-04-26 13:47:46 -05:00
Derek Foreman 7b687c1a25 gl_drm: Fix KHR partial update support
I fixed this in other engines but missed this one.  The result is some
terrible flickering on gl_drm on recent mali drivers.
2017-03-17 15:32:26 -05:00
Derek Foreman 3b50c86985 gl_drm: Properly disable EGL_EXT_buffer_age when we don't have it
If we don't have EGL_EXT_buffer_age then we don't have buffer age - it's
a completely independent extension to KHR partial update.

This partially fixes partial update on recent mali drivers.
2017-03-17 15:04:47 -05:00
Carsten Haitzler 6b59dbfdb4 evas gl drm engine - fix warning about struct wl_resource not used
this struct is not actually used other than in this func ptr decl and
it's warning-land for gcc, so .. make it void * and do things like
pretty much all other gl extn func ptrs... be very generic
2017-02-12 00:29:50 +09:00
Jean-Philippe Andre 1d4affadd1 evas: Try to fix compilation with EGLAttrib 2016-12-21 13:56:14 +09:00
Derek Foreman acb0ee2a9d evas engines: Use EGLImageKHR instead of EGLImage
If someone's trying to build efl git with 2.5 year old EGL headers they get
a break on missing EGLImage...

We should probably consider keeping an up to date copy of the EGL headers
in efl.  There may be someone out there with even older headers.
2016-12-20 10:16:40 -06:00
Derek Foreman 2e6f93ccda gl_drm: Use common eglCreateImage implementation
Refactor to reduce copy and paste.
2016-12-19 15:52:58 -06:00
Derek Foreman c11b66434f evas engines: Stop using arrays of 1 member for egl context and surface
There's actually an array of 2 in gl_x11, but it appears we only use the
first 1, except in an #if 0 block.

I gather this is legacy for some reason - it sure doesn't seem to make
any sense now, so I'm chopping off all the extra array indexes.

Note: I've not changed gl_sdl - it looks like it doesn't use the context
or surface at all and they could just be removed, but I don't build that
one here and don't want to touch it.
2016-12-16 09:48:15 -06:00
Jean-Philippe Andre 581505791a evas: Remove context from some engine function
This is for canvas_alpha_get. context is never used.
2016-12-16 10:40:55 +09:00
Cedric Bail 7316bda150 evas: refactor swap mode info get. 2016-12-08 15:06:25 -08:00
Chris Michael a85605553b evas-gl-drm: Cleanup evas-gl-drm engine build and fix build break
A previous patch from some french guy broke building of the gl_drm
engine. This patch fixes the build break and cleans up unused
variables, etc.

ref 73b308fb66

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-08 09:02:43 -05:00
Derek Foreman add19c8a77 gl_drm: Check for the correct dma_buf extension
We're importing, not exporting
2016-12-08 07:36:26 -06:00
Cedric BAIL 73b308fb66 evas: refactor setup stage and reduce complexity for engine. 2016-12-07 15:47:56 -08:00
Derek Foreman da5f41723a gl_drm: Only use dmabuf if the extension is present
Need to check for the extension string instead of just the presence of the
function pointers.
2016-12-07 16:41:34 -06:00
Derek Foreman cef41ae70a gl_drm: Query eglGetProcAddress with dlsym
eglGetProcAddress should be queried with dlsym unconditionally.  What we
had could query it with other extended forms of eglGetProcAddress, which
is probably not what anyone wants.

Also, throwing away the weird extended forms because there's a good chance
our other gl bits don't run on any stacks that don't support normal
eglGetProcAddress.
2016-12-07 16:39:17 -06:00
Derek Foreman 661e44c38d gl_drm: simplify outbuf_reconfigure
Calling render_engine_software_generic_update from eng_setup lets us
remove a bunch of stuff from evas_outbuf_reconfigure.
2016-12-07 15:54:06 -06:00
Derek Foreman 4258fa4f70 gl_drm: Allow testing of dmabuf objects
Enlightenment needs to know if a specific dmabuf format is supported
before it lets clients use it.  This lets E test commit a wayland
dmabuf object without assigning it a buffer.
2016-12-06 16:34:54 -06:00
Cedric BAIL 6427c77707 evas: refactor initialisation and shutdown of evas_common. 2016-12-05 11:22:52 -08:00
Jean-Philippe Andre 182418dc1c gl drm/x11: Fix compilation for EGL < 1.5
This is an attempt at fixing compilation for systems with old
EGL headers (version < 1.5).

Thanks Roy for the report!
2016-12-02 14:26:47 +09:00
Derek Foreman f0e8ebeaea gl_drm: Fix eglCreateImage for 32-bit systems
eglCreateImageKHR and eglCreateImage have different prototypes, but we
treated them the same.  Fix that so 32-bit users can have them too.
2016-12-01 15:06:58 -06:00
Derek Foreman adabe89b3a gl_drm: Don't query gl functions that don't exist anywhere
We're just making stuff up now and hoping they magically match existing
prototypes, I guess.

Hardly the weirdest thing in this file.
2016-12-01 15:06:58 -06:00
Carsten Haitzler dbebf2835f evas surface/buffer wl support - define missing egl ifdefs if missing
this will define EGL_WAYLAND_PLANE_WL and EGL_WAYLAND_BUFFER_WL if
missing as SOME older egl public headers dont expose them and yet we
still wans to compile and support the feature should the egl BINARY
etc. actually support this (or be upgraded to support it after efl
compilation).

@fix
2016-11-17 18:41:31 +09:00
Carsten Haitzler e146371ed9 evas modules - only unregister log domain if its registered
some modules did check, some didnt... but this makes them consistent
and silences and eina err log. :)
2016-11-17 18:41:31 +09:00
Derek Foreman 5eec34812e 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.
2016-09-08 13:55:24 -05:00
Derek Foreman 794798f559 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.
2016-09-08 13:55:23 -05:00
Derek Foreman 0c21a926a3 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.
2016-08-19 16:26:20 -05:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Jean-Philippe Andre ecc1d5dfaf gl_drm: Fix shadow warning 2016-06-07 15:10:28 +09:00
Chris Michael ccb573ec7b evas-engines: Port evas drm engines to use Ecore_Drm2 library
This patch ports the evas drm and gl_drm engines to use the new
Ecore_Drm2 library

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-27 11:57:53 -04:00
Derek Foreman d93db5bcaa gl_drm: switch to GLERRV macro for error reporting
eglGetError() is actually somewhat heavy, so hide it behind the GLERRV
macro which compiles out the test by default.
2016-05-20 15:53:20 -05:00
Derek Foreman f8976aed13 gl_drm: Fix silly run time warning for wayland dmabuf
DMABuf buffers destroy their glimage in the unbind callback, so it's
usually already gone for the free callback.

Now we test if we actually need to destroy anything.

Also, switch to GLERRV macro for error reporting - it saves us the heavy
eglGetError() unless we've built it in intentionally.
2016-05-20 15:47:21 -05:00
Derek Foreman 5f0aea2e24 gl_drm: Add wayland dmabuf native surface support 2016-05-18 11:52:24 -05:00
Minkyoung Kim f10672dd74 evas : remove native.func.data variable and data argument of native calblacks.
Summary:
Evas Image should be independent of render engine.
So remove native.func.data member of RGBA_Image, Evas_GL_Image struct.
And remove data argument,too.

Test Plan: Local test, Tizen3.0 mobile, Desktop englitenment

Reviewers: jpeg, spacegrapher, wonsik

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3850
2016-04-01 12:09:06 +09:00
Minkyoung Kim fb3368111d evas: Move engine data to native.
Summary:
native_xx_cbs must be independent to evas render engine.
This was applied to only gl_x11 backend.
Propagate to others.

Test Plan: Tizen3.0 Mobile

Reviewers: wonsik, spacegrapher, jpeg

Reviewed By: jpeg

Subscribers: cedric, dkdk

Differential Revision: https://phab.enlightenment.org/D3840
2016-03-30 15:09:27 +09:00
Jean-Philippe Andre 20b4d9dd6a Evas engines: Add internal functions for native images
- image_native_init
- image_native_shutdown

init() will be used to test whether the engine supports a
certain type of native image.

Note: Native image support is very much dependent on the engine,
and some stuff like opengl should work everywhere (even in sw
with osmesa) but that's not the case.
2016-03-15 11:11:59 +09:00
Derek Foreman 943f2df006 ecore_drm/ecore_wl2: logging: remove errant usage of %m
Summary:
printf %m stringifies and prints errno.  I've tried to remove its use
anywhere that the immediately preceding function might not set errno
or is a complicated function for which knowing errno doesn't really
give any useful information.

I've left a few of the drmMode calls because they're just wrappers
around ioctl, which legitimately sets errno.

@fix

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3572
2016-01-14 13:06:02 -05:00
Wonsik Jung 7db9613e8c Evas_Engine: add TBM surface and clean up Native Struct
Summary:
Add TBM surface in wayland and clean up Native struct on Evas Engine.
Previous TBM surface for evas_object_image's native_surface_set is only in Evas X11 backend.
This patch has the code for wayland backend.
In addition, evas_native_tbm.c is moved to software_generic. Becuase this file is common.
And, Native in Evas_Engine is clean-up.

@feature

Test Plan:
TBM surface is tested with spacegrapher's test app(tbm.c) in Tizen Device.
Pixmap surface is tested in ubuntu with same test app.
EvasGL is tested with elementary_test.

Reviewers: jpeg, spacegrapher, raster, cedric

Subscribers: dkdk, scholb.kim, JoogabYun

Differential Revision: https://phab.enlightenment.org/D3501
2016-01-05 17:01:45 +09:00
Dongyeon Kim 16eb3942bb evas/gl: Do not check for egl errors with glEGLImageTargetTexture2DOES
Summary:
glEGLImageTargetTexture2DOES is a GL extension API, so we need to use
glGetError instead of eglGetError!
2015-11-12 10:03:10 +09:00
Chris Michael b2785f01c5 evas-gl-drm: Find symlink for eglSetDamageRegionKHR
In efforts to reduce tearing in the gl_drm engine, find and link to
the eglSetDamageRegionKHR function so we can mark damaged regions of a
surface

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-11-04 11:18:25 -05:00