aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* drm: Add CrtcGetSequence and CrtcQueueSequence IOCTLs [v2]Keith Packard2017-12-171-1/+11
| | | | | | | | | | | These provide a crtc-id based interface to get the current sequence (frame) number and to queue an event to be delivered at a specific sequence. v2: Remove FIRST_PIXEL_OUT flag. This has been removed from the proposed kernel API Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Add drmSyncobjReset & drmSyncobjSignal wrappers.Bas Nieuwenhuizen2017-12-171-0/+2
| | | | | | | anv already uses the ioctls but does not use libdrm, so these were not wrapped yet. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: add drmSyncobjWait wrapperMarek Olšák2017-10-121-0/+3
| | | | Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
* libdrm: add drm syncobj create/destroy/import/exportDave Airlie2017-06-281-0/+8
| | | | | | | These ioctls are now in drm next so add the first set of libdrm APIs. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Export drmDevicesEqualAdam Jackson2017-05-041-0/+2
| | | | | | | | | | | | | | | | drmCompareBusInfo was almost this already, but it wasn't exported, its name didn't match its functionality, and while it almost looks like it was usable for sorting due to memcmp it wouldn't work if you had multiple bus types. I don't really want to think about defining a sensible sort order for bus types, so let's at least make it less of a trap for the caller. Invert its boolean sense to be 'true if equal', rename it to describe the types it actually operates on, and export. Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Emil Velikov <emil.velilkov@collabora.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
* Add CRTC ID to vblank eventAnder Conselvan de Oliveira2017-04-061-1/+8
| | | | | | | | | | | | | | | | | | | | When using the atomic API, one request can span multiple CRTCs, however one event is generated per CRTC. As we cannot disambiguate the CRTC with user data (since we only have one piece of user data to pass in), newer kernels can include the CRTC ID in the page flip event. Add a new vfunc to dispatch vblank events carrying a CRTC ID to clients who negotiate a higher interface version. [daniels: Rebased, include new cap, call page_flip_handler if it is set but page_flip_handler2 isn't even on newer contexts, write a commit message.] v2: Split into separate commit. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
* xf86drm: Add platform and host1x bus supportThierry Reding2017-01-201-2/+28
| | | | | | | | | | | | | | | | | | | | | | | ARM SoCs usually have their DRM/KMS devices on the platform bus, so add support for that to enable these devices to be used with the drmDevice infrastructure. NVIDIA Tegra SoCs have an additional level in the hierarchy and DRM/KMS devices can also be on the host1x bus. This is mostly equivalent to the platform bus. v4: - continue on error to process platform or host1x device v3: - guard Linux-specific sysfs parsing code with #ifdef __linux__ v2: - be careful not to overflow the full name - read compatible strings into device info Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
* xf86drm: Add USB supportThierry Reding2017-01-201-0/+13
| | | | | | | | | | | | | | | | | Allow DRM/KMS devices hosted on USB to be detected by the drmDevice infrastructure. v4: - continue on error to process USB devices v3: - guard Linux-specific sysfs parsing code with #ifdef __linux__ v2: - make sysfs_uevent_get() more flexible using a format string Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
* xf86drm: introduce drmGetDevice[s]2Emil Velikov2016-12-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Relative to the original version, here one can provide a flags bitmask. Currently only DRM_DEVICE_IGNORE_PCI_REVISION is supported. Implementation detail: If it's set, we will only parse the separate sysfs files and we won't touch the config one. The latter awakes the device (causing delays) which is the core reason why this API was introduced. v2: - Initialize revision to 0xff if it's unread. - Change DRM_DEVICE_IGNORE_PCI_REVISION to DRM_DEVICE_GET_PCI_REVISION - Add explicit note that drmGetDevice[s]2 does not retrieve the revision by default. v3: - Correctly fold drmParsePciDeviceInfo() hunk in this patch. Cc: Michel Dänzer <michel@daenzer.net> Cc: Nicolai Hähnle <nhaehnle@gmail.com> Cc: Mauro Santos <registo.mailling@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502 Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
* xf86drm: introduce drmGetDeviceNameFromFd2Emil Velikov2016-11-221-0/+5
| | | | | | | | | | | | | The original version considered only card devices, while this will pick the device/node name regardless - card, control, renderD, other... Current implementation is "linux" specific, in such that it relies on sysfs/uevent file. At the same time this gives us the flexibility to support any nodes even future ones, as long as they're within DRM_MAJOR. Shamelessly copied from mesa, latter by: Gary Wong <gtw@gnu.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
* xf86drm: add drm{Get,Free}DeviceEmil Velikov2015-09-211-0/+3
| | | | | | | | | | | Similar interface to the *Devices() ones but they obtain/free the information of the opened device (as given by its fd). Note there is a fair bit of duplication between the two Get functions, and anyone interested is more than welcome to consolidate it. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
* drm: add interface to get drm devices on the system v3Emil Velikov2015-08-241-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | For mutiple GPU support, the devices on the system should be enumerated to get necessary information about each device, and the drmGetDevices interface is added for this. Currently only PCI devices are supported for the enumeration. Typical usage: int count; drmDevicePtr *foo; count = drmGetDevices(NULL, 0); foo = calloc(count, sizeof(drmDevicePtr)); count = drmGetDevices(foo, count); /* find proper device, open correct device node, etc */ drmFreeDevices(foo, count); free(foo); v2: [Jammy Zhou] - return a list of devices, rather than nodes v3: [Jammy Zhou] - fix the signed extension for PCI device info Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
* remove usage of 'c_plusplus' preprocessor macroTapani Pälli2015-08-101-2/+2
| | | | | | | Use only __cplusplus which is supported by the C++ standard. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* xf86drm: use the correct device minor names on OpenBSDJonathan Gray2015-07-291-0/+7
| | | | | | | | | | | Add defines for the device minor names and make use of them in drmGetMinorName() so the correct paths will be used on OpenBSD. v2: don't add new defines to xf86drm.h to keep them out of the API as requested by Emil. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* Revert "Add device enumeration interface (v4)"Emil Velikov2015-06-291-19/+0
| | | | | | | | | | | | | | | | | This reverts commit fde4969176822fe54197b6baa78f8b0ef900baba. The commit adds an API that does not seem flexible enough to be used in current open-source projects. Additionally it adds a hidden dependency of libudev, which when used in mesa caused grief when combined with Steam('s runtime). Let's revert this for now and add a tweaked API later on that can be used in mesa/xserver. Cc: Frank Min <frank.min@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Jammy Zhou <Jammy.Zhou@amd.com>
* Add device enumeration interface (v4)frank2015-05-261-0/+19
| | | | | | | | | | | | | Add an interface for enumerating PCI devices on a system. v3: switch to udev/sysfs for the enumeration v4: fix warnings Signed-off-by: Frank Min <frank.min@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
* drm: add drmGet(Primary|Render)DeviceNameFromFd functionsEmil Velikov2015-03-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently most places assume reliable primary(master) <> render node mapping. Although this may work in some cases, it is not correct. Add a couple of helpers that hide the details and provide the name of the master or render device name, given an fd. The latter may belong to either the master, control or render node device. v2: - Rename Device and Primary to Master (aka the /dev/dri/cardX device). - Check for the file via readdir_r() rather than stat(). - Wrap the check into a single function. - Return NULL for non-linux platforms. v3: - Don't segfault if name is NULL. - Update function names, as suggested by Frank Binns. v4: - Update commit message to reflect the function name changes. Cc: Frank Binns <frank.binns@imgtec.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com>
* Add new drmGetNodeTypeFromFd functionFrank Binns2015-02-231-0/+1
| | | | | | | Add a helper function that returns the type of device node from an fd. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* Add new drmOpenOnceWithType function (v2)Jammy Zhou2015-02-121-0/+1
| | | | | | | | v2: call drmOpenOnceWithType in drmOpenOnce, and drop unused param for drmOpenOnceWithType Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
* Add new drmOpenWithType function (v4)Jammy Zhou2015-02-121-1/+8
| | | | | | | | | | v2: Add drmGetMinorBase, and call drmOpenWithType in drmOpen v3: Pass 'type' to drmOpenByBusid and drmOpenDevice in drmOpenByName v4: Renumber node type definitions, and return -1 for unsupported type Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v3) Reviewed-by: Frank Binns <frank.binns@imgtec.com>
* Add new drmOpenRender functionFrank Binns2015-01-231-0/+2
| | | | | | | | Add a new function, drmOpenRender, that can be used to open render nodes. This can be used in the same way that drmOpenControl is used to open control nodes. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
* Mark functions printf-like where possibleThierry Reding2014-04-171-1/+1
| | | | | | | | | | These functions all take a format string and either a list of variable arguments or a va_list. Use the new DRM_PRINTFLIKE macro to tell the compiler about it so that the arguments can be checked against the format string. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Thierry Reding <treding@nvidia.com>
* Mark debug_print with __attribute__ ((format(__printf__, 1, 0)))Keith Packard2014-01-131-1/+7
| | | | | | | | the drmServerInfo member, debug_print, takes a printf format string and varargs list. Tell the compiler about it. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
* drm: Introduce a drmSetClientCap() wrapperDamien Lespiau2013-09-301-0/+2
| | | | | | | | That wraps around the new DRM_SET_CLIENT_CAP ioctl. v2: SET_CAP -> SET_CLIENT_CAP renaming Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
* libdrm: add prime fd->handle and handle->fd interfacesDave Airlie2012-07-151-0/+3
| | | | | | | | These are just basic ioctl wrappers around the prime ioctls, along with the capability reporting. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* xf86drm.h : wrap C code for C++ compilation/linkingTapani Pälli2011-09-231-0/+8
| | | | | | | | To enable usage of xf86drm.h from C++ programs/frameworks. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> [ickle: also wrap xf86drmMode.h] Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* libdrm: (revised) vblank wait on crtc > 1Ilija Hadzic2011-04-041-0/+3
| | | | | | | | | | | | | | | | | | | | | Hi Alex, Enclosed is a revised version of the patch sent on Mar 18, against the master branch of the drm userspace (i.e. libdrm). Details summarised in this thread: http://lists.freedesktop.org/archives/dri-devel/2011-March/009499.html This patch reconciles libdrm with the the kernel change that Dave pushed this morning. It *supersedes* the previously sent patch (i.e. apply it to the master branch as it exists at the time of this writing, not as an incremental patch to the one sent previously). Regards, Ilija Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com> Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
* Implement drmGetCap() to query device/driver capabilitiesBen Skeggs2011-03-031-0/+1
| | | | Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
* Bump event context structure version for page flippingJesse Barnes2009-12-031-1/+1
|
* Merge branch 'pageflip' of git://people.freedesktop.org/~jbarnes/drmJesse Barnes2009-12-031-0/+6
| | | | | Conflicts: include/drm/drm.h - RMFB had its signature changed to avoid uint32_t
* Correctly set DRM_MAX_MINOR for all platforms.Robert Noland2009-11-251-2/+4
| | | | | DRM_MAJOR is platform specific, but not used outside of xf86drm.c that I can find.
* Add missing DRM_MAX_MINOR defineAlex Deucher2009-11-241-0/+1
| | | | | | lost in 500f5b524000ed5930301f4303744cb4c0a19b75 Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
* Add drmGetDeviceNameFromFd functionKristian Høgsberg2009-11-231-0/+2
| | | | Determines the /dev filename of the drm fd argument.
* Fix build on *BSDKristian Høgsberg2009-11-231-0/+22
| | | | | | This adds a minimal #ifdef clause to drm.h that we'll push upstream. Once that goes in we can share drm.h between linux, libdrm, and the bsd's.
* Move libdrm/ up one levelKristian Høgsberg2009-11-171-0/+689