aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/drm
Commit message (Collapse)AuthorAgeFilesLines
* Per discussions on arch@ and elsewhere, retire drm module / drives.Warner Losh2019-02-1976-43236/+0
| | | | | | | | | | | | | Retire the drm modules / drivers. These are now handled by the drm-legacy-kmod port and/or the drm-kmod port. All future development and maintanace will be handled there. Approved by: graphics team Reviewed by: manu@, mmel@ Differential Revision: https://reviews.freebsd.org/D19196 Notes: svn path=/head/; revision=344297
* [drm] Fix off-by-one error when accessing driver-specific ioctl handlers arrayOleksandr Tymoshenko2019-01-151-1/+1
| | | | | | | | | | PR: 231513 Submitted by: Young_X <YangX92@hotmail.com> Approved by: imp MFC after: 1 week Notes: svn path=/head/; revision=343060
* Add big, nasty abandonware tags to this code.Warner Losh2018-08-282-1/+13
| | | | | | | | | | | | | This code works for some people, but hasn't been updated in a long time. Still allow people to use this code for the moment, but put a big, nasty obsolete message to inform and encourage people to move to the port. Approved by: re@ (gjb) Differential Review: https://reviews.freebsd.org/D16894 Notes: svn path=/head/; revision=338348
* Eliminate the arena parameter to kmem_free(). Implicitly this corrects anAlan Cox2018-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | error in the function hypercall_memfree(), where the wrong arena was being passed to kmem_free(). Introduce a per-page flag, VPO_KMEM_EXEC, to mark physical pages that are mapped in kmem with execute permissions. Use this flag to determine which arena the kmem virtual addresses are returned to. Eliminate UMA_SLAB_KRWX. The introduction of VPO_KMEM_EXEC makes it redundant. Update the nearby comment for UMA_SLAB_KERNEL. Reviewed by: kib, markj Discussed with: jeff Approved by: re (marius) Differential Revision: https://reviews.freebsd.org/D16845 Notes: svn path=/head/; revision=338318
* Revert drm2 removal.Warner Losh2018-08-2476-0/+43224
| | | | | | | | | | | | | | | | | | | | | | | | | | | Revert r338177, r338176, r338175, r338174, r338172 After long consultations with re@, core members and mmacy, revert these changes. Followup changes will be made to mark them as deprecated and prent a message about where to find the up-to-date driver. Followup commits will be made to make this clear in the installer. Followup commits to reduce POLA in ways we're still exploring. It's anticipated that after the freeze, this will be removed in 13-current (with the residual of the drm2 code copied to sys/arm/dev/drm2 for the TEGRA port's use w/o the intel or radeon drivers). Due to the impending freeze, there was no formal core vote for this. I've been talking to different core members all day, as well as Matt Macey and Glen Barber. Nobody is completely happy, all are grudgingly going along with this. Work is in progress to mitigate the negative effects as much as possible. Requested by: re@ (gjb, rgrimes) Notes: svn path=/head/; revision=338285
* Remove legacy drm and drm2 from treeMatt Macy2018-08-2276-43224/+0
| | | | | | | | | | | | | | | | | As discussed on the MLs drm2 conflicts with the ports' version and there is no upstream for most if not all of drm. Both have been merged in to a single port. Users on powerpc, 32-bit hardware, or with GPUs predating Radeon and i915 will need to install the graphics/drm-legacy-kmod. All other users should be able to use one of the LinuxKPI-based ports: graphics/drm-stable-kmod, graphics/drm-next-kmod, graphics/drm-devel-kmod. MFC: never Approved by: core@ Notes: svn path=/head/; revision=338172
* Eliminate the unused arena parameter from kmem_alloc_attr().Alan Cox2018-08-181-2/+2
| | | | | | | | Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D16793 Notes: svn path=/head/; revision=338030
* drm: fix memory leak on error pathEric van Gyzen2018-05-281-0/+1
| | | | | | | | | | Reported by: Coverity CID: 1368753 MFC after: 3 days Sponsored by: Dell EMC Notes: svn path=/head/; revision=334269
* Correct signedness bug in drm_modeset_ctlEd Maste2018-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | drm_modeset_ctl() takes a signed in from userland, does a boundscheck, and then uses it to index into a structure and write to it. The boundscheck only checks upper bound, and never checks for nagative values. If the int coming from userland is negative [after conversion] it will bypass the boundscheck, perform a negative index into an array and write to it, causing memory corruption. Note that this is in the "old" drm driver; this issue does not exist in drm2. Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> Reviewed by: cem MFC after: 1 day Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=331339
* Fix kernel memory disclosure in drm_infobufsEd Maste2018-03-211-0/+1
| | | | | | | | | | | | | | | drm_infobufs() has a structure on the stack, fills it out and copies it to userland. There are 2 elements in the struct that are not filled out and left uninitialized. This will leak uninitialized kernel stack data to userland. Submitted by: Domagoj Stolfa <ds815@cam.ac.uk> Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com> MFC after: 1 day Security: Kernel memory disclosure (798) Notes: svn path=/head/; revision=331333
* kernel: Fix several typos and minor errorsEitan Adler2017-12-271-2/+2
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* Add PNP metadata to more driversConrad Meyer2017-09-261-1/+1
| | | | | | | | | | | | | | | GPUs: radeonkms, i915kms NICs: if_em, if_igb, if_bnxt This metadata isn't used yet, but it will be handy to have later to implement automatic module loading. Reviewed by: imp, mmacy Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12488 Notes: svn path=/head/; revision=324038
* Include opt files in the kernel with "" instead of <>.Warner Losh2017-07-101-1/+1
| | | | Notes: svn path=/head/; revision=320860
* Switch prison check from PROV_DRIVER to PRIV_KMEM_WRITE (like /dev/mem).Alexander Leidinger2017-07-091-1/+1
| | | | | | | | | | | | | | Access to the dri device gives effectively access to the entire memory of the machine (you can program the graphic card to do DMA). For current/stable/release this is a NOP, as access to memory is not allowed in a jail. This puts the dri device into the same (in)security class than /dev/mem for future use. Discussed with: anholt(?) several years ago Sponsored by: Hackathon Essen 2017 Notes: svn path=/head/; revision=320827
* All these files need sys/vmmeter.h, but now they got it implicitlyGleb Smirnoff2017-04-171-0/+1
| | | | | | | included via sys/pcpu.h. Notes: svn path=/head/; revision=317055
* Use atop() instead of OFF_TO_IDX() for convertion of addresses orKonstantin Belousov2017-03-141-1/+1
| | | | | | | | | | | addresses offsets, as intended. Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=315281
* drm(old): Remove i915 and radeon driversEmmanuel Vadot2017-03-1123-48460/+0
| | | | | | | | | | | | | They cannot be used anymore with the userland bits we provide. Furthermore, their KMS versions support the same hardware. Submitted by: dumbbell Reviewed by: emaste, manu Sponsored by: AsiaBSDCon Differential Revision: https://reviews.freebsd.org/D5614 Notes: svn path=/head/; revision=315045
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-0313-15/+15
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* As <machine/param.h> is included from <sys/param.h>, there is no needSvatopluk Kraus2016-02-221-1/+0
| | | | | | | | | | to include it explicitly when <sys/param.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5378 Notes: svn path=/head/; revision=295881
* As <machine/pmap.h> is included from <vm/pmap.h>, there is no need toSvatopluk Kraus2016-02-221-1/+0
| | | | | | | | | | include it explicitly when <vm/pmap.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373 Notes: svn path=/head/; revision=295880
* Instead of defining the actualy user and group id in the drmP.h filesKoop Mast2015-08-111-2/+2
| | | | | | | | | | | | | | define GID_VIDEO in sys/conf.h, and use it together with UID_ROOT to define DRM_DEV_UID and DRM_DEV_GID in the drmP.h files. So there is one place where the UID's and GID's are defined. Submitted by: ed@ Reviewed by: ed@, dumbbell@ Differential Revision: https://reviews.freebsd.org/D3360 Notes: svn path=/head/; revision=286640
* Add a new group named 'video' with the id of 44. And make drm createKoop Mast2015-08-091-1/+1
| | | | | | | | | | | | | | devices in /dev/dri/ with this new group. This will allow ports and users to more easily access to these devices for OpenGL and OpenCL support. Reviewed by: dumbbell@ Approved by: dumbbell@ Differential Revision: https://reviews.freebsd.org/D1260 Notes: svn path=/head/; revision=286524
* Remove compatibility shims for FreeBSD versions older than 8.0.John Baldwin2015-06-0413-119/+0
| | | | Notes: svn path=/head/; revision=283999
* Add a new file operations hook for mmap operations. File type-specificJohn Baldwin2015-06-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | logic is now placed in the mmap hook implementation rather than requiring it to be placed in sys/vm/vm_mmap.c. This hook allows new file types to support mmap() as well as potentially allowing mmap() for existing file types that do not currently support any mapping. The vm_mmap() function is now split up into two functions. A new vm_mmap_object() function handles the "back half" of vm_mmap() and accepts a referenced VM object to map rather than a (handle, handle_type) tuple. vm_mmap() is now reduced to converting a (handle, handle_type) tuple to a a VM object and then calling vm_mmap_object() to handle the actual mapping. The vm_mmap() function remains for use by other parts of the kernel (e.g. device drivers and exec) but now only supports mapping vnodes, character devices, and anonymous memory. The mmap() system call invokes vm_mmap_object() directly with a NULL object for anonymous mappings. For mappings using a file descriptor, the descriptors fo_mmap() hook is invoked instead. The fo_mmap() hook is responsible for performing type-specific checks and adjustments to arguments as well as possibly modifying mapping parameters such as flags or the object offset. The fo_mmap() hook routines then call vm_mmap_object() to handle the actual mapping. The fo_mmap() hook is optional. If it is not set, then fo_mmap() will fail with ENODEV. A fo_mmap() hook is implemented for regular files, character devices, and shared memory objects (created via shm_open()). While here, consistently use the VM_PROT_* constants for the vm_prot_t type for the 'prot' variable passed to vm_mmap() and vm_mmap_object() as well as the vm_mmap_vnode() and vm_mmap_cdev() helper routines. Previously some places were using the mmap()-specific PROT_* constants instead. While this happens to work because PROT_xx == VM_PROT_xx, using VM_PROT_* is more correct. Differential Revision: https://reviews.freebsd.org/D2658 Reviewed by: alc (glanced over), kib MFC after: 1 month Sponsored by: Chelsio Notes: svn path=/head/; revision=283998
* Adjust printf format specifiers for dev_t and ino_t in kernel.Gleb Kurtsou2014-12-171-2/+3
| | | | | | | | | ino_t and dev_t are about to become uint64_t. Reviewed by: kib, mckusick Notes: svn path=/head/; revision=275856
* Remove always false comparison.Gleb Smirnoff2014-09-031-1/+1
| | | | | | | Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=271013
* Remove ia64.Marcel Moolenaar2014-07-072-3/+1
| | | | | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan Notes: svn path=/head/; revision=268351
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-282-2/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-272-1/+2
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-272-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* - Modify vm_page_unwire() and vm_page_enqueue() to directly acceptAttilio Rao2014-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | | the queue where to enqueue pages that are going to be unwired. - Add stronger checks to the enqueue/dequeue for the pagequeues when adding and removing pages to them. Of course, for unmanaged pages the queue parameter of vm_page_unwire() will be ignored, just as the active parameter today. This makes adding new pagequeues quicker. This change effectively modifies the KPI. __FreeBSD_version will be, however, bumped just when the full cache of free pages will be evicted. Sponsored by: EMC / Isilon storage division Reviewed by: alc Tested by: pho Notes: svn path=/head/; revision=267548
* Add missing calls to bus_dmamap_unload() when freeing static DMAJohn Baldwin2014-06-132-0/+2
| | | | | | | | | allocations. Reviewed by: scottl Notes: svn path=/head/; revision=267446
* Back out r261266 pending security buy-in.Jamie Gritton2014-01-311-3/+1
| | | | | | | | | | | r261266: Add a jail parameter, allow.kmem, which lets jailed processes access /dev/kmem and related devices (i.e. grants PRIV_IO and PRIV_KMEM_WRITE). This in conjunction with changing the drm driver's permission check from PRIV_DRIVER to PRIV_KMEM_WRITE will allow a jailed Xorg server. Notes: svn path=/head/; revision=261326
* Add a jail parameter, allow.kmem, which lets jailed processes accessJamie Gritton2014-01-291-1/+3
| | | | | | | | | | | | /dev/kmem and related devices (i.e. grants PRIV_IO and PRIV_KMEM_WRITE). This in conjunction with changing the drm driver's permission check from PRIV_DRIVER to PRIV_KMEM_WRITE will allow a jailed Xorg server. Submitted by: netchild MFC after: 1 week Notes: svn path=/head/; revision=261266
* In sys/dev/drm/mach64_dma.c, remove static function mach64_set_dma_eol(),Dimitry Andric2013-12-261-48/+0
| | | | | | | | | | which has never been used, even by upstream, since its initial upstream commit (see http://cgit.freedesktop.org/mesa/drm/commit/?id=873e1c4d ) MFC after: 3 days Notes: svn path=/head/; revision=259902
* Fix undefined behavior: (1 << 31) is not defined as 1 is an int and thisEitan Adler2013-11-309-47/+47
| | | | | | | | | | | | | | | | shifts into the sign bit. Instead use (1U << 31) which gets the expected result. This fix is not ideal as it assumes a 32 bit int, but does fix the issue for most cases. A similar change was made in OpenBSD. Discussed with: -arch, rdivacky Reviewed by: cperciva Notes: svn path=/head/; revision=258780
* Similar to the (1 << 31) case it is not defined to do (2 << 30).Eitan Adler2013-11-301-2/+2
| | | | Notes: svn path=/head/; revision=258779
* Replace kernel virtual address space allocation with vmem. This providesJeff Roberson2013-08-071-2/+2
| | | | | | | | | | | | | | | | transparent layering and better fragmentation. - Normalize functions that allocate memory to use kmem_* - Those that allocate address space are named kva_* - Those that operate on maps are named kmap_* - Implement recursive allocation handling for kmem_arena in vmem. Reviewed by: alc Tested by: pho Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=254025
* Fix white spaces.Jung-uk Kim2013-04-231-2/+2
| | | | Notes: svn path=/head/; revision=249816
* Remove always-true conditions from if statement.Eitan Adler2013-04-231-2/+2
| | | | | | | | | PR: kern/176712 Submitted by: Hiren Panchasara <hiren.panchasara@gmail.com> Approved by: cperciva (mentor) Notes: svn path=/head/; revision=249799
* Switch the vm_object mutex to be a rwlock. This will enable in theAttilio Rao2013-03-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | future further optimizations where the vm_object lock will be held in read mode most of the time the page cache resident pool of pages are accessed for reading purposes. The change is mostly mechanical but few notes are reported: * The KPI changes as follow: - VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK() - VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK() - VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK() - VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED() (in order to avoid visibility of implementation details) - The read-mode operations are added: VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(), VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED() * The vm/vm_pager.h namespace pollution avoidance (forcing requiring sys/mutex.h in consumers directly to cater its inlining functions using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h consumers now must include also sys/rwlock.h. * zfs requires a quite convoluted fix to include FreeBSD rwlocks into the compat layer because the name clash between FreeBSD and solaris versions must be avoided. At this purpose zfs redefines the vm_object locking functions directly, isolating the FreeBSD components in specific compat stubs. The KPI results heavilly broken by this commit. Thirdy part ports must be updated accordingly (I can think off-hand of VirtualBox, for example). Sponsored by: EMC / Isilon storage division Reviewed by: jeff Reviewed by: pjd (ZFS specific review) Discussed with: alc Tested by: pho Notes: svn path=/head/; revision=248084
* Cast VIA_READ to (void) where the result is unused.Roman Divacky2012-11-092-3/+3
| | | | Notes: svn path=/head/; revision=242825
* Make sure to define __BIG_ENDIAN and __LITTLE_ENDIAN with the appropriateNathan Whitehorn2012-10-261-0/+5
| | | | | | | | | | number of underscores for Linux compatibility in drm(4). Submitted by: sendtomatt at gmail dot com MFC after: 2 weeks Notes: svn path=/head/; revision=242132
* Streamline use of cdevpriv and correct some corner cases.Hans Petter Selasky2012-08-151-8/+6
| | | | | | | | | | | | | | | | | | | | | | | 1) It is not useful to call "devfs_clear_cdevpriv()" from "d_close" callbacks, hence for example read, write, ioctl and so on might be sleeping at the time of "d_close" being called and then then freed private data can still be accessed. Examples: dtrace, linux_compat, ksyms (all fixed by this patch) 2) In sys/dev/drm* there are some cases in which memory will be freed twice, if open fails, first by code in the open routine, secondly by the cdevpriv destructor. Move registration of the cdevpriv to the end of the drm open routines. 3) devfs_clear_cdevpriv() is not called if the "d_open" callback registered cdevpriv data and the "d_open" callback function returned an error. Fix this. Discussed with: phk MFC after: 2 weeks Notes: svn path=/head/; revision=239303
* In sys/dev/drm/radeon_state.c, use the correct printf length modifiersDimitry Andric2011-12-301-1/+1
| | | | | | | | | for ints. MFC after: 1 week Notes: svn path=/head/; revision=228979
* Fix format string Z --> z, since the former is a deprecated and (in FreeBSD)Stefan Eßer2011-12-161-2/+2
| | | | | | | | | | | unsupported form of the latter. This change has been reviewed and accepted in the -hackers list. Submitted by: Alexander Best Reviewed by: David Schulz Notes: svn path=/head/; revision=228572
* Do not define bool/true/false if the symbols already exist.Matthew D Fleming2011-12-121-1/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: Isilon Systems, LLC Notes: svn path=/head/; revision=228443
* Fix display of the drm sysctls.Konstantin Belousov2011-04-231-1/+1
| | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 3 days Notes: svn path=/head/; revision=220979
* Do a sweep of the tree replacing calls to pci_find_extcap() with calls toJohn Baldwin2011-03-231-1/+1
| | | | | | | pci_find_cap() instead. Notes: svn path=/head/; revision=219902
* - Remove no longer in useMartin Wilke2011-02-222-87/+0
| | | | | | | | | | PR: kern/152354 Submitted by: vehemens <vehemens@verizon.net> Discussion with:kib Approved by: rwatson (mentor) Notes: svn path=/head/; revision=218937