Commit Graph

28 Commits

Author SHA1 Message Date
Christopher Michael 10474986cc ecore-drm2: Update plane state values based on FB
Summary:
When we are trying to set an FB onto a plane, we need to update the
plane state values to reflect any changes in the FB. Failure to do
this will result in Atomic Commit failures as the plane state values
will not match what the FB is.

ref T7690

@fix

Depends on D8110

Reviewers: raster, cedric, zmike

Reviewed By: cedric

Subscribers: cedric

Tags: #efl, #do_not_merge

Maniphest Tasks: T7690

Differential Revision: https://phab.enlightenment.org/D8111
2019-03-22 12:41:08 -04:00
Derek Foreman 7d54989f9b ecore_drm2: Fix failure to properly set up new plane
Summary:
When we add a plane we need to add it to the list before doing the atomic
test to ensure we're testing new state that includes the plane, and to
ensure the next screen update includes the plane we just added.

Fix T7066

Reviewers: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7066

Differential Revision: https://phab.enlightenment.org/D6432
2018-06-26 15:28:07 -04:00
Derek Foreman 5f2d4e75ab ecore_drm2: Add callbacks for plane assign/release
E will need these to gate wayland buffer releases.
2017-06-23 08:15:41 -05:00
Derek Foreman a8c7b89cb7 ecore_drm2: Move fb from plane state struct to plane struct
The plane state struct needs the fb id for drm updates, and the plane
state can be updated even if it's pointed to by a dead plane.

Dead planes need to keep their fb so we can properly handle the fb
lifetime.
2017-06-23 08:15:41 -05:00
Derek Foreman be90b91ac1 ecore_drm2: Don't clear plane fb on release
We'll need this later for post-page flip bookkeeping, and nothing will
notice that it's not cleared now anyway.
2017-06-23 08:15:41 -05:00
Chris Michael f2a0e5ae4c ecore-drm2: Minor formatting fix
NB: No functional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-30 15:56:51 -04: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
Chris Michael af587c01cb ecore-drm2: Add start of refcounting for FB objects
Small patch which starts to implement refcounting on framebuffer
objects. This will be needed so that we do not free FB objects while
they are on the screen.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-09 11:47:04 -04:00
Derek Foreman 18af247ab2 ecore_drm2: Add checks for using a plane after death
We keep planes on the plane list to ensure a released plane is removed
from display - however this means that if a caller starts messing with
a plane after release, that it could potentially reposition a plane it
doesn't own anymore.

Use EINA_SAFETY macros to prevent this.
2017-05-05 12:53:25 -05:00
Derek Foreman c722466a60 ecore_drm2: Replace plane state release flag with plane dead flag
The release flag is actually less useful than the existing in_use flag
for determining if a plane is unused.  If a new plane is assigned before
the next flip cleans up released planes, then it can point to a released
plane state, and both it and the previous user will be freed on the next
commit, leaking a plane.

Putting the flag in the plane structure fixes this while still allowing us
to keep released planes around to ensure a recently released plane is
cleared from atomic state.
2017-05-05 12:53:25 -05:00
Derek Foreman 1071c9f3a8 ecore_drm2: Call flip test in plane release
If we don't do a flip test, the atomic state isn't updated.  This fixes
a potential problem where the last operation in state preparation is
a release - the following commit wouldn't include state from the release.
2017-05-05 12:53:25 -05:00
Derek Foreman 699ed066ea ecore_drm2: Require x and y value in plane assign
Saves us a flip test, and gaurantees that we're always testing with a
reasonable x, y and not something leftover from a previous assignment.
2017-05-05 12:53:25 -05:00
Chris Michael 0c0f525d9a ecore-drm2: Add 'release' flag for planes
As we cannot immediately remove a plane from an output, due to needing
an atomic commit to actually remove the plane from screen, we can use
a 'release' flag to indicate that a given plane needs removal from the
screen during our next atomic commit.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:24 -05:00
Chris Michael bd4ccfa0f5 ecore-drm2: Don't remove plane from output list on release
As we need to be able to commit a new plane state for any released
planes, we should not be removing them from the output list just yet.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:24 -05:00
Chris Michael 373e4b0684 ecore-drm2: Don't assign plane to output list if test fails
There is little point in assigning a plane to the output list if the
atomic flip test fails.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:24 -05:00
Derek Foreman 0aac2db93a ecore_drm2: Use stricter cursor plane size check
Unfortunately the plane sized returned from the cursor plane query isn't
a limit, it's an exact size.  Sometimes you can use a different size,
but that's completely hardware dependent - so stick to the advertised
size.
2017-05-05 12:53:24 -05:00
Derek Foreman ab8ec5ed5f ecore_drm2: Add API to update the fb for a plane 2017-05-05 12:53:23 -05:00
Derek Foreman c98a9b06c6 ecore_drm2: Rebuild atomic state from plane_destination_set
Call a test commit to rebuild the atomic_req
2017-05-05 12:53:23 -05:00
Derek Foreman 6482367aa2 ecore_drm2: Perform test flip during plane assignment
Make sure we can commit that plane at assign time so when we hook up to
the scene graph it knows when it can safely use a plane.
2017-05-05 12:53:22 -05:00
Derek Foreman ba2275b7ec ecore_drm2: Add ecore_drm2_plane_release to release planes
Opposite of plane assign.
2017-05-05 12:53:22 -05:00
Derek Foreman 014e84d8fa ecore_drm2: Store output in plane structure
This will simplify a bunch of API that would otherwise have to pass in
both output and plane - and in some cases we might not have the output
handy anyway.
2017-05-05 12:53:21 -05:00
Derek Foreman aae1c50dd3 ecore_drm2: Remove next, current, pending from plane state
These will be output state eventually
2017-05-05 12:53:21 -05:00
Derek Foreman 308a11cfd6 ecore_drm2: Assign planes in ecore_drm2_plane_assign
Don't just test, allocate the resource, and then prevent further
assignments from trying to use it as well.
2017-05-05 12:53:21 -05:00
Chris Michael e5de325e90 ecore-drm2: Remove #ifdef for HAVE_ATOMIC in plane_assign function
As there is nothing inside this function which requires any Atomic API
calls, this #ifdef can be removed and the function can then still be
used to assign Primary planes for non-atomic use cases.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Chris Michael e2a6ee29f0 ecore-drm2: Add fields to plane structure for current, next, pending
FBOs

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 9e07d37320 ecore-drm2: Add API function to set plane destination
When we do an atomic commit, we need to know where to place a given
plane (in the case of overlays) in relation to the CRTC, so provide an
API function that can be used for that purpose.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 44d5c855e0 ecore-drm2: Store plane src values on assign
As we will need the plane state source values when we do an atomic
commit, we can store them when plane_assign is called as we already
have the FBO available.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 19da4706f3 ecore-drm2: Add hardware plane functions
This patch adds a new file where we can store any additional functions
we may need to work with hardware planes. Currently the file contains
a public function that can be used to assign a given Ecore_Drm2_Fb to
a hardware plane

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00