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.
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.
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
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>
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>
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>
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>
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
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.
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.
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>
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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>
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>
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>
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>
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>
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>
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.
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.
If the first output we test is disconnected but has the crtc of
the primary display assigned then we'll fail to assign the crtc
to the connector it's really connected to later.
This is a quick hack as trying to sort this out properly may be
too invasive for the upcoming 1.18 and isn't really important until
1.19 supports multihead anyway.
As it turns out, when we vt-switch Back to a running Enlightenment,
it ends up processing all outputs and causes Evas to create a giant
canvas to cover all outputs. This new canvas causes a blank screen as
the pageflipping fails (due to fb being too large). As we do not yet
support output on more an one screen anyway, temporarily disable any
output which is not marked as primary.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Previously a drm event could create a new output or disconnect an output,
but could not re-enable an existing output.
This results in failure to properly wake from screen blanker.