summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-03-16exynos: add exynos prefix to fimg2d headerTobias Jakobi
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-16exynos: use structure initialization instead of memsetTobias Jakobi
Keeps the code cleaner, since the structs have to be initialized once anyway. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com> [evelikov: squash trivial conflict] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Conflicts: tests/exynos/exynos_fimg2d_test.c
2015-03-16exynos: honor the repeat mode in g2d_copy_with_scaleTobias Jakobi
This is useful when the default repeat mode, which is 'repeat' produces artifacts at the borders of the copied image. Choose the 'pad' mode to make use of the color of the destination image. In my usage case the destination is the framebuffer, which is solid filled with a background color. Scaling with 'pad' mode would then just do the right thing and also produces nice borders on the output. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-16exynos: add g2d_scale_and_blendTobias Jakobi
This is a combination of g2d_copy_with_scale and g2d_scale. It is a pretty common operation to scale one buffer and then blend it on top of another, so provide a direct way to that operation. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-16tests/exynos: fimg2d: add a checkerboard testTobias Jakobi
This makes it easier to spot memory corruptions which don't become visible when using a plain buffer filled with a solid color (so corruptions that are just a permutation of the bytes in the buffer). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Inki Dae <inki.dae@samsung.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-16modetest: include into the build when libkms is not selected.Emil Velikov
With commit d7c0a08bc57(modetest: Allocate dumb buffers with the correct bpp) we moved away from the libkms dependency. As such we are safe with including the Makefile/subdir, even as we opt out of building the library. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-03-15Add static qualifier to local functionsJan Vesely
v2: Don't bother marking dead functions static (handler, xf86VDrvMsgVerb, drmSetDebugMsgFunction) Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-14Fix unused, and unused-but-set variables warningsJan Vesely
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14dristat: Handle DRM_CONSISTENTJan Vesely
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14Fix type-limits, pointer-arith and sign-compare warningsJan Vesely
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14tests: String literals are const char *Jan Vesely
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Emil Velikov <eil.l.velikov@gmail.com>
2015-03-14On Solaris, #include <sys/mkdev.h> in xf86drm.cAlan Coopersmith
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-13nouveau: Do not add most bo's to the global bo list.Maarten Lankhorst
Only add wrapped bo's and bo's that have been exported through flink or dma-buf. This avoids a lock in the common case, and decreases traversal needed for importing a dma-buf or flink. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Tested-By: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-13nouveau: make nouveau importing global buffers completely thread-safe, with ↵Maarten Lankhorst
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-13Use __sync_add_and_fetch instead of __sync_fetch_and_add for atomic_dec_and_testMaarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Acked-By: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-13Add atomic_inc_return to atomics.Maarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Acked-By: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10exynos: fimg2d: whitespace fix in g2d_flushTobias Jakobi
Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10exynos: fimg2d: introduce G2D_OP_INTERPOLATETobias Jakobi
This sets up the blending equation in the following way: out = src * src_alpha + dst * (1 - src_alpha) Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10exynos: fimg2d: unify register styleTobias Jakobi
Register defines all use uppercase hex codes. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10exynos: fimg2d: fix comment for G2D_COEFF_MODE_GB_COLORTobias Jakobi
The coefficient mode enables use of global color, not alpha. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10exynos: fimg2d: remove TRUE/FALSE from headerTobias Jakobi
The fimg2d header was defining TRUE and FALSE, but actually these defines are just used once. Remove them, since they don't make the code better readable/understandable. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10tests/exynos: improve error handlingTobias Jakobi
Check for a useable connector and also if the resolution is sane (width and height are both non-zero). Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10exynos: introduce g2d_add_base_addr helper functionTobias Jakobi
In almost all functions the base address register is written, so it makes sense to have a helper function for this. v3: Wrap line as pointed out by Emil Velikov <emil.l.velikov@gmail.com>. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10tests/exynos: introduce wait_for_user_inputTobias Jakobi
Currently getchar() is used to pause execution after each test. The user isn't informed if one is supposed to do anything for the tests to continue, so print a simple message to make this more clear. v3: Compactify printf calls as pointed out by Emil Velikov <emil.l.velikov@gmail.com>. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10tests/exynos: disable the G2D userptr/blend testTobias Jakobi
v2: Move the commit description into the patch itself. v3: Use common commenting style as pointed out by Emil Velikov <emil.l.velikov@gmail.com>. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10tests/exynos: fix typos and change wordingTobias Jakobi
No functional changes. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10exynos: replace G2D_DOUBLE_TO_FIXED macro with functionTobias Jakobi
This also avoids the floating point conversion steps and just uses pure integer arithmetic. Since the G2D hardware scaling approach is a bit unintuitive, document it in the function as well. v2: Explicitly mention the normalization constant. v3: Use common commenting style as pointed out by Emil Velikov <emil.l.velikov@gmail.com>. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Tested-by: Joonyoung Shim <jy0922.shim@samsung.com>
2015-03-10drm: add drmGet(Primary|Render)DeviceNameFromFd functionsEmil Velikov
Currently most places assume reliable primary(master) <> render node mapping. Although this may work in some cases, it is not correct. Add a couple of helpers that hide the details and provide the name of the master or render device name, given an fd. The latter may belong to either the master, control or render node device. v2: - Rename Device and Primary to Master (aka the /dev/dri/cardX device). - Check for the file via readdir_r() rather than stat(). - Wrap the check into a single function. - Return NULL for non-linux platforms. v3: - Don't segfault if name is NULL. - Update function names, as suggested by Frank Binns. v4: - Update commit message to reflect the function name changes. Cc: Frank Binns <frank.binns@imgtec.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com>
2015-03-10tests: automake: keep the libs link at the final stageEmil Velikov
Currently the static archive libdrmtest.la links against libdrm.la. Only to have both added to the executables' LDADD. Simplify things a bit, by doing the link in the final module (the executables/tests in this case). Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10tests: move the SUBDIR at the top of the makefileEmil Velikov
None of the subdirs require the modules built in the local makefile, so moving them at the top makes things a hell lot easier to read. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10automake: drop the NULL variable from the makefileEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-10configure: update help stringsEmil Velikov
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-10configure: omap, freedreno and tegra require atomicsEmil Velikov
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-10automake: wrap an insanely long lineEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-03-06Revert "intel: Fix documentation for drm_intel_gem_bo_wait()"Daniel Vetter
This reverts commit 080b4929b7452dc1fea32ac1d32e7e571e7fb38b. Chris noticed that "negative values wait forever" is indeed intended behaviour and the issue is just that we didn't have a testcase (fixed now) and that a regression slipped through (fixed and on track for all stable kernels). So lets undo the documentation change for consistency, since working around kernel regressions isn't good. Practical impact is nil anyway. v2: Add a note to docs that some kernels have been broken. v3: Remove the random garbage included by accident. Cc: Kristian Høgsberg <krh@bitplanet.net> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-02intel: Fix documentation for drm_intel_gem_bo_wait()Kristian Høgsberg
The kernel doesn't actually wait indefinately when passed a negative, timeout, it returns immediately. Document this and suggest using INT64_MAX for indefinite waits. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-27tests/radeon: set the list* functions as inlineEmil Velikov
To silence the chatty compiler. As a future work we may want to merge these with libdrm_lists.h Cc: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27exynos_fimg2d_test: remove unused variablesEmil Velikov
Cc: Inki Dae <inki.dae@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27tests: remove unused variablesEmil Velikov
As kindly pointed out by GCC. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27autotools: add WARN_CFLAGS to all targetsEmil Velikov
... minus test/ttmtest. The latter is not really hooked up with the actual build. This will give us 66 warnings on a distribution build of which - 12 -Wunused-variable - 11 -Wunused-function - 19 -Wmissing-prototypes and a few -Wswitch-enum, -Wtype-limits etc. Adding the CFLAGS gives some exposure to these so that we can fix them. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27tests: fix implicit funciton declaration errorsEmil Velikov
ioctl() and strcmp() were used without the relevent header being included. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27exynos_fimg2d_test: fix implicit funciton declaration errorsEmil Velikov
As one adds WARN_CFLAGS to the build the compiler throws a couple of lovely error messages. Add the relevant includes to fix them. error: implicit declaration of function ‘time’ error: implicit declaration of function ‘getopt’ Cc: Inki Dae <inki.dae@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-27autotools: add AM_DISTCHECK_CONFIGURE_FLAGSEmil Velikov
To make sure that the release/distribution tarball is not broken for all the targets. Currently the experimental APIs are disabled by default amongst others. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-02-25tests: add support for imx-drmPhilipp Zabel
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-23Add new drmGetNodeTypeFromFd functionFrank Binns
Add a helper function that returns the type of device node from an fd. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-23android: remove duplicate libdrm in LOCAL_SHARED_LIBRARIESChih-Wei Huang
v2: Fold libpciaccess and libdrm into a single local_shared_libraries Acked-by: Jan Vesely <jan.vesely@rutgers.edu> Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-23libdrm: fix the Android 64bit buildEmil Velikov
With 64bit bionic mmap now handles 64bit offset, thus we no longer need the __mmap2 trick. Fix from Chih-Wei Huang, over at the google forums. Cc: Chih-Wei Huang <cwhuang@android-x86.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-16nouveau: fix unlock nouveau_bo_name_ref()Jerome Glisse
Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
2015-02-12Add new drmOpenOnceWithType function (v2)Jammy Zhou
v2: call drmOpenOnceWithType in drmOpenOnce, and drop unused param for drmOpenOnceWithType Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-02-12Add new drmOpenWithType function (v4)Jammy Zhou
v2: Add drmGetMinorBase, and call drmOpenWithType in drmOpen v3: Pass 'type' to drmOpenByBusid and drmOpenDevice in drmOpenByName v4: Renumber node type definitions, and return -1 for unsupported type Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v3) Reviewed-by: Frank Binns <frank.binns@imgtec.com>