Age | Commit message (Collapse) | Author |
|
The probe functions in intel_module.c call intel_open_device() before
calling intel_scrn_create(), but if the later fails because of e.g.
an allocation failure they were not cleaning up the resources
claimed by intel_open_device(), esp. leaking the fd is a problem
because this breaks the fallback to the modesetting driver.
This commit fixes this by adding a intel_close_device() cleanup
function and calling that when intel_scrn_create() fails.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Different OS name the i915 KMS module differently, so make it convenient
for us to be able to feed in the right name, or even just try them all
and pick the first one that exists!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We need to include <sys/mkdev.h> on Solaris.
Reported-by: Richard Palo <richard@netbsd.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89763
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
DRI3 can use render nodes if provided by the kernel, so enable it.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The executive decision has been made to render DRI2 inoperable with
render-nodes, so keep on passing the master device path to clients.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Beware the barbarians at the gate, who invade and steal your ScrnInfoPtr
and its Entity from underneath you. In some configurations, we lose
access to the struct intel_device stored on the Entity after
initialisation, causing havoc. Workaround this by storing the
intel_device that we open in our driverPrivate.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We only automount debugfs for Linux, but sys/mount.h on BSD has unmet
dependencies breaking the build.
Reported-by: Jonathan Gray <jsg@jsg.id.au>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Suggested-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Other platforms are not going to have the same debug infrastructure, nor
even the same mount(2).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we require debugging information from debugfs and we cannot find it,
silently mount it and dump the information we need.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we fail to claim the DRM device as master, dump /debugfs/.../clients
so that we can check to see who failed to drop master for us.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As root, X gets away with many things, including submitting commands to
the DRM device whilst it is no longer authorised (i.e. when it has
relinquished master to another client across a VT switch). In the
non-root future, if we attempt to use the device whilst unauthorized the
rendering will be lost and we will mark the device as unusable. So flush
our render queue to the device around a VT switch.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If the path we want to open for the KMS device is not yet available,
wait a short while and try again.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The call to GETPARAM requires either a rendernode or authorisation.
Therefore we can only assert that the fd is a valid i915 handle after
authorise() and not before.
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When probing the module, clear structs passed into unknown ioctls to
keep valgrind quiet.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
SET_MASTER and DROP_MASTER are only available to the root user. If we
are started as an ordinary user, and we are master by virtue of being
the first user of the device, never release our fd or master.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we are given an fd by the Xserver, then it is not our responsibility
to close it during CloseScreen.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Hans de Goede <hdegoede@redhat.com>
|
|
Since we already lookup the device path if we do not know it after
opening the fd, we can remove the special case along the legacy PCI
probe path.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
I hit this corner case when testing a single X server spanning both intel
gfx + an usb display link adapter driven by xf86-video-modesetting.
In this scenario the intel driver gets its platformProbe method called first,
and if it then closes the server managed fd, the xf86-video-modesetting gets
EBADFD errors.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Based on the patch by Hans de Goede, this removes the handling of
drmOpen() and DRM_MASTER from within uxa and instead uses the common
routines. This reduces the duplicate code from within uxa, and enables
new features such as server managed fds.
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we are not supplied the path, call the libdrm function to search for
the canonical name for our device.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If for some reason we have an fd, but no device path, use the likely
default path (derived from and validated against the major/minor of the
open device fd).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
In the post-modern world, the platform device nodes are handed to a
non-privileged Xserver by systemd/logind. We can then query the core for
our assigned fd rather than try to open the device for ourselves (which
would fail when trying to obtain DRM_MASTER status). A consequence is
that we then do not directly control DRM_MASTER status and must act as a
delegate of systemd.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
Allow fd_set_cloexec / fd_set_nonblock to be used outside of intel_device.c.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
O_NONBLOCK is a status flag not a descriptor flag, so F_GETFL / F_SETFL should
be used to modify it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
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>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
When computing the render node for the device, filter out the potential
control node.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
This reverts commit 42d94356f65972eb7fb8991234a4e9388c4c2031.
Ordered-by: The Management.
|
|
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>
|
|
This is essential to prevent deadlocks when running with ZaphodHeads.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|