summaryrefslogtreecommitdiff
path: root/xf86drmMode.h
Commit message (Collapse)AuthorAgeFilesLines
* xf86drmMode: add helpers for dumb buffersSimon Ser2022-10-271-0/+32
| | | | | | | | | | | Up until now, DRM clients had to hand-roll their code to create, destroy and map dumb buffers. This is slightly inconvenient, a bit error-prone, and not easily discoverable. Introduce wrappers for these operations, just like we have for other KMS IOCTLs. Signed-off-by: Simon Ser <contact@emersion.fr>
* xf86drmMode: introduce drmModeConnectorGetPossibleCrtcsSimon Ser2022-07-021-0/+13
| | | | | | | | | | | | Nowadays, users don't really care about encoders except for retrieving the list of CRTCs compatible with a connector. Introduce a new function so that users no longer need to deal with encoders. This is a re-do of [1], but with a slightly different API. Signed-off-by: Simon Ser <contact@emersion.fr> [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/102
* xf86drmMode: introduce drmModeGetConnectorTypeNameSimon Ser2022-07-021-0/+9
| | | | | | | | | | | | | | User-space often needs to print the name of a connector type. When a new connector type is added, all user-space programs need to be updated to support the new connector type. Expose a function to get a connector type name in libdrm. The names are taken from the kernel [1]. [1]: https://cgit.freedesktop.org/drm/drm/tree/drivers/gpu/drm/drm_connector.c?h=4fc8cb47fcfdc93e274a1291757e478df4f9c39b#n83 Signed-off-by: Simon Ser <contact@emersion.fr>
* xf86drmMode: constify drmModeAtomicReq functionsSimon Ser2022-06-091-4/+4
| | | | | | | | | This acts as an additional ABI guarantee, and improves documentation for users. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
* xf86drm: add iterator API for DRM/KMS IN_FORMATS blobsLuigi Santivetti2021-11-081-0/+9
| | | | | | | | | | | | | Add support for parsing IN_FORMATS property blobs. Providing libdrm with this functionality helps to standardise how user-space reads kernel blobs and decreases duplication on the client side. drmModeFormatModifierBlobIterNext() allows the caller to view formats and associated modifiers given a valid property blob. An example is available inside the libdrm unit test, modetest.c. Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com> Reviewed-by: Simon Ser <contact@emersion.fr>
* xf86drmMode: simplify drm_property_type_isSimon Ser2021-09-271-8/+5
| | | | | | | | | | | | No need to have two branches depending on DRM_MODE_PROP_EXTENDED_TYPE. We can just use drmModeGetPropertyType instead. This does introduce a slight change: previously, drm_property_type_is() could be called with non-type flags such as IMMUTABLE. However no user seems to do this (checked KWin/Mutter/Sway/Weston/Xorg). Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* xf86drmMode: switch to standard inline qualifierSimon Ser2021-09-271-1/+1
| | | | | | | __inline is non-standard, inline is. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* xf86drmMode: make drm_property_type_is arg constSimon Ser2021-09-271-1/+1
| | | | | | | | This function only needs read-only access to the property. This is not a breaking ABI change. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* xf86drmMode: introduce drmModeGetPropertyTypeSimon Ser2021-03-311-0/+5
| | | | | | | | | We already have drm_property_type_is, but it's needlessly complicated and doesn't cover all use-cases (requires the caller to provide a type). Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* xf86drmMode: add drmIsKMSSimon Ser2021-02-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | If a device has a primary node, it doesn't necessarily mean it's suitable for KMS usage. For instance, render-only drivers also expose primary nodes. The check is extracted from Weston [1]. The motivation for this new function is two-fold: - Avoid an unnecessary GETRESOURCES call. To check whether a primary node is suitable for KMS, we don't actually need to retrieve the object IDs we just need to check the counts. - Avoid confusion in user-space and make sure user-space implements the check properly. For instance, wlroots doesn't [2]: it uses drmGetVersion which succeeds with render-only drivers. [1]: https://gitlab.freedesktop.org/wayland/weston/-/blob/master/libweston/backend-drm/drm.c#L2689 [2]: https://github.com/swaywm/wlroots/blob/a290d7a78dc36275e24e54f84570f37a66dc67a4/backend/session/session.c#L268 Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* Remove outdated comments about stdint.hSimon Ser2021-01-111-3/+0
| | | | | | | | We include stdint.h unconditionally in the header. We don't require users to include it manually before xf86drmMode.h. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* Remove definitions duplicated from drm_mode.hSimon Ser2021-01-111-115/+1
| | | | | | | | | | | | | I don't exactly know why these were duplicated before. Maybe libdrm didn't always vendored drm_mode.h from the kernel? In any case, we now do, so instead of having copy-pasted definitions, just include our vendored version which cannot be outdated. Contrary to what the comment says, drm.h doesn't include drm_mode.h, so we need to add the include. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* xf86drmMode.h: use ANSI C99 arraysSimon Ser2020-12-101-2/+2
| | | | | | | | | | This avoids the use of a GNU-specific extension in public headers. Also see [1]. [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/80#note_707458 Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* Document drmModeConnectionSimon Ser2020-12-101-0/+12
| | | | Signed-off-by: Simon Ser <contact@emersion.fr>
* Add DRM_MODE_CONNECTOR_WRITEBACK to xf86drmMode.hDaniel Stone2020-03-171-0/+1
| | | | | | | | | xf86drmMode.h currently duplicates the connector-type definitions from drm_mode.h. Add DRM_MODE_CONNECTOR_WRITEBACK, which is only visible through a client cap, from drm_mode.h. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
* Add drmModeGetFB2Daniel Stone2020-02-121-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a wrapper around the getfb2 ioctl, which returns extended framebuffer information mirroring addfb2, including multiple planes and modifiers. Changes since v7: - add new symbols to core-symbol.txt (Eric Engestrom) Changes since v5: - style change Changes since v4: - Set fb_id at init instead of memclear() and set (Eric Engestrom) Changes since v3: - remove unnecessary null check in drmModeFreeFB2 (Daniel Stone) Changes since v2: - getfb2 ioctl has been merged upstream - sync include/drm/drm.h in a seperate patch Changes since v1: - functions should be drm_public - modifier should be 64 bits - update ioctl number Signed-off-by: Juston Li <juston.li@intel.com> Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch>
* Fix missing stdlib includes in xf86drmMode.hSimon Ser2019-11-121-0/+2
| | | | | | | | | Including xf86drmMode.h results in undefined references to uint32_t and ssize_t. Include the stdlib headers that define them to allow the file to be included without xf86drm.h. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
* fix various typosEric Engestrom2019-04-171-5/+5
| | | | | | | | | | | Saw a couple of typos fixes in the patch DragonFlyBSD carries [1], so I ran codespell (a spell checker for code) on the whole repo. [1] https://github.com/DragonFlyBSD/DPorts/blob/master/graphics/libdrm/files/patch-xf86drm.c Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* drm: Add drm mode lease ioctl wrappers [v3]Keith Packard2017-12-181-0/+22
| | | | | | | | | | | | | | | | | drmModeCreateLease drmModeListLessees drmModeGetLease drmModeRevokeLease Changes for v2: Remove lessee id from GetLease Remove lessor_id from ListLeases Add revoke Renumber to track kernel rebase on drm-next Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* Add const qualifier to arguments of drmModeAddFB2()Tobias Jakobi2017-10-201-5/+6
| | | | | | | | | | Both drmModeAddFB2() and drmModeAddFB2WithModifiers() have some arguments that are just pointers to uint32_t in disguise. These are not modified (just copied) in the function, so we can add a const qualifier here. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
* xf86drmMode.h: Add DisplayPort MST and DPI encoders/connectorsThierry Reding2017-01-181-0/+3
| | | | | | | | | | | This brings xf86drmMode.h in sync with include/drm/drm_mode.h. Eventually we really should only have a single set of definitions rather than duplicating this in two files. v2: add DPI encoder and connector types introduced in Linux v4.7 Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
* xf86drmMode.h: Use consistent paddingThierry Reding2017-01-181-8/+8
| | | | | Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
* Add drmModePageFlipTargetMichel Dänzer2016-10-191-0/+3
| | | | | | It supports the DRM_MODE_PAGE_FLIP_TARGET_* flags. Acked-by: Daniel Vetter <daniel@ffwll.ch>
* Add drmModeAddFB2WithModifiers() which takes format modifiersKristian H. Kristensen2016-09-281-0/+7
| | | | | | | | The only other user of this feature open codes the ioctl. Let's add an entry point for this to libdrm. Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org> Reviewed-by: Rob Clark <robdclark@gmail.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>
* Add blob property create/destroy ioctl wrappersDaniel Stone2015-06-291-0/+5
| | | | | | | v2: Use memclear to zero out structure. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Rob Clark <robclark@freedesktop.org>
* Support atomic modesetting ioctlVille Syrjälä2015-06-291-0/+19
| | | | | | | | | | | | | | | | | Add support for the atomic modesetting ioctl through a property-set API. v1: Squashed intermediate patches from Ville, Rob and myself. Updated for current kernel interface (no blobs). v2: Rewrite user-facing API to provide transactional/cursor interface. Use memclear to zero out ioctl. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Rob Clark <robclark@freedesktop.org> Signed-off-by: Daniel Stone <daniels@collabora.com> v3 [Emil Velikov]: Remove DRM_CAP_ATOMIC - superseded by DRM_CLIENT_CAP_ATOMIC. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* mode: Retrieve only the current information for a ConnectorChris Wilson2015-04-141-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a new API that allows the caller to skip any forced probing, which may require slow i2c to a remote display, and only report the currently active mode and encoder for a Connector. This is often the information of interest and is much, much faster than re-retrieving the link status and EDIDs, e.g. if the caller only wishes to count the number of active outputs. v2: Fix error path to avoid double free after a failed GETCONNECTOR ioctl. v3: Daniel strongly disapproved of my disjoint in behaviour between GetConnector and GetConnectorCurrent, and considering how best to make a drop in replacement for drmmode_output_init() convinced me keeping the API as consistent as possible was the right approach. v4: Avoid probing on the second calls to GETCONNECTOR for unconnected outputs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Cc: David Herrmann <dh.herrmann@googlemail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* xf86drmMode.h: inline -> __inline for use with gcc -std=c89 -pedanticDaniel Kurtz2015-04-051-1/+1
| | | | | | | | | | Unfortunately, there are some users of libdrm installed headers that like to be built with -std=c89 -pedantic, which does not like "inline". However, __inline works. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* update signed/object prop typesRob Clark2014-11-241-0/+9
| | | | Signed-off-by: Rob Clark <robclark@freedesktop.org>
* drm: Add universal plane capability bit and plane type enumsMatt Roper2014-05-191-0/+4
| | | | | Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Rob Clark <robclark@freedesktop.org>
* Use signed location for drmModeSetPlaneDaniel Kurtz2014-05-011-1/+1
| | | | | | | | | | | DRM_IOCTL_MODE_SETPLANE crtc_x, crtc_y are s32. This is to allow a destination location that is partially off screen. Make this more obvious to users of libdrm by using signed crtc_x/_y parameters for drmModeSetPlane() as well. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
* libdrm/mode: Update the encoder and connector definesThomas Hellstrom2013-11-191-0/+5
| | | | | | | Update the defines to match the kernel drm_mode.h Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
* drm: Synchronize the stereo 3D mode flags from the kernel headersDamien Lespiau2013-09-301-14/+24
| | | | | | v2: stereo layouts are now an enum (Daniel Vetter) Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
* libdrm: Make some drm headers compatible with gcc -std=c89 -pedanticDaniel Kurtz2013-09-221-2/+2
| | | | | | | | | | | | | | The following minor changes were needed to these headers: * Convert // comments to /* */ * No , after final member of enum With these changes, these header files can be included by a program that is built with gcc options: -std=c89 -Werror -pedantic Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
* drm: add hotspot cursor interface support.Dave Airlie2013-07-021-0/+1
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* Add support for generic object properties IOCTLsPaulo Zanoni2012-06-081-0/+14
| | | | | | | | | | | New library calls: - drmModeObjectGetProperties - drmModeFreeObjectProperties - drmModeObjectSetProperties Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com> Reviewed-by: Rob Clark <rob@ti.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
* xf86drmMode.h: Add header protectionDavid Herrman2012-03-091-0/+5
| | | | | | | | xf86drmMode.h is missing a header protection. xf86drm.h has one so just copy it and adjust the name. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
* This function was missing.Ville Syrjälä2012-02-021-0/+1
| | | | Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
* libdrm: update drm headers from kernel, including new overlay ioctls & structsJesse Barnes2011-12-131-0/+33
| | | | | | | | Add structs and functions necessary for the new plane and fb handling code, including a new header, drm_fourcc.h, that includes the surface formats supported by various DRM drivers. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
* 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>
* tests: vrefresh is actually not * 1000.Marcin Kościelnicki2010-02-281-1/+1
|
* drm: a some new connector types from the kernelAlex Deucher2010-02-101-0/+2
| | | | | | Add eDP (embedded displayport) and generic TV Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
* Merge branch 'modesetting-dirty-libdrm'Jakob Bornecrantz2009-12-021-0/+20
|\ | | | | | | | | Conflicts: include/drm/drm.h
| * Bring dirty code from old branchJakob Bornecrantz2009-11-261-0/+20
| |
* | Merge branch 'pageflip' of git://people.freedesktop.org/~jbarnes/drmJesse Barnes2009-12-031-0/+2
|/ | | | | Conflicts: include/drm/drm.h - RMFB had its signature changed to avoid uint32_t
* Move libdrm/ up one levelKristian Høgsberg2009-11-171-0/+364