aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/drm2
Commit message (Collapse)AuthorAgeFilesLines
* MFC: r364737, r365264 and r365287Niclas Zeising2020-09-062-4/+8
| | | | | | | | | | | | | Together, these three revisions improve the drm2 (aka legacy drm or drm-legacy) drivers to point towards graphics/drm-kmod where relevant, and to remove references to graphics/drm-legacy-kmd as that is being deprecated. Since part of the drm2 drivers are still used on arm, arm is currently excluded from the deprecation message. Approved by: imp, manu (implicit, MFC) Notes: svn path=/stable/12/; revision=365377
* Fix misleading indentation in sys/dev/drm2/radeon/evergreen.cDimitry Andric2020-04-251-1/+1
| | | | | | | | | | | | This fixes the following warning from recent versions of clang and gcc: sys/dev/drm2/radeon/evergreen.c:554:4: error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation] Direct commit to stable/{10,11,12}, since this driver has been removed from FreeBSD 13. Notes: svn path=/stable/12/; revision=360303
* MFC r350421:Mark Johnston2019-08-211-0/+1
| | | | | | | Avoid relying on header pollution from sys/refcount.h. Notes: svn path=/stable/12/; revision=351345
* MFC r349432:Mark Johnston2019-07-031-1/+1
| | | | | | | Add a return value to vm_page_remove(). Notes: svn path=/stable/12/; revision=349701
* drm2/intel_iic: stop using iicbus_set_nostopAndriy Gapon2019-06-201-4/+79
| | | | | | | | | | | | | | | The desired mode of transmitting messages is implemented by subclassing iicbb driver and overriding its iicbus_transfer method with an almost identical copy that issues the stop condition only at the very end. iicbus_set_nostop is very broken and is set to be removed from the KPI. This is a direct commit as in head the drm drivers have been moved out of the tree. The same change has been committed to FreeBSDDesktop/drm-legacy. Notes: svn path=/stable/12/; revision=349224
* MFC r348785:Mark Johnston2019-06-171-1/+1
| | | | | | | Replace uses of vm_page_unwire(m, PQ_NONE) with vm_page_unwire_noq(m). Notes: svn path=/stable/12/; revision=349139
* MFC r342888:Mark Johnston2019-01-122-8/+0
| | | | | | | | | Complete the removal of obsolete ioctl handlers. PR: 234706 Notes: svn path=/stable/12/; revision=342969
* MFC r342182:Mark Johnston2019-01-029-10807/+33
| | | | | | | Remove UMS support code from radeonkms. Notes: svn path=/stable/12/; revision=342689
* MFC 339475: improve drm messaging in driver and UPDATINGWarner Losh2018-10-231-2/+2
| | | | | | | Approved by: re@ (rgrimes) Notes: svn path=/stable/12/; revision=339633
* Reapply, with minor tweaks, r338025, from the original commit:Warner Losh2018-09-262-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
* Convert x86 cache invalidation functions to ifuncs.Konstantin Belousov2018-09-192-6/+7
| | | | | | | | | | | | | This simplifies the runtime logic and reduces the number of runtime-constant branches. Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation Approved by: re (gjb) Differential revision: https://reviews.freebsd.org/D16736 Notes: svn path=/head/; revision=338807
* Add big, nasty abandonware tags to this code.Warner Losh2018-08-282-1/+16
| | | | | | | | | | | | | 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-24269-0/+235179
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-22269-235179/+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
* Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer2018-08-192-2/+2
| | | | | | | | | | I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
* Remove unused and easy to misuse PNP macro parameterConrad Meyer2018-08-192-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
* 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
* Make timespecadd(3) and friends publicAlan Somers2018-07-302-4/+3
| | | | | | | | | | | | | | | | | | | | | | The timespecadd(3) family of macros were imported from NetBSD back in r35029. However, they were initially guarded by #ifdef _KERNEL. In the meantime, we have grown at least 28 syscalls that use timespecs in some way, leading many programs both inside and outside of the base system to redefine those macros. It's better just to make the definitions public. Our kernel currently defines two-argument versions of timespecadd and timespecsub. NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define three-argument versions. Solaris also defines a three-argument version, but only in its kernel. This revision changes our definition to match the common three-argument version. Bump _FreeBSD_version due to the breaking KPI change. Discussed with: cem, jilles, ian, bde Differential Revision: https://reviews.freebsd.org/D14725 Notes: svn path=/head/; revision=336914
* Fix build of i915kms with base gccDimitry Andric2018-06-111-1/+9
| | | | | | | | | | | | | | | | | | | | | | | Base gcc fails to compile sys/dev/drm2/i915/intel_display.c for i386, with the following -Werror warnings: cc1: warnings being treated as errors /usr/src/sys/dev/drm2/i915/intel_display.c:8884: warning: initialization from incompatible pointer type This is due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432, which incorrectly interprets the [] as a flexible array member. Because base gcc does not have a -W flag to suppress this particular warning, it requires a rather ugly cast. To not influence any other compiler, put it in a #if/#endif block. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15744 Notes: svn path=/head/; revision=334946
* Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis2018-04-064-7/+0
| | | | | | | | | | | | | | | | | | | | | opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
* Correct pseudo misspelling in sys/ commentsEd Maste2018-02-231-1/+1
| | | | | | | contrib code and #define in intel_ata.h unchanged. Notes: svn path=/head/; revision=329873
* vm_wait() rework.Konstantin Belousov2018-02-204-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Make vm_wait() take the vm_object argument which specifies the domain set to wait for the min condition pass. If there is no object associated with the wait, use curthread' policy domainset. The mechanics of the wait in vm_wait() and vm_wait_domain() is supplied by the new helper vm_wait_doms(), which directly takes the bitmask of the domains to wait for passing min condition. Eliminate pagedaemon_wait(). vm_domain_clear() handles the same operations. Eliminate VM_WAIT and VM_WAITPFAULT macros, the direct functions calls are enough. Eliminate several control state variables from vm_domain, unneeded after the vm_wait() conversion. Scetched and reviewed by: jeff Tested by: pho Sponsored by: The FreeBSD Foundation, Mellanox Technologies Differential revision: https://reviews.freebsd.org/D14384 Notes: svn path=/head/; revision=329636
* drm2: Basic use of mallocarray(9).Pedro F. Giffuni2018-01-221-6/+2
| | | | | | | | | | | | | | These functions deal the same type of overflows we do with mallocarray(9). Using our mallocarray will panic, which different from the previous behavior (returning NULL), but neither behavior is more correct. As a sidenote, drm_calloc_large() is not currently used at all. Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D13835 Notes: svn path=/head/; revision=328261
* These drivers have a sentinel at the end of the device list. ExcludeWarner Losh2017-12-232-2/+2
| | | | | | | it. Notes: svn path=/head/; revision=327100
* Fix typos from last commit, these should have been #.Warner Losh2017-12-221-1/+1
| | | | Notes: svn path=/head/; revision=327095
* Use '#' rather than some made up name for fields we want to ignore.Warner Losh2017-12-222-2/+2
| | | | Notes: svn path=/head/; revision=327089
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-275-1/+11
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* Unrevert r324059Conrad Meyer2017-09-272-0/+4
| | | | | | | | | | With a colon and bogus name ("#") added to appease the simplistic parser used in kldxref. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=324067
* Remove PNP metadata from drm2 drivers until kldxref problem is resolvedConrad Meyer2017-09-272-4/+0
| | | | | | | | Reported by: np Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=324059
* Add PNP metadata to more driversConrad Meyer2017-09-262-0/+4
| | | | | | | | | | | | | | | 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
* Simplify i915_gem_wire_page() and avoid unneeded page-busying.Mark Johnston2017-09-211-7/+6
| | | | | | | | Reviewed by: alc, kib MFC after: 1 week Notes: svn path=/head/; revision=323880
* Modernize calls to vm_page_unwire(). As of r288122, vm_page_unwire()Alan Cox2017-09-212-4/+3
| | | | | | | | | | | | accepts PQ_NONE as the specified queue and returns a Boolean indicating whether the page's wire count transitioned to zero. Use these features in dev/drm2. Reviewed by: kib, markj MFC after: 1 week Notes: svn path=/head/; revision=323868
* Don't bother enqueuing a page immediately before freeing it.Mark Johnston2017-05-181-1/+1
| | | | | | | | | No functional change intended. MFC after: 1 week Notes: svn path=/head/; revision=318479
* Fix a few uses of kern_yield() in the TTM and the LinuxKPI.Mark Johnston2017-05-181-2/+2
| | | | | | | | | | | | | | kern_yield(0) effectively causes the calling thread to be rescheduled immediately since it resets the thread's priority to the highest possible value. This can cause livelocks when the pattern "while (!trylock()) kern_yield(0);" is used since the thread holding the lock may linger on the runqueue for the CPU on which the looping thread is running. MFC after: 1 week Notes: svn path=/head/; revision=318478
* Add TUNABLE_INT to radeonkms driver parameters.Yoshihiro Takahashi2017-04-291-0/+17
| | | | | | | | | | | They are required by PowerMac G5 DP. PR: 217852 Submitted by: Hiroo Ono MFC after: 1 week Notes: svn path=/head/; revision=317591
* 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
* drm2: Add some missing PCIIDs for some Haswell systemsConrad Meyer2017-04-132-0/+2
| | | | | | | Submitted by: Jia-Shiun Li <jiashiun at gmail.com> Notes: svn path=/head/; revision=316749
* 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
* Really revert 312923 this timeBaptiste Daroussin2017-01-285-12/+13
| | | | Notes: svn path=/head/; revision=312928
* Revert crap accidentally committedBaptiste Daroussin2017-01-287-76/+83
| | | | Notes: svn path=/head/; revision=312927
* Revert r312923 a better approach will be taken laterBaptiste Daroussin2017-01-287-83/+76
| | | | Notes: svn path=/head/; revision=312926
* Make the drm2 module depend on linuxkpiBaptiste Daroussin2017-01-285-13/+12
| | | | | | | Use linux memory allocation to reduce diff with upstream Notes: svn path=/head/; revision=312923
* Introduce __read_mostly and __exclusive_cache_line macros.Mateusz Guzik2017-01-271-1/+0
| | | | | | | | | | | | | | | | The intended use is to annotate frequently used globals which either rarely change (and thus can be grouped in the same cacheline) or are an atomic counter (which means it may benefit from being the only variable in the cacheline). Linker script support is provided only for amd64. Architectures without it risk having other variables put in, i.e. as if they were not annotated. This is harmless from correctness point of view. Reviewed by: bde (previous version) MFC after: 1 month Notes: svn path=/head/; revision=312888
* Import drm_patform.c, an implementation of non-PCI based attachmentMichal Meloun2016-12-262-0/+187
| | | | | | | | | | for graphics drivers. It will be used in upcoming driver for Nvidia Tegra boards. MFC after: 1 month Notes: svn path=/head/; revision=310599
* Fix late monitor hotplug event.Michal Meloun2016-12-261-0/+22
| | | | | | | | | | | | | | If system starts without attached monitor, DRM create framebuffer for VT console. Later, when monitor is attached, the hotplug event must issue full modeset procedure to setup CRTC. In original code, this was done in drm_fb_helper_set_par(), but we don't have this function implemented yet. Use unrolled version of drm_fb_helper_set_par() to ensure same functionality. MFC after: 1 month Notes: svn path=/head/; revision=310593
* Fix bug in r309712, do not leak gem object pin count in case of errorKonstantin Belousov2016-12-131-1/+3
| | | | | | | | | | | or retry. Reported and tested by: Michael Butler <imb@protected-networks.net> Sponsored by: The FreeBSD Foundation MFC after: 16 days Notes: svn path=/head/; revision=310027
* Use the populate() driver paging method for i915 driver.Konstantin Belousov2016-12-081-52/+19
| | | | | | | | | | | | | | In particular, the fault access type is accounted for when the aperture page is moved to GTT domain. On the other hand, the current pager structure is left intact, most important, only one page is instantiated per populate call. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Notes: svn path=/head/; revision=309712
* Allow DRM2 code to be built on platforms without AGP.Michal Meloun2016-11-135-40/+178
| | | | | | | | | | This patch is taken from original drm-3.8 code. Differential Revision: https://reviews.freebsd.org/D8454 MFC after: 3 weeks Notes: svn path=/head/; revision=308612
* Fix a race in vm_page_busy_sleep(9).Konstantin Belousov2016-10-132-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose that we have an exclusively busy page, and a thread which can accept shared-busy page. In this case, typical code waiting for the page xbusy state to pass is again: VM_OBJECT_WLOCK(object); ... if (vm_page_xbusied(m)) { vm_page_lock(m); VM_OBJECT_WUNLOCK(object); <---1 vm_page_busy_sleep(p, "vmopax"); goto again; } Suppose that the xbusy state owner locked the object, unbusied the page and unlocked the object after we are at the line [1], but before we executed the load of the busy_lock word in vm_page_busy_sleep(). If it happens that there is still no waiters recorded for the busy state, the xbusy owner did not acquired the page lock, so it proceeded. More, suppose that some other thread happen to share-busy the page after xbusy state was relinquished but before the m->busy_lock is read in vm_page_busy_sleep(). Again, that thread only needs vm_object lock to proceed. Then, vm_page_busy_sleep() reads busy_lock value equal to the VPB_SHARERS_WORD(1). In this case, all tests in vm_page_busy_sleep(9) pass and we are going to sleep, despite the page being share-busied. Update check for m->busy_lock == VPB_UNBUSIED in vm_page_busy_sleep(9) to also accept shared-busy state if we only wait for the xbusy state to pass. Merge sequential if()s with the same 'then' clause in vm_page_busy_sleep(). Note that the current code does not share-busy pages from parallel threads, the only way to have more that one sbusy owner is right now is to recurse. Reported and tested by: pho (previous version) Reviewed by: alc, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D8196 Notes: svn path=/head/; revision=307218