summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-07-16Consistently check the fd valueEmil Velikov
Follow the approach used through the rest of the project. Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-07-16xf86drm: fix incorrect fd comparison in drmOpenOnce{,WithType}Emil Velikov
Spotted by looking for similar "let's assume fd == 0 is invalid" bugs. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-07-16omap: zero is a valid fd number, treat it as suchEmil Velikov
Equivalent to the previous patch. Cc: Rob Clark <robdclark@gmail.com> Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-07-16freedreno: zero is a valid fd number, treat it as suchEmil Velikov
Abeit quite unlikely to get hit by this bug here, let just fix it. v2: Correct conditional (do not call ioctl(DRM_IOCTL_PRIME_HANDLE_TO_FD) when we already have the fd). v3: Fix kgsl_pipe.c, suggested by Thierry. Cc: freedreno@lists.freedesktop.org Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
2015-07-13include <sys/types.h> & <sys/mkdev.h> directly for major() and minor()Alan Coopersmith
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-11Fix headers inclusion in xf86drmMode.cJulien Cristau
Add sys/sysctl.h to get sysctlbyname declaration on kFreeBSD Updated by Thorsten “mirabilos” Glaser <t.glaser@tarent.de> to add autoconf check and only include <sys/sysctl.h> if it is detected by configure as it’s unusable on Linux/x32 (and others, e.g. other new architectures). Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-07-06Set alignment value in drm_intel_add_validate_buffer()Anuj Phogat
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
2015-07-06i965/gen9: Pass alignment as function parameter in ↵Anuj Phogat
drm_intel_gem_bo_alloc_internal() In case of YF/YS tiled buffers libdrm need not know about the tiling format because these buffers don't have hardware support to be tiled or detiled through a fenced region. But, libdrm still need to know about buffer alignment restrictions because kernel uses it when resolving the relocation. Mesa uses drm_intel_gem_bo_alloc_for_render() to allocate Yf/Ys buffers. So, use the passed alignment value in this function to initialize the align variable in drm_intel_bo. Note that we continue ignoring the alignment value passed to drm_intel_gem_bo_alloc() to follow the previous behavior. V2: Add a condition to avoid allocation from cache. (Ben) V3: Make no changes in cache allocation strategy. Just update the alignment. Update the aperture size estimate including the alignment. (Ben, Chris) V4: Move aperture size adjustments inside drm_intel_bo_gem_set_in_aperture_size() Don't split sentences across the one-line header and the changelog. (Chris) Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-30configure: default --enable-valgrind to autoEmil Velikov
... as the help text says. Reported-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29configure.ac: bump version to 2.4.62 for releaseEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29tests/exynos: handle G2D_IMGBUF_COLOR in switch statementsTobias Jakobi
This fixes a compiler warning about missing handling of enum values in the switch statements. Also remove the silent mapping to G2D_IMGBUF_GEM when an unknown buffer type is encountered. We have full control about the type here, and if it's unknown then we obviously have a bug in the code. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29tests/exynos: remove connector_find_planeTobias Jakobi
No test uses DRM planes at the moment so this function is never called. Inspection of the git history shows that DRM planes were also never used in these tests in the past. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29tests/exynos: simplify drm_set_crtcTobias Jakobi
We can just return 'ret' here, the goto serves no purpose. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29tests/exynos: remove struct fimg2d_test_caseTobias Jakobi
It doesn't make sense to keep this structure, since we can just call all tests directly. An inspection of the git history shows that no code ever used this abstraction in the past. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29tests/exynos: remove unused defineTobias Jakobi
It doesn't make sense to limit the number of test cases anyway. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29tests/exynos: clean struct connectorTobias Jakobi
Remove all unused struct members. An inspection of the git history shows that these members were also never used in the past. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29exynos/fimg2d: simplify g2d_fini()Tobias Jakobi
free()ing a nullptr is a noop, so remove the check. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29tests/exynos: replace return by breakTobias Jakobi
The 'usage' function already does exit(0), so that this 'return -EINVAL' is never called. Just put a break there to avoid confusion. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29exynos: fimg2d: fix return codesTobias Jakobi
Even if flushing the command buffer doesn't succeed, the G2D calls would still return zero. Fix this by just passing the flush return code. In fact error handling currently ignores the fact that g2d_add_cmd() can fail. This is going to be handled in a later patch. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29configure: Add flag to disable valgrind support.Matt Turner
v2 [Emil Velikov]: Autodetect valgrind. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29xf86drmMode: include config.h before anything elseEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29xf86drmMode: remove unused valgrind(VG) macrosEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29Add blob property create/destroy ioctl wrappersDaniel Stone
v2: Use memclear to zero out structure. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Rob Clark <robclark@freedesktop.org>
2015-06-29Support atomic modesetting ioctlVille Syrjälä
Add support for the atomic modesetting ioctl through a property-set API. v1: Squashed intermediate patches from Ville, Rob and myself. Updated for current kernel interface (no blobs). v2: Rewrite user-facing API to provide transactional/cursor interface. Use memclear to zero out ioctl. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Rob Clark <robclark@freedesktop.org> Signed-off-by: Daniel Stone <daniels@collabora.com> v3 [Emil Velikov]: Remove DRM_CAP_ATOMIC - superseded by DRM_CLIENT_CAP_ATOMIC. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-06-29Revert "Add device enumeration interface (v4)"Emil Velikov
This reverts commit fde4969176822fe54197b6baa78f8b0ef900baba. The commit adds an API that does not seem flexible enough to be used in current open-source projects. Additionally it adds a hidden dependency of libudev, which when used in mesa caused grief when combined with Steam('s runtime). Let's revert this for now and add a tweaked API later on that can be used in mesa/xserver. Cc: Frank Min <frank.min@amd.com> Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Jammy Zhou <Jammy.Zhou@amd.com>
2015-06-21nouveau: add asserts to make sure krefs are thereIlia Mirkin
This should help catch odd bugs at the callsites rather than much later on with completely bogus bo indices. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-05-28tests/kmstest: support atmel-hlcdcBoris BREZILLON
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
2015-05-28modetest: add atmel-hlcdc driver supportBoris BREZILLON
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
2015-05-28modetest: only select plane with matching formatTobias Jakobi
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-28modetest: make middle SMPTE colors transparentTobias Jakobi
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-28drmPrime*: initialize output args to 0Guillaume Desmottes
Fix Valgrind errors because those memory was uninitialized. https://bugs.freedesktop.org/show_bug.cgi?id=90194 Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> v2: Explicitly zero the whole struct using memclear. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28Fix one warning (v2)Jammy Zhou
xf86drm.c:356:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] group = (serv_group >= 0) ? serv_group : DRM_DEV_GID; ^ v2: do 'int' cast to fix the warning Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-05-28xf86drm: simplify drmMalloc/drmFreeEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-28modetest: replace malloc + memset with callocEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-28modetest: explicitly zero the newly allocated memoryEmil Velikov
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-26Add device enumeration interface (v4)frank
Add an interface for enumerating PCI devices on a system. v3: switch to udev/sysfs for the enumeration v4: fix warnings Signed-off-by: Frank Min <frank.min@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
2015-05-26radeon: add new bonaire pci idAlex Deucher
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2015-05-21nouveau: add coherent BO attributeAlexandre Courbot
Add a flag allowing Nouveau to specify that an object should be coherent at allocation time. This is required for some class of objects like fences which are randomly-accessed by both the CPU and GPU. This flag instructs the kernel driver to make sure the object remains coherent even on architectures for which coherency is not guaranteed by the bus. Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2015-05-18intel: Add the Broxton PCI IDsDamien Lespiau
Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-07configure.ac: bump version to 2.4.61 for releaseBen Skeggs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-05-06nouveau: restore check that avoids multiple user bos per kernel boBen Skeggs
Lost in 5ea6f1c32628887c9df0c53bc8c199eb12633fec, triggering fdo#89842. Unlike the PRIME fd->handle interfaces, the GEM_OPEN interface doesn't do anything at the kernel level to prevent this situation occuring, and we end up with multiple GEM handles for a single kernel buffer. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2015-05-05modetest: fix allocation for yuv420/yvu420Rob Clark
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2015-04-29freedreno: link against CLOCK_LIBEmil Velikov
Required by clock_gettime() Cc: Rob Clark <robdclark@gmail.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-29android: set the HAVE_VISIBILITY defineEmil Velikov
... in order to limit the exported symbols only to the required ones. Both compilers used with Android (GCC and LLVM) support this, so set it unconditionally. Cc: Chih-Wei Huang <cwhuang@linux.org.tw> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-29modetest: fix the arguments of the MAKE_RGB_INFO defineJoonyoung Shim
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-29intel: Leak the userptr test boTvrtko Ursulin
In order to use userptr, the kernel tracks the owner's mm with a mmu_notifier. Setting that is very expensive - it involves taking all mm_locks and a stop_machine(). This tracking lives only for as long as the client is using userptr objects - so if the client allocates then frees a userptr in a loop, we will be executing that heavyweight setup everytime. To ammoritize this cost, just leak the test bo and the single backing page we use for detecting userptr. v2: Free the object and memory when bufmgr is destroyed. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-04-28modetest: destroy the cursor boJoonyoung Shim
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-28modetest: clear buffer and framebuffer for planesJoonyoung Shim
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-28modetest: fix the error path handlingJoonyoung Shim
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-28modetest: make use of drmModeRmFBJoonyoung Shim
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>