Commit Graph

59 Commits (d7320bfcddc596f23fa2b7166e447a0747139199)

Author SHA1 Message Date
Lucas De Marchi 6229895cc5 libkms: annotate public functions
This was done with:
nm --dynamic --defined-only build/libkms/libkms.so | \
	grep kms_ | \
	cut -d' ' -f3 > /tmp/a.txt

while read sym; do
	read f func line _ <<<$(cscope -d -L -1 $sym)
	if [ ! -z "$f" ]; then
		sed -i "${line}s/^/drm_public /" $f
	fi
done < /tmp/a.txt

The idea here will be to switch the default visibility to hidden so we
don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-19 22:46:45 -07:00
Eric Engestrom 0926f0af54 meson,configure: include config.h automatically
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>
2018-03-20 18:19:26 +00:00
Heiko Becker 4f08bfe96d *-symbol-check: Don't hard-code nm executable
Helpful if your nm executable has a prefix based on the
architecture, for example.

Signed-off-by: Heiko Becker <heirecka@exherbo.org>
Cc: Timo Gurr <timo.gurr@gmail.com>
[Eric: v2: rebase and add Meson support]
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-02-23 17:53:08 +00:00
Eric Engestrom ee47329bef meson,configure: always define HAVE_{INTEL,VMWGFX,NOUVEAU,EXYNOS,VC4,RADEON}
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-01-29 15:41:52 +00:00
Dylan Baker 5f7deb5078 Add meson build system
This patch adds a complete meson build system, including tests and
install. It has the necessary hooks to allow it be used as a subproject
for other meson based builds such as mesa.

Signed-off-by: Dylan Baker <dylan.c.baker@intel.com>
Reviewed-and-tested-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2018-01-12 09:40:48 -08:00
Inki Dae be40710f06 exynos: change the license to X11/MIT
Change GPL license of Exynos related code to X11/MIT.

I'd like to keep a consistent license across all Exynos code
because License checker notices two more licenses exist
in libdrm.

For the license change I need to get your agree - all committers.
So please give me Acked-by if you agree with me.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Acked-by: Hyungwon Hwang <human.hwang@samsung.com>
Acked-by: SooChan Lim <sc1.lim@samsung.com>
Acked-by: Sangjin LEE <lsj119@samsung.com>
Acked-by: Boram Park <boram1288.park@samsung.com>
Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Jan Vesely <jan.vesely@rutgers.edu>
2017-11-07 11:19:58 +00:00
Emil Velikov 03d2e91d00 android: introduce Android.common.mk to reduce boilerplate
... across the makefiles. Currently this isn't much but that will change
shortly.

As an added bonus this fixes all present and future cases where we've
forgotten to strip out the headers from LOCAL_SRC_FILES.

In a couple of cases (the tests) we start setting
LOCAL_EXPORT_C_INCLUDE_DIRS, which shouldn't be an issue.

Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2017-01-27 15:48:16 +00:00
Emil Velikov de5b41ef5a android: remove LOCAL_MODULE_TAGS := optional tag
Seems to be the default option since ~2009 with commit 2f31293ba78 "auto
import from //branches/cupcake/...@137197". Fleshed out from a larger
commit in the AOSP repo/fork.

Cc: Dan Willemsen <dwillemsen@google.com>
Cc: Chih-Wei Huang <cwhuang@android-x86.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
2017-01-27 15:47:13 +00:00
Seung-Woo Kim a07cf7f08d libkms/exynos: fix memory leak in error path
This patch fixes memory leak in error path of exynos_bo_create().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-12-14 17:10:51 +00:00
Emil Velikov 9b05d40399 kms: remove commented out libudev code
Cc: Jakob Bornecrantz <wallbraker@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-12-05 17:24:03 +00:00
Andreas Boll a5446775f2 automake: Don't include Android Makefiles in the release tarball
Currently only some Android Makefiles are included in the release tarball.
To be more consistent one could either add the remaining files or don't
ship Android Makefiles altogether.

According to Emil the Android folk doesn't use our release tarballs.
Thus it makes sense to remove those files from distribution which also
means less work for maintenance in the future.

Suggested-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-07-23 09:45:53 +02:00
Mike Frysinger 8c8d5dd76f pull in sys/sysmacros.h when available
This header provides major/minor/makedev funcs under most Linux C
libs.  Pull it in to fix building with newer versions that drop the
implicit include via sys/types.h.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94231
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2016-07-06 16:58:38 +01:00
Rob Herring d342cd34ac Android: strip out header files from sources list
AOSP master now errors if LOCAL_SRC_FILES contains headers, so filter
out header files from the source lists.

Signed-off-by: Rob Herring <robh@kernel.org>
2016-07-06 16:58:38 +01:00
Chih-Wei Huang 4274539673 android: add virgl to be a valid driver
To avoid the warning:

external/libdrm/libkms/Android.mk:17: invalid GPU drivers: virgl

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-02-25 17:03:20 +00:00
Emil Velikov ca5017b69c libkms: add libdrm to Requires.private
Analogous to last two changes (amdgpu and radeon).

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2016-02-04 13:22:50 +00:00
Emil Velikov aecd5a1879 libkms: use static const for good measure
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:39:06 +01:00
Tapani Pälli 1c205749fe remove usage of 'c_plusplus' preprocessor macro
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>
2015-08-10 11:25:39 +03:00
Alan Coopersmith dfed5e18f3 include <sys/types.h> & <sys/mkdev.h> directly for major() and minor()
Linux seems to pick these up via another header, but Solaris needs them
explicitly included, or we get undefined symbol errors for major & minor.

v2: use headers documented in makedev(3C) man page instead of sysmacros.h

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

v3 [Emil Velikov]: include sys/mkdev.h only when available.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-13 19:38:28 +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 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 568b3a0954 android: add the missing tag "optional" to libkms
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 17:03:16 +00:00
Emil Velikov ff021215ea android: remove LOCAL_COPY_HEADERS* variables
With earlier changes we've implicitly add the relevant directories
to the includes list, via LOCAL_EXPORT_C_INCLUDES_DIRS.

v2: Update the top Android.mk as well.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 17:02:56 +00:00
Emil Velikov af4379f759 android: simplify LOCAL_C_INCLUDES
Each of the libdrm_${hw} modules pull libdrm for linking as such:

libdrm's LOCAL_EXPORT_C_INCLUDE_DIRS are added to the includes list.
The former of which is already set to ${top} and ${top}/include/drm.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 16:59:22 +00:00
Emil Velikov 24ac8cd7db android: correcly set LOCAL_EXPORT_C_INCLUDE_DIRS
- Don't add ${hw}/${hw}, but ${hw} to the includes path. The former
does not exist.
 - Set the variable for libkms.

Inspired by the work of from Chih-Wei from the Android-x86 project.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 16:59:22 +00:00
Hyungwon Hwang d41b7a3a74 exynos: Don't use DRM_EXYNOS_GEM_{MAP_OFFSET/MMAP} ioctls
The ioctl DRM_EXYNOS_GEM_MAP_OFFSET and DRM_EXYNOS_GEM_MMAP are removed from
the linux kernel. This patch modifies libdrm and libkms to use drm generic
ioctls instead of the removed ioctls.

v2: The original patch was erroneous. In case the MODE_MAP_DUMB ioctl failed
    it would return the retvalue as a void-pointer. Users of libdrm would then
    happily use that ptr, eventually leading to a segfault. Change this to
    return NULL in that case and also restore the previous behaviour of logging
    to stderr.
    The other error was that 'bo->vaddr' was never filled with the mapped
    buffer address. Hence exynos_bo_map still returned NULL even if the
    buffer mapping succeeded.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-02-02 14:45:39 -05:00
Emil Velikov dadc9eff9f libkms: use drm_mmap/drm_munmap wrappers
... for all by exynos.

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 268dce4192 automake: pick up all files for distribution.
Autotools is already smart enough to pick the *.pc.in files but it
needs some help with the Android.mk ones.

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 a3dfd6d40d libkms: add Android build
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
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 1a75044a39 libkms: move sources lists to makefile.sources
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 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 02b3ad7e19 libkms: remove explicit define _FILE_OFFSET_BITS 64
configure.ac has AC_SYS_LARGEFILE which provides the define and/or
approapriate magic when required.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:01 +01:00
Emil Velikov 8e93afc976 all: include config.h only when available and use its defines
... rather than explicitly redefining HAVE_STDINT_H and _GNU_SOURCE.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:01 +01:00
Hyungwon Hwang 3732ef59eb tests/kmstest: support exynos
In this patch, to support exynos for KMS, Exynos KMS driver is newly added.
Also, Exynos is added to the list of kmstest supported modules.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-12 08:23:38 -05:00
Laurent Pinchart aa4afdf0b3 kms: Return a negative error code in kms_bo_create()
The function returns returns 0 on success or a negative value in case of an
error, except when given invalid attributes in which case it returns the
positive EINVAL value. Replace that with -EINVAL to allow the caller to detect
errors with a < 0 check.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2013-04-18 10:07:01 -04:00
Laurent Pinchart 9fa4a4b1a8 kms: Make libkms.h usable in C++
Wrap the header in extern "C" { ... };.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jakob Bornecrantz <wallbraker@gmail.com>
2013-04-18 10:05:53 -04:00
Maxime Villard baf0a7daaf libkms: return -EINVAL on fstat error
On error fstat return -1, instead return -EINVAL to caller

Signed-off-by: Maxime Villard <rustyBSD@gmx.fr>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-02 10:57:07 -05:00
Maxime Villard 1f4b5e11e6 libkms: fix memory leak in error path
Signed-off-by: Maxime Villard <rustyBSD@gmx.fr>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-01-02 10:55:50 -05:00
Marcin Slusarz 9c3c95fc0c libkms: link against libdrm
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
2012-09-08 00:50:22 +02:00
Chris Wilson 61be94018a libkms: All current BO_TYPE are 32bpp
... so request a 32bpp dumb buffer rather than a 16bpp.

Fixes modetest and friends.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-05-14 11:17:23 +01:00
Dave Airlie bb99465366 libkms: add dumb support
this uses the drm cap interface to check if the dumb ioctl
is supported.
2011-03-04 15:25:51 +10:00
nobled ed7d177f66 libkms/radeon: Add backend
Todo: What tiling should be set on scanout buffers?

Haven't tested besides compiling it.
2011-02-17 09:26:30 +01:00
Daniel Stone ae57dcf6e0 libkms: Fix include paths
Otherwise xf86drm.h isn't found, or the wrong one.
2010-06-01 19:23:42 +01:00
Marcin Kościelnicki d5a2e77682 libkms/nouveau: Add support 2010-02-28 00:25:22 +00:00
Marcin Kościelnicki 23f62721b7 libkms/intel: Throw out unused intel_bo fields.
Acked-by: Jakob Bornecrantz <jakob@vmware.com>
2010-02-28 00:25:22 +00:00
Jakob Bornecrantz a5c8f55397 libkms: Use a standard version number 2010-02-18 16:29:36 +01:00
Jakob Bornecrantz 25c0c638c4 libkms: Add missing include file to libkms source 2010-02-18 13:28:52 +01:00
Jakob Bornecrantz 44a0e0a099 libkms: Rework interface to not duplicate fields from kms and make formats explicit
List of changes:
Fixes the cursor size to 64x64, you still need ti supply width and height
Explicitly make the cursor format A8R8G8B8
Explicitly make the scanout format X8R8G8B8
2010-01-28 17:32:54 +01:00
Jakob Bornecrantz dfa7297860 libkms: Fix return value in vmwgfx_bo_create 2010-01-23 01:39:07 +00:00
Jakob Bornecrantz 2959266188 libkms: Fix multiple map unmap in vmwgfx and add comment in intel 2010-01-15 20:13:20 +00:00