Commit Graph

197 Commits (1ec3c44bdd38051d870f64d0b2cc7dbd59760386)

Author SHA1 Message Date
Thierry Reding 1ec3c44bdd tests: Split helpers into library
Some of the helpers, such as the pattern drawing helpers or the format
lookup helpers, have potential to be reused. Move them into a separate
library to make it easier to share them.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:43:40 +00:00
Emil Velikov 8913cd95b2 configure.ac: test for the same atomic function as the one we use
Unlikely that we'll hit a case where __sync_fetch_and_add is present
while __sync_add_and_fetch isn't. Regardless let's keep things sane and
consistent.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-11-16 13:52:56 +00:00
Jonathan Gray f4b83bff60 configure.ac: rework compiler builtin atomic tests
The libdrm autoconf test for atomics uses __sync_val_compare_and_swap with
the address of a function argument which triggers a gcc ICE on sparc64
with the OpenBSD system compiler.

Mark Kettenis pointed out that while other architectures probably spill the
argument onto the stack this is likely not the case on register window
architectures like SPARC and suggested passing a pointer as an argument
instead which avoids the ICE and allows the drm libraries requiring
atomics to build on sparc64 with the autoconf build.

Reported-by: Christian Weisgerber <naddy@openbsd.org>
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Matthieu Herrb <matthieu@openbsd.org>
2015-11-16 13:45:37 +00:00
Rob Clark c349616763 Bump version for release
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-09-16 09:03:40 -04:00
Emil Velikov 7faedc9efc configure: remove -Wno-missing-field-initializers
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:39:06 +01:00
Emil Velikov 598294dde8 configure: enable -Wshadow when available
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:39:06 +01:00
Rob Clark ab2fadabde Bump version for release
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-08-18 11:56:50 -04:00
Marek Olšák f045da45fe Bump version for release 2015-08-14 14:19:29 +02:00
Alex Deucher c8df9e724e add a note about which version of cunit is fixed for debian/ubuntu
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-06 13:44:16 -04:00
Alex Deucher e1f31d98a7 move up cunit workaround for ubuntu/debian
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-06 13:38:31 -04:00
Alex Deucher b93594b1bf fix amdgpu cunit configure test harder
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-06 11:19:55 -04:00
Alex Deucher 11a390ea66 fix configuration when amdgpu is disabled
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-06 11:13:48 -04:00
Alex Deucher 3c5fe78801 drm: add tests/amdgpu (v3)
This adds some basic unit tests for the new amdgpu driver.

v2: use common util_math.h
v3: implement suggestions from Emil
    replace malloc/memset with calloc
    make header guards all caps
    use posix_memalign rather than mem_align
    replace malloc with calloc for pm4 allocations
    make CU_SuiteInfo static
    fix Makefile.am
    fix fd numbering
    use drmGetVersion/drmFreeVersion rather than open coding it
    close fd, clean up CU registry on error

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:48 -04:00
Alex Deucher 0936139536 drm: add libdrm_amdgpu (v7)
This is the new ioctl wrapper used by the new admgpu driver.
It's primarily used by xf86-video-amdgpu and mesa.

v2: fix amdgpu_drm.h install
v3: Integrate some of the sugestions from Emil:
    clean up Makefile.am, configure.ac
    capitalize header guards
    fix _FILE_OFFSET_BITS with config.h
    use drm_mmap/drm_munmap
    Remove unused ARRAY_SIZE macro
    use shared list implementation
    use shared math implementation
    use drmGetNodeTypeFromFd helper
v4: remove unused tiling defines
v5: include amdgpu.h in Makefile.am
v6: update amdgpu_drm.h
v7: libdrm.h -> libdrm_macros.h

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-08-05 13:47:48 -04:00
Julien Cristau fc8c3e23fb Fix headers inclusion in xf86drmMode.c
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>
2015-07-11 21:21:07 +01:00
Emil Velikov 676c806d02 configure: default --enable-valgrind to auto
... as the help text says.

Reported-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-30 14:01:16 +01:00
Emil Velikov ba4b5ac010 configure.ac: bump version to 2.4.62 for release
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:25:35 +01:00
Matt Turner 47a2de27a0 configure: Add flag to disable valgrind support.
v2 [Emil Velikov]: Autodetect valgrind.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29 19:19:22 +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
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 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 40902b9fa1 configure.ac: split -fvisibility and __attribute__((visibility)) checks
The former does not imply the latter and vice-versa. One such example is
the Sun compiler.

v2: Add missing closing brakets. (Alan)

Cc: Alan Coopersmith <alan.coopersmith@oracle.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:18:43 +01:00
Damien Lespiau 5f7b6723e1 build: Bump version number to 2.4.60 before release
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-19 14:36:56 +00:00
Emil Velikov d20413a7ce configure.ac: error out if building freedreno_kgsl without freedreno
The former is a subset of the latter. Error out early so the user is
aware that they are doing something very wrong.

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
2015-03-17 22:37:05 +00:00
Emil Velikov 648508518e configure.ac: fix help string copy/pasta
The message "enabled on x86" was meant for the intel libdrm.
Take the opportunity to mention how libkms is autodetected.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-17 22:37:03 +00:00
Emil Velikov 0e4d5a3a46 configure.ac: fix host_cpu/atomics detection
Previous code was busted, as it wasn't checking directly for what it was
meant to, and at the end changing the user's selection if host_cpu
heuristics were involved.

Simplify things by adding a macro that does the long message printing
for us, and check for only what we need.

This fixes commit 36cff14bb03(configure: omap, freedreno and tegra
require atomics) which incorrectly assumed that the code was working
fine, and effectively made impossible to enable freedreno due to it's
host_cpu detection.

Cc: Rob Clark <robdclark@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-17 22:37:02 +00:00
Emil Velikov d8ea64d90b configure: Stop using AM_MAINTAINER_MODE
AM_MAINTAINER_MODE can be used to disable generation of rebuild rules.
This is not something we want to condone/support, considering it can
cause greater problems than the perceived benefits. Additionally the
Automake manual leans towards avoiding the use of AM_MAINTAINER_MODE.

http://www.gnu.org/software/automake/manual/html_node/maintainer_002dmode.html

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-17 22:34:59 +00:00
Alan Coopersmith 0e1135de5c On Solaris, #include <sys/mkdev.h> in xf86drm.c
Needed on Solaris for the definitions of major() & minor() used in
drmGetNodeTypeFromFd() and makedev() used in drmOpenMinor()

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-14 08:37:36 -07:00
Maarten Lankhorst 5ea6f1c326 nouveau: make nouveau importing global buffers completely thread-safe, with tests
While I've closed off most races in a previous patch, a small race still existed
where importing then unreffing cound cause an invalid bo. Add a test for this case.

Racing sequence fixed:

- thread 1 releases bo, refcount drops to zero, blocks on acquiring nvdev->lock.
- thread 2 increases refcount to 1.
- thread 2 decreases refcount to zero, blocks on acquiring nvdev->lock.

At this point the 2 threads will clean up the same bo.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Reviewed-By: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-13 20:26:33 +01:00
Emil Velikov 9244d98136 configure: update help strings
Mention that freedreno and intel are both auto-detected (depending on
the presence of atomics), plus host_cpu "defined".

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10 18:10:52 +00:00
Emil Velikov 36cff14bb0 configure: omap, freedreno and tegra require atomics
They have used them since day one, but the check was never there.

v2:
 - Update the freedreno message (API is no longer experimental).
 - Move the freedreno host_cpu detection next to the intel one.

Cc: Rob Clark <robdclark@gmail.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10 18:09:18 +00:00
Maarten Lankhorst d2e0f55246 configure.ac: bump version to 2.4.59 for release 2015-01-21 11:52:33 +01:00
Maarten Lankhorst d5bfbdc62f only enable support for freedreno on arm automatically
Users can still override this by explicitly passing --enable-freedreno
to configure.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-21 11:47:13 +01:00
Rob Clark a5003c6f85 configure/freedreno: enable freedreno by default
Now that enabling freedreno doesn't automatically enable kgsl, lets
enable it by default.  The drm/msm driver has been upstream for a
while now, and it's ABI is locked.  So I don't think we need to keep
calling it experimental.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-01-18 13:18:33 -05:00
Rob Clark 28662b77ee configure/freedreno: make KGSL support optional
libdrm_freedreno currently supports two backends, 'msm' for the upstream
drm/msm driver, and 'kgsl' which supports (to some extent), the android/
downstream kgsl driver plus a sort of drm shim nonsense to get flink
names.

However, kgsl support is strictly on a best-effort basis.  Different
android devices with different versions of kgsl may have different
abi's.  And the existing kgsl interface (at least the parts of it that
we use) is completely broken for 64bit.  Lets disable it by default lest
anyone actually try to use it.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-01-18 13:18:33 -05:00
Thierry Reding 93035cfbeb tegra: Add simple test for drm_tegra_open()
This test opens a device, dumps the version information and checks that
a Tegra DRM context can be opened on it.

Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-27 17:20:27 +01:00
Thierry Reding d6a4c2cbd1 libdrm: Add NVIDIA Tegra support
Add the libdrm_tegra helper library to encapsulate Tegra-specific
interfaces to the DRM.

Furthermore, Tegra is added to the list of supported chips in the
modetest and vbltest programs.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-11-27 17:05:35 +01:00
Paulo Zanoni 8f66c98818 tests: add proptest
A small program that allows us to see and modify properties.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:51:59 -05:00
Rob Clark 7068d987f4 configure.ac: bump version to 2.4.58 for release
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-28 14:53:34 -04:00
Rob Clark a6cddb3410 configure.ac: bump version to 2.4.57 for release
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-09-28 12:25:21 -04:00
Emil Velikov f3fd11beaa libkms: build the intel backend only when needed
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28 17:09:34 +01:00
Emil Velikov be7d297172 configure: unconditionally check for atomic ops/primitives
Just have the check once, and let new drivers opt-in if they want
to use them. Move the block further up the script, to tie nicely
with the actual usage of $HW defines.

Move the final $HW users to be alongside their brethren.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28 17:09:34 +01:00
Emil Velikov 98ec08d836 automake: remove obsolete makefiles
Rather than having two extra makefiles in order to ship ~10 headers
just fold its 5 lines of code into the top one makefile.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28 17:09:33 +01:00
Thierry Reding 5d8357976a configure: Support symbol visibility when available
Checks whether or not the compiler supports the -fvisibility option. If
so it sets the VISIBILITY_CFLAGS variable which can be added to the per
directory AM_CFLAGS where appropriate.

By default all symbols will be hidden via the VISIBILITY_CFLAGS. The
drm_public macro can be used to mark symbols that should be exported.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-07-30 16:58:14 +02:00
Marek Olšák d6861609b2 configure.ac: bump version to 2.4.56 for release 2014-07-29 18:54:33 +02:00
Maarten Lankhorst 6f15ca8081 bump to version 2.4.55 for release 2014-07-25 15:08:23 +02:00
Alex Deucher 5126fcb2b4 bump version to 2.4.54 for release
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-05-02 16:59:30 -04:00
Marek Olšák 504d606275 Bump version to 2.4.53 for release 2014-04-10 21:12:54 +02:00