Commit Graph

147 Commits (20138ea997e4e2eadd43846c114a7891688d653d)

Author SHA1 Message Date
Ilia Mirkin 691a215799 modetest: fix printing of fourcc on BE machines
fourcc is not a string, it's a packed integer. This happens to work out
on LE, but gets reversed on BE.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2017-04-19 23:25:43 -04:00
Tomasz Figa 8ef7e5b702 tests: Use -pthread in CFLAGS instead of -lpthread
-lpthread is not always a valid flag to pull pthread support, especially
on Android it will fail to link due to a missing libpthread.so. The more
generic way to build-in pthread support is to use the -pthread CFLAG, so
let's use it instead.

Signed-off-by: Tomasz Figa <tfiga@chromium.org>
[Emil Velikov: rebase on top of previous commit]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-01-27 16:18:02 +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
Ville Syrjälä e3af5368b2 modetest: Allow the user to specify the plane ID
Devices can have multiple planes, so allow the user to choose between
them.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-12-19 15:14:07 +02:00
Stéphane Marchesin 72a041694e modetest: Also print the pixel clock
This can be useful for debugging. xrandr prints it, so why not.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2016-09-01 16:02:46 +01: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
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
Gustavo Padovan dfd8cd4611 modetest: print signed values correctly
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-03-28 22:13:29 +01:00
Kylie McClain ff0c9caa8e tests: Include poll.h rather than sys/poll.h
sys/poll.h is a non-standard location of the poll.h header, and is
incorrect on non-glibc libcs. poll.h, however, is defined in SUS (v2)
and is more portable.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93764
http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:50:17 +00:00
Khem Raj 358615f416 tests: Include sys/select.h
Used in compliance with POSIX 2001/2008

Fixes errors e.g.
error: implicit declaration of function 'select'

and helps with missing definitions of FD_* defines

v2: conditionally include sys/select.h, include in every test where
needed.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:50:17 +00:00
Thierry Reding 1674147a14 tests: util: Fixup util_open() parameter order
util_open() takes a device parameter, followed by a module parameter.
The existing tests used the drmOpen() function, which uses a different
ordering of the parameters, and the old ordering was accidentally kept
during the conversion.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2016-01-26 21:50:17 +00:00
Thierry Reding c26266fcd0 modetest: Use util_open()
Use the new util_open() helper instead of open-coding the method for
finding a usable device.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-18 17:44:16 +00:00
Thierry Reding 4664d657ea tests: Move name tables to libutil
These tables are duplicated in several places, so move them into libutil
so that they can be shared.

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:44:01 +00:00
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 04e243262d modetest: annotate const data as such for good measure
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:39:06 +01:00
Emil Velikov 99722bfec6 modetest: fix shadowing warnings
No real issue here, but let's fix these so that real issues don't get
lost in the spam.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-09-04 21:36:42 +01:00
Hyungwon Hwang 6e84ada4cc modetest: remove the trailing white spaces
This patch removes the trailing white spaces.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
2015-08-20 17:11:15 +01:00
Thierry Reding f05a74fb9c tests: modetest: Accept connector names in addition to connector IDs
Allow connector names to be used in the specification of the -s option.
This requires storing the string passed on the command-line so that it
can later be resolved to a connector ID (after the DRM device has been
opened).

Connector names are constructed from the connector type name and
connector type ID using the same format as used internally in the
Linux kernel.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-08-15 03:06:57 +03: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
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
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
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
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 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
Rob Clark 0d78b37b1c modeprint: add missing encoder/connector type names
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-04-15 09:35:00 -04:00
Chih-Wei Huang 6f90b77ea9 android: remove unnecessary TARGET_OUT_HEADERS variable
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-09 16:26:59 +01:00
Daniel Kurtz 9588e66dbd tests: add rockchip to modetest, kmstest, vbltest and proptest
There is a rockchip drm kms driver.
Add "rockchip" to the static lists of driver names in the the standard
set of tests.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
[Emil Velikov: Resolve trivial conflicts.]
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-20 17:18:01 +00:00
Philipp Zabel 77703f61cb tests: add support for imx-drm
Since imx-drm has graduated from staging it seems to be a good idea to
recognize it by default in the libdrm tests.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-25 17:51:22 +01:00
Laurent Pinchart d7c0a08bc5 modetest: Allocate dumb buffers with the correct bpp
The modetest application uses libkms to allocate dumb buffers, leading
to overallocation due to the hardcoded 32 bpp value. This can even cause
failures in drivers when the resulting pitch is too large for the
hardware to handle and gets rejected by the driver when creating the
frame buffer.

Fix this by computing the required bpp value and allocating dumb buffers
directly without going through libkms.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-01-11 14:37:53 +02: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
Rob Clark fb4177046d update signed/object prop types
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:56:50 -05:00
Ville Syrjälä c2c0346e1f modetest: Print newline for empty blobs
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:54:35 -05:00
Rob Clark b958d76f77 modetest: alpha buffers
Make upper-left corner for RGB32 buffers translucent, for testing
blending of AR24 vs XR24.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 19:53:41 -05:00
Rob Clark 1fec623b02 modetest: universal plane support
Minimal support, so we can at least dump properties of primary/cursor
planes.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-24 13:43:10 -05:00
Jasper St. Pierre 29bb4c6911 modetest: Use threads for cursors instead of SIGALRM
This fixes an issue when trying to use -v and -C together. When trying
to read the page flip event, we are interrupted by the SIGALRM that
comes in, and so we think we timed out when we simply got EINTR. While
we could just loop checking for EINTR, SIGALRM is just bad idea to
begin with, so just rewrite it to use a thread.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-11-22 11:45:02 -05: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
Benjamin Gaignard 33bad73b27 modetest: Add support of STI driver
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
2014-09-28 17:09:34 +01:00
Emil Velikov 6f95526a81 modetest: add Android build
v2: include modetest rather than modeset.
Spotted by Mauro Rossi and Paulo Sergio.

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
2014-09-28 17:09:34 +01:00
Emil Velikov fea3831133 modetest: move sources lists to makefiles.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 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
Rob Clark 0e512794bf modetest: add cursor support
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-04-22 11:14:12 -04:00