Commit Graph

79 Commits

Author SHA1 Message Date
Derek Foreman 1848f9a8e6 ecore_drm2: Better handling of blank time checks
On some systems we'll successfully complete the vblank ioctl but get
a reply of 0.  When that happens we can't use that time for ticking
as it will break all of the entire world.

Fixes immediate screen blank on rpi3.

@ref T5977
2017-09-05 12:12:30 -05:00
Derek Foreman eec565cc0f ecore_drm2: Add query for pending pageflip
We've been tracking this in ecore_evas, but ecore_evas isn't the only
caller, and it doesn't know about flips initiated by the evas engines.
2017-08-11 17:11:12 -05:00
Derek Foreman 9fd0ed736d ecore_drm2: Remove ecore_drm2_output_resolution_get()
No local callers.  Superseded by ecore_drm2_output_info_get()
2017-08-09 14:56:59 -05:00
Derek Foreman 5ecfe6a8b5 ecore_drm2: Remove ecore_drm2_output_crtc_size_get()
Replaced with ecore_drm2_output_info_get()
2017-08-09 14:56:59 -05:00
Derek Foreman 846db0e0e7 ecore_drm2: Remove ecore_drm2_output_geometry_get()
Replaced with ecore_drm2_output_info_get()
2017-08-09 14:56:59 -05:00
Derek Foreman 1b853dcfad ecore_drm2: Add ecore_drm2_output_info_get
We've got too many ways to query output information, so let's add more.
(this will soon replace all of them)
2017-08-09 14:56:59 -05:00
Derek Foreman 9b9d704292 ecore_drm2: Remove connector bitfield
This is unreliable - there's no reason to expect these connector ids
will be low enough to sensibly store in a bit field.
2017-08-09 14:56:58 -05:00
Derek Foreman 2f9cb33f0b ecore_drm2: remove unused crtc bitfield
We'll need something like this when multi-head works, but it can't
be implemented this way anyway.  There's no guarantee that crtc
ids will be low enough to fit sensibly in a bitfield.
2017-08-09 14:56:58 -05:00
Derek Foreman df658a6d15 ecore_drm2: Remove dead code in blank time get
When I added the fallback block I left an if statement that could
never evaluate to true.  Remove it.
2017-07-31 10:57:56 -05:00
Carsten Haitzler 2c1e2db876 ecore_drm2 - fix startup if edid blob is null.. assume all 0's
this causes a crash when no edid is available. survive and dont crash.
this causes e wayland to not work at all on my baytrail laptop.

@fix
2017-07-30 23:27:56 +09:00
Derek Foreman 0584fc81a2 ecore_drm2: Add a fallback method for vblank waiting
We can't depend on vblank waits being implemented by the driver, but we
can count on page flips functioning, so add a fallback that does a page
flip and waits for it.
2017-07-28 15:35:03 -05:00
Derek Foreman 8e500c6835 ecore_drm2: Allow picking a sequence number for blanktime_get
This lets us do a blocking wait for a vsync.  Something we should try to
do as infrequently as possible, but in some cases we need it one time at
startup to catch graphics driver bugs.
2017-07-28 10:41:11 -05:00
Derek Foreman 20def4da21 ecore_drm2: Add a query for the next vblank time
I guess this is a feature, and we're deep in freeze, but:

a) this is critical for fixing T5462 properly without any side effects.
b) ecore_drm2 is all beta api
c) this should only affect wayland users

ref T5462
2017-07-13 18:07:42 -05:00
Derek Foreman 74290490ad ecore_drm2: Remove obsolete per output fb callback api
It's all beta API so I can throw this away now that there are no in-tree
users anymore.
2017-06-23 08:15:40 -05:00
Mike Blumenkrantz a3d0af0069 ecore-drm2: add ecore_drm2_output_subpixel_get()
@feature
2017-06-16 12:23:08 -04:00
Chris Michael bbd18510d6 ecore-drm2: Remove #ifdef HAVE_ATOMIC_DRM
As we now use static_libs/libdrm for compiling ecore-drm2, we can
remove the atomic #ifdefs as we can run-time check this now.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-09 14:20:05 -04:00
Chris Michael 0ecf044080 ecore-drm2: Fix potential SIGFPE when adding output mode
If we receive bad crtc info from libdrm, then we could end up with a
SIGFPE here due to division by zero if info h/v total are not set.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-08 10:34:29 -04:00
Chris Michael 96347d1ee2 ecore-drm2: Don't use Atomic functions to set DPMS levels
This was initially an experiment in trying to use Atomic properties to
set dpms on/off, however it does not turn off backlight support when
triggered so it is useless.

Fixes T5462

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-06 11:06:34 -04:00
Chris Michael 2f10ce1055 ecore-drm2: Add internal functions to get backlight values
Small patch to add an internal function which can be used to retrieve
backlight values on output creation.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-06 10:37:01 -04:00
Derek Foreman e24670b1e2 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
2017-06-05 16:25:14 -05:00
Derek Foreman 9d583b3fdb 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.
2017-06-02 15:50:08 -05:00
Derek Foreman 0df7299526 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.
2017-06-02 15:50:08 -05:00
Chris Michael dc3da87139 ecore-drm2: Don't free output plane states if not using atomic
If atomic support is not enabled (kernel or env var), then we will not
be filling output plane_states, so no need to free them (if non-atomic).

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-30 15:57:07 -04:00
Chris Michael ba4042da1e ecore-drm2: Don't fill output atomic states if not using atomic
If atomic support is not enabled (kernel or env var), then we should
not be filling in output atomic state

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-30 11:00:20 -04:00
Chris Michael e0a1e63072 ecore-drm2: Don't call fb_flip until output is enabled
When calling ecore_drm2_output_enabled_set, we cannot initiate a
pageflip until the output has been enabled, so remove call to fb_flip
here. The dpms_set function will handle issueing the pageflip anyway.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-19 11:33:19 -04:00
Chris Michael 851a2c72af ecore-drm2: Cleanup output_enabled_set function code
If we are using atomic, we don't need to set the crtc active values
here as they will be set in output_dpms_set function anyway.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-19 11:32:20 -04:00
Chris Michael 7a3c658759 ecore-drm2: Fix atomic dpms setting (round 2)
As it turns out, we still need to enable/disable the output crtc when
we enable/disable dpms in order for the screen itself to turn off, so
this patch "should" finally fix atomic dpms setting.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-19 11:29:47 -04:00
Chris Michael 76806fda80 ecore-drm2: Update connector state dpms value if setting works
If we successfully set dpms via atomic state, we should also update
the connector state dpms value

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-18 12:22:27 -04:00
Chris Michael 892b58fbf2 ecore-drm2: Fix setting dpms level using atomic state
The property we need to change during an atomic dpms change is
actually from the output connector state (not crtc state). This fix
should make dpms work when using atomic

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-18 12:14:01 -04:00
Derek Foreman 8143abff2c ecore_drm2: Replace output fbs with state structs
next, pending, and current are going to have to deal with atomic state
instead of just fbs soon
2017-05-05 12:53:22 -05:00
Derek Foreman 63dbf061a9 ecore_drm2: Move atomic state into an output state struct
This should make it easier to share code paths between atomic and non
atomic operations.
2017-05-05 12:53:22 -05:00
Chris Michael 2ba64a4c0a ecore-drm2: Free output atomic request on destruction
When we free an output, make sure we cleanup any existing atomic
commit requests

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Chris Michael 86bd42884a ecore-drm2: Fill output states regardless if atomic
This commit fills in various output 'state' structures during creation
so that those state structures can be reused for pageflip handling
even if Atomic support is not enabled.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Chris Michael eb1ed0fc0a ecore-drm2: Minor formatting fix
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Derek Foreman 05e8d76021 ecore_drm2: Fix ticking when atomic mode set is enabled
Putting the PAGE_FLIP_EVENT flag on the set rotation request resulted
in an extra event on the drm device fd that screwed up page flipping
badly from that point on.

@fix
2017-04-21 16:39:19 -05:00
Chris Michael f1525ecf35 ecore-drm2: Cleanup list of output planes on output_destroy
Small patch to make sure we free memory previously allocated for
hardware planes when we destroy an output

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 980ed70eb9 ecore-drm2: Support multiple planes on a given output
Various hardware can support multiple planes on a given output. As
such, we need to be able to store multiple plane states per-output.
This small patch adds support for that.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael c126ce2e70 ecore-drm2: Add API function to set output rotation
This patch adds a new API function that can be called from
Enlightenment wl_drm module to enable output rotation.

NB: Only works if Atomic support is enabled as it rotates the hardware
plane directly...and we don't support planes without Atomic enabled.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-18 11:29:14 -05:00
Chris Michael ca194584d5 ecore-drm2: Add API function to return supported rotations of an output
Small patch to add an API function which can be used to return the
supported rotations of a given output. This is used inside the
Enlightenment wl_drm module to determine if rotations is supported on
an output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-18 10:38:01 -05:00
Chris Michael 6b350fc696 ecore-drm2: Add API function to allow setting gamma of a given output
Small patch to add an API function which will allow setting the gamma
level of a given output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-29 09:15:07 -05:00
Chris Michael e0b61a35c5 ecore-drm2: Add API function to return screen dpi
This patch adds a new API function which will be called from
Ecore_Evas to return the screen dpi

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-28 10:09:41 -05:00
Derek Foreman 168a127c8c ecore_drm2: Make sure something's on screen after dpms wake
Flip to the previous buffer on dpms wake to make sure we show something
2016-11-16 15:05:40 -06:00
Chris Michael 8421a37313 ecore-drm2: Make calls to symlink'd libdrm functions
Instead of linking to libdrm and calling drmMode functions, we will
instead symlink the functions we need during runtime and call those
symlinks.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-15 08:42:07 -05:00
Chris Michael aba152a8be ecore-drm2: Free Output modes on destroy
When we destroy outputs, we should be freeing the Output's Modes also
as that was previously allocated memory.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-11 11:30:49 -04:00
Chris Michael fb112b8fab ecore-drm2: Use Atomic Modesetting for resolution changes
Since we have atomic properties now, we can use those to set given
Output modes (resolutions).

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-11 11:30:49 -04:00
Chris Michael bcf311ae3c ecore-drm2: Use Atomic State to enable/disable an output
If Atomic Modesetting is supported, we can use that to enable/disable
a given output.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-23 08:53:32 -04:00
Chris Michael bfff91bac5 ecore-drm2: Add code to support setting DPMS levels via Atomic
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael a262629282 ecore-drm2: Add code to use Atomic for Edid if available
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael 2bda227304 ecore-drm2: Add code to setup Plane Atomic state for Outputs
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00
Chris Michael a76eae227a ecore-drm2: Add code to setup Connector Atomic state for Outputs
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-09-22 14:20:24 -04:00