path: root/src/lib/ecore_drm2/ecore_drm2_fb.c (unfollow)
AgeCommit message (Collapse)Author
2020-09-04ecore drm - increase timeout for flips from 0.05 to 2.0 secCarsten Haitzler (Rasterman)
so our timeout is far too agressive. we cant stay hung on buggy devices/drivers though so make the timeout 2s instead of 0.05s so we dont go retrying flips too agressively which causes stuttering @fix
2020-04-20ecore-drm2: Change ERR to WRNChristopher Michael
No real need for these to be ERR because we are not going to crash if these happen anyway.
2019-04-30ecore drm2 - fix timeout in case case called from threadCarsten Haitzler (Rasterman)
so sw rendering make call ecore drm2 calls from a thread - i didnt know that. so this makes my fix for gl hangs add hangs in sw as a result. this fixes that. not perfect but better. do need refcoutnts on outputs to be perfect... also sometimes the commits fail so retry a few times... this still leaves us wth another hang that is a separate issue. @fix
2019-04-18ecore-drm2: Fill in crtc background color (if supported) during atomicChristopher Michael
commits Small patch to add the crtc background_color property (if supported) to any atomic tests/commits @feature
2019-04-10ecore drm2 - handle possible NULL fb when doing a flipCarsten Haitzler (Rasterman)
2019-03-22ecore-drm2: Don't use AtomicAddProperty for plane rotationChristopher Michael
Summary: Apparently something has been changed recently in libdrm that causes AtomicAddProperty to fail when trying to set plane rotation. Until this can be found & fixed, let's just disable trying to rotate hardware planes with atomic commits. ref T7690 @fix Reviewers: raster, cedric, zmike Subscribers: zmike, cedric Tags: #efl, #do_not_merge Maniphest Tasks: T7690 Differential Revision:
2019-02-21ecore drm2 - work around kms/drm bug seemingly when no flip event comesCarsten Haitzler (Rasterman)
so we request a flip so we can do vsync events. the flip event never comes. i am not sure why it never comes, but we ask and nothing arrives, and this basically halts all rendering in wayland compositor mode as we are syncing rendering to vsync (of course). put in a timeout of 0.05s (50ms) to try ask again if the event never comes and log the error. this is a pretty useful workaround becauswe having your entire display freeze is a ... bad thing. @fix
2019-01-17ecore-drm2: Pass output as data to drmModePageFlip and drmModeAtomicCommitChristopher Michael
In order to support per-output ticking, the drmModePageFlip and drmModeAtomicCommit functions need to pass the actual Output as data to the pageflip callback so that the pageflip callback function can pass the proper rectangle to ecore_evas_animator_tick Differential Revision:
2019-01-02ecore-drm2: Fix drmModeSetCrtc call during fb flipChristopher Michael
drmModeSetCrtc x & y values are actually offsets into the framebuffer memory. As such, we should not be sending output position here. @fix
2019-01-02ecore-drm2: Minor formatting fixesChristopher Michael
NB: No functional changes
2017-08-09ecore_drm2: Pass Ecore_Drm2_Device instead of fd to most functionsDerek Foreman
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-07-31ecore_drm2: Stop making dumb fbs and mmapping for gbm fdsDerek Foreman
We were doing this so E could do screenshots in a hackish way, E has been fixed so this hack here no longer needs to live.
2017-06-30ecore_drm2: fix scanout_on callback firing too oftenDerek Foreman
We need to increase the on scanout count for a buffer only when the plane it's on makes its transition from pending to visible. Previously it was firing for every refresh which would break refcounting for any plane using surface that didn't change every frame.
2017-06-23ecore_drm2: Add scanout status callbacksDerek Foreman
This generates callbacks when a fb becomes scanned out on a hardware plane or when it no longer is.
2017-06-23ecore_drm2: Add Fb deleted eventDerek Foreman
2017-06-23ecore_drm2: Track number of times an fb is on scanoutDerek Foreman
The same fb can be placed in multiple hardware planes, we need to keep track of the number of planes it's on at any time so we can send events to a compositor in a later commit.
2017-06-23ecore_drm2: Track whether an Ecore_Drm2_Plane has ever been on scanoutDerek Foreman
2017-06-23ecore_drm2: Stop using the old per output release callbacksDerek Foreman
2017-06-23ecore_drm2: Update buffer release mechanism to send new status informationDerek Foreman
Begin moving internals over to the new per fb status updates.
2017-06-23ecore_drm2: Add ecore_drm2_fb_status_handler_setDerek Foreman
The old per output release handler is no longer complicated enough. In the near future we'll need to be able to tell an engine that its fb has been placed on scanout via hardware plane, or removed from a hardware plane. It's simpler to provide that information as well as release information through a single callback.
2017-06-09ecore-drm2: Remove #ifdef HAVE_ATOMIC_DRMChris Michael
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 <>
2017-06-09ecore-drm2: Fix drm_mode variables to work with static libChris Michael
As we now use static_libs/libdrm to build ecore_drm2, we need to fix how our drm_mode variables are declared so we can use them. @fix Signed-off-by: Chris Michael <>
2017-06-02ecore_drm2: Rename _release_buffer and make it private instead of staticDerek Foreman
Other files in ecore_drm2 need to release buffers too.
2017-05-30ecore-drm2: Remove useless returnChris Michael
This 'return' statement here is just useless as the code can fall through and the function will return 0 anwyay. Signed-off-by: Chris Michael <>
2017-05-17ecore_drm2: Better handle flip failure round 2Derek Foreman
If the buffer being flipped to is the one already on screen then releasing it on flip failure will leave it on scanout with no references. The next time a buffer is queued it will be removed from scanout and deleted. Not good. Fix T5462
2017-05-17ecore_drm2: Better handle flip failureDerek Foreman
We need to release the buffer we couldn't flip to when a flip fails. This makes whatever bug is causing a page flip to happen right after dpms blanks the screen, which was leading to a failure to ever wake from dpms because the flip left a pending buffer that never completed. Fix T5462
2017-05-15ecore_drm2: Clear next fb if we use itDerek Foreman
Fixes a race that's either really hard to hit if you're a developer or really easy to hit if you're a user. Thanks to ApB for the debug assistance. Fix T5484
2017-05-14ecore_drm2: Fix use after freeDerek Foreman
In trying to clean up some code and fix a hypothetical buffer leak, I added a use after free error that can break rendering on the drm and gl_drm evas engines. Coverity did the heavy lifting for me on this one. Fix Coverity CID 1375047 Fix T5484
2017-05-12ecore_drm2: Add some safety checks for accessing dead fbsDerek Foreman
Accessing an fb after discarding it is bad karma, so we should log something if it ever happens.
2017-05-12ecore_drm2: refcount fbsDerek Foreman
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-09ecore-drm2: Add start of refcounting for FB objectsChris Michael
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 <>
2017-05-09ecore_drm2: Move test for atomic_req into atomic flip pathDerek Foreman
We ended up doing an occasional atomic ioctl when we shouldn't. This should be a harmless failure, but it's also a pointless one.
2017-05-09ecore_drm2: Fix dmabuf fb destroyDerek Foreman
I missed the fact that it'd run through the existing non-gbm path on destroy, resulting in a (probably harmless) bad ioctl
2017-05-05ecore_drm2: Replace plane state release flag with plane dead flagDerek Foreman
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-05ecore_drm2: Fix flip test error handlingDerek Foreman
We need to free the atomic req if commit fails, so let's merge these failure paths and simplify code a bit.
2017-05-05ecore-drm2: Release any marked planes during atomic commitChris Michael
This patch fixes plane_state values during atomic flip test for any planes marked for release. When the fb_flip actually completes, we will remove the marked plane(s) from the output. Signed-off-by: Chris Michael <>
2017-05-05ecore-drm2: Fix formattingChris Michael
NB: No functional changes Signed-off-by: Chris Michael <>
2017-05-05ecore_drm2: Fix atomic flip with no new bufferDerek Foreman
We don't have an atomic state, so we need to create one before the flip
2017-05-05ecore_drm2: Pass user data to atomic flipDerek Foreman
We need the user_data to come back to us in the flip handler like it does in the non atomic flip.
2017-05-05ecore_drm2: Add some atomic state trackingDerek Foreman
I think we're now at the point where the two paths are merged. Still no atomic functionality because nothing assigned the primary plane, so we have no atomic state to commit. The machinery should be in place though.
2017-05-05ecore_drm2: Handle atomic state in _release_bufferDerek Foreman
Further merging of atomic and non-atomic paths
2017-05-05ecore_drm2: Make _release_buffer take a state struct instead of fbDerek Foreman
Lets us push the NULL set into _release_buffer for some clean up
2017-05-05ecore_drm2: Refactor common code from non-atomic pathDerek Foreman
We'll need to perform all this for atomic operations as well.
2017-05-05ecore_drm2: Fix typo in commentDerek Foreman
2017-05-05ecore_drm2: treat atomic flip without a req as an errorDerek Foreman
We should use the safety macro here instead of silently continuing so we can get something in the log if this happens.
2017-05-05ecore_drm2: remove fb parameter from _fb_flip()Derek Foreman
Time to start smashing the atomic and non-atomic paths together.
2017-05-05ecore_drm2: Replace output fbs with state structsDerek Foreman
next, pending, and current are going to have to deal with atomic state instead of just fbs soon
2017-05-05ecore_drm2: Move atomic state into an output state structDerek Foreman
This should make it easier to share code paths between atomic and non atomic operations.
2017-05-05ecore_drm2: Drop static from _fb_atomic_flip_test()Derek Foreman
We're going to need this one in plane assign to test commits
2017-05-05ecore_drm2: remove flip test from commit pathDerek Foreman
We'll be doing tests as we build up plane state assignment. it's too late to do anything about it if we fail here - failed tests will block plane assignment in the first place so the scene graph knows it still has to render those visual elements.