dim [Thu, 20 Mar 2014 22:03:37 +0000 (22:03 +0000)]
MFC r260046 (by glebius):
Fix the parse type for NGM_LISTTYPES.
Actually, text versions of generic commands are not used, since ngctl(8)
uses binary messages for them. And to request a text command one needs
a working ngctl(8). That's why the bug was never discovered. I'm pondering
on removing the text support for generic commands.
dim [Thu, 20 Mar 2014 21:12:23 +0000 (21:12 +0000)]
MFC r260020:
For sys/dev/drm2/radeon, only use -fms-extensions with gcc. This flag
is only to stop gcc complaining about anonymous unions, which clang does
not do. For clang 3.4 however, -fms-extensions enables the Microsoft
__wchar_t type, which clashes with our own types.h.
FreeBSD porting notes: the kernel part of this changeset depends
on Solaris buf(9S) interfaces and are not really applicable for
our use. vdev_disk.c is patched as-is to reduce diverge from
upstream, but vdev_file.c is left intact.
delphij [Wed, 19 Mar 2014 19:32:53 +0000 (19:32 +0000)]
Make it possible to call VOP_PUTPAGES with shared vnode lock instead
of insisting an exclusive lock.
When VFS_LOCK_DEBUG is enabled and when the underlying file system is
capable of MNT_SHARED_WRITES, a failed assertion may lead to a panic
because when calling fsync(2), a.k.a. sys_fsync() over a vnode with
mmap'ed page, it will grab a shared lock when underlying file system
is capable, then call vm_object_page_clean that eventually proceeded
to vnode_pager_putpages() that tries to do VOP_PUTPAGES, where
VOP_PUTPAGES_APV generated from the declaration asserts the vnode is
always exclusively locked by caller.
This is a direct commit to stable/9 because a majority portion of the
original changeset 257899 (kib), which main goal was an optimization,
was omitted. We saw the panic independently in a FreeNAS bug ticket
(#4578).
rwatson [Wed, 19 Mar 2014 10:32:57 +0000 (10:32 +0000)]
Merge r262690 from head to stable/9:
When querying a process's umask via sysctl in libprocstat(), don't
print a warning if EPERM is returned as this is an expected failure
mode rather than error -- similar to current handling of ESRCH.
This makes the output of 'procstat -as' vastly more palatable.
jhb [Tue, 18 Mar 2014 17:17:42 +0000 (17:17 +0000)]
Increment fi_wgen before awakening threads polling the read socket of a
FIFO. Previously, a thread sleeping in poll() could be awakened and
re-poll the FIFO with the old value of fi_wgen (and thus improperly
setting POLLINIGNEOF) before a thread closing a writable fifo descriptor
bumped fi_wgen. The end result was that the reading thread in poll()
would never see POLLHUP but could block forever (or until a timeout).
This is a direct commit to 8 and 9 since the FIFO code is implemented
differently in 10.x and later. The pipe-backed FIFOs in 10 do not have
this bug.
markj [Tue, 18 Mar 2014 00:38:36 +0000 (00:38 +0000)]
MFC r259535:
The fasttrap fork handler is responsible for removing tracepoints in the
child process that were inherited from its parent. However, this should
not be done in the case of a vfork, since the fork handler ends up removing
the tracepoints from the shared vm space, and userland DTrace probes in the
parent will no longer fire as a result.
Now the child of a vfork may trigger userland DTrace probes enabled in its
parent, so modify the fasttrap probe handler to handle this case and handle
the child process in the same way that it would handle the traced process.
In particular, if once traces function foo() in a process that vforks, and
the child calls foo(), fasttrap will treat this call as having come from the
parent. This is the behaviour of the upstream code.
While here, add #ifdef guards to some code that isn't present upstream.
delphij [Mon, 17 Mar 2014 19:09:39 +0000 (19:09 +0000)]
MFC r262676:
All callers of static method load_nvlist() in spa.c handles error case,
so there is no reason to assert that we won't hit an error. Instead,
just return that error to caller and have the upper layer handle it.
Obtained from: FreeNAS
Reported by: rodrigc
Reviewed by: Matthew Ahrens
dumbbell [Fri, 14 Mar 2014 12:37:42 +0000 (12:37 +0000)]
MFC Radeon KMS driver
FreeBSD 9 already had modern Intel GPUs support, now this is the case for
Radeon GPUs too. This will ease the work on ports, where there won't be a
need to distinguish between FreeBSD 9/10 and different hardware vendors.
Help from: jhb@, jkim@, kan@, kib@,
J.R. Oldroyd <fbsd@opal.com> (previous version of the patch)
The following revisions were merged in this single commit:
r254885:
drm/radeon: Import the Radeon KMS driver
This driver is based on Linux 3.8 and a previous effort by kan@.
More informations about this project can be found on the FreeBSD wiki:
https://wiki.freebsd.org/AMD_GPU
The driver is split into:
sys/dev/drm2:
The driver sources.
sys/modules/drm2/radeonkmw:
The driver main kernel module's Makefile.
sys/modules/drm2/radeonkmsfw:
All firmware kernel module Makefiles. There's one directory and one
Makefile for each firmware.
sys/contrib/dev/drm2/radeonkmsfw:
All firmware binary sources.
tools/tools/drm/radeon
Tools to update firmwares or regenerate some headers.
Merging the driver to FreeBSD 9.x may be possible but not a priority for
now.
Help from: kib@, kan@
Tested by: avg@, kwm@, ray@,
Alexander Yerenkow <yerenkow@gmail.com>,
Anders Bolt-Evensen <andersbo87@me.com>,
Denis Djubajlo <stdedjub@googlemail.com>,
J.R. Oldroyd <fbsd@opal.com>,
Mikaël Urankar <mikael.urankar@gmail.com>,
Pierre-Emmanuel Pédron <pepcitron@gmail.com>,
Sam Fourman Jr. <sfourman@gmail.com>,
Wade <wade-is-great@live.com>,
(probably other I forgot...)
HW donations: kyzh, Yakaz
r254894:
drm/radeon: Rename the (S)DEBUG macros in atom.c to avoid conflicts
For instance, DEBUG is already defined in the LINT kernel configuration.
This fixes the build of LINT.
r254899:
drm/radeon: Disable build on i386/pc98
r255572:
drm/radeon: Fix usage of vga_pci_map_bios()
vga_pci_(un)map_bios() takes a vgapci device as argument, not a drmn
one. This fixes a bug where the BIOS couldn't be mapped if the device
wasn't the boot display.
Approved by: re (kib; blanket for following drm2/radeon commits)
r255573:
drm/radeon: Fix usage of pci_save_state() and pci_restore_state()
Calling those functions with the drmn device as argument causes a panic,
because it's not a direct child of pci$N. They must be called with the
vgapci device instead.
This fix is not enough to make suspend/resume work reliably.
Approved by: re (blanket)
r255587:
drm/radeon: Add missing "return false" after unmapping invalid BIOS
Without that, we would try to copy the unmapped BIOS.
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: re (blanket)
r256771:
drm/radeon: radeonkms depends on firmware(9)
Submitted by: tijl@
r257869:
drm: Initialize "handle" to 0 before calling drm_gem_handle_create()
This is variable is being checked in drm_gem_name_create() before being
set.
r257870:
drm/radeon: Wake up userland after page flip
For instance, this caused issues in KDE, such as stuttered animations
(with desktop effects enabled).
r259003:
Initialize modesetting sysctls in radeonkms.
This is intended for MFC if re@ permits.
Reviewed by: kib, dumbbell
Tested by: Steven Chamberlain <steven@pyro.eu.org>
MFC after: 3 days
r259101:
drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytes
This fixes radeon_agp_init() and gtt_size is now correct. However, this
is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't
implemented yet.
Submitted by: tijl@
r259104:
drm/radeon: radeon_dp_i2c_aux_ch() must return 0 on FreeBSD
The code was unmodified compared to Linux and returned the amount of
received bytes from the i2c bus. This led to non-working i2c bus and
failure to eg. read monitor's EDID, if connected to DisplayPort.
MFC after: 3 days
Tested by: Mikaël Urankar <mikael.urankar@gmail.com>
r259684:
drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS...
... for msleep/cv_*wait() return values, where wait_event*() is used
on Linux. ERESTARTSYS is the return code expected by callers when the
operation was interrupted.
For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): if
an error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs an
error.
Note that ERESTARTSYS is defined as ERESTART, but this keeps callers'
code close to Linux.
Submitted by: avg@ (previous version)
r261497:
Abort when firmware isn't present in R600+ models.
More details at:
http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux/debian/patches/bugfix/all/radeon-firmware-is-required-for-drm-and-kms-on-r600-onward.patch?revision=20909&view=co
hselasky [Fri, 14 Mar 2014 10:18:53 +0000 (10:18 +0000)]
MFC r227751, r238766, r241553, r242748, r244047, r245947, r246021, r247255,
r249039, r249204, r250848, r251351, r252295, r252498, r255123, r255238,
r256782, r257132, r257390 and r259675:
- Add various new USB ID's and quirks.
- Make sure the usbdevs mergeinfo gets recorded on the sys directory.
mav [Fri, 14 Mar 2014 07:48:35 +0000 (07:48 +0000)]
MFC r262886:
Fix support for increased logical sector size (4K-native drives).
- Logical sector size is measured in words, not bytes.
- If physical sector is not bigger then logical sector, it does not mean
it should be set equal to 512 bytes, but set to logical sector.
PR: misc/187269
Submitted by: Ravi Pokala <rpokala@panasas.com>
dumbbell [Thu, 13 Mar 2014 21:06:13 +0000 (21:06 +0000)]
MFC changes to atomic.h usage in DRM code
This commit follows the merge of atomic.h changes in r262807 and r262823.
The original work is from Jung-uk Kim (jkim@).
The following revisions were merged in this single commit:
r255009:
Fix a compiler warning. With this fix, a negative time can be converted to
a struct timeval and back to the original nanoseconds correctly.
r255012:
Fix a compiler warning and add couple of VM map types.
r255013:
Correct atomic operations in i915.
r255037:
Fix atomic operations on context_flag without altering semantics.
r255039:
- Remove test_and_set_bit() macro. It is unused since r255037.
- Relax atomic_read() and atomic_set() macros. Linux does not require any
memory barrier. Also, these macros may be even reordered or optimized away
according to the API documentation:
bapt [Tue, 11 Mar 2014 16:24:54 +0000 (16:24 +0000)]
MFC: r262398,r262399,r262410,r262975
Import libucl into head
UCL is heavily infused by nginx configuration as the example of a convenient
configuration system. However, UCL is fully compatible with JSON format and is
able to parse json files.
UCL is used by pkg(8) for its configuration file as well for the manifest format
in packages, it will be used in base for the pkg boostrap (signature checking
and configuration file parsing.)
libucl has been developped and is maintained by vsevolod@