Commit Graph

5245 Commits (d4083dc762a2974c35ecd16be995272bbb6d57b4)

Author SHA1 Message Date
Thierry Reding d4083dc762 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>
2014-04-17 16:21:47 +02:00
Thierry Reding 303ff26311 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>
2014-04-17 16:21:46 +02:00
Thierry Reding 3d7a51e43e 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>
2014-04-17 16:21:45 +02:00
Thierry Reding 44b08c0ddf 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>
2014-04-17 16:21:40 +02:00
Maarten Lankhorst 7974b539d2 amend previous commit to actually compile
Ugh!
2014-04-16 16:52:48 +02:00
Maarten Lankhorst b1d4def059 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>
2014-04-15 10:29:49 +02:00
Marek Olšák 504d606275 Bump version to 2.4.53 for release 2014-04-10 21:12:54 +02:00
Marek Olšák 4e77991424 radeon: sync with radeon_drm.h from kernel headers
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
2014-04-04 19:07:55 +02:00
Rob Clark 1cb5fc706c freedreno: zero out unused field
Since realloc() doesn't zero-init.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-19 10:12:18 -04:00
Emil Velikov 230389a0d7 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>
2014-03-16 10:46:25 -04:00
Rob Clark ee8c9a1383 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>
2014-03-05 10:35:41 -05:00
Rob Clark cd1996470a freedreno: fix null ptr in error path
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-05 09:40:19 -05:00
Rob Clark 5a3324638b freedreno: simplify device creation
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-03-05 09:39:35 -05:00
François Tigeot 1d86869da6 Enable libkms by default on DragonFly
Signed-off-by: François Tigeot <ftigeot@wolfpond.org>
2014-03-02 22:15:12 -05:00
Rob Clark c5de5abbd9 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>
2014-02-19 11:47:40 -05:00
Rob Clark 128e74cf64 freedreno: fix license
The userspace headers were intended to be BSD license.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-31 11:58:30 -05:00
Robert Millan cbb31f2d6e 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>
2014-01-24 17:52:14 -05:00
Lucas Stach ce62b8e059 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>
2014-01-24 17:51:05 -05:00
Kenneth Graunke 46d451c9a9 Bump the version to 2.4.52
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 10:58:15 -08:00
Kenneth Graunke edf17dbdaa 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>
2014-01-20 10:58:15 -08:00
Eric Anholt 02f93c21e6 intel: Track whether a buffer is idle to avoid trips to the kernel.
I've seen a number of apps spending unreasonable amounts of time in
drm_intel_bo_busy during the buffer mapping process.

We can't track idleness in general, in the case of buffers shared
across processes.  But this should significantly reduce our overhead
for checking for busy on things like VBOs.

Improves (unoptimized) glamor x11perf -f8text by 0.243334% +/-
0.161498% (n=1549), which has formerly been spending about .5% of its
time hitting the kernel for drm_intel_gem_bo_busy().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 10:58:13 -08:00
Eric Anholt 734de7093d drm: Initialize or valgrind-clear modesetting ioctl arguments.
Fixes valgrind complaints in the modesetting driver.  I tried to
follow each ioctl's pattern for whether it was initializing just the
in values, or both in and out values.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2014-01-20 10:58:06 -08:00
Keith Packard cb4bc8ead6 Mark debug_print with __attribute__ ((format(__printf__, 1, 0)))
the drmServerInfo member, debug_print, takes a printf format string
and varargs list. Tell the compiler about it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2014-01-13 10:13:42 -08:00
Rob Clark 8279c8fb49 freedreno: add fd_device_new_dup()
There seem to be some cases (I've noticed this switching resolution in
some games, for example) where the fd can get closed() before the device
and all it's bo's are destroyed.  Which, if the drm device is opened
again and bo's are allocated with the same handles, results that when
the first pipe_screen/pipe_context is destroyed causes the first dev to
close handles for bo's allocated by the second device.

The easy solution to that is to add a mode where the fd_device creates
it's own private fd (a dup()).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-12 09:00:51 -05:00
Vincent ABRIOU de09702030 modetest: add the possibility to select the refresh frequency for a mode
When mode is selected we only give the name of the mode as parameter.
But sometime, two different modes have the same name but not
the same vrefresh frequency.
This patch give the possibility to select a mode by its name
and optionally by its refresh frequency.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-12 08:24:00 -05:00
Hyungwon Hwang 3732ef59eb tests/kmstest: support exynos
In this patch, to support exynos for KMS, Exynos KMS driver is newly added.
Also, Exynos is added to the list of kmstest supported modules.

Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-12 08:23:38 -05:00
Ben Widawsky a254cb5041 intel: Merge latest i915_drm.h
This was not done as a straight copy because reset_stats IOCTL landed in
libdrm before upstream kernel.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-10 11:05:50 -08:00
Ben Widawsky 3d34fe2495 intel: Handle malloc fails in context create
The previous code would just use the potentially unallocated variable,
which is probably okay most of the time, but not very nice to the user
of the library.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-10 11:05:50 -08:00
Ben Widawsky 743372ea26 intel: squash unused variable 'bo_gem'
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-10 11:05:50 -08:00
Rob Clark dc864c8dea Bump the version to 2.4.51
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-08 15:36:29 -05:00
Rob Clark 9fa22a845b freedreno: allow IB to different ringbuffer
Allow IB to different ringbuffer in addition to just different part of
same ringbuffer.  In particular, we need to add bo's to the parent (ie.
one passed to flush) bo table, since the bo table applies to all the
cmd buffers in submit ioctl.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-07 11:33:54 -05:00
Rob Clark b6caecfa90 freedreno/kgsl: fix crash introduced w/ bo-cache
Signed-off-by: Rob Clark <robclark@freedesktop.org>
2014-01-07 11:33:54 -05:00
Alex Deucher e8cbc57965 radeon: fix sumo2 pci id
0x9649 is sumo2, not sumo.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-12-24 15:19:34 -05:00
Alex Deucher 1543c96e15 radeon: avoid possible divide by 0 in surface manager
Some users report hitting a divide by 0 with the tile split in
certain apps.  Tile_split shouldn't ever be 0 unless the surface
structure was not properly initialized.  I think there may be some
cases where mesa uses an improperly initialized surface struct,
but I haven't had time to track it down.

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=72425

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2013-12-24 15:17:06 -05:00
Rob Clark 068ea68b3f freedreno: add bo cache
Workloads which create many transient buffers cause significant CPU
overhead in buffer allocation, zeroing, cache maint, and mmap setup.
By caching and re-using existing buffers, the CPU overhead drops
significantly.  See:

http://bloggingthemonkey.blogspot.com/2013/09/freedreno-update-moar-fps.html

A simple time based policy is used for purging the cache.  Once the
kernel supports it, we could use madvise style API to handle memory
pressure scenarios a bit better.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
2013-12-13 15:48:10 -05:00
Damien Lespiau 1489811a80 intel/test_decode: Allow gen8 to be infered from the batch filenames
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-12-13 18:18:53 +00:00
Damien Lespiau bd73fd02e9 gitignore: Ignore various generated files
- *.log/*.trs are generated by make check
- TAGS are generated by make tags
- build-aux, config.h.in~ by autoconf
- *.sw? are temporary files create by vim
- name_from_fd wasn't ignored yet for some reason

v2: Ignore *~ as well (Daniel Vetter)

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-12-13 18:17:25 +00:00
Marek Olšák 4c5de721c4 Bump the version to 2.4.50 2013-12-03 19:50:22 +01:00
Keith Packard c3d96897de intel: Track known prime buffers for re-use
If the application sends us a file descriptor pointing at a prime
buffer that we've already got, we have to re-use the same bo_gem
structure or chaos will result.

Track the set of all known prime objects and look to see if the kernel
has returned one of those for a new file descriptor.

Also checks for prime buffers in the flink case.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-26 21:45:40 -08:00
Michel Dänzer c8a437f4c7 radeon: Update unaligned offset for 2D->1D tiling transition on SI
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71983

Tested-by: Arek Ruśniak <arek.rusi@gmail.com>
2013-11-26 18:16:03 +09:00
Marek Olšák 7ddc98f92f Bump the version for release 2013-11-23 01:27:57 +01:00
Marek Olšák 3f46489022 radeon: handle P16 pipe configs for Hawaii 2013-11-23 00:35:42 +01:00
Michel Dänzer f0e399d8f0 radeon: don't overallocate stencil by 4 on SI and CIK
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
2013-11-23 00:35:42 +01:00
Marek Olšák 67d92404d6 radeon: implement 2D tiling for CIK
Bug fixes and simplification by Marek.
We have to use the tile index of 0 for non-MSAA depth-stencil after all.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-23 00:35:39 +01:00
Michel Dänzer ce8af45425 radeon: fix mipmap level 0 and 1 alignment for SI and CIK
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-23 00:35:34 +01:00
Ian Romanick 0c3fd8708f intel: Use memset instead of VG_CLEAR
The ioctl expects that certain fields will be zeroed, so we should allow
the helper function to actually work in non-Valgrind builds.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reported-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-20 11:55:07 -08:00
Thomas Hellstrom c601444a90 libdrm/mode: Update the encoder and connector defines
Update the defines to match the kernel drm_mode.h

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-19 18:15:30 +01:00
Ian Romanick 71beb7b079 libdrm: bump to 2.4.48 2013-11-15 18:01:08 -08:00
Ian Romanick 5a41b02504 intel: Add support for GPU reset status query ioctl
I would have just used the drmIoctl interface directly in Mesa, but the
ioctl needs some data from the drm_intel_context that is not exposed
outside libdrm.

This ioctl is in the drm-intel-next tree as b635991.

v2: Update based on Mika's kernel work.

v3: Fix compile failures from last-minute typos.  Sigh.

v4: Import the actual changes from the kernel i915_drm.h.  Only comments
on some fields of drm_i915_reset_stats differed.  There are still some
deltas between the kernel i915_drm.h and the one in libdrm, but those
can be resolved in other patches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v3]
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-15 11:31:49 -08:00
Alex Deucher 1a84eea45b radeon: add hawaii pci ids
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2013-11-13 11:33:31 -05:00