Commit Graph

19 Commits (118addfaf8dc79b2ab4016b0d77726fc2a8e005c)

Author SHA1 Message Date
Karol Herbst 678a32b98f nouveau: add ioctl wrapper to check for dead channels
v2: explicitly set nr_push to 0 as well

Signed-off-by: Karol Herbst <kherbst@redhat.com>
2022-05-03 11:23:30 +00:00
Karol Herbst 1d29e1df8b nouveau: print bo address in the GPU/CPU vm and its size
v2: print bo->offset as 64 bit

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
2021-08-04 18:27:13 +02:00
Karol Herbst cfbea78fdf nouveau: add debug option to sync pushbuffer submissions
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:41:16 +02:00
Karol Herbst 2f04bd2d89 nouveau: mask push buffer length pushbuf_dump
nvc0 sets the NVC0_IB_ENTRY_1_NO_PREFETCH bit on some pushbuffers

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:41:09 +02:00
Karol Herbst 52fd2a2542 nouveau: fix crash in pushbuf_dump with an unmapped bo
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-05-06 19:40:57 +02:00
Eric Engestrom 4b737cde8f nouveau: add missing drm_public exports
Fixes: d7320bfcdd "nouveau: annotate public functions"
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108006
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Tested-by: Dylan Baker <dylan@pnwbakers.com>
2018-09-20 18:23:52 +01:00
Lucas De Marchi d7320bfcdd nouveau: annotate public functions
This was done with:
nm --dynamic --defined-only build/nouveau/libdrm_nouveau.so | \
	grep nouveau_ | \
	cut -d ' ' -f3 > /tmp/a.txt

while read sym; do
	read f func line _ <<<$(cscope -d -L -1 $sym)
	if [ ! -z "$f" ]; then
		line=$((line-1))
		sed -i "${line}s/^/drm_public /" $f
	fi
done < /tmp/a.txt

Then some corner cases were manually fixed. The idea here will be to
switch the default visibility to hidden so we don't export symbols we
shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2018-09-19 22:46:45 -07:00
Eric Engestrom 0926f0af54 meson,configure: include config.h automatically
This will prevent any more missing `#include "config.h"` bug, at the
cost of having to recompile some files that didn't need to be when
changing build options.

Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-03-20 18:19:26 +00:00
Ben Skeggs 4283e3f656 nouveau: make use of nouveau_drm::fd instead of nouveau_device::fd
The latter is deprecated, and will not be valid for newer clients.

v2.
- split out nouveau_object_find removal

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-12-22 13:22:28 +10:00
Ilia Mirkin 203983f842 nouveau: add asserts to make sure krefs are there
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-06-21 19:26:42 -04:00
Emil Velikov 0f8da82500 drm: remove drm_public macro
Some compilers (like the Oracle Studio), require that the function
declaration must be annotated with the same visibility attribute as the
definition. As annotating functions with drm_public is no longer
required just remove the macro.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-04-28 11:19:15 +01: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
Maarten Lankhorst 482abbfafb nouveau: prevent undefined behavior in nouveau_pushbuf_reloc with gcc-4.8
Reported-by: ronald645@gmail.com
Bisected-by (gcc): Andreas Radke <a.radke@arcor.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71116
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
2013-11-07 13:37:49 +01:00
Marcin Slusarz f92d7969bf nouveau: add a way to override single pushbuffer memory limits
Currently single pushbuffer can take up to 80% of VRAM and 80% of GART.
As this value seems to be arbitrary (and user may need to set it differently)
this patch adds support for 2 environment variables:
NOUVEAU_LIBDRM_VRAM_LIMIT_PERCENT (default 80)
NOUVEAU_LIBDRM_GART_LIMIT_PERCENT (default 80)
which will let users override pushbuffer VRAM/GART limits.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
2013-03-26 21:08:03 +01:00
Marcin Slusarz 284421a569 nouveau: return error from pushbuf_validate
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
2013-03-26 21:08:03 +01:00
Ben Skeggs 891517f511 nouveau: disallow pushbuf BOs in multiple memory types
Under certain circumstances it's possible for libdrm to decide to move
a GART|VRAM pushbuf to be VRAM-only.  This causes the kernel to reject
the command submission on GF8 and up, due to a stricter policy where
buffers are only allowed to move to memory types that were specified
at creation time.

The simplest fix for this is to force the creation-time memory type for
the lifetime of the push buffer.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2013-01-07 13:15:28 +10:00
Marcin Slusarz 9e0026d35c nouveau: silence some remaining valgrind warnings
Valgrind can't understand some of the fields passed to ioctls are overwritten
by kernel, so we need to initialize them. Almost all of our ioctl wrappers
already do it and the cost of remaining 3 is very small.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
2012-06-09 23:23:32 +02:00
Marcin Slusarz d954648b48 nouveau: remove unnecessary EAGAIN loops
drmCommandWrite / drmCommandWriteRead already loop on EAGAIN.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-04-24 12:41:39 +10:00
Ben Skeggs 292da616fe nouveau: pull in major libdrm rewrite
Redesigned primarily to allow us to better take advantage of BO's having
fixed GPU virtual addresses on GeForce 8 and up, and to reduce the overhead
of handling relocations on earlier chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2012-04-14 02:47:23 +10:00