Commit Graph

25 Commits

Author SHA1 Message Date
Chris Wilson 35ea7b2dd5 intel: Silence a compiler warning (-Wshadow)
intel_device.c: In function 'intel_entity_get_devid':
intel_device.c:82:32: warning: declaration of 'index' shadows a global declaration [-Wshadow]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-17 12:55:33 +00:00
Chris Wilson 76b14a90c1 sna: Quieten a couple of valgrind warnings about unknown ioctls
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-28 20:55:41 +00:00
Chris Wilson 7284e7f48b intel: Filter out the control bit from the device minor
When computing the render node for the device, filter out the potential
control node.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-05 23:00:49 +01:00
Chris Wilson a0476ee6d0 intel: Allow opening the device only through platform information
Only fail to open the device based on the PCI address, if and only if we
do not have sufficient platform information to find the correct system
device.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-03 16:15:22 +01:00
Chris Wilson a47f8683fe intel: Handle fallback probing without match_data
One extreme fallback path through the xf86PlatformProbe results in a
call without any match data. As we have a device by this point, we can
simply do a reverse match.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-03 16:15:22 +01:00
Chris Wilson 6c157a925f intel: Remove dependence upon having PciInfo
After some probing mechanisms, we may end up with a valid device without
knowing its PCI address a priori. Having a valid device, we can just
query it for the correct device id, and can safely abort any path that
requires PCI information that we don't have. (Those paths are not valid
under such hosting anyway - if it may be required, we could reconstruct
the address.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-03 16:13:38 +01:00
Chris Wilson 58b26055f4 intel: Querying device attributes must be non-NULL
Check first for a NULL platform device before querying the attributes or
else suffer a segfault during PCI probing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-03 14:09:26 +01:00
Chris Wilson b7d5292e01 intel: Fix fallout from accident push of ODEV_ATTRIB_FD
This is WIP for passing along a hosted fd. It wasn't meant to be pushed
along with the bug fix this morning.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-03 13:38:06 +01:00
Chris Wilson 3b3a5ca603 intel: Query platform fd
Under a compositor, we wish to use the pre-authorized fd passed to us by
the host, stashed away in the platform device.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-02 18:29:38 +01:00
Chris Wilson 7978592048 intel: Pass the platform device along to the open routines
This allows us to pass along more metadata along with the platform
device in future. Currently we pass the device path, but in a hosted
environment we should be passing along the authorized fd from the host.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-10-02 18:24:47 +01:00
Chris Wilson dcf9b5ae18 intel: Compile fixes for base install of SLED11.sp3
Highlights of that distribution include xorg-xserver-1.6.5, kernel
3.0.76 and gcc-4.3.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-18 12:49:41 +01:00
Chris Wilson 0c697aee9b Revert "sna: Add XMir support"
This reverts commit 42d94356f6.

Ordered-by: The Management.
2013-09-07 08:42:26 +01:00
Chris Wilson 42d94356f6 sna: Add XMir support
With lots of updates by Christopher James Halse Rogers as he updated the
XMir API - but now supposedly frozen!

"<RAOF> ickle: I think the xmir api should be pretty much stable now,
barring people coming up with more awesome ways of doing things."

Signed-off-by: Christopher James Halse Rogers <raof@ubuntu.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-04 15:18:29 +01:00
Chris Wilson dbf5751b5b sna: Open the device non-blocking
This is essential to prevent deadlocks when running with ZaphodHeads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-31 10:35:36 +01:00
Chris Wilson 8b0d69e76c intel: Add experimental rendernode support
Render nodes allow clients full access to off-screen rendering and GPU
offload, without assuming any master responsiblities (for device and
display management). As they have a more limited interface, they can be
used in a more permissive manner.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-23 19:27:23 +01:00
Chris Wilson b6b5c3f009 intel: Disable incompatible features whilst hosted
Start adding the infrastructure to disable direct hardware access if X
is being run under a system compositor (aka "hosted").

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-09 11:46:24 +01:00
Chris Wilson 282507af8e intel: Move the validation of the KMS device into the open routine
Currently we leak the fd should we open the device node and decide that
is not a GEM/KMS kernel driver. The simplest way to perform the cleanup
upon failure is to move the checking for GEM/KMS into the device open
routine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-07-02 09:38:07 +01:00
Chris Wilson 5005bd2d52 intel: Fix failure code for reporting !drmCheckModesetingSupported
The new function returns the fd, not a Bool, so the error code must now
be -1.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-30 15:02:19 +01:00
Jonathan Gray f8738d7b4c intel: replace direct ioctl use with drm{Set, Drop}Master
Use drmSetMaster/drmDropMaster instead of calling the ioctls
directly.  Fixes compilation on OpenBSD where these ioctls
aren't defined.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2013-06-30 11:32:24 +01:00
Chris Wilson 40301e6d03 sna: Store the path used to open the device and pass to DRI
Avoid having to search the device tree once again in order to simply
recover the path we used to open the device.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-30 11:32:24 +01:00
Chris Wilson 48b5ac11a0 intel: Use fcntl to try and set CLOEXEC if the open(O_CLOEXEC) fails
As suggested by Arkadiusz Miskiewicz.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-27 21:42:13 +01:00
Chris Wilson 9b3e5c2114 intel: #ifdef O_CLOEXEC for compilation on squeeze
If the system doesn't support O_CLOEXEC, then we simply can't use it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-27 21:09:38 +01:00
Chris Wilson 98feba417c sna: Drop master when closing the screen
As we reacquire master when initialisation the next gen of the server,
to keep the reference counting consistent we need to release our master
reference on CloseScreen.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-25 18:36:59 +01:00
Chris Wilson febfd38823 intel: Use the correct errno value for reporting the drmSetVersion failure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-25 18:05:28 +01:00
Chris Wilson 7ec0378b64 sna: Only open the /dev/dri/cardX device once
Merge the device open in the main driver with the probing so that we can
open the path explicitly passed in by the PlatformProbe and keep that fd
around for the main driver and so avoid a later search.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-23 07:33:56 +01:00