Commit Graph

5516 Commits (ed44e0b9585c563905447eceed12af9c1c7ca8d4)

Author SHA1 Message Date
Ville Syrjälä ed44e0b958 Support atomic modesetting ioctl
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>
2015-06-29 19:01:19 +01:00
Emil Velikov 5b0e76f143 Revert "Add device enumeration interface (v4)"
This reverts commit fde4969176.

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>
2015-06-29 11:12:21 +01:00
Ilia Mirkin 203983f842 nouveau: add asserts to make sure krefs are there
This should help catch odd bugs at the callsites rather than much later
on with completely bogus bo indices.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-06-21 19:26:42 -04:00
Boris BREZILLON 97be70b45e tests/kmstest: support atmel-hlcdc
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
2015-05-28 16:04:16 +01:00
Boris BREZILLON e6a1064929 modetest: add atmel-hlcdc driver support
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
2015-05-28 16:03:57 +01:00
Tobias Jakobi 360a7eacd4 modetest: only select plane with matching format
Don't assume that a plane supports any kind of pixelformat
but do a check first.

v2: Simplify the format check.
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28 16:02:28 +01:00
Tobias Jakobi 85ede61136 modetest: make middle SMPTE colors transparent
This enables us to check for overlay planes which are located
'below' the primary plane.

Since the alpha value only has an effect when creating surfaces
with an alpha-pixelformat this doesn't affect the regular
XRGB8888 primary surface.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28 16:01:33 +01:00
Guillaume Desmottes 4bca42fc50 drmPrime*: initialize output args to 0
Fix Valgrind errors because those memory was uninitialized.

https://bugs.freedesktop.org/show_bug.cgi?id=90194
Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>

v2: Explicitly zero the whole struct using memclear.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28 15:58:34 +01:00
Jammy Zhou 454b149494 Fix one warning (v2)
xf86drm.c:356:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
  group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
  ^

v2: do 'int' cast to fix the warning

Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28 15:49:18 +01:00
Emil Velikov d0e592d4e9 xf86drm: simplify drmMalloc/drmFree
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-28 15:40:18 +01:00
Emil Velikov 128344c2cf modetest: replace malloc + memset with calloc
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-28 15:40:16 +01:00
Emil Velikov c78917ee4f modetest: explicitly zero the newly allocated memory
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-28 15:40:13 +01:00
frank fde4969176 Add device enumeration interface (v4)
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>
2015-05-26 12:34:38 -04:00
Alex Deucher bb0b97e673 radeon: add new bonaire pci id
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-26 12:26:40 -04:00
Alexandre Courbot a1acffd4e0 nouveau: add coherent BO attribute
Add a flag allowing Nouveau to specify that an object should be coherent
at allocation time. This is required for some class of objects like
fences which are randomly-accessed by both the CPU and GPU. This flag
instructs the kernel driver to make sure the object remains coherent
even on architectures for which coherency is not guaranteed by the bus.

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2015-05-21 21:20:29 +03:00
Damien Lespiau e9ea1f42d1 intel: Add the Broxton PCI IDs
Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-18 16:24:21 +01:00
Ben Skeggs b2360626c4 configure.ac: bump version to 2.4.61 for release
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-05-07 09:06:31 +10:00
Ben Skeggs 812e8fe6ce nouveau: restore check that avoids multiple user bos per kernel bo
Lost in 5ea6f1c326, triggering fdo#89842.

Unlike the PRIME fd->handle interfaces, the GEM_OPEN interface doesn't
do anything at the kernel level to prevent this situation occuring,
and we end up with multiple GEM handles for a single kernel buffer.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-05-06 14:50:07 +10:00
Rob Clark b4defea65f modetest: fix allocation for yuv420/yvu420
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-05-05 11:16:23 -04:00
Emil Velikov b4a6f50f2a freedreno: link against CLOCK_LIB
Required by clock_gettime()

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-29 17:30:17 +00:00
Emil Velikov 9dd2e8e552 android: set the HAVE_VISIBILITY define
... in order to limit the exported symbols only to the required ones.
Both compilers used with Android (GCC and LLVM) support this, so set it
unconditionally.

Cc: Chih-Wei Huang <cwhuang@linux.org.tw>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-29 17:29:37 +00:00
Joonyoung Shim b091ecdbf9 modetest: fix the arguments of the MAKE_RGB_INFO define
The current order (rbg) seems wrong.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-29 17:28:32 +00:00
Tvrtko Ursulin 30921483c7 intel: Leak the userptr test bo
In order to use userptr, the kernel tracks the owner's mm with a
mmu_notifier. Setting that is very expensive - it involves taking all
mm_locks and a stop_machine(). This tracking lives only for as long as
the client is using userptr objects - so if the client allocates then
frees a userptr in a loop, we will be executing that heavyweight setup
everytime. To ammoritize this cost, just leak the test bo and the single
backing page we use for detecting userptr.

v2: Free the object and memory when bufmgr is destroyed.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-04-29 15:22:58 +01:00
Joonyoung Shim 9915e68b3b modetest: destroy the cursor bo
Currently we are missing the bo_destroy() when modetest terminates.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:06:37 +01:00
Joonyoung Shim 4d760d7f46 modetest: clear buffer and framebuffer for planes
Currently we don't destroy buffer and remove framebuffer for
planes when closing modetest.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message. fb_id = 0 is unused]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:06:28 +01:00
Joonyoung Shim 21170a8c63 modetest: fix the error path handling
Remove the framebuffer and destroy the bo when error occurs on set_mode
and test_page_flip.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:04:49 +01:00
Joonyoung Shim bcaaa75cf4 modetest: make use of drmModeRmFB
We should remove the framebuffer before destroying the buffer.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message. fb_id = 0 is unused]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 13:04:15 +01:00
Joonyoung Shim 4e4d79d4ca modetest: fix Segmentation fault
If use -P option without -s option, the program segfaults due to
dev.mode.bo being NULL.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:27:18 +01:00
Tobias Jakobi b1d19de764 modetest: initialize handles/pitches in set_plane()
Only the 'offsets' array was initialized to zero.
Since bo_create only sets the handles which are
necessary, were we passing garbage data to the
kernel when calling drmModeAddFB2 later.

The issue only seems to appear when passing e.g.
NV12 data to the kernel, a case where not only
handles[0] is used. I therefore also removed the
corresponding comment.

v2: Do the same for set_mode(), set_cursors()
    and test_page_flip().

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:23:14 +01:00
Greg Hackmann 0c8db0a563 Add missing <strings.h> includes
A couple of files use ffs() without explicitly including strings.h.
Some systems will pull in ffs()'s declaration through another header
anyway, but not when compiling against bionic in AOSP master.

Signed-off-by: Greg Hackmann <ghackmann@google.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:22:31 +01:00
Emil Velikov e2b531866f man: rework the Makefile.am
Remove GNU make specific constructs and take into consideration that
Solaris man 7 is not the same as Linux man 7.

This commit introduces a dependency of xorg-macros 1.12 (released 4+
years ago) which is used to handle the above man section discrepancies.

Cc: Niveditha Rau <niveditha.rau@oracle.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:21:10 +01:00
Emil Velikov 41eb131dfe drm: use c99 __func__ over __FUNCTION__
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:21:02 +01:00
Emil Velikov e59f00fb43 configure: request/set the compiler in C99 mode
Required by intel and drmstat at least. Considering that every compiler
used to build libdrm is C99 compatible, just enable it for the whole
build.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:20:52 +01:00
Emil Velikov 0f8da82500 drm: remove drm_public macro
Some compilers (like the Oracle Studio), require that the function
declaration must be annotated with the same visibility attribute as the
definition. As annotating functions with drm_public is no longer
required just remove the macro.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 104c895f65 drm: remove no longer needed VISIBILITY_CFLAGS
With earlier commits we've annotated the private symbols, thus
we no longer require the -fvisibility=hidden CFLAGS.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 42465feb97 drm: rename libdrm{,_macros}.h
Provide a more meaningful name, considering what it does.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov a814f933bf tegra: add symbols test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 62b35fb275 omap: add symbols test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 9f8fb46862 exynos: add symbols test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov b0d4ee6907 libkms: add symbols test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 983892d275 libkms: annotate private symbols
Cc: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 47429af325 nouveau: add symbols test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 76e9799b8a nouveau: annotate the private symbols
They are less and easier to track than the public ones. The macro
drm_public will be going away by the end of the series.

Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov a418f2f895 intel: add symbols test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 5966d37732 intel: annotate the private symbols
They are less and easier to track than the public ones. The macro
drm_public will be going away by the end of the series.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01:00
Emil Velikov 1756d3d64b intel: remove unused mmFindBlock
The function was never part of the public API and a release or so back
was hidden from the global name-space (list of exported symbols).

According to git log this function was never used internally.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:13 +01:00
Emil Velikov 8e76f63cc4 intel: remove the drm_mm* symbol workarounds
Added with commit 57b4c4c32d3(Move the renaming of mm.c symbols to
symbol duplication/collision with ones that are available elsewhere.

As the public/private symbols of libdrm are properly annotated neither
one of the symbols will end up in the global name-space, thus should no
longer be required.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:18:43 +01:00
Emil Velikov 7c7d1f3c9c freedreno: add symbols test
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:18:43 +01:00
Emil Velikov 44e9a0258a freedreno: annotate the private symbols
They are less and easier to track than the public ones. The macro
drm_public will be going away by the end of the series.

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:18:43 +01:00
Emil Velikov 552de225bf radeon: add symbols test
Will allow us to catch when the library exports more symbols than
the ones in the public headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:18:43 +01:00