Prodives memset() and strlen(), used in tests/setversion
tests/getversion respectively.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Multiple the image height by 1.5 for NV12/NV21 and by 2 for NV16/NV61 to
make room for the chroma plane.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
The line stride passed to the function is expressed in bytes, there's no
need to multiply it by 2.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
When building the pipeline, instead of using only the encoders attached
to a connector, take all possible encoders into account to locate a
CRTC.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
The -s argument can now take a list of connectors. Configure all of them
in cloned mode using a single CRTC.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This prepares the code for handling multiple connectors in a single
pipeline in a cloned configuration.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
There's not reason to require setting a mode to test planes. Split the
two operations.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Planes are associated with CRTCs, not connectors. Don't try to be too
clever, use the CRTC ID in the -P option. This prepares for splitting
CRTC and planes setup.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This prepares the code for the split in separate functions of CRTC and
planes setup.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This prepares the code for the split in separate functions of CRTC and
planes setup.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Instead of passing the device fd and resources as global variables group
them in a device structure and pass it explictly to all functions that
need it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
As modetest automatically selects an unused plan, providing the plane ID
allows modifying plane properties for the selected planes.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Extend the -P option to allow specifying the plane x and y offsets. The
position is optional, if not specified the plane will be positioned at
the center of the screen as before.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
The -w parameter can be used to set a property value from the command
line, using the target object ID and the property name.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Configuring mode on more than two connectors or two planes is perfectly
valid. Support it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Instead of retrieving resources as they are needed, retrieve them all
(except property blobs) in one go at startup.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
If the -d parameter is specified, modetest will drop master permissions
after setting the mode.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
If the -M parameter is specified, modetest will use the requested device
name instead of trying its builtin list of device names.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
The current mostly random sort order hinders code readability. Sort the
options alphabetically in the code, and by group in the help message.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Those variables are declared in unistd.h, there's no need to redeclare
them here.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Enable all standard automake warnings except for -Wpointer-arith (as the
test pattern generation code uses void pointer arithmetics) and fix
them.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Render the crosshairs for 565 and x888/a888 formats.
v2: Use the drm format to determine cairo format
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
YUV420 support is trivial to add since the code already supports
YVU420.
But it looks like the YVU420 support is a bit broken. The chroma
planes are passed in the wrong order to the fill functions, so
fix that while were at it.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
The fourcc is inside the format_info structure, so if we want to use
it inside the various fill_tiles functions, we need to pass down the
whole format_info, not just the rgb/yuv infos.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Spelling out eDP or DP make for a ridicilously long string which plays
havoc with formatting. Just say eDP or DP.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
libkms only has the xrgb8888 format, so we're overallocating the bo by
quite a lot in some cases. But we still need to get the pitch from the
libkms since it's the driver that decides how to align it.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Install test programs is useful in cross compilation case. By default
the behavior is the same and test programs aren't installed in $bindir.
If --enable-install-test-programs is set then test programs are
installed in $bindir.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
This patch adds library and test application for g2d gpu(fimg2d).
The fimg2d hardware is a 2D graphics accelerator(G2D) that
supports Bit Block Transfer(BitBLT).
The library includes the following primitive drawing operations:
.solid fill - This operation fills the given buffer with
the given color data.
.copy - This operation copies contents in source buffer to
destination buffer.
.copy_with_scale - This operation copies contents in source buffer
to destination buffer scaling up or down properly.
.blend - This operation blends contents in source buffer with
the ones in destination buffer.
And the above operations uses gem handle or user space address
allocated by malloc() as source or destination buffer.
And the test application includes just simple primitive drawing
tests with the above library.
And the guide to test is as the following,
"#exynos_fimg2d_test -s connector_id@crtc_id:mode"
With this above simple command, four primitive drawing operations
would be called step by step and also rendered on the output device
to the given connector and crtc id.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
We don't want to build libdrm tests with Cairo support under Poky, since
they're never used and also cause a build loop from libdrm -> cairo ->
mesa-dri -> libdrm.
To avoid variance in build results, introduce a --disable-cairo-tests
switch.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
If color format for CRTC layer is not specified on commandline, then
c->fourcc is unintialized resulting in addfb call failing.
Signed-off-by: Rob Clark <rob@ti.com>
As the modeset test application is often referred to as an example of
the KMS API usage, move test pattern generation and buffer allocation to
a separate file to keep it simple and clear.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This will make it easier to add additional parameters to the connector
and plane arguments.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Implement tiles and SMPTE test pattern generation for the RGB565,
BGR888, RGB888, ARGB8888, BGRA8888 and BGRX8888 formats.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Implement tiles and SMPTE test pattern generation for the NV12, NV21,
NV16 and NV61 formats.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Implement tiles and SMPTE test pattern generation for the UYVY, VYUY and
YVYU formats.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Merge the create_test_buffer() and create_grey_buffer() functions into a
single buffer allocation function that takes the pixel format and fill
pattern as parameters.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
this patch adds libdrm_exynos helper layer that inclues some intefaces
for exynos specific gem and virtual display driver and also adds exynos
module name to modtest and vbltest.
Changelog v2:
- fixed exynos broken ioctl.
the pointer of uint64_t *edid should be removed.
- removed unnecessary definitions.
- added drm prime interfaces.
this feature is used to share a buffer between drivers or memory managers
and for this, please, refer to below links:
http://www.mjmwired.net/kernel/Documentation/dma-buf-sharing.txthttp://lwn.net/Articles/488664/
this patch is based on a link below:
git://anongit.freedesktop.org/mesa/drm
commit id: d72a44c7c4
Reviewed-by: Rob Clark <rob@ti.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Rob Clark <rob@ti.com>
In the future we'll have more than just connector properties, so create
a dump_prop function that can handle any property (instead of the
current dump_props function that only handles connector properties).
Also, make this function print a lot more information about the existing
properties.
Also change the printed indentation of the modes to make the output more
readable.
The previous function dump_props also segfaulted when we didn't have
enought permissions. The new function does not segfault in this case (by
checking for the return value of drmModeGetProperty).
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
24 (16 direct, 8 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 7
at 0x402994D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4A25950: drmMalloc (xf86drm.c:147)
by 0x4A2E26D: drmModeGetPlaneResources (xf86drmMode.c:951)
by 0x4025FF: dump_planes (modetest.c:276)
by 0x4052AF: main (modetest.c:1120)
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Don't "continue" without freeing the connector.
192 bytes in 6 blocks are indirectly lost in loss record 6 of 12
at 0x4C2779D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4E30DD8: drmMalloc (xf86drm.c:147)
by 0x4E35024: drmAllocCpy (xf86drmMode.c:73)
by 0x4E35D69: drmModeGetConnector (xf86drmMode.c:507)
by 0x402F22: dump_connectors (modetest.c:181)
by 0x40261B: main (modetest.c:801)
Reviewed-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Use unsigned int instead of int:
- modetest.c:90:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:98:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:118:1: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:286:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:303:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:694:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
- modetest.c:1088:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
The 'fd' variable is global, we don't need to pass it as an argument:
- modetest.c:998:40: warning: unused parameter ‘fd’ [-Wunused-parameter]
We don't use the 'modeset' variable:
- modetest.c:1025:8: warning: variable ‘modeset’ set but not used [-Wunused-but-set-variable]
V2: rebase, clear some more warnings
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This adds libdrm_omap helper layer (as used by xf86-video-omap,
omapdrmtest, etc).
Signed-off-by: Rob Clark <rob@ti.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
[danvet: pushed for Rob, he doesn't yet have commit access.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
gem_flink|gem_open are DRM_AUTH ioctl, and being lazy we do not
establish ourselves as authenticated before testing the ioctls. So
instead of aborting, skip the test unless we have root privileges (and
so DRM_MASTER and the DRM_AUTH restriction no longer applies).
A future test could assert that the flink fails without proper
authentication.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43924
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
It's more compatible; at least the Intel driver now rejects 32 bit
depths since it generally can't support real 32 bit framebuffers
(supports 30, 36, and 64 bit, but not 32).
Currently, all the tests for libdrm are built during 'make all', even
if you do not wish to run tests. Attached is a patch, based on
version 2.4.15, to make the tests build in 'make check'.
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
Add mode setting files to libdrm, including xf86drmMode.* and the new
drm_mode.h header. Also add a couple of tests to sanity check the
kernel interfaces and update code to support them.
Main fix is an oops that was triggered by the gtt pwrite path when we don't
have the gtt initialized. Also, settle on -EBADF for "bad object handle",
and -EINVAL for "reading/writing beyond object boundary".
Lots of conflicts, seems to load ok, but I'm sure some bugs snuck in.
Conflicts:
linux-core/drmP.h
linux-core/drm_lock.c
linux-core/i915_gem.c
shared-core/drm.h
shared-core/i915_dma.c
shared-core/i915_drv.h
shared-core/i915_irq.c
This is the create (may want location flags), pread/pwrite/mmap
(performance tuning hints), and set_domain (will 32 bits be enough for
everyone?) ioctls. Left in the generic set are just flink/open/close.
The 2D driver must be updated for this change, and API but not ABI is broken
for 3D. The driver version is bumped to mark this.
Okay we have crtc, encoder and connectors.
No more outputs exposed beyond driver internals
I've broken intel tv connector stuff.
Really for TV we should have one TV connector, with a sub property for the
type of signal been driven over it
so really want to get a list of modes per output not the global hammer list.
also we remove the mode ids and let the user pass back the full mode description
need to fix up add/remove mode for user modes now
This allow the user to retrieve a list of properties for an output.
Properties can either be 32-bit values or an enum with an associated name.
Range properties are to be supported.
This API is probably not all correct, I may make properties part of the general
resource get when I think about it some more.
So basically you can create properties and attached them to whatever outputs you want,
so it should be possible to create some generics and just attach them to every output.
Conflicts:
linux-core/drmP.h
linux-core/drm_bo.c
linux-core/drm_drv.c
linux-core/drm_objects.h
shared-core/drm.h
shared-core/i915_dma.c
shared-core/i915_drv.h
shared-core/i915_irq.c
Mostly removing typedefs that snuck into the modesetting code and
updating to the latest TTM APIs. As of today, the i915 driver builds,
but there are likely to be problems, so debugging and bugfixes will
come next.