summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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>
2015-02-12Stop undefining _ATOMIC_TYPE in Solaris/NetBSD section of xf86atomic.hAlan Coopersmith
Since the atomic_set() macro references _ATOMIC_TYPE, undefining it broke that macro, resulting in build errors of: "intel_bufmgr_gem.c", line 775: undefined symbol: _ATOMIC_TYPE Now that we're leaving the macro in the namespace, renamed it to start with LIBDRM_ instead of _ to avoid polluting others namespace. Regression introduced in 87fdd32c8779648 Add NetBSD atomic ops support. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-By: Thomas Klausner <wiz@NetBSD.org>
2015-02-11xf86drm: Fix ioctl struct clearing in drmGetVersionDaniel Vetter
Oops, fumbled that one. Reported-by: Jan Vesely <jan.vesely@rutgers.edu> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-11tests: remove intel-specific testsDaniel Vetter
These all moved to igt meanwhile. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-11xf86drm: Unconditionally clear ioctl structsDaniel Vetter
We really have to do this to avoid surprises when extending the ABI later on. Especially when growing the structures. A bit overkill to update all the old legacy ioctl wrappers, but can't hurt really either. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-11drm: use drmIoctl everywhereDaniel Vetter
Well just core drm. All the other callers in there that still use direct calls to ioctl have some custom retry logic already, so should be good already. All the other offenders (tests, freedreno/kgsl, ...) don't really matter (e.g. kgsl is the blob library and so not a drm thing) or are again special exceptions with their own retry loops. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-11xf86drmMode: Unconditionally clear ioctl structsDaniel Vetter
We really have to do this to avoid surprises when extending the ABI later on. Especially when growing the structures. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-11intel: Unconditionally clear ioctl structsDaniel Vetter
We really have to do this to avoid surprises when extending the ABI later on. Especially when growing the structures. Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-10Fix gcc -Wextra warningsJan Vesely
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-10random: Use unsigned long for seedJan Vesely
v2: Remove unrelated change in main() This is more consistent with the rest, and avoids potential undefined behavior (signed overflow) ind drmRandom() Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-02-02exynos: remove DRM_EXYNOS_GEM_{MAP_OFFSET/MMAP} ioctlsHyungwon Hwang
This patch removes the ioctls which are removed from the linux kernel. 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-02exynos: Don't use DRM_EXYNOS_GEM_{MAP_OFFSET/MMAP} ioctlsHyungwon Hwang
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-01-26nouveau: Remove unused static function.Thomas Klausner
Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-26intel: Only define variable when it's used.Thomas Klausner
Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-26Add NetBSD atomic ops support.Thomas Klausner
Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-26Fix libdrm's atomic_dec_and_test on Solaris.Thomas Klausner
_nv means new value, not old value! Signed-off-by: Thomas Klausner <wiz@NetBSD.org> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-23Add new drmOpenRender functionFrank Binns
Add a new function, drmOpenRender, that can be used to open render nodes. This can be used in the same way that drmOpenControl is used to open control nodes. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
2015-01-23Rename DRM_NODE_RENDER to DRM_NODE_PRIMARYFrank Binns
Now that there are render nodes it doesn't seem appropriate for the type of the card nodes to be DRM_NODE_RENDER. For this reason, rename this type to DRM_NODE_PRIMARY as this name better represents the purpose of these nodes. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Rob Clark <robdclark@gmail.com>
2015-01-21configure.ac: bump version to 2.4.59 for releaseMaarten Lankhorst
2015-01-21only enable support for freedreno on arm automaticallyMaarten Lankhorst
Users can still override this by explicitly passing --enable-freedreno to configure. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
2015-01-19radeon: align r600/700 fmask to 128 X blocks.Dave Airlie
After much searching and empricial testing, and reading of things I've no justifcation for this fix, other than it really appears this is what the hw is doing or close enough. It makes sense that each entry in the FMASK corresponds to an entry in the CMASKm and the CMASK is organised into 128x128 blocks, but I can't find anything in any of the docs/info from AMD. But I've spent a lot of time on this, and this seems to be the simplest fix, in that we don't over allocate things too much, once this fix in place we can nuke the extra multiplier in mesa. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-01-18configure/freedreno: enable freedreno by defaultRob Clark
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-18configure/freedreno: make KGSL support optionalRob Clark
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>