Commit Graph

64 Commits

Author SHA1 Message Date
Christopher Michael d09664e20e ecore-drm2: Add background_color to crtc atomic properties
This patch adds a new field to the crtc atomic state which will be
used to support crtc background_color property, and also fills in that
state during crtc atomic state fill.

@feature
2019-04-18 07:21:39 -04:00
Christopher Michael 8e0c4d83ed ecore-drm2: Make atomic property values support uint64_t
Some Atomic property values are actually uint64_t, so fix the
structure to reflect that.

@fix
2019-04-18 07:21:39 -04:00
Christopher Michael 9c08fe29d4 ecore-drm2: Set output rotation value
Summary:
When we call ecore_drm2_output_rotation_set we need to store that
value in the Output structure so that it can be checked later when
needed.

ref T7690

Depends on D8112

Reviewers: raster, cedric, zmike

Reviewed By: cedric

Subscribers: cedric

Tags: #efl, #do_not_merge

Maniphest Tasks: T7690

Differential Revision: https://phab.enlightenment.org/D8113
2019-03-22 12:41:17 -04:00
Carsten Haitzler 39f224b3a6 ecore drm2 - work around kms/drm bug seemingly when no flip event comes
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-02-21 09:52:31 +00:00
Chris Michael fc4f66c6c2 ecore-drm2: Add API to get/set which output is relative to another
In order to know which output we should clone, we need a way to
store/retrieve the output which should be cloned. This patch adds a
small api we can use in randr config dialog to get/set that value.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-27 09:16:00 -05:00
Chris Michael a78dc2d816 ecore-drm2: Add API functions to get/set output relative mode
These API functions will be used inside Enlightenment in order to
determine the proper extended screen size based on outputs relative
position.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-02-13 11:44:11 -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 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 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 69181cc9e8 ecore_drm2: Track number of times an fb is on scanout
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-23 08:15:41 -05:00
Derek Foreman bc8b11bd78 ecore_drm2: Track whether an Ecore_Drm2_Plane has ever been on scanout 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 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
Derek Foreman a3eed7865a ecore_drm2: Add ecore_drm2_fb_status_handler_set
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-23 08:15:40 -05: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 6e37d13a1c ecore-drm2: Use static libdrm to build ecore-drm2
As we will now use static_libs/libdrm to build ecore_drm2, we no
longer need to include the copied code from the libdrm headers so
remove all of the copied code from our source files.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-09 13:48:55 -04:00
Chris Michael 0dc439abbc ecore-drm2: Fix output backlight value type definitions
When we go to set output backlight level we use doubles, so lets just
store these values as doubles in the structure.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-06 10:44:55 -04:00
Derek Foreman df0595ebc0 ecore_drm2: Rename _release_buffer and make it private instead of static
Other files in ecore_drm2 need to release buffers too.
2017-06-02 15:50:08 -05:00
Mike Blumenkrantz ed4e54ebe2 wayland/drm: create evas_devices and add device pointer to input events
this is still semi-broken if a seat has many pointer-ish type devices since
pointer devices in ecore-evas were never correctly implemented to be 1:1 with
seat:cursor relationships

@feature
2017-05-26 16:27:43 -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 8067b0146a ecore_drm2: Fix dmabuf fb destroy
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-09 10:34:33 -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
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
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
Derek Foreman 8d42d7d50a ecore_drm2: Drop static from _fb_atomic_flip_test()
We're going to need this one in plane assign to test commits
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 03cb02fa74 ecore-drm2: Remove newly added atomic API functions
As we need to do atomic commits on a per-output basis, these 2 newly
added API functions can go because these functions did one atomic
commit for all outputs

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Chris Michael e1b26f6320 ecore-drm2: Enable reuse of existing state structures for non-atomic
As there is nothing 'atomic' specific in these structures, we can move
them outside the atomic ifdef and make use of them for handling
pageflip for both atomic and non-atomic use cases.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-05-05 12:53:20 -05:00
Chris Michael c4b22eb59c ecore-drm2: Iterate plane formats properly
This patch addresses an issue where plane formats were not being
properly copied into our Plane State structure and causing any usage
of our atomic code paths to crash and burn

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-19 14:58:11 -04: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 9d5c76e0d5 ecore-drm2: Add library symlink to merge atomic commit requests
Small commit to symlink to drmModeAtomicMerge function so we can use
that for atomic commit tests.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04: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 9dbf54e2f6 ecore-drm2: Move defines for CAP_CURSOR sizes to private header
As we may need these defines in other files, move them to the private
header so there is access to them.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 205c829a11 ecore-drm2: Store cursor size on device
As we will need these values later to determine if an FBO can go onto
the cursor plane, we should store this in the device structure to
avoid having to refetch them later.

@fix

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 4f8f41299f ecore-drm2: Add support for plane formats
Small patch to store supported formats on a given plane state. This
will be used for assigning dmabuf clients to a hardware plane based on
size and supported format.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Chris Michael 43104a7268 ecore-drm2: Add opaque structure to represent a hardware plane
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-04-18 07:55:10 -04:00
Derek Foreman 61f40d58f7 ecore_drm2: Add ecore_drm2_fb_dmabuf_import
Imports a set of dmabuf buffers as a single Ecore_Drm2_Fb
2017-04-18 07:55:10 -04:00
Derek Foreman f0fc86516d ecore_drm2: store 4 handles, strides, and planes
We're going to support multi-planar formats soon.

It'll be great, you'll love it.
2017-04-18 07:55:10 -04:00
Derek Foreman 45e173d186 ecore_drm2: Use library function instead of ioctl for addfb2
Minor clean up.
2017-04-18 07:55:10 -04:00
Chris Michael 1a3bae8133 ecore-drm2: Remove unused field in Output structure
The 'planes' field in Ecore_Drm2_Output structure is unused and can
thus be removed here.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-24 08:54:52 -04:00
Chris Michael f32268ad1b ecore-drm2: Expose Ecore_Drm2_Rotation enum
As we will need these values when doing rotation checks inside wl_drm
module (for randr rotation support), let's move them out of the
private header and expose them in Ecore_Drm2.h

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-18 10:06:20 -05:00
Chris Michael 7c829d1669 ecore-drm2: Minor formatting fix
NB: No functional changes, just formatting

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-01-18 10:05:13 -05:00
Chris Michael 4b4201584f ecore-drm2: Add symlink to gamma setting function
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-29 09:14:31 -05:00
Chris Michael f5a5a9df44 ecore-drm2: Remove unused structure
As we don't ever use drmVersionBroken structure in this code, remove it

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-11-15 09:14:50 -05:00