Commit Graph

121 Commits

Author SHA1 Message Date
Elyes HAOUAS 1fd0435f21 Get rid of trailing whitespaces (4 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12002
2020-06-23 10:29:14 +02:00
Stefan Schmidt 2e6323b3d4 ecore_drm: check return of drmModeSetCrtc()
Report if we fail to reset the Crtc during output free. Only print an
error and keep going with the rest of the output free.

CID: 1402668

Reviewed-by: Christopher Michael <devilhorns@comcast.net>
Differential Revision: https://phab.enlightenment.org/D11965
2020-06-10 17:38:55 +02:00
Chris Michael d40cd1dab2 ecore-drm: Fix potential segfault when setting output mode
If a NULL mode is passed into ecore_drm_output_mode_set, then we try
to disable the given output. If disabling the output fails, we were
trying to print an ERR message which tried to access the NULL mode.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-05-10 11:28:26 -04:00
Derek Foreman 1460321b12 ecore_drm: Fix off by 1000 in output rate calculation
This results in wayland wl_output modes having their refresh rates
1000x too high, which has the magical effect of making some native
Qt apps fail with a GTK error when Xwayland crashes on 32-bit systems.

@fix
Fixes T3587
2016-05-06 15:43:47 -05:00
Chris Michael acc1a5dcc0 ecore-drm: Don't leak object properties
When fetching possible planes for an output, we end up leaking object
properties here as these were never freed.

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-04-13 12:55:59 -04:00
Chris Michael d4307e3494 ecore-drm: Don't re-include config.h
As ecore_drm_private.h already includes config.h header, we don't need
to include it here in these files also

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-09 08:27:05 -05:00
Chris Michael 2dbe2732a2 ecore-drm: Update copyright notice
As portions of this code have been derived from existing code in
Weston, we should also be including their copyright/licence text to
give credit.

NB: Fixes T3286

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-03-09 08:22:22 -05:00
Derek Foreman fbf8ee656c ecore_drm: Check list presence by NULL test instead of counting
a count of < 1 will just be a NULL pointer, and a count of > 0 will
be non NULL, so we can simplify these conditionals.
2016-02-18 15:50:16 -05:00
Duna Oh 5ae5aade0a ecore-drm: Make ecore_drm_output_rotation_set fail properly
When trying to set a rotation on a given output, we would previously
always be returning EINA_TRUE. We should be returning EINA_FALSE when
the rotation_set fails.

@fix

Summary: ecore_drm_output_rotation_set should be returning EINA_FALSE when the output doesn't have a plane of requested type.

Test Plan:
1. call ecore_drm_output_rotation_set() with ECORE_DRM_PLANE_TYPE_CURSOR
2. If output doesn't have a plane of ECORE_DRM_PLANE_TYPE_CURSOR, the for statement does nothing. But return value is TRUE;

Reviewers: raster, stefan_schmidt, gwanglim, devilhorns, zmike

Subscribers: input.hacker, cedric, JHyun, ManMower, jpeg

Differential Revision: https://phab.enlightenment.org/D3678
2016-02-15 08:46:08 -05:00
Chris Michael 497a287f07 This should not have been pushed. Revert
Revert "ecore-drm: Add API functions for rotation support"

This reverts commit b8ceaf0d40.
2016-02-04 09:44:45 -05:00
Chris Michael b8ceaf0d40 ecore-drm: Add API functions for rotation support
This adds 2 new API functions for getting supported rotations of an
output, and for setting rotation on an output

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-02-04 09:36:33 -05:00
Chris Michael 3ed4b3e6fd ecore-drm: Add internal function to create planes for an output
This patch adds an internal function that we use during output
creation in order to create the planes necessary and get the supported
rotation values for an output

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-02-04 09:27:40 -05:00
Chris Michael 26eefa970f ecore-drm: Add API function to set rotation on an output
This patch adds an API function to allow the Screen Setup dialog in
Enlightenment to support setting rotations on an output when running
under drm

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-02-04 09:27:40 -05:00
Chris Michael bb774a538e ecore-drm: Add API function to get supported rotations from an output
This patch adds an API function so that we can get the supported
rotations from an output. This is needed so that the Screen Setup
dialog in Enlightenment can list the rotations supported for the user
to choose from while running using drm

@feature

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-02-04 09:27:38 -05:00
Derek Foreman 943f2df006 ecore_drm/ecore_wl2: logging: remove errant usage of %m
Summary:
printf %m stringifies and prints errno.  I've tried to remove its use
anywhere that the immediately preceding function might not set errno
or is a complicated function for which knowing errno doesn't really
give any useful information.

I've left a few of the drmMode calls because they're just wrappers
around ioctl, which legitimately sets errno.

@fix

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3572
2016-01-14 13:06:02 -05:00
Chris Michael 1d981756b9 ecore-drm: Fix setting proper output subpixel value
Summary: This adds a minor internal function to convert
DRM_MODE_SUBPIXEL values into something that the wayland protocol
supports.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-23 11:11:29 -04:00
Chris Michael c6b997eb17 ecore-drm: Fix issue of outputs not getting registered with the wayland registry
Summary: This fixes T2465: QT5 apps don't work. The issue here is that
when the randr code runs in E we make calls to
ecore_drm_output_enable/disable which is supposed to register the
outputs with the wayland registry. This was not happening due to the
enable/disabled checks at the top of these functions.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-23 11:11:29 -04:00
Chris Michael 6407b8a820 ecore-drm: Don't free an output on unplug
Summary: We should not be freeing an output when it gets unplugged (as
it may get replugged). Just disable rendering on that output

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-05 10:00:45 -04:00
Chris Michael 354fd6f67b ecore-drm: Don't crash when trying to disable an output
Summary: If we call these functions with an already disabled output,
we crash. Check for an output being 'enabled' before we make these
calls.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-06-05 10:00:44 -04:00
Chris Michael 8a4922132f ecore-drm: Remove call to set drm mode when creating an output
Summary: As it turns out, we don't need to make the call to set an
output mode during creation. The mode will end up getting set anyway
when we set the first buffer.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-21 10:51:29 -04:00
Chris Michael dcc73c8f9a ecore-drm: Only try to set the crtc mode if an output is connected
Summary: If an output is disconnected, then we should not be trying to
set the mode of it's CRTC as that is going to fail anyway.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-18 10:15:09 -04:00
Chris Michael 066ca5ffdd ecore-drm: Ignore output enabled flag when setting output mode
Summary: We really do not need to check the enable flag here because
if we are setting a valid mode, then we will be enabled anyway

NB: This makes it actually possible to Enable/Disable outputs in the
RandR config dialog of E-Wl ;)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-14 09:17:02 -04:00
Chris Michael eaf2b91a3d ecore-drm: Fix segfault if sending output event and output has no current mode
Summary: This fixes a segfault which could happen if we enable an
output before setting the output current mode. Now we test for an
output having a current_mode, and if not we use the crtc size when
sending the output event.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-14 08:36:57 -04:00
Chris Michael bcf3b442dd ecore-drm: Add API function to set a new mode on an output
Summary: This adds a new API function (ecore_drm_output_mode_set) that
we can use from within RandR code to set the resolution of an output
(or disable an output if NULL is passed in).

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 14:42:15 -04:00
Chris Michael d9b59f34d2 ecore-drm: Fix issue with output_current_resolution_get function
Summary: This fixes ecore_drm_output_current_resolution_get function
to properly operate if an output does not have a current mode assigned.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 14:42:15 -04:00
Chris Michael 7d5d06bb20 ecore-drm: Only send output events when we enable/disable an output
Summary: This reduces the number of output events that wl_drm module
will receive from ecore-drm. We now only send those events when an
output gets enabled/disabled where previously we were also sending
them during output creation.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 14:42:15 -04:00
Chris Michael 3aaa9f2f9f ecore-drm: Fix purpose of ecore_drm_output_enable/disable functions
Summary: These API functions should be used for enable/disable of a
given output. They were previously being misused to stop/start
rendering on an output when we VT switch away so now we add an
internal function we can call to disable/enable rendering.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-13 14:42:03 -04:00
Chris Michael 4073519cac ecore-drm: Skip not connected outputs when calculating geometry
Summary: When we make a call to get the geometry of all outputs, we
should be skipping ones which are not connected.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-12 12:07:31 -04:00
Chris Michael 723c24de31 ecore-drm: Fix finding possible crtcs
Summary: This fixes an issue when searching for possible crtcs that an
output can work on. Previously, we would end up not returning any
possible crtcs due to not looping the crtcs of the resource.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-12 12:07:31 -04:00
Chris Michael e577a108cf ecore-drm: Add a 'name' field to Ecore_Drm_Event_Output
Summary: This adds a new 'name' field to the Ecore_Drm_Event_Output
structure so that when we catch drm output events in E, we can compare
this name to find an e_randr screen and update compositor's outputs.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-12 12:07:31 -04:00
Chris Michael df28c380d3 ecore-drm: Fix ecore_drm_output_edid_get to return a hex string
Summary: As we will use the edid string inside RandR code to store
unique information about an output, we should be returning this edid
in a "readable" form.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-12 12:07:31 -04:00
Chris Michael 956eb9318b ecore-drm: Fix issue of edid parsing not ignoring string
Summary: When we are parsing the edid string, if the string is random
junk, then we need to ignore it. Prior to this commit, we were not
setting the returned text properly.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-12 12:07:31 -04:00
Chris Michael 8a3441dfe9 ecore-drm: Add API function to test if an output can go on a given crtc
Summary: This adds a new API function to test if a given
Ecore_Drm_Output can be used on a given crtc. This is needed for DRM
RandR support

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-12 08:57:47 -04:00
Chris Michael 958b15c207 ecore-drm: Add new API function to mark an output as primary
Summary: This adds a new API function which we can use to mark a given
Ecore_Drm_Output as being the primary output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 49de7d0ee8 ecore-drm: Add API function to get an output's crtc size
Summary: This adds a new API function to return an output's crtc size.
This is mainly used for drm RandR config in E

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 8120cdcc13 ecore-drm: Add API function to return primary output
Summary: This adds a new API function to return the output which is
marked as the primary output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 94adf30b93 ecore-drm: Add support for a Primary Output
Summary: As 'primary' output support is not implemented in hardware,
we need to support this feature via software. For now, the first
output returned via libdrm will be marked as 'primary' until user
changes it via config

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 7df68b484b ecore-drm: Cleanup plane debug output
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael e8754ee9d2 ecore-drm: Set output connected property in the creation function
Summary: Makes more sense to set the output's connected property
inside the function which creates outputs.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 0341d08831 ecore-drm: Add some debug code to spit out planes and plane properties
Summary: This adds a debug function to spit out planes and their
properties while debugging rotation support

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 1ab4975491 ecore-drm: Add API function to return output modes
Summary: This adds a new API function to return a list of modes
supported on a given output

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 34664306a9 ecore-drm: Add API function to return the edid of a given output
Summary: This adds a new API function to return the EDID string of a
given output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 130ad6d60f ecore-drm: Add API function to return if a given output has a backlight
Summary: This adds a new API function to call so we can check if a
given Ecore_Drm_Output has a backlight

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 4d2290847f ecore-drm: Add API function to return the connector type of a given output
Summary: This adds a new API function to return the connector type of
an Ecore_Drm_Output

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:46 -04:00
Chris Michael 3aee7d1b6f ecore-drm: Add connector type to output structure
Summary: This adds a connector type field to the Output structure.
This will be used in the Enlightenment Drm rendering code for RandR
config

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:45 -04:00
Chris Michael c4461ac5d8 ecore-drm: Add API function to return output connected state
Summary: This adds a new API function to check if a given output is connected or not.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:45 -04:00
Chris Michael 2606735b39 ecore-drm: Add API function to return the name of an output
Summary: This adds a new API function to turn the name of a given Ecore_Drm_Output.

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-05-07 14:39:45 -04:00
Mike Blumenkrantz 3d71a10891 ecore-drm: add safety checks to all EAPI functions 2015-04-24 12:53:01 -04:00
Mike Blumenkrantz e95488ded5 ecore-drm: refactor _ecore_drm_output_backlight_init() to use fewer gotos 2015-04-23 13:21:32 -04:00
Mike Blumenkrantz e6ed330dce ecore-drm: use eeze_udev_find_by_filter() to only return relevant backlight devices 2015-04-23 13:17:25 -04:00