Commit Graph

5454 Commits (7e4f0664acfa79448f6e32c1f1b12b94626777b2)

Author SHA1 Message Date
Damien Lespiau 77dce9a012 intel: Don't leak the test page in an has_userptr() error path
When handling the error on GEM_CLOSE, we weren't freeing the allocated
page. Plug that.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-19 14:36:35 +01:00
Rafal Sapala 0fa1dbf646 intel: Adding locks for drm objects synchronization.
The changes make sure that members of the bufmgr_gem and bo_gem
name lists are sychronized between threads
when using the create from prime and create from name methods.

Signed-off-by: Rafal Sapala <rafal.a.sapala@intel.com>
Testcase: igt/drm_import_export
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-09-19 09:20:22 +02:00
Tvrtko Ursulin ae8edc7544 intel: Add support for userptr objects
Allow userptr objects to be created and used via libdrm_intel.

At the moment tiling and mapping to GTT aperture is not supported
due hardware limitations across different generations and uncertainty
about its usefulness.

v2: Improved error handling in feature detection per review comments.

v3: Rebase on top of the drm_public addition, minor whitespace addition.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> (v3)
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> (v1,v2)
2014-09-17 12:15:57 +01:00
Lionel Landwerlin 86b37c61c7 intel: make drm_intel_gem_bo_get_reloc_count() thread safe
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2014-09-15 14:51:25 +01:00
Lionel Landwerlin 88025ad808 intel: make bo_unreference() thread safe
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2014-09-15 14:51:16 +01:00
Lionel Landwerlin 743af59669 intel: make bufmgr_gem shareable from different API
When using Mesa and LibVA in the same process, one would like to be
able bind buffers from the output of the decoder to a GL texture
through an EGLImage.

LibVA can reuse buffers allocated by Gbm through a file descriptor. It
will then wrap it into a drm_intel_bo with
drm_intel_bo_gem_create_from_prime().

The problem at the moment is that both library get a different
drm_intel_bufmgr object when they call drm_intel_bufmgr_gem_init()
even though they're using the same drm file descriptor. As a result,
instead of manipulating the same buffer object for a given file
descriptor, they get 2 different drm_intel_bo objects and 2 different
refcounts, leading one of the library to get errors from the kernel on
invalid BO when one of the 2 library is done with a shared buffer.

This patch modifies drm_intel_bufmgr_gem_init() so, given a file
descriptor, it will look for an already existing drm_intel_bufmgr
using the same file descriptor and return that object.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2014-09-15 14:51:07 +01:00
Lionel Landwerlin 63fc571863 atomic: add atomic_add_unless()
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2014-09-15 14:50:47 +01:00
Emil Velikov 8c2ae16959 freedreno: fd_bo_from_handle() remove duplicate declaration
Already declared in our public header freedreno_drmif.h

Cc: Rob Clark <robclark@freedesktop.org>
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Rob Clark <robclark@freedesktop.org>
2014-09-01 16:12:52 +01:00
Emil Velikov d69cc400f5 android: add CleanSpec.mk
The file contains rules that are executed on incremental builds. This
way one can avoid doing a full clean and ensure that the new object
(library) is correctly build. Let's also cleanup the headers.

Inspired by the work of Chih-Wei Huang, from the Android-x86 project.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:02 +01:00
Emil Velikov a8ce03f35f freedreno: add Android build support
v2 Rename the headers variable(s) to *_H_FILES.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:02 +01:00
Emil Velikov 41bfc07fe5 nouveau: add Android build support
v2 Rename the headers variable(s) to *_H_FILES.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:02 +01:00
Emil Velikov adb1cdcdde radeon: add Android build support
v2 Rename the headers variable(s) to *_H_FILES.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:02 +01:00
Emil Velikov b26dc002f7 libdrm,intel: rework android header handling
Contains the following patches squashed in:

    commit 99247a5bd724ddcf0f06a5518baad207c53f1e2b
    Author: Haitao Huang <haitao.huang@intel.com>
    Date: Fri, 27 Apr 2012 13:20:53 -0500

        Android.mk: use LOCAL_COPY_HEADERS to export headers.

        Export necessary header files used by other components for
        Android, such as libva intel-driver, gralloc, hwcomposer, etc.

        Change-Id: I2feabf6941379ef4d756e942f30eba059de641f1
        Signed-off-by: Haitao Huang <haitao.huang@intel.com>
        [chad: Fixed inconsistent indentation.]
        Signed-off-by: Chad Versace <chad.versace@linux.intel.com>

    commit 7d0b528cb69995d7ea4e29b2daa1e3b28a362f42
    Author: Emil Velikov <emil.l.velikov@gmail.com>
    Date: Sun, 27 Jul 2014 18:22:41 +0100

        android: reuse headers lists, separate libdrm from intel headers

        Rather than having a duplicate copy of the headers list(s),
        reuse the existing one(s). Distinguish that the intel headers
        should be copied when libdrm_intel is used.

        v2 Rename the headers variable(s) to *_H_FILES.

        Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>

    commit 361de3ba4cadd5357596d1537bb3f216d281532b
    Author: Piotr Luc <piotr.luc@intel.com>
    Date: Fri, 14 Jun 2013 13:00:39 +0200

        Export include dir from libdrm

        BZ: 116218

        Google introduced new method of specifying include path(s)
        between modules. This allows a module to include header from a
        library without directly specifyining by includer the path where
        headers are located.

        The method requires from library that holds headers to export
        include path(s) in LOCAL_EXPORT_C_INCLUDE_DIRS variable.
        These exported include path(s) are automatically added to
        include path(s) of modules that have name of the library in the
        LOCAL_SHARED_LIBRARIES or LOCAL_STATIC_LIBRARIES list.

        This change sets LOCAL_EXPORT_C_INCLUDE_DIRS to folders that
        contain headers file that used by other modules in order to
        export these paths.

        Change-Id: Id1ac885b31ef2efe194e0289fbcaecd9eb533df0
        Signed-off-by: Piotr Luc <piotr.luc@intel.com>
        Reviewed-on: http://android.intel.com:8080/113562
        Reviewed-by: cactus <cactus@intel.com>
        Reviewed-by: Luc, Piotr <Piotr.Luc@intel.com>
        Reviewed-by: Purushothaman, Vijay A <vijay.a.purushothaman@intel.com>
        Reviewed-by: Stimson, Dale B <dale.b.stimson@intel.com>
        Tested-by: Stimson, Dale B <dale.b.stimson@intel.com>
        Reviewed-by: buildbot <buildbot@intel.com>
        Tested-by: buildbot <buildbot@intel.com>

    commit 2bf22fcbd4cbb9e7c7764d5eff0bb4e75ab1a005
    Author: Emil Velikov <emil.l.velikov@gmail.com>
    Date: 27 Jul 2014 18:27:21 +0100

        android: Separate libdrm and intel LOCAL_EXPORT_C_INCLUDE_DIRS

        Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:02 +01:00
Emil Velikov 0a92953e70 libdrm,intel: Add Android build
Contains the following patches squashed in:

    commit f340a8b9f2b84d5762553bef046914e0bde20795
    Author: Chad Versace <chad.versace@linux.intel.com>
    Date: Wed, 21 Dec 2011 11:43:57 -0800

        libdrm,intel: Add Android makefiles (v2)

        This enables libdrm.so and libdrm_intel.so to build on Android
        IceCreamSandwich.

        v2: Link libdrm_intel to libpciaccess.

        Change-Id: Ie5ed4bc0e6b4f9f819e3ec44488e385c35e97128
        Signed-off-by: Chad Versace <chad.versace@linux.intel.com>

    commit 8fb3f42389dea34218ed1fe59550ec2abb4d6953
    Author: Andrew Boie <andrew.p.boie@intel.com>
    Date: Wed, 26 Sep 2012 13:32:05 -0700

        libdrm, libdrm_intel: Skip driver name checks

        These libraries have 'optional' tags, which means they won't get
        built unless something else depends on them or they are added to
        PRODUCT_PACKAGES. There's no need for additional filtering.

        Change-Id: I5d90969f38671f8144c0dc27d47144b3f09a15ce
        Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2014-09-01 16:06:01 +01:00
Emil Velikov 4255d3d51d libdrm, freedreno, intel, nouveau, radeon: add Makefile.sources
Will be used to consolidate the required sources lists as well as the
install-able headers. This is turn will help us to avoid the
duplication with the upcoming Android build support.

v2: Rename the headers variable to *_H_FILES.
v3: Rebase on top of symbol visibility patches.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:01 +01:00
Emil Velikov 02b3ad7e19 libkms: remove explicit define _FILE_OFFSET_BITS 64
configure.ac has AC_SYS_LARGEFILE which provides the define and/or
approapriate magic when required.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-09-01 16:06:01 +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
Maks Naumov 391bba9c4c radeon: Fix surf->bankh init by default value when surf->tile_split == 0
Signed-off-by: Maks Naumov <maksqwe1@ukr.net>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-08-25 13:07:12 +02:00
Alex Deucher 22b995d8cb radeon: add new SI pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-21 11:06:33 -04:00
Alex Deucher 3ad801bf1f radeon: add new CIK pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-21 11:04:51 -04:00
Maarten Lankhorst d9ce09de12 exynos: Use symbol visibility.
No changes to exported symbols.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-08-14 21:59:20 +02:00
Maarten Lankhorst 479b6cef70 freedreno: Use symbol visibility.
Hiding fd_device_del_locked, and fd_cleanup_bo_cache.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-08-14 21:59:19 +02:00
Maarten Lankhorst 2d1044cc47 omap: Use symbol visibility.
No changes to exported symbols.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-08-14 21:59:18 +02:00
François Tigeot edbb4e545f drm: Implement drmCheckModesettingSupported() for DragonFly
For the sake of simplicity, KMS support can always be considered
present on DragonFly.

If some particular version doesn't support KMS yet, appropriate
checks are already done in Dports's x11-drivers/ Makefiles and
KMS-enabled driver packages don't get built.

Signed-off-by: François Tigeot <ftigeot@wolfpond.org>
Signed-off-by: Maarten Lankhorst <dev@mblankhorst.nl>
2014-08-14 21:56:46 +02:00
Maarten Lankhorst 07fead4462 intel: Use symbol visibility.
No exports changed for this driver.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-04 09:36:05 +02:00
Maarten Lankhorst 58ce9d6292 radeon: Use symbol visibility.
All the bof_* symbols are now no longer exported.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2014-08-04 09:22:36 +02:00
Maarten Lankhorst 56c4857f17 nouveau: Only export public functions.
This hides all the abi16_* functions and the nouveau_debug variable,
they should have been private to begin with.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-08-04 09:22:00 +02:00
Thierry Reding 5d8357976a configure: Support symbol visibility when available
Checks whether or not the compiler supports the -fvisibility option. If
so it sets the VISIBILITY_CFLAGS variable which can be added to the per
directory AM_CFLAGS where appropriate.

By default all symbols will be hidden via the VISIBILITY_CFLAGS. The
drm_public macro can be used to mark symbols that should be exported.

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-07-30 16:58:14 +02:00
Marek Olšák d6861609b2 configure.ac: bump version to 2.4.56 for release 2014-07-29 18:54:33 +02:00
Marek Olšák 2169dce96c radeon: fix typo in sample split / fixes MSAA on Hawaii
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2014-07-29 00:24:32 +02:00
Andreas Boll 8bdb4cfa45 libdrm: Fix drm.h include in qxl drm header file
Use "drm.h" instead of "drm/drm.h" as used in the other header files.
Fixes xserver-xorg-video-qxl build with KMS support on Debian, where this
file is installed in /usr/include/libdrm.

Fixes Debian bug #746807

Reported-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2014-07-28 17:35:29 +02:00
Maarten Lankhorst 6f15ca8081 bump to version 2.4.55 for release 2014-07-25 15:08:23 +02:00
Maarten Lankhorst a328b02c1d exynos: do not build fimg2d_test when building without libkms support.
This prevents a build failure.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2014-07-25 11:38:55 +02:00
Thomas Klausner c0b34dca26 radeon: Add missing header includes.
unistd.h for close() and xf86drm.h for drmOpen().

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-07-16 12:16:08 +09:00
Thomas Klausner 72f84b85af radeon: Remove superfluous parentheses.
Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
2014-07-16 12:15:29 +09:00
Tobias Jakobi e8c3c1358e exynos: fix scaling factor computation in g2d_copy_with_scale
When division of source and destination width yields the
scaling factor for the x-coordinate, then it should be
source/destination _height_ for y.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-20 15:53:01 -04:00
Tobias Jakobi 3001c232d1 exynos: fix G2D_DOUBLE_TO_FIXED for non-integer input
The hardware accepts scaling factors formatted in a
fixed-point format. The current macro casts to integer
first, then multiplies by the fp conversion factor.

This does not make any sense. In particular, truly
'fractional' inputs, like 1.5, won't work that way.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-20 15:53:01 -04:00
Tobias Jakobi 63f51fc4d3 exynos: fix coordinate computation in g2d_copy
The right-bottom register isn't set correctly.
Looks like a copy-and-paste error.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-20 15:53:01 -04:00
Tvrtko Ursulin 4fddc92e04 intel: Add new userptr ioctl
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2014-06-19 18:35:05 +01:00
Damien Lespiau 20edfb9a16 intel: Sync typo fix from the kernel sources.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-06-19 18:29:20 +01:00
Damien Lespiau 3cde43f566 intel: Sync the command parser version parameter from kernel
Cc: Bradley Volkin <bradley.d.volkin@intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-06-19 18:29:02 +01:00
Rob Clark 56d170bc06 freedreno: add chip-id property
Userspace needs to know the patch-revision in addition to just the
gpu-id (ie. 320, 305, etc).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-18 10:42:07 -04:00
Rob Clark 09db8019da freedreno: sync kernel header
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-06-18 09:42:11 -04:00
Matt Roper 8fc62ca8ac drm: Add universal plane capability bit and plane type enums
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-05-19 19:43:16 -04:00
Daniel Kurtz 305478ce02 drmOpenByName: remove redundant drmAvailable check
drmOpenByName() is a static function that is only called by drmOpen().
drmOpen() already checks drmAvailable(), so the check in
drmOpenByName() is redundant.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
2014-05-13 12:14:19 +02:00
Daniel Kurtz ee87b4716d exynos: removed unused fd field
The documentation says fd holds the fd from prime import/export.
However, it isn't actually used, nor is it necessary, so let's just remove
it.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:21 -04:00
Daniel Kurtz a13bdd5c71 exynos: prime: use drmPrime*() helpers
Reuse the common drmPrime() helper functions rather than reinventing them.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:20 -04:00
Daniel Kurtz d1000c432c exynos_fimg2d_test: fix drmModeRmFB
The first parameter should be the drm fd, second param is the fb id.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:20 -04:00
Daniel Kurtz 382043ee48 exynos: remove unusable "run" target
This looks like it was copied from kmstest, but isn't needed, and doesn't
actually work since exynos_fimg2d_test requires parameters.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:19 -04:00
Daniel Kurtz 4e193aa817 exynos_fimg2d: fix cast from pointer to integer of different size
Fixes two gcc [-Wpointer-to-int-cast] warnings.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
2014-05-12 23:09:13 -04:00