aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* libdrm: reduce number of reallocations in drmModeAtomicAddPropertyAdrian Salido2018-07-181-3/+4
|\ | | | | | | | | | | am: c5371788ed Change-Id: I3815cd86f4bdc41b5c7553e9ca237d8cc8cfd88f
| * libdrm: reduce number of reallocations in drmModeAtomicAddPropertyAdrian Salido2018-07-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | When calling drmModeAtomicAddProperty allocation of memory happens as needed in increments of 16 elements. This can be very slow if there are multiple properties to be updated in an Atomic Commit call. Increase this to as many as can fit in a memory PAGE to avoid having to reallocate memory too often. Bug: 111047515 Change-Id: I043db1e7608b0a606adf1a6e468c90734372f363
| * Merge tag libdrm-2.4.75 into aosp/masterRichard Yoo2017-05-091-10/+42
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Below is a brief summary of patches pulled in: 0da99b8a (m/master, aosp/master) Move libdrm.so to vendor partition d4b83443 (tag: libdrm-2.4.75) Bump version for 2.4.75 release dae413e4 (tag: libdrm-2.4.74) Bump version for release 317bdff1 (tag: libdrm-2.4.73) Bump version for release 8cf43127 (tag: libdrm-2.4.72) Bump version for release a44c9c31 (tag: libdrm-2.4.71) Bump version for release 20208455 (tag: android-o-preview-1, tag: android-n-mr2-preview-2, tag: android-n-mr2-preview-1, aosp/sdk-release, aosp/o-preview) add a flag control that private libdrm can be chosen Bug: 35871718 Test: aosp_arm-eng compiles Change-Id: I81985fd41d5c0d8a732705dc2a4bee8eb5d459bb
| * \ Merge tag 'tags/libdrm-2.4.66' into masterSean Paul2016-02-031-57/+372
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tag libdrm-2.4.66 from git://anongit.freedesktop.org/mesa/drm Signed-off-by: Sean Paul <seanpaul@chromium.org> Conflicts: Android.mk Makefile.am configure.ac freedreno/Android.mk include/drm/drm_mode.h intel/Android.mk libkms/Android.mk nouveau/Android.mk radeon/Android.mk tegra/tegra.c tests/Makefile.am xf86drmMode.c xf86drmMode.h Change-Id: I3186bde7f196d2f3438c4334591ee2a0c1371c96
| * | | BACKPORT: fixup! libdrm: atomic mode setRob Clark2015-04-171-1/+2
| | | | | | | | | | | | | | | | | | | | (cherry picked from commit 6ddc823aeb1af0c70cdcd9b206aa45d1e5f394d7) Signed-off-by: Sean Paul <seanpaul@chromium.org>
| * | | BACKPORT: libdrm: Fix bogus increment of a property set object countAnder Conselvan de Oliveira2015-04-171-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If drmModePropertySetAdd() is called with the following property pairs it will mistakenly increase the object count: (4, 1), (5,1), (4, 2). When adding the third pair, the new_obj variable would be set when prev points to (4, 1) since it disregarded the value of the previous item. This patch changes the logic so that the obj count is incresed only if both the previous and next items have differing object ids. (cherry picked from commit 2b1faf742b6391b1537e2635b6926b3a196c1540) Signed-off-by: Sean Paul <seanpaul@chromium.org>
| * | | BACKPORT: libdrm: atomic mode setVille Syrjälä2015-04-171-0/+273
| | | | | | | | | | | | | | | | | | | | (cherry picked from commit fb8403c23edb3e06c979115b7b0cce2ba5099aa2) Signed-off-by: Sean Paul <seanpaul@chromium.org>
* | | | xf86drmMode: merge successive mutually-exclusive #ifsEric Engestrom2018-03-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* | | | meson,configure: include config.h automaticallyEric Engestrom2018-03-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will prevent any more missing `#include "config.h"` bug, at the cost of having to recompile some files that didn't need to be when changing build options. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* | | | drm/atomic: Refuse to add invalid objects to requestsDaniel Stone2018-03-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Object and property IDs cannot be zero. Prevent them from being added to the request stream at all, rather than breaking at commit time. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* | | | drm: Add CrtcGetSequence and CrtcQueueSequence IOCTLs [v2]Keith Packard2017-12-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 drm mode lease ioctl wrappers [v3]Keith Packard2017-12-171-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Add CRTC ID to vblank eventAnder Conselvan de Oliveira2017-04-061-8/+16
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fix type-punned pointer build warningThierry Reding2017-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CC libdrm_la-xf86drmMode.lo ../xf86drmMode.c: In function 'drmHandleEvent': ../xf86drmMode.c:854:15: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] e = (struct drm_event *)(&buffer[i]); ^ Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99350 Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
* | | Add drmModePageFlipTargetMichel Dänzer2016-10-191-0/+16
| | | | | | | | | | | | | | | | | | 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-4/+17
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | xf86drm: Fix spelling mistakesEric Engestrom2016-04-071-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* | | Fix memory leak with drmModeGetConnectorCurrent()Ville Syrjälä2016-01-071-4/+7
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drmModeGetConnectorCurrent() must provide temporary storage for the kernel to fill in at least one mode (asking for !=0 modes is how you prevent the heavyweight probe in the kernel). Currently we malloc that temp storage but we fail to free it before overwriting the pointer with the address of the actual storage we use to store the real mode list we get from the kernel in the second ioctl call. Let's just keep the temporary storage on the stack and thus we avoid the leak and also eliminate some pointless mallocs. Cc: Chris Wilson <chris@chris-wilson.co.uk> Fixes: 5ed5fa10600f ("mode: Retrieve only the current information for a Connector") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
* | xf86drmMode: smoke-test the atomic APIEmil Velikov2015-09-211-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As going through the modetest patches for atomic support I've noticed that if we pass NULL for the drmModeAtomicReqPtr argument we'll crash. So let's handle things appropriately if the user forgot to check the return value of drmModeAtomicAlloc and drmModeAtomicDuplicate or made a typo somewhere along the way. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Rob Clark <robclark@freedesktop.org> Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* | xf86drmMode: remove the trailing white spacesHyungwon Hwang2015-08-201-2/+2
| | | | | | | | | | | | This patch removes the trailing white spaces. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
* | libdrm: Make indentation consistentThierry Reding2015-08-181-2/+2
| | | | | | | | | | | | | | | | Use tabs and spaces consistently to align function arguments on subsequent lines with those of the first line. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
* | libdrm: Remove gratuitous blank linesThierry Reding2015-08-181-8/+0
| | | | | | | | | | | | | | | | Usage of blank lines can be a matter of taste, of course, but for these we can surely all agree that they're not needed and inconsistent. Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
* | xf86drmMode: Implement drmCheckModesettingSupported() for OpenBSDJonathan Gray2015-07-291-1/+18
| | | | | | | | | | | | | | | | This is implemented with kms ioctls so it could also be used as a generic fallback. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* | drm: Detect no-op drmModeAtomicRequest and return earlyChris Wilson2015-07-281-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the number of items to process in the request is zero, we can forgo duplicating, sorting the request and feeding it into the kernel and instead report success immediately. This prevents a NULL dereference of the sorted->items for the no-op request. Fixes: ed44e0b9585c563905447eceed12af9c1c7ca8d4 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Rob Clark <robclark@freedesktop.org> Cc: Daniel Stone <daniels@collabora.com> Cc: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* | Fix headers inclusion in xf86drmMode.cJulien Cristau2015-07-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | Add sys/sysctl.h to get sysctlbyname declaration on kFreeBSD Updated by Thorsten “mirabilos” Glaser <t.glaser@tarent.de> to add autoconf check and only include <sys/sysctl.h> if it is detected by configure as it’s unusable on Linux/x32 (and others, e.g. other new architectures). Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* | xf86drmMode: include config.h before anything elseEmil Velikov2015-06-291-4/+5
| | | | | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* | xf86drmMode: remove unused valgrind(VG) macrosEmil Velikov2015-06-291-8/+0
| | | | | | | | Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
* | Add blob property create/destroy ioctl wrappersDaniel Stone2015-06-291-0/+34
| | | | | | | | | | | | | | 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/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Fix type-limits, pointer-arith and sign-compare warningsJan Vesely2015-03-141-1/+1
| | | | | | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
* | xf86drmMode: Unconditionally clear ioctl structsDaniel Vetter2015-02-111-27/+28
| | | | | | | | | | | | | | | | | | We really have to do this to avoid surprises when extending the ABI later on. Especially when growing the structures. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
* | Fix gcc -Wextra warningsJan Vesely2015-02-101-1/+1
|/ | | | | | Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
* drm: Implement drmCheckModesettingSupported() for DragonFlyFrançois Tigeot2014-08-141-0/+2
| | | | | | | | | | | | For the sake of simplicity, KMS support can always be considered present on DragonFly. If some particular version doesn't support KMS yet, appropriate checks are already done in Dports's x11-drivers/ Makefiles and KMS-enabled driver packages don't get built. Signed-off-by: François Tigeot <ftigeot@wolfpond.org> Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
* 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>
* drm: Implement drmCheckModesettingSupported() for FreeBSDRobert Millan2014-01-241-1/+34
| | | | | | | | | Add the missing implementation of drmCheckModesettingSupported() to detect KMS support on FreeBSD (and GNU/kFreeBSD). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72847 Signed-off-by: Konstantin Belousov <kib@freebsd.org> Signed-off-by: Robert Millan <rmh@freebsd.org>
* drm: Initialize or valgrind-clear modesetting ioctl arguments.Eric Anholt2014-01-201-0/+19
| | | | | | | | Fixes valgrind complaints in the modesetting driver. I tried to follow each ioctl's pattern for whether it was initializing just the in values, or both in and out values. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* drm: add hotspot cursor interface support.Dave Airlie2013-07-021-0/+15
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* initialize width/height fields in drmModeCrtcRob Clark2012-10-141-1/+4
| | | | | | | | | If we have valid timings, we can at least set width/height to *something*, which is I think at least less confusing than always seeing width/height of zero. At least modeprint and modetest seem to expect width/height to mean something. Signed-off-by: Rob Clark <rob@ti.com>
* Add support for bitmask propertiesRob Clark2012-06-081-2/+2
| | | | | | | | | A bitmask property is similar to an enum. The enum value is a bit position (0-63), and valid property values consist of a mask of zero or more of (1 << enum_val[n]). Signed-off-by: Rob Clark <rob@ti.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
* Add support for generic object properties IOCTLsPaulo Zanoni2012-06-081-0/+83
| | | | | | | | | | | 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>
* Using sizeof() on a function parameter with an array type does notVille Syrjälä2012-02-021-3/+3
| | | | | | work. sizeof() treats such parameters as pointers. Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
* This function was missing.Ville Syrjälä2012-02-021-0/+9
| | | | Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
* drmModeFreeResources() always leaked some memory.Ville Syrjälä2012-02-021-0/+6
| | | | | | | drmModeGetPlaneResources() and drmModeGetPlane() leaked in one error path. 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/+153
| | | | | | | | 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>
* drm mode: fix drmIoctl wrapperMarcin Slusarz2011-09-181-1/+1
| | | | | | | | | | | Both drmIoctl and ioctl define second argument as unigned long. Debugging/tracing tools (like strace or valgrind) on 64-bit machines see different request value for ioctls with 32nd bit set, because casting signed int to unsigned long extends 32nd bit to upper word, so 0x80000000 becomes 0xFFFFFFFF80000000) Nobody noticed because higher 32 bits are chopped off on their way to kernel.
* Specify the return type explicitly.Chih-Wei Huang2011-07-121-1/+1
|
* Free the property blob along the error path.Chris Wilson2010-08-241-1/+1
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* drm mode: Return -errno on drmIoctl() failureChris Wilson2010-07-011-24/+18
| | | | | | | | | | The high layers expect to receive a status code on error (on the pessimistic assumption that the errno value will have been overwritten by the time the failure is propagated all the way up), so convert xf86drmMode.c to return -errno on an ioctl error and be consistent with the rest of the libdrm API. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>