platform/upstream/libdrm.git
10 years agofix compile error on 32bit systems
Rob Clark [Sun, 28 Sep 2014 18:19:14 +0000 (14:19 -0400)]
fix compile error on 32bit systems

4c2766b (drm_mmap/drm_unmap) brought this error for every .c file that
was not #including config.h:

  In file included from private.h:4:0,
                   from abi16.c:29:
  ../libdrm.h: In function 'drm_munmap':
  ../libdrm.h:81:4: error: size of unnamed array is negative

Signed-off-by: Rob Clark <robdclark@gmail.com>
10 years agoconfigure.ac: bump version to 2.4.57 for release 2.4.57 libdrm-2.4.57
Rob Clark [Sun, 28 Sep 2014 16:25:21 +0000 (12:25 -0400)]
configure.ac: bump version to 2.4.57 for release

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agointel: use drm_mmap/drm_munmap wrappers
Emil Velikov [Sun, 7 Sep 2014 18:47:06 +0000 (19:47 +0100)]
intel: use drm_mmap/drm_munmap wrappers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agofreedreno: use drm_mmap/drm_munmap wrappers
Emil Velikov [Sun, 7 Sep 2014 18:44:48 +0000 (19:44 +0100)]
freedreno: use drm_mmap/drm_munmap wrappers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agoradeon: use drm_mmap/drm_munmap wrappers
Emil Velikov [Sun, 7 Sep 2014 18:43:53 +0000 (19:43 +0100)]
radeon: use drm_mmap/drm_munmap wrappers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agonouveau: use drm_mmap/drm_munmap wrappers
Emil Velikov [Sun, 7 Sep 2014 18:42:08 +0000 (19:42 +0100)]
nouveau: use drm_mmap/drm_munmap wrappers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agolibkms: use drm_mmap/drm_munmap wrappers
Emil Velikov [Sun, 7 Sep 2014 18:41:37 +0000 (19:41 +0100)]
libkms: use drm_mmap/drm_munmap wrappers

... for all by exynos.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agodrm: use drm_mmap/drm_munmap wrappers
Emil Velikov [Sun, 7 Sep 2014 19:03:05 +0000 (20:03 +0100)]
drm: use drm_mmap/drm_munmap wrappers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agoAdd private mmap/munmap wrappers
Emil Velikov [Sun, 7 Sep 2014 18:29:00 +0000 (19:29 +0100)]
Add private mmap/munmap wrappers

Unlike Linux, Android (bionic) has separate functions - mmap & mmap64.
Add a local wrapper (inspired by gallium) that will be used throughout
libdrm to combat this bionic feature.

v2:
 - Drop the undefined unlikely macro.
 - Use macro for munmap under Android.
 - Wrap long lines.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
10 years agoautomake: pick up all files for distribution.
Emil Velikov [Sun, 7 Sep 2014 14:48:48 +0000 (15:48 +0100)]
automake: pick up all files for distribution.

Autotools is already smart enough to pick the *.pc.in files but it
needs some help with the Android.mk ones.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agomodetest: Add support of STI driver
Benjamin Gaignard [Sun, 7 Sep 2014 17:26:06 +0000 (18:26 +0100)]
modetest: Add support of STI driver

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agomodetest: add Android build
Emil Velikov [Sun, 7 Sep 2014 17:23:38 +0000 (18:23 +0100)]
modetest: add Android build

v2: include modetest rather than modeset.
Spotted by Mauro Rossi and Paulo Sergio.

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> (v1)
10 years agomodetest: move sources lists to makefiles.sources
Emil Velikov [Sun, 7 Sep 2014 17:20:03 +0000 (18:20 +0100)]
modetest: move sources lists to makefiles.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agolibkms: add Android build
Emil Velikov [Sun, 7 Sep 2014 17:13:10 +0000 (18:13 +0100)]
libkms: add Android build

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agolibkms: move sources lists to makefile.sources
Emil Velikov [Sun, 7 Sep 2014 17:00:16 +0000 (18:00 +0100)]
libkms: move sources lists to makefile.sources

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agolibkms: build the intel backend only when needed
Emil Velikov [Sun, 7 Sep 2014 16:54:39 +0000 (17:54 +0100)]
libkms: build the intel backend only when needed

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agoconfigure: unconditionally check for atomic ops/primitives
Emil Velikov [Sun, 7 Sep 2014 16:39:46 +0000 (17:39 +0100)]
configure: unconditionally check for atomic ops/primitives

Just have the check once, and let new drivers opt-in if they want
to use them. Move the block further up the script, to tie nicely
with the actual usage of $HW defines.

Move the final $HW users to be alongside their brethren.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agoautomake: fix 'make commit-headers'
Emil Velikov [Sun, 7 Sep 2014 14:54:16 +0000 (15:54 +0100)]
automake: fix 'make commit-headers'

Not too long ago the in-kernel drm public headers were moved. Since then
we could no longer fetch/update the ones in libdrm using the command.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agoRemove i810_drm.h and i830_drm.h from the distribution tarball
Emil Velikov [Sun, 7 Sep 2014 14:46:42 +0000 (15:46 +0100)]
Remove i810_drm.h and i830_drm.h from the distribution tarball

Both of these headers are not installed since they were imported.
They  are not even used internally. The latter no longer exist in the
kernel...

Note the * symbol in EXTRA_DIST causes 'make distcheck' to fail. When
was the last time we ran it ?

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoautomake: remove obsolete makefiles
Emil Velikov [Sun, 7 Sep 2014 14:31:00 +0000 (15:31 +0100)]
automake: remove obsolete makefiles

Rather than having two extra makefiles in order to ship ~10 headers
just fold its 5 lines of code into the top one makefile.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
10 years agofreedreno: add dmabuf import/export helpers
Rob Clark [Tue, 16 Sep 2014 20:26:50 +0000 (16:26 -0400)]
freedreno: add dmabuf import/export helpers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agointel: Don't leak the test page in an has_userptr() error path
Damien Lespiau [Wed, 17 Sep 2014 12:33:45 +0000 (13:33 +0100)]
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>
10 years agointel: Adding locks for drm objects synchronization.
Rafal Sapala [Tue, 5 Aug 2014 18:51:38 +0000 (14:51 -0400)]
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>
10 years agointel: Add support for userptr objects
Tvrtko Ursulin [Thu, 19 Jun 2014 14:52:03 +0000 (15:52 +0100)]
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)
10 years agointel: make drm_intel_gem_bo_get_reloc_count() thread safe
Lionel Landwerlin [Fri, 12 Sep 2014 12:48:38 +0000 (13:48 +0100)]
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>
10 years agointel: make bo_unreference() thread safe
Lionel Landwerlin [Fri, 12 Sep 2014 12:48:37 +0000 (13:48 +0100)]
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>
10 years agointel: make bufmgr_gem shareable from different API
Lionel Landwerlin [Fri, 12 Sep 2014 12:48:36 +0000 (13:48 +0100)]
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>
10 years agoatomic: add atomic_add_unless()
Lionel Landwerlin [Fri, 12 Sep 2014 12:48:35 +0000 (13:48 +0100)]
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>
10 years agofreedreno: fd_bo_from_handle() remove duplicate declaration
Emil Velikov [Sun, 24 Aug 2014 22:48:39 +0000 (23:48 +0100)]
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>
10 years agoandroid: add CleanSpec.mk
Emil Velikov [Mon, 4 Aug 2014 18:49:08 +0000 (19:49 +0100)]
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>
10 years agofreedreno: add Android build support
Emil Velikov [Mon, 28 Jul 2014 01:38:35 +0000 (02:38 +0100)]
freedreno: add Android build support

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

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agonouveau: add Android build support
Emil Velikov [Mon, 28 Jul 2014 01:33:08 +0000 (02:33 +0100)]
nouveau: add Android build support

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

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agoradeon: add Android build support
Emil Velikov [Sun, 27 Jul 2014 17:51:59 +0000 (18:51 +0100)]
radeon: add Android build support

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

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
10 years agolibdrm,intel: rework android header handling
Emil Velikov [Fri, 27 Apr 2012 18:20:53 +0000 (13:20 -0500)]
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>
10 years agolibdrm,intel: Add Android build
Emil Velikov [Sun, 27 Jul 2014 16:27:50 +0000 (17:27 +0100)]
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>
10 years agolibdrm, freedreno, intel, nouveau, radeon: add Makefile.sources
Emil Velikov [Sun, 24 Aug 2014 18:26:14 +0000 (19:26 +0100)]
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>
10 years agolibkms: remove explicit define _FILE_OFFSET_BITS 64
Emil Velikov [Sun, 27 Jul 2014 13:54:59 +0000 (14:54 +0100)]
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>
10 years agoall: include config.h only when available and use its defines
Emil Velikov [Sun, 27 Jul 2014 13:46:45 +0000 (14:46 +0100)]
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>
10 years agoradeon: Fix surf->bankh init by default value when surf->tile_split == 0
Maks Naumov [Mon, 18 Aug 2014 19:59:35 +0000 (12:59 -0700)]
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>
10 years agoradeon: add new SI pci ids
Alex Deucher [Thu, 21 Aug 2014 15:06:33 +0000 (11:06 -0400)]
radeon: add new SI pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoradeon: add new CIK pci ids
Alex Deucher [Thu, 21 Aug 2014 15:04:51 +0000 (11:04 -0400)]
radeon: add new CIK pci ids

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoexynos: Use symbol visibility.
Maarten Lankhorst [Mon, 4 Aug 2014 09:23:52 +0000 (11:23 +0200)]
exynos: Use symbol visibility.

No changes to exported symbols.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
10 years agofreedreno: Use symbol visibility.
Maarten Lankhorst [Mon, 4 Aug 2014 09:23:20 +0000 (11:23 +0200)]
freedreno: Use symbol visibility.

Hiding fd_device_del_locked, and fd_cleanup_bo_cache.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
10 years agoomap: Use symbol visibility.
Maarten Lankhorst [Mon, 4 Aug 2014 09:22:33 +0000 (11:22 +0200)]
omap: Use symbol visibility.

No changes to exported symbols.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
10 years agodrm: Implement drmCheckModesettingSupported() for DragonFly
François Tigeot [Sat, 26 Jul 2014 11:39:58 +0000 (13:39 +0200)]
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>
10 years agointel: Use symbol visibility.
Maarten Lankhorst [Thu, 31 Jul 2014 13:07:27 +0000 (15:07 +0200)]
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>
10 years agoradeon: Use symbol visibility.
Maarten Lankhorst [Thu, 31 Jul 2014 13:39:15 +0000 (15:39 +0200)]
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>
10 years agonouveau: Only export public functions.
Maarten Lankhorst [Thu, 31 Jul 2014 12:33:36 +0000 (14:33 +0200)]
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>
10 years agoconfigure: Support symbol visibility when available
Thierry Reding [Wed, 19 Feb 2014 14:56:50 +0000 (15:56 +0100)]
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>
10 years agoconfigure.ac: bump version to 2.4.56 for release 2.4.56 libdrm-2.4.56
Marek Olšák [Tue, 29 Jul 2014 16:54:33 +0000 (18:54 +0200)]
configure.ac: bump version to 2.4.56 for release

10 years agoradeon: fix typo in sample split / fixes MSAA on Hawaii
Marek Olšák [Sat, 26 Jul 2014 18:07:33 +0000 (20:07 +0200)]
radeon: fix typo in sample split / fixes MSAA on Hawaii

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
10 years agolibdrm: Fix drm.h include in qxl drm header file
Andreas Boll [Mon, 5 May 2014 21:28:23 +0000 (23:28 +0200)]
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>
10 years agobump to version 2.4.55 for release libdrm-2.4.55
Maarten Lankhorst [Fri, 25 Jul 2014 13:08:23 +0000 (15:08 +0200)]
bump to version 2.4.55 for release

10 years agoexynos: do not build fimg2d_test when building without libkms support.
Maarten Lankhorst [Fri, 25 Jul 2014 09:22:24 +0000 (11:22 +0200)]
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>
10 years agoradeon: Add missing header includes.
Thomas Klausner [Tue, 15 Jul 2014 17:22:55 +0000 (19:22 +0200)]
radeon: Add missing header includes.

unistd.h for close() and xf86drm.h for drmOpen().

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
10 years agoradeon: Remove superfluous parentheses.
Thomas Klausner [Tue, 15 Jul 2014 17:22:52 +0000 (19:22 +0200)]
radeon: Remove superfluous parentheses.

Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
10 years agoexynos: fix scaling factor computation in g2d_copy_with_scale
Tobias Jakobi [Sun, 1 Jun 2014 16:04:06 +0000 (18:04 +0200)]
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>
10 years agoexynos: fix G2D_DOUBLE_TO_FIXED for non-integer input
Tobias Jakobi [Sun, 1 Jun 2014 16:04:05 +0000 (18:04 +0200)]
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>
10 years agoexynos: fix coordinate computation in g2d_copy
Tobias Jakobi [Sun, 1 Jun 2014 16:04:04 +0000 (18:04 +0200)]
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>
10 years agointel: Add new userptr ioctl
Tvrtko Ursulin [Thu, 19 Jun 2014 14:48:34 +0000 (15:48 +0100)]
intel: Add new userptr ioctl

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
10 years agointel: Sync typo fix from the kernel sources.
Damien Lespiau [Thu, 19 Jun 2014 10:25:48 +0000 (11:25 +0100)]
intel: Sync typo fix from the kernel sources.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agointel: Sync the command parser version parameter from kernel
Damien Lespiau [Thu, 19 Jun 2014 10:25:03 +0000 (11:25 +0100)]
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>
10 years agofreedreno: add chip-id property
Rob Clark [Wed, 18 Jun 2014 13:45:23 +0000 (09:45 -0400)]
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>
10 years agofreedreno: sync kernel header
Rob Clark [Wed, 18 Jun 2014 13:42:11 +0000 (09:42 -0400)]
freedreno: sync kernel header

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agodrm: Add universal plane capability bit and plane type enums
Matt Roper [Thu, 10 Apr 2014 21:23:12 +0000 (14:23 -0700)]
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>
10 years agodrmOpenByName: remove redundant drmAvailable check
Daniel Kurtz [Thu, 17 Apr 2014 04:08:01 +0000 (12:08 +0800)]
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>
10 years agoexynos: removed unused fd field
Daniel Kurtz [Thu, 17 Apr 2014 03:54:41 +0000 (11:54 +0800)]
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>
10 years agoexynos: prime: use drmPrime*() helpers
Daniel Kurtz [Thu, 17 Apr 2014 03:54:40 +0000 (11:54 +0800)]
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>
10 years agoexynos_fimg2d_test: fix drmModeRmFB
Daniel Kurtz [Thu, 17 Apr 2014 03:54:39 +0000 (11:54 +0800)]
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>
10 years agoexynos: remove unusable "run" target
Daniel Kurtz [Thu, 17 Apr 2014 03:54:38 +0000 (11:54 +0800)]
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>
10 years agoexynos_fimg2d: fix cast from pointer to integer of different size
Daniel Kurtz [Thu, 17 Apr 2014 03:54:37 +0000 (11:54 +0800)]
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>
10 years agoexynos: fix two warnings
Daniel Kurtz [Thu, 17 Apr 2014 03:54:36 +0000 (11:54 +0800)]
exynos: fix two warnings

warning: assignment makes pointer from integer without a cast [enabled by default]
warning: initialization makes integer from pointer without a cast [enabled by default]

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
10 years agoeyxnos: install exynos tests if HAVE_INSTALL_TESTS
Daniel Kurtz [Thu, 17 Apr 2014 03:54:35 +0000 (11:54 +0800)]
eyxnos: install exynos tests if HAVE_INSTALL_TESTS

This exynos test was added just before HAVE_INSTALL_TESTS, and so didn't
get this annotation.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Acked-by: Inki Dae <inki.dae@samsung.com>
10 years agobump version to 2.4.54 for release libdrm-2.4.54
Alex Deucher [Fri, 2 May 2014 20:59:30 +0000 (16:59 -0400)]
bump version to 2.4.54 for release

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
10 years agoradeon: add Mullins pci ids
Samuel Li [Tue, 12 Nov 2013 20:39:31 +0000 (15:39 -0500)]
radeon: add Mullins pci ids

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoradeon: add Mullins chip family
Samuel Li [Thu, 17 Apr 2014 18:30:08 +0000 (14:30 -0400)]
radeon: add Mullins chip family

Signed-off-by: Samuel Li <samuel.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
10 years agoUse signed location for drmModeSetPlane
Daniel Kurtz [Thu, 1 May 2014 11:56:43 +0000 (19:56 +0800)]
Use signed location for drmModeSetPlane

DRM_IOCTL_MODE_SETPLANE crtc_x, crtc_y are s32.
This is to allow a destination location that is partially off screen.

Make this more obvious to users of libdrm by using signed crtc_x/_y
parameters for drmModeSetPlane() as well.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
10 years agointel/chv: Add Cherryview PCI IDs
Ville Syrjälä [Wed, 13 Feb 2013 21:05:45 +0000 (23:05 +0200)]
intel/chv: Add Cherryview PCI IDs

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
10 years agofreedreno: add missing fxn prototype
Rob Clark [Fri, 25 Apr 2014 18:53:48 +0000 (14:53 -0400)]
freedreno: add missing fxn prototype

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agomodetest: add cursor support
Rob Clark [Tue, 22 Apr 2014 14:33:12 +0000 (10:33 -0400)]
modetest: add cursor support

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agotests: Use drmFreeVersion() instead of drmFree()
Thierry Reding [Wed, 19 Feb 2014 13:45:30 +0000 (14:45 +0100)]
tests: Use drmFreeVersion() instead of drmFree()

drmFreeVersion() frees the memory allocated for the name, date and desc
fields in addition to that for the struct _drmVersion.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agolibdrm: Remove extraneous parameter
Thierry Reding [Tue, 8 Apr 2014 20:33:04 +0000 (22:33 +0200)]
libdrm: Remove extraneous parameter

The debug message's format string doesn't contain any conversion
specifiers, therefore making the fd argument unused.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agointel: Fix some format strings
Thierry Reding [Tue, 8 Apr 2014 20:18:18 +0000 (22:18 +0200)]
intel: Fix some format strings

Some of the format strings for debug messages use the wrong modifier to
print sizes.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agoMark functions printf-like where possible
Thierry Reding [Wed, 22 Jan 2014 11:06:51 +0000 (12:06 +0100)]
Mark functions printf-like where possible

These functions all take a format string and either a list of variable
arguments or a va_list. Use the new DRM_PRINTFLIKE macro to tell the
compiler about it so that the arguments can be checked against the
format string.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Thierry Reding <treding@nvidia.com>
10 years agoamend previous commit to actually compile
Maarten Lankhorst [Wed, 16 Apr 2014 14:52:48 +0000 (16:52 +0200)]
amend previous commit to actually compile

Ugh!

10 years agonouveau: safen up nouveau_device list usage against concurrent access
Maarten Lankhorst [Thu, 13 Mar 2014 02:05:15 +0000 (22:05 -0400)]
nouveau: safen up nouveau_device list usage against concurrent access

I cannot make nouveau_bo_wrap thread-safe (by design), but it seems to be used to convert
drm fb's to nouveau_bo's and to get a notify handle from fifo->notify in nv30_screen.c

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
10 years agoBump version to 2.4.53 for release 2.4.53 libdrm-2.4.53
Marek Olšák [Thu, 10 Apr 2014 19:12:54 +0000 (21:12 +0200)]
Bump version to 2.4.53 for release

10 years agoradeon: sync with radeon_drm.h from kernel headers
Marek Olšák [Fri, 4 Apr 2014 17:05:01 +0000 (19:05 +0200)]
radeon: sync with radeon_drm.h from kernel headers

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
10 years agofreedreno: zero out unused field
Rob Clark [Wed, 19 Mar 2014 14:11:13 +0000 (10:11 -0400)]
freedreno: zero out unused field

Since realloc() doesn't zero-init.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: do not leak drmVersion
Emil Velikov [Wed, 12 Mar 2014 20:45:45 +0000 (20:45 +0000)]
freedreno: do not leak drmVersion

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno/kgsl: don't even bother trying CREATE_FD
Rob Clark [Fri, 28 Feb 2014 15:02:59 +0000 (10:02 -0500)]
freedreno/kgsl: don't even bother trying CREATE_FD

Don't even bother trying DRM_KGSL_GEM_CREATE_FD.  It hasn't worked since
(afaict) 2.6.35 kernels.  And in some cases seems to cause some
problems.  Instead just allocate a minimum size dummy object (just for
purposes of having a handle) and then mmap the framebuffer as user-mem
(which is deprecated, but seems to still work.. and as far as I can tell
is the best option for now).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: fix null ptr in error path
Rob Clark [Fri, 28 Feb 2014 14:25:10 +0000 (09:25 -0500)]
freedreno: fix null ptr in error path

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: simplify device creation
Rob Clark [Fri, 28 Feb 2014 14:24:39 +0000 (09:24 -0500)]
freedreno: simplify device creation

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agoEnable libkms by default on DragonFly
François Tigeot [Mon, 17 Feb 2014 09:07:54 +0000 (10:07 +0100)]
Enable libkms by default on DragonFly

Signed-off-by: François Tigeot <ftigeot@wolfpond.org>
10 years agofreedreno: some msm-ring reset/flush fixes
Rob Clark [Wed, 19 Feb 2014 16:01:23 +0000 (11:01 -0500)]
freedreno: some msm-ring reset/flush fixes

Need to update timestamp on all ring's associated with a submit (ie.
both the binning pass and main ring).  Also, make sure nr_reloc's
in particular gets cleared if the rb is reset.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agofreedreno: fix license
Rob Clark [Fri, 31 Jan 2014 16:58:30 +0000 (11:58 -0500)]
freedreno: fix license

The userspace headers were intended to be BSD license.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
10 years agodrm: Implement drmCheckModesettingSupported() for FreeBSD
Robert Millan [Thu, 23 Jan 2014 14:46:05 +0000 (14:46 +0000)]
drm: Implement drmCheckModesettingSupported() for FreeBSD

Add the missing implementation of drmCheckModesettingSupported()
to detect KMS support on FreeBSD (and GNU/kFreeBSD).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72847
Signed-off-by: Konstantin Belousov <kib@freebsd.org>
Signed-off-by: Robert Millan <rmh@freebsd.org>
10 years agomodeprint: pretty print connector names
Lucas Stach [Fri, 17 Jan 2014 11:19:17 +0000 (12:19 +0100)]
modeprint: pretty print connector names

Use same names as the kernel, makes it easier to identify
connectors in the common case.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
10 years agoBump the version to 2.4.52 libdrm-2.4.52
Kenneth Graunke [Mon, 13 Jan 2014 23:47:15 +0000 (15:47 -0800)]
Bump the version to 2.4.52

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
10 years agointel: Create a new drm_intel_bo offset64 field.
Kenneth Graunke [Mon, 13 Jan 2014 22:14:36 +0000 (14:14 -0800)]
intel: Create a new drm_intel_bo offset64 field.

The existing 'offset' field is unfortunately typed as 'unsigned long',
which is unfortunately only 4 bytes with a 32-bit userspace.

Traditionally, the hardware has only supported 32-bit virtual addresses,
so even though the kernel uses a __u64, the value would always fit.

However, Broadwell supports 48-bit addressing.  So with a 64-bit kernel,
the card virtual address may be too large to fit in the 'offset' field.

Ideally, we would change the type of 'offset' to be a uint64_t---but
this would break the libdrm ABI.  Instead, we create a new 'offset64'
field to hold the full 64-bit value from the kernel, and store the
32-bit truncation in the existing 'offset' field, for compatibility.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>