360303 |
25-Apr-2020 |
dim |
Fix misleading indentation in sys/dev/drm2/radeon/evergreen.c
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. |
349227 |
20-Jun-2019 |
avg |
drm2/intel_iic: stop using iicbus_set_nostop
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. |
346817 |
28-Apr-2019 |
dchagin |
MFC r329873 (by emaste@):
Correct pseudo misspelling in sys/ comments
contrib code and #define in intel_ata.h unchanged. |
342969 |
12-Jan-2019 |
markj |
MFC r342888: Complete the removal of obsolete ioctl handlers.
PR: 234706 |
342691 |
02-Jan-2019 |
markj |
MFC r342182: Remove UMS support code from radeonkms. |
335288 |
17-Jun-2018 |
dim |
MFC r334946:
Fix build of i915kms with base gcc
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 Differential Revision: https://reviews.freebsd.org/D15744 |
331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
331017 |
15-Mar-2018 |
kevans |
MFC r317055,r317056 (glebius): Include sys/vmmeter.h as included
r317055: All these files need sys/vmmeter.h, but now they got it implicitly included via sys/pcpu.h.
r317056: Typo! |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
324129 |
30-Sep-2017 |
alc |
MFC r323868 Modernize calls to vm_page_unwire(). As of r288122, vm_page_unwire() 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. |
324083 |
28-Sep-2017 |
markj |
MFC r323880: Simplify i915_gem_wire_page() and avoid unneeded page-busying. |
318848 |
25-May-2017 |
markj |
MFC r318479: Don't bother enqueuing a page immediately before freeing it. |
318847 |
25-May-2017 |
markj |
MFC r318476, r318478: Fix up some kern_yield() usages. |
317902 |
07-May-2017 |
nyan |
MFC: r317591
Add TUNABLE_INT to radeonkms driver parameters. They are required by PowerMac G5 DP.
PR: 217852 Submitted by: Hiroo Ono |
317609 |
30-Apr-2017 |
markj |
MFC r316749 (by cem): drm2: Add some missing PCIIDs for some Haswell systems
PR: 218969 |
317011 |
16-Apr-2017 |
mmel |
MFC r310593,r310599:
r310593: Fix late monitor hotplug event. 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. r310599: Import drm_patform.c, an implementation of non-PCI based attachment for graphics drivers. It will be used in upcoming driver for Nvidia Tegra boards. |
317008 |
16-Apr-2017 |
mmel |
MFC r308612,r308614:
r308612: Allow DRM2 code to be built on platforms without AGP. This patch is taken from original drm-3.8 code. r308614: Allow embeding DRM2 code into kernel. It's usefull for development (for netboot) and it also helps to boot FreeBSD on some embeded platforms (where we must boot kernel directly, without standard boot loader). |
316073 |
28-Mar-2017 |
kib |
MFC r315281: Use atop() instead of OFF_TO_IDX() for convertion of addresses or addresses offsets, as intended.
MFC r315580 (by alc): Simplify the logic for clipping the range returned by the pager to fit within the map entry. Use atop() rather than OFF_TO_IDX() on addresses. |
315284 |
14-Mar-2017 |
mjg |
MFC r312888:
Introduce __read_mostly and __exclusive_cache_line macros.
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. |
312075 |
13-Jan-2017 |
kib |
MFC r309712: Use the populate() driver paging method for i915 driver.
MFC r310027: Fix bug in r309712, do not leak gem object pin count in case of error or retry. |
307671 |
20-Oct-2016 |
kib |
MFC r307218: Fix a race in vm_page_busy_sleep(9). |
305554 |
07-Sep-2016 |
dim |
MFC r305344:
Define drmP.h's __OS_HAS_AGP and __OS_HAS_MTRR macros in a defined and portable way.
Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D7770 |
303689 |
03-Aug-2016 |
ngie |
MFC r302571,r302572,r302577,r302841:
Approved by: re (gjb)
r302571:
Remove redundant declaration for radeon_pm_acpi_event_handler(..) to fix -Wredundant-decls warning
PR: 209924 Tested with: devel/amd64-gcc (5.3.0)
r302572:
Remove redundant declarations for intel_fbc_enabled(..) and i915_gem_dump_object(..) to fix -Wredundant-decls warning
PR: 209924 Tested with: devel/amd64-gcc (5.3.0)
r302577:
Add missing default case to capable(..) function definition
By definition (enum __drm_capabilities), cases other than CAP_SYS_ADMIN aren't possible. Add in a KASSERT safety belt and return false in !INVARIANTS case if an invalid value is passed in, as it would be a programmer error.
This fixes a -Wreturn-type error with gcc 5.3.0.
r302841:
Always panic if an invalid capability is passed to `capable(..)` instead of just with INVARIANTS
rwatson's point was valid in the sense that if the data passed at runtime is invalid, it should always trip the invariant, not just in the debug case. This is a deterrent against malicious input, or input caused by hardware errors.
Requested by: rwatson |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
301236 |
03-Jun-2016 |
adrian |
[drm] fix up hex_dump_to_buffer to not overflow linebuf.
That check wasn't enough to handle appending a two byte character following it.
This prevented my T400 (Intel Core 2 Duo P8400) from attaching; it would panic from a stack overflow detection.
|
300050 |
17-May-2016 |
eadler |
Don't repeat the the word 'the'
(one manual change to fix grammar)
Confirmed With: db Approved by: secteam (not really, but this is a comment typo fix)
|
299381 |
10-May-2016 |
hselasky |
Ensure waiting loops terminate during cold boot. This fixes boot with MacBookPro and i915kms_load="YES" in /boot/loader.conf.
A lowlevel timeout in one of the display ports caused an infinite wait because a ticks/jiffies comparison was constant. The clock subsystem which makes ticks/jiffies increment is started after the initial driver probing is done. Refer to sys/kernel.h and SI_SUB_DRIVERS vs SI_SUB_CLOCKS .
Discussed with: kmacy @
|
298955 |
03-May-2016 |
pfg |
sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
|
298951 |
03-May-2016 |
jhb |
Revert bus_get_cpus() for now.
I really thought I had run this through the tinderbox before committing, but many places need <sys/types.h> -> <sys/param.h> for <sys/bus.h> now.
|
298933 |
02-May-2016 |
jhb |
Add a new bus method to fetch device-specific CPU sets.
bus_get_cpus() returns a specified set of CPUs for a device. It accepts an enum for the second parameter that indicates the type of cpuset to request. Currently two valus are supported:
- LOCAL_CPUS (on x86 this returns all the CPUs in the package closest to the device when DEVICE_NUMA is enabled) - INTR_CPUS (like LOCAL_CPUS but only returns 1 SMT thread for each core)
For systems that do not support NUMA (or if it is not enabled in the kernel config), LOCAL_CPUS fails with EINVAL. INTR_CPUS is mapped to 'all_cpus' by default. The idea is that INTR_CPUS should always return a valid set.
Device drivers which want to use per-CPU interrupts should start using INTR_CPUS instead of simply assigning interrupts to all available CPUs. In the future we may wish to add tunables to control the policy of INTR_CPUS (e.g. should it be local-only or global, should it ignore SMT threads or not).
The x86 nexus driver exposes the internal set of interrupt CPUs from the the x86 interrupt code via INTR_CPUS.
The ACPI bus driver and PCI bridge drivers use _PXM to return a suitable LOCAL_CPUS set when _PXM exists and DEVICE_NUMA is enabled. They also and the global INTR_CPUS set from the nexus driver with the per-domain set from _PXM to generate a local INTR_CPUS set for child devices.
Reviewed by: wblock (manpage) Differential Revision: https://reviews.freebsd.org/D5519
|
298931 |
02-May-2016 |
pfg |
etc: minor spelling fixes.
Mostly comments but also some user-visible strings.
MFC after: 2 weeks
|
298335 |
20-Apr-2016 |
cem |
i915kms: Fix memory leak if a CRT is detected
Reported by: Coverity CID: 1090729 Sponsored by: EMC / Isilon Storage Division
|
298334 |
20-Apr-2016 |
cem |
drm2(4): Fix double-free in low-memory error path
Reallocf frees 'block'; don't attempt to free it again.
Reported by: Coverity CID: 1091165 Sponsored by: EMC / Isilon Storage Division
|
298331 |
20-Apr-2016 |
cem |
i915kms intel_pm: Read from actual tsc_freq instead of uninitialized local
The local of the same name would alias the global, but we didn't even include the header that defines tsc_freq. Include it and rename the local.
Reported by: Coverity CID: 1331559 Sponsored by: EMC / Isilon Storage Division
|
297793 |
10-Apr-2016 |
pfg |
Cleanup unnecessary semicolons from the kernel.
Found with devel/coccinelle.
|
297231 |
24-Mar-2016 |
kib |
Handle the driver KPI change from r292373. Ensure that managed device pagers fault routines always return with a result page, be it the proper and valid result page, or initially passed freshly allocated placeholder. Do not free the passed in page until we are able to provide the replacement, and do not assign NULL to *mres.
Reported and tested by: dumbbell Reviewed by: royger (who also verified that Xen code is safe) Sponsored by: The FreeBSD Foundation
|
297128 |
21-Mar-2016 |
emaste |
i915: disable GEN6_MBCTL write in gen6_init_clock_gating
This write came from Linux commit b4ae3f22d238 which has been implicated in Sandy Bridge power consumption issues (albeit under different conditions on Linux). Disabling it restores normal power consumption on my Sandy Bridge laptop (Thinkpad X220).
PR: 207889 Reviewed by: cem, dumbbell Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5665
|
296862 |
14-Mar-2016 |
bz |
Fix the printf for PAE kernels where it'd be long long to unbreak the build.
|
296768 |
12-Mar-2016 |
dumbbell |
drm/i915: Import Linux commit 168f83660211b9e059e3bc0638daaa01e9ea0b71
This makes sure the default context of each ring is cleaned up with the ring itself and fixes a memory leak.
Author: Mika Kuoppala <mika.kuoppala@linux.intel.com> Date: Fri May 3 16:29:08 2013 +0300
drm/i915: unreference default context on module unload
Before module unload is called, gpu_idle() will switch to default context. This will increment ref count of base object as the default context is 'running' on module unload time. Unreference the drm object so that when context is freed, base object is freed as well.
v2: added comment to explain the refcounts (Ben Widawsky)
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Obtained from: Linux
|
296721 |
12-Mar-2016 |
dumbbell |
drm/i915: Call i915_gem_gtt_fini() when the device is detached
This fixes several memory leaks. Apparently, this problem exists in Linux 3.8 but the code changed in Linux 3.9 so it may be fixed upstream already. Still, this is something we need to pay attention to.
|
296720 |
12-Mar-2016 |
dumbbell |
drm/i915: Fix page fault handler failure
... when __wait_seqno() is interrupted by a signal. In this case, __wait_seqno() returns -ERESTARTSYS. Like we already do in drm_ioctl(), we need to convert this error to a common code such as -EINTR, so the page fault handler is restarted.
Reported by: Frederic Chardon <chardon.frederic@gmail.com> Tested by: Frederic Chardon <chardon.frederic@gmail.com>
|
296681 |
11-Mar-2016 |
dumbbell |
drm/i915: Fix malloc type in i915_gem_object_bind_to_gtt()
drm_mm.c expects DRM_MEM_MM, not DRM_I915_GEM.
|
296674 |
11-Mar-2016 |
dumbbell |
drm: Fix dev->ioctl_count references leak
This fixes the following error: kernel: error: [drm:pid1167:drm_release] *ERROR* Device busy: 2
Because of that, drm_lastclose() was not called, leading to a few memory leaks once the driver was unloaded.
MFC after: 1 week
|
296548 |
08-Mar-2016 |
dumbbell |
drm/i915: Update to match Linux 3.8.13
This update brings initial support for Haswell GPUs.
Tested by: Many users of FreeBSD, PC-BSD and HardenedBSD Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5554
|
296272 |
01-Mar-2016 |
jhb |
Remove taskqueue_enqueue_fast().
taskqueue_enqueue() was changed to support both fast and non-fast taskqueues 10 years ago in r154167. It has been a compat shim ever since. It's time for the compat shim to go.
Submitted by: Howard Su <howard0su@gmail.com> Reviewed by: sephe Differential Revision: https://reviews.freebsd.org/D5131
|
295881 |
22-Feb-2016 |
skra |
As <machine/param.h> is included from <sys/param.h>, there is no need to include it explicitly when <sys/param.h> is already included.
Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5378
|
295880 |
22-Feb-2016 |
skra |
As <machine/pmap.h> is included from <vm/pmap.h>, there is no need to include it explicitly when <vm/pmap.h> is already included.
Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5373
|
293851 |
13-Jan-2016 |
dumbbell |
drm: Revert the part of r288653 about M_WAITOK vs M_NOWAIT
Using M_NOWAIT could lead to transient failures with ioctls.
Suggested by: kib
|
293837 |
13-Jan-2016 |
dumbbell |
drm/i915: Further reduce the diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
|
292469 |
19-Dec-2015 |
alc |
Introduce a new mechanism for relocating virtual pages to a new physical address and use this mechanism when:
1. kmem_alloc_{attr,contig}() can't find suitable free pages in the physical memory allocator's free page lists. This replaces the long-standing approach of scanning the inactive and inactive queues, converting clean pages into PG_CACHED pages and laundering dirty pages. In contrast, the new mechanism does not use PG_CACHED pages nor does it trigger a large number of I/O operations.
2. on 32-bit MIPS processors, uma_small_alloc() and the pmap can't find free pages in the physical memory allocator's free page lists that are covered by the direct map. Tested by: adrian
3. ttm_bo_global_init() and ttm_vm_page_alloc_dma32() can't find suitable free pages in the physical memory allocator's free page lists.
In the coming months, I expect that this new mechanism will be applied in other places. For example, balloon drivers should use relocation to minimize fragmentation of the guest physical address space.
Make vm_phys_alloc_contig() a little smarter (and more efficient in some cases). Specifically, use vm_phys_segs[] earlier to avoid scanning free page lists that can't possibly contain suitable pages.
Reviewed by: kib, markj Glanced at: jhb Discussed with: jeff Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4444
|
292409 |
17-Dec-2015 |
jhb |
t seems certain Intel GPUs use GPIO bitbanging over a child device instead of GMBUS access for I2C transfers. The GMBUS driver falls back to this mode when a transfer times out. However, the first transfer to timeout was sending the request back to itself resulting in an panic due to recursing on a lock. Fix it to forward the request on to the proper device. This appears to have been accidentally changed in r277487.
Reported by: Joe Maloney <jmaloney@pcbsd.org> Reviewed by: adrian, dumbbell, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4599
|
292373 |
16-Dec-2015 |
glebius |
A change to KPI of vm_pager_get_pages() and underlying VOP_GETPAGES().
o With new KPI consumers can request contiguous ranges of pages, and unlike before, all pages will be kept busied on return, like it was done before with the 'reqpage' only. Now the reqpage goes away. With new interface it is easier to implement code protected from race conditions.
Such arrayed requests for now should be preceeded by a call to vm_pager_haspage() to make sure that request is possible. This could be improved later, making vm_pager_haspage() obsolete.
Strenghtening the promises on the business of the array of pages allows us to remove such hacks as swp_pager_free_nrpage() and vm_pager_free_nonreq().
o New KPI accepts two integer pointers that may optionally point at values for read ahead and read behind, that a pager may do, if it can. These pages are completely owned by pager, and not controlled by the caller.
This shifts the UFS-specific readahead logic from vm_fault.c, which should be file system agnostic, into vnode_pager.c. It also removes one VOP_BMAP() request per hard fault.
Discussed with: kib, alc, jeff, scottl Sponsored by: Nginx, Inc. Sponsored by: Netflix
|
291431 |
28-Nov-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
291430 |
28-Nov-2015 |
dumbbell |
drm/i915: Further reduce the diff in i915_dma.c
MFC after: 2 months
|
291428 |
28-Nov-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
290555 |
08-Nov-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
290238 |
01-Nov-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
290228 |
31-Oct-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
290070 |
27-Oct-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
290055 |
27-Oct-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
289936 |
25-Oct-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 month
|
289934 |
25-Oct-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
289719 |
21-Oct-2015 |
jhb |
i915_gem_do_execbuffer() holds the pages backing each relocation region for various reasons while executing user commands. After these commands are completed, the pages backing the relocation regions are unheld.
Since relocation regions do not have to be page aligned, the code in validate_exec_list() allocates 2 extra page pointers in the array of held pages populated by vm_fault_quick_hold_pages(). However, the cleanup code that unheld the pages always assumed that only the buffer size / PAGE_SIZE pages were used. This meant that non-page aligned buffers would not unheld the last 1 or 2 pages in the list. Fix this by saving the number of held pages returned by vm_fault_quick_hold_pages() for each relocation region and using this count during cleanup.
Reviewed by: dumbbell, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3965
|
289456 |
17-Oct-2015 |
dumbbell |
drm/i915: Reduce diff with Linux 3.8
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
289109 |
10-Oct-2015 |
dumbbell |
drm/i915: Remove "Attempting to unbind pinned buffer" message
This error message is removed in later versions of Linux and currently, it spams users.
PR: 200712 MFC after: 1 week
|
288952 |
06-Oct-2015 |
adrian |
Remove gen3 check introduced in r286653.
kib spotted this and noticed it's not correct.
Submitted by: kib Reviewed by: dumbbell
|
288653 |
04-Oct-2015 |
adrian |
drm2: a few minor fixes after r280183
* Remove obsolete drm_agp_*_memory() prototypes. * Fix comment in drm_fops.c (outisde -> outside). * Fix some formatting issues in drm_stub.c (spaces -> tabs). * Add missing case statement (gen == 3) in intel_gpu_reset(). * Restore pci_enable_busmaster() call in the init path (fixes gpu hang on i945GM). * Replace M_WAITOK with M_NOWAIT when the return value of malloc is checked (may be incorrect).
Submitted by: <s3erios@gmail.com> Reviewed by: dumbbell Approved by: dumbbell Differential Revision: https://reviews.freebsd.org/D3413
|
288452 |
01-Oct-2015 |
jhb |
Most error cases in i915_gem_do_execbuffer() jump to one of two labels to release resources (such as unholding pages) when errors occur. Some recently added error checks return immediately instead of jumping to a label resulting in leaks. Fix these to jump to a label to do cleanup instead.
Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3745
|
288112 |
22-Sep-2015 |
bz |
Hide an unused in FreeBSD function behind #ifdef linux to get rid of the compile time warning.
Reviewed by: gnn MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3710
|
287673 |
11-Sep-2015 |
avg |
radeon_suspend_kms: don't mess with pci state that's managed by the bus
The pci bus driver handles the power state, it also manages configuration state saving and restoring for its child devices. Thus a PCI device driver does not have to worry about those things. In fact, I observe a hard system hang when trying to suspend a system with active radeonkms driver where both the bus driver and radeonkms driver try to do the same thing. I suspect that it could be because of an access to a PCI configuration register after the device is placed into D3 state.
Reviewed by: dumbbell, jhb MFC after: 13 days Differential Revision: https://reviews.freebsd.org/D3561
|
287573 |
08-Sep-2015 |
dumbbell |
drm/ttm: Drain taskqueue if taskqueue_cancel_timeout() returned an error
Before, this was done if `pending` was true. This is not what the manpage suggests and not what was done elsewhere in the same file.
|
287496 |
05-Sep-2015 |
bapt |
Reduce diff with linux 3.8.13 on i915 headers
|
287268 |
29-Aug-2015 |
bapt |
Mark ValleyView/Bay Trail as not supported
|
287192 |
27-Aug-2015 |
bapt |
More fixes to the new macros
|
287191 |
27-Aug-2015 |
bapt |
Fix typo in new macros
|
287177 |
26-Aug-2015 |
bapt |
Merge i915_emit_box_p and i915_emit_box as done in linux 3.8
Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3495
|
287176 |
26-Aug-2015 |
bapt |
Back out a change which should not have been committed yet
|
287175 |
26-Aug-2015 |
bapt |
backout a change that should not have crept in
|
287174 |
26-Aug-2015 |
bapt |
Reduce diff against linux 3.8
Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3492
|
287173 |
26-Aug-2015 |
bapt |
Reduce diff with linux 3.8.13 on i915_drv.c
While here update the list of devices id to match the one in linux 3.8.13
Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3489
|
287172 |
26-Aug-2015 |
bapt |
Add more DRM_* debug macros from linux 3.8.13
|
287171 |
26-Aug-2015 |
bapt |
Synchronize i915_reg.h with linux 3.8.13 version
Keep a couple of old macros that will be removed lated when the rest of the code will be updated to 3.8.13 equivalent. Chase the renamed macros
Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D3487
|
287165 |
26-Aug-2015 |
bapt |
Reduce diff on i915_dma.c against linux 3.8.13
No functional changes
Discussed with: dumbbell Reviewed by: dumbbell
|
286640 |
11-Aug-2015 |
kwm |
Instead of defining the actualy user and group id in the drmP.h files 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
|
286524 |
09-Aug-2015 |
kwm |
Add a new group named 'video' with the id of 44. And make drm create 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
|
285988 |
28-Jul-2015 |
dumbbell |
drm/i915: Sort functions in i915_gem.c to match Linux 3.8's ordering
While here, reduce the style diff with Linux.
There is no functional change. The goal is to ease the future update to Linux 3.8's i915 driver.
MFC after: 2 months
|
284416 |
15-Jun-2015 |
avg |
ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restriction
This change re-organizes code a little bit to extract common pieces of ttm_alloc_new_pages() and ttm_get_pages() into dedicated functions. Also, for requests without address restrictions regular vm_page_alloc() is used. Lastly, when vm_page_alloc_contig() fails we call VM_WAIT before calling vm_pageout_grow_cache() to ensure that there is enough free pages at all.
Reviewed by: kib MFC after: 15 days
|
284316 |
12-Jun-2015 |
glebius |
A miss from r284310. vm_pager_get_pages() updates the array, so there is no need for vm_page_lookup().
|
284215 |
10-Jun-2015 |
mjg |
Implement lockless resource limits.
Use the same scheme implemented to manage credentials.
Code needing to look at process's credentials (as opposed to thred's) is provided with *_proc variants of relevant functions.
Places which possibly had to take the proc lock anyway still use the proc pointer to access limits.
|
283998 |
04-Jun-2015 |
jhb |
Add a new file operations hook for mmap operations. File type-specific 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
|
283291 |
22-May-2015 |
jkim |
CALLOUT_MPSAFE has lost its meaning since r141428, i.e., for more than ten years for head. However, it is continuously misused as the mpsafe argument for callout_init(9). Deprecate the flag and clean up callout_init() calls to make them more consistent.
Differential Revision: https://reviews.freebsd.org/D2613 Reviewed by: jhb MFC after: 2 weeks
|
280814 |
29-Mar-2015 |
dumbbell |
drm: Import Linux commit 9bc3cd5673d84d29272fa7181a4dfca83cbb48c1
Author: Ville Syrjälä <ville.syrjala@linux.intel.com> Date: Fri May 31 12:17:08 2013 +0000
drm: Sort connector modes based on vrefresh
Keeping the modes sorted by vrefresh before the pixel clock makes the mode list somehow more pleasing to the eye.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
PR: 198936 Obtained from: Linux MFC after: 1 month MFC with: r280183
|
280187 |
17-Mar-2015 |
glebius |
Fix build.
Reviewed by: dumbbell
|
280183 |
17-Mar-2015 |
dumbbell |
drm: Update the device-independent code to match Linux 3.8.13
This update brings few features: o Support for the setmaster/dropmaster ioctls. For instance, they are used to run multiple X servers simultaneously. o Support for minor devices. The only user-visible change is a new entry in /dev/dri but it is useless at the moment. This is a first step to support render nodes [1].
The main benefit is to greatly reduce the diff with Linux (at the expense of an unreadable commit diff). Hopefully, next upgrades will be easier.
No updates were made to the drivers, beside adapting them to API changes.
[1] https://en.wikipedia.org/wiki/Direct_Rendering_Manager#Render_nodes
Tested by: Many people MFC after: 1 month Relnotes: yes
|
279919 |
12-Mar-2015 |
jah |
Using parent DMA tag in drm_pci_alloc(). This can allow drm2 devices to work with Intel DMAR enabled for the system, as long as DMAR is disabled for the drm2 device.
Approved by: kib (mentor) MFC after: 1 week
|
279599 |
04-Mar-2015 |
dumbbell |
drm: Import Linux commit b7ea85a4fed37835eec78a7be3039c8dc22b8178
Author: Huacai Chen <chenhc@lemote.com> Date: Tue May 21 06:23:43 2013 +0000
drm: fix a use-after-free when GPU acceleration disabled
When GPU acceleration is disabled, drm_vblank_cleanup() will free the vblank-related data, such as vblank_refcount, vblank_inmodeset, etc. But we found that drm_vblank_post_modeset() may be called after the cleanup, which use vblank_refcount and vblank_inmodeset. And this will cause a kernel panic.
Fix this by return immediately if dev->num_crtcs is zero. This is the same thing that drm_vblank_pre_modeset() does.
Call trace of a drm_vblank_post_modeset() after drm_vblank_cleanup(): [ 62.628906] [<ffffffff804868d0>] drm_vblank_post_modeset+0x34/0xb4 [ 62.628906] [<ffffffff804c7008>] atombios_crtc_dpms+0xb4/0x174 [ 62.628906] [<ffffffff804c70e0>] atombios_crtc_commit+0x18/0x38 [ 62.628906] [<ffffffff8047f038>] drm_crtc_helper_set_mode+0x304/0x3cc [ 62.628906] [<ffffffff8047f92c>] drm_crtc_helper_set_config+0x6d8/0x988 [ 62.628906] [<ffffffff8047dd40>] drm_fb_helper_set_par+0x94/0x104 [ 62.628906] [<ffffffff80439d14>] fbcon_init+0x424/0x57c [ 62.628906] [<ffffffff8046a638>] visual_init+0xb8/0x118 [ 62.628906] [<ffffffff8046b9f8>] take_over_console+0x238/0x384 [ 62.628906] [<ffffffff80436df8>] fbcon_takeover+0x7c/0xdc [ 62.628906] [<ffffffff8024fa20>] notifier_call_chain+0x44/0x94 [ 62.628906] [<ffffffff8024fcbc>] __blocking_notifier_call_chain+0x48/0x68 [ 62.628906] [<ffffffff8042d990>] register_framebuffer+0x228/0x260 [ 62.628906] [<ffffffff8047e010>] drm_fb_helper_single_fb_probe+0x260/0x314 [ 62.628906] [<ffffffff8047e2c4>] drm_fb_helper_initial_config+0x200/0x234 [ 62.628906] [<ffffffff804e5560>] radeon_fbdev_init+0xd4/0xf4 [ 62.628906] [<ffffffff804e0e08>] radeon_modeset_init+0x9bc/0xa18 [ 62.628906] [<ffffffff804bfc14>] radeon_driver_load_kms+0xdc/0x12c [ 62.628906] [<ffffffff8048b548>] drm_get_pci_dev+0x148/0x238 [ 62.628906] [<ffffffff80423564>] local_pci_probe+0x5c/0xd0 [ 62.628906] [<ffffffff80241ac4>] work_for_cpu_fn+0x1c/0x30 [ 62.628906] [<ffffffff802427c8>] process_one_work+0x274/0x3bc [ 62.628906] [<ffffffff80242934>] process_scheduled_works+0x24/0x44 [ 62.628906] [<ffffffff8024515c>] worker_thread+0x31c/0x3f4 [ 62.628906] [<ffffffff802497a8>] kthread+0x88/0x90 [ 62.628906] [<ffffffff80206794>] kernel_thread_helper+0x10/0x18
Signed-off-by: Huacai Chen <chenhc@lemote.com> Signed-off-by: Binbin Zhou <zhoubb@lemote.com> Cc: <stable@vger.kernel.org> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Acked-by: Paul Menzel <paulepanter@users.sourceforge.net> Signed-off-by: Dave Airlie <airlied@gmail.com>
Reported by: J.R. Oldroyd <fbsd@opal.com> MFC after: 2 weeks
|
279488 |
01-Mar-2015 |
dumbbell |
vt(4): Add support to "downgrade" from eg. vt_fb to vt_vga
The main purpose of this feature is to be able to unload a KMS driver.
When going back from the current vt(4) backend to the previous backend, the previous backend is reinitialized with the special VDF_DOWNGRADE flag set. Then the current driver is terminated with the new "vd_fini" callback.
In the case of vt_fb and vt_vga, this allows the former to pass the vgapci device vt_fb used to vt_vga so the device can be rePOSTed.
Differential Revision: https://reviews.freebsd.org/D687
|
278438 |
09-Feb-2015 |
dim |
After r278004 was committed, Bruce Evans noted that the casts were actually completely unnecessary, here:
https://lists.freebsd.org/pipermail/svn-src-all/2015-February/098478.html
Remove the casts, and just assign &xxx_io_mc_regs[0][0] directly.
Reviewed by: dumbbell MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1748
|
278159 |
03-Feb-2015 |
emaste |
Remove duplicate intel_fbc_enabled prototype
Fixed upstream in Linux commit 7ff0ebcc1e30e3216c8c62ee71f59ac830b10364
Differential Revision: https://reviews.freebsd.org/D1762 Reviewed by: hselasky, kib Sponsored by: The FreeBSD Foundation
|
278153 |
03-Feb-2015 |
kib |
If the vm_page_alloc_contig() failed in the ttm page allocators, do what other callers of vm_page_alloc_contig() do, retry after vm_pageout_grow_cache().
Sponsored by: The FreeBSD Foundation
|
278152 |
03-Feb-2015 |
kib |
Do not access gmbus_ports array past its end.
Reported and tested by: hselasky Sponsored by: The FreeBSD Foundation
|
278148 |
03-Feb-2015 |
kib |
Followup to r278147. Two more sign errors.
Noted by: hps Sponsored by: The FreeBSD Foundation
|
278147 |
03-Feb-2015 |
kib |
Fix sign for the error code returned from the driver-specific code.
Noted by: hps Sponsored by: The FreeBSD Foundation
|
278146 |
03-Feb-2015 |
kib |
Do not attach to the unsupported chipsets, unless magic tunable is frobbed.
Sponsored by: The FreeBSD Foundation
|
278004 |
31-Jan-2015 |
dim |
Constify a number of accesses in drm2's radeon drivers to avoid -Wcast-qual warnings. No functional change.
Reviewed by: dumbbell MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D1727
|
277959 |
31-Jan-2015 |
adrian |
Fix backlight for ivybridge based laptops (and whatever else comes through this codepath.)
(1<<30) is documented as BLM_PCH_OVERRIDE_ENABLE, which the current i915 driver in Linux only sets for broadwell chips.
This fixes the backlight control on the Lenovo X230.
Approved by: kib Obtained from: Linux 7aa1e7f06d6ea1bce3b27630d50769d13da28b1a
|
277487 |
21-Jan-2015 |
kib |
An update for the i915 GPU driver, which brings the code up to Linux commit 4d93914ae3db4a897ead4b. Some related drm infrastructure changes are imported as needed.
Biggest update is the rewrite of the i915 gem io to more closely follow Linux model, althought the mechanism used by FreeBSD port is different.
Sponsored by: The FreeBSD Foundation MFC after: 2 month
|
275856 |
17-Dec-2014 |
gleb |
Adjust printf format specifiers for dev_t and ino_t in kernel.
ino_t and dev_t are about to become uint64_t.
Reviewed by: kib, mckusick
|
275209 |
28-Nov-2014 |
rea |
DRM2: fix off-by-one overflow in ioctl processing
Call to the driver-specific ioctl used to process ioctl number that will lead to the out-of-bounds access to the ioctl handler array.
PR: 193367 Approved by: kib MFC after: 1 week
|
274587 |
16-Nov-2014 |
dumbbell |
drm/radeon: Lower priority of a message related to invalid EDID
Like in r259717, the prority goes from "error" to "debug" to avoid spamming logs when the connectors are polled.
PR: 194770 Submitted by: Larry Rosenman <ler@lerctr.org> MFC after: 1 week
|
274049 |
03-Nov-2014 |
dumbbell |
drm: When reading connector mode tunables, list connectors
... and their associated tunables. This gives a way to know the list of available connectors, no matter the driver.
The problem is that xrandr(1) can list connectors but it uses a different naming.
MFC after: 1 week
|
274031 |
03-Nov-2014 |
dumbbell |
drm: Take vt(4) default mode from loader tunables
By default, vt(4) gets the "preferred mode" from DRM, when using a DRM video driver as its backend. The preferred mode is usually the native screen resolution.
Now, if this mode isn't appropriate, a user can use loader tunables to select a mode. The tunables are read in the following order: 1. kern.vt.fb.modes.$connector_name 2. kern.vt.fb.default_mode
For example, to set a 1024x768 mode, no matter the connector: kern.vt.fb.default_mode="1024x768"
To set a 800x600 mode only on the laptop builtin screen: kern.vt.fb.modes.LVDS-1="800x600"
MFC after: 1 week
|
273969 |
02-Nov-2014 |
tijl |
Use default memory type for TTM buffer objects that may be cached.
MFC after: 1 week
|
273962 |
02-Nov-2014 |
dumbbell |
drm: Lower priority of two messages related to invalid EDID
Like in r259717, the prority goes from "error" to "debug" to avoid spamming logs when the connectors are polled.
MFC after: 1 week
|
273862 |
30-Oct-2014 |
tijl |
Port the TTM AGP backend to the FreeBSD agp driver and enable AGP support in the radeonkms driver.
Note: In PCI mode virtual addresses on the graphics card that map to system RAM are translated to physical addresses by the graphics card itself. In AGP mode address translation is done by the AGP chipset so fictitious addresses appear on the system bus. For the CPU cache management to work correctly when the CPU accesses this memory it needs to use the same fictitious addresses (and let the chipset translate them) instead of using the physical addresses directly.
Reviewed by: kib MFC after: 1 month
|
273174 |
16-Oct-2014 |
davide |
Follow up to r225617. In order to maximize the re-usability of kernel code in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols.
Submitted by: kmacy Tested by: make universe
|
272761 |
08-Oct-2014 |
kib |
Add an argument to the x86 pmap_invalidate_cache_range() to request forced invalidation of the cache range regardless of the presence of self-snoop feature. Some recent Intel GPUs in some modes are not coherent, and dirty lines in CPU cache must be flushed before the pages are transferred to GPU domain.
Reviewed by: alc (previous version) Tested by: pho (amd64) Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
271705 |
17-Sep-2014 |
dumbbell |
drm/i915: Add HW context support
This feature is required by Mesa 9.2+. Without this, a GL application crashes with the following message: # glxinfo name of display: :0.0 Gen6+ requires Kernel 3.6 or later. Assertion failed: (ctx->Version > 0), function handle_first_current, file ../../src/mesa/main/context.c, line 1498. Abort (core dumped)
Now, Mesa 10.2.4 and 10.3-rc3 works fine: # glxinfo name of display: :0 display: :0 screen: 0 direct rendering: Yes ... OpenGL renderer string: Mesa DRI Intel(R) 965GM OpenGL version string: 2.1 Mesa 10.2.4 ...
The code was imported from Linux 3.8.13.
Reviewed by: kib@ Tested by: kwm@, danfe@, Henry Hu, Lundberg, Johannes <johannes@brilliantservice.co.jp>, Johannes Dieterich <dieterich.joh@gmail.com>, Lutz Bichler <lutz.bichler@gmail.com>, MFC after: 3 days Relnotes: yes
|
270750 |
28-Aug-2014 |
dumbbell |
drm/radeon: Fix a memory leak when radeonkms is unloaded
MFC after: 1 week
|
270706 |
27-Aug-2014 |
dumbbell |
drm: Don't "taskqueue" vt-switch if under DDB/panic situation
If DDB is active, we can't use a taskqueue thread to switch away from the X window, because this thread can't run.
Reviewed by: ray@ Approved by: ray@ MFC after: 1 week
|
270516 |
25-Aug-2014 |
adrian |
i915 driver - enable opregion handle; program CADL.
add opregion handling for drm2 - which exposes some ACPI video configuration pieces that some Lenovo laptop models use to flesh out which video device to speak to. This enables the brightness control in ACPI to work these models.
The CADL bits are also important - it's used to figure out which ACPI events to hook the brightness buttons into. It doesn't yet seem to work for me, but it does for the OP.
Tested:
* Lenovo X230 (mine) * OP: ASUS UX51VZ
PR: 190186 Submitted by: Henry Hu <henry.hu.sh@gmail.com> Reviewed by: dumbbell
|
269634 |
06-Aug-2014 |
royger |
drm: fix usage of vm_phys_fictitious_to_vm_page
vm_phys_fictitious_to_vm_page should not be called directly, even when operating on a range that has been registered using vm_phys_fictitious_reg_range. PHYS_TO_VM_PAGE should be used instead because on arches that use VM_PHYSSEG_DENSE the page might come directly from vm_page_array.
Reported by: nwhitehorn Tested by: nwhitehorn, David Mackay <davidm.jx8p@gmail.com> Sponsored by: Citrix Systems R&D
|
268981 |
22-Jul-2014 |
ray |
Remove #ifdef-s to reduce difference to upstream.
Pointed by: kib
MFC after: 1 week Sponsored by: The FreeBSD Foundation
|
268954 |
21-Jul-2014 |
sbruno |
Merge change from upstream linux kernel submitted by OpenBSD:
drm/radeon: fix-up some float to fixed conversion thinkos
Spotted by Brad Smith when porting to OpenBSD. Noticed-by: Brad Smith <brad@comstyle.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
ref: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1cd73ff7
Remove #ifdef DUMBBELL_WIP in favor of upstream fix.
Phabric: https://phabric.freebsd.org/D423 Reviewed by: dumbbell, jkim MFC after: 2 weeks
|
268947 |
21-Jul-2014 |
emaste |
Hide syscons-specific workaround under DEV_SC
This change is a bit ugly, but so is the coupling between the i915 driver and syscons. It isn't worth developing a more elegant solution only to support the legacy syscons console.
|
268564 |
12-Jul-2014 |
rpaulo |
Revert r268543.
We should probably fix sys/gpio.h instead.
|
268543 |
12-Jul-2014 |
rpaulo |
Move iic.h to sys/ so that it's automatically installed in /usr/include/sys.
This lets us call iic(4) ioctls without needing the kernel source code and follows the same model of GPIO.
MFC after: 3 weeks
|
268351 |
07-Jul-2014 |
marcel |
Remove ia64.
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
|
267992 |
28-Jun-2014 |
hselasky |
Pull in r267961 and r267973 again. Fix for issues reported will follow.
|
267985 |
27-Jun-2014 |
gjb |
Revert r267961, r267973:
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
|
267961 |
27-Jun-2014 |
hselasky |
Extend the meaning of the CTLFLAG_TUN flag to automatically check if 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
|
267548 |
16-Jun-2014 |
attilio |
- Modify vm_page_unwire() and vm_page_enqueue() to directly accept 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
|
267446 |
13-Jun-2014 |
jhb |
Add missing calls to bus_dmamap_unload() when freeing static DMA allocations.
Reviewed by: scottl
|
266792 |
28-May-2014 |
marius |
Fix DMA handling in radeon_dummy_page_init(): - Based on actual usage and on what Linux does, dummy_page.addr should contain the physical bus address of the dummy page rather than its virtual one. As a side-effect, correcting this bug fixes compilation with PAE support enabled by getting rid of an inappropriate cast. - Also based on actual usage of dummy_page.addr, theoretically Radeon devices could do a maximum of 44-bit DMA. In reality, though, it is more likely that they only support 32-bit DMA, at least that is what radeon_gart_table_ram_alloc() sets up for, too. However, passing ~0 to drm_pci_alloc() as maxaddr parameter translates to 64-bit DMA on amd64/64-bit machines. Thus, use BUS_SPACE_MAXSIZE_32BIT instead, which the existing 32-bit DMA limits within the drm2 code spelled as 0xFFFFFFFF should also be changed to.
Reviewed by: dumbbell MFC after: 1 week Sponsored by: Bally Wulff Games & Entertainment GmbH
|
265262 |
03-May-2014 |
dumbbell |
drm/radeon: Add 32bit ioctls support
This allows to run 32bit applications on a 64bit host. This was tested successfully with Wine (emulators/i386-wine-devel) and StarCraft II.
Submitted by: Jan Kokemüller <jan.kokemueller@gmail.com> MFC after: 1 week
|
265102 |
29-Apr-2014 |
kib |
Fix two cases of recursive acquisitions of the vm object lock, only possible in rare failure situations.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
261497 |
04-Feb-2014 |
rmh |
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
Reviewed by: dumbbell MFC after: 1 week
|
259717 |
22-Dec-2013 |
dumbbell |
drm: Lower priority of "EDID checksum is invalid" message
The priority goes from "error" to "debug".
Connectors are polled every 10 seconds. Reading EDID is part of this polling. However, when an invalid EDID is returned, this error message is logged. When using Newcons for instance, having a kernel message every 10 seconds is getting annoying.
Now that it's a debug message, it'll be logged only if hw.dri.debug is enabled. This fix console spamming for some users.
Tested by: Larry Rosenman <ler@lerctr.org>
|
259684 |
21-Dec-2013 |
dumbbell |
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)
|
259612 |
19-Dec-2013 |
avg |
ttm_bo_vm_lookup_rb: actually make use of the red-black tree
Previously the code would just iterate over the whole tree as if it were just a list.
Without this change I would observe X server becoming more and more jerky over time.
MFC after: 5 days
|
259261 |
12-Dec-2013 |
ray |
Do not try to probe/attach if attempt to add fbd child are failed.
Sponsored by: The FreeBSD Foundation
|
259179 |
10-Dec-2013 |
ray |
Disable error message about failed attempt to attach fbd when drm2 built with syscons.
Sponsored by: The FreeBSD Foundation
|
259104 |
08-Dec-2013 |
dumbbell |
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>
|
259101 |
08-Dec-2013 |
dumbbell |
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@
|
259016 |
05-Dec-2013 |
ray |
Merge VT(9) project (a.k.a. newcons).
Reviewed by: nwhitehorn MFC_to_10_after: re approval
Sponsored by: The FreeBSD Foundation
|
259003 |
05-Dec-2013 |
rmh |
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
|
258930 |
04-Dec-2013 |
dumbbell |
drm: Read PCIER_LINK_CAP/PCIER_LINK_CAP2 from the PCI bridge
Before this fix, capabilities were read from vgapci and were incorrect.
|
258822 |
02-Dec-2013 |
eadler |
Partial revert of r258779 and r258780: The directory sys/dev/drm2/i915 is apperently contributed code. Revert to the broken version of this file to make future imports easier.
Requested by: kib
|
258780 |
30-Nov-2013 |
eadler |
Fix undefined behavior: (1 << 31) is not defined as 1 is an int and this 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
|
258779 |
30-Nov-2013 |
eadler |
Similar to the (1 << 31) case it is not defined to do (2 << 30).
|
258553 |
25-Nov-2013 |
dumbbell |
drm: Fix build with gcc, broken with r258549
The code was easier to read without __DECONST and clang didn't report any error. I thought the cast was enough...
MFC after: 3 days X-MFC-With: r258549
|
258549 |
25-Nov-2013 |
dumbbell |
drm: Dereference pointers given to qsort_r()'s cmp callback
drm_le_cmp() (qsort_r()'s callback) receives pointers to elements in the array passed to qsort_r(), not the elements themselves.
Before this fix, the use of qsort_r() shuffled the array, not sorted it, because the compare callback accessed random memory locations, not the expected elements.
This bug triggered an infinite loop in KDE/xserver:
1. KDE has a kded module called "randrmonitor" which queries xserver for current monitors at startup and then listens to RandR notifications from xserver.
2. xserver handles the query from "randrmonitor" by polling the video device using the "drm_mode_getconnector()" ioctl. This ioctl returns a list of connectors and, for those with a connected monitor, the available modes. Each modes list is sorted by the kernel before returning. When xserver gets the connectors list, it sorts the modes lists again.
In the case of this bug, when two modes are equal (in xserver's compare function PoV), their order is kept stable (ie. the kernel order is kept for those two modes). And because the list was shuffled by the kernel, the order of two equal modes was frequently changed in the final modes list in xserver.
3. xserver compares the returned connectors list with the list obtained earlier. In particular, it compares the sorted modes lists for each connector. If a property of a connector changes (eg. modes), xserver sends a "RRNotify_OutputChange" notification.
Because of the change of order between equal modes, xserver sent a notification after each polling of the connectors.
4. "randrmonitor" receives a notification, triggered by its query. The notification doesn't contain the new connectors list, therefore, it asks for the new list using the same function: go back to step #2.
MFC after: 3 days
|
258262 |
17-Nov-2013 |
dumbbell |
drm: Support DRM_CAP_TIMESTAMP_MONOTONIC capability
This fixes DPMS with KDE and radeonkms. Without this, the display would freeze when the monitor is put into sleep state, and only resumes after several dozens of minutes once the monitor is powered on again.
Tested by: Mathias Picker <Mathias.Picker@virtual-earth.de>
|
257870 |
08-Nov-2013 |
dumbbell |
drm/radeon: Wake up userland after page flip
For instance, this caused issues in KDE, such as stuttered animations (with desktop effects enabled).
|
257869 |
08-Nov-2013 |
dumbbell |
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.
|
256848 |
21-Oct-2013 |
kib |
Reset function on SandyBridge holds the gt_lock for the whole duration already. Also, according to the specs, GDRST register is not in the power well, so the forcewake for reset status read is excessive for this reason.
Use plain register read for waiting of the reset completion notification, to avoid gt_lock recursion. Linux upstream did the similar change, but their code was already restructured.
Reported by: ray Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
256771 |
19-Oct-2013 |
dumbbell |
drm/radeon: radeonkms depends on firmware(9)
Submitted by: tijl@
|
255587 |
15-Sep-2013 |
dumbbell |
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)
|
255573 |
14-Sep-2013 |
dumbbell |
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)
|
255572 |
14-Sep-2013 |
dumbbell |
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)
|
255426 |
09-Sep-2013 |
jhb |
Add a mmap flag (MAP_32BIT) on 64-bit platforms to request that a mapping use an address in the first 2GB of the process's address space. This flag should have the same semantics as the same flag on Linux.
To facilitate this, add a new parameter to vm_map_find() that specifies an optional maximum virtual address. While here, fix several callers of vm_map_find() to use a VMFS_* constant for the findspace argument instead of TRUE and FALSE.
Reviewed by: alc Approved by: re (kib)
|
255045 |
29-Aug-2013 |
jkim |
'u_long' is consistently spelled 'unsigned long' in this file. Fix it.
|
255044 |
29-Aug-2013 |
jkim |
Partially revert r254880. The bitmap operations actually use long type now.
|
255042 |
29-Aug-2013 |
jkim |
Fix the incomplete conversion from atomic_t to long for test_bit().
|
255041 |
29-Aug-2013 |
jkim |
Clarify confusions between atomic_t and bitmap. Fix bitmap operations accordingly.
|
255039 |
29-Aug-2013 |
jkim |
- 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:
https://www.kernel.org/doc/Documentation/atomic_ops.txt
|
255037 |
29-Aug-2013 |
jkim |
Fix atomic operations on context_flag without altering semantics.
|
255013 |
29-Aug-2013 |
jkim |
Correct atomic operations in i915.
|
255012 |
28-Aug-2013 |
jkim |
Fix a compiler warning and add couple of VM map types.
|
255009 |
28-Aug-2013 |
jkim |
Fix a compiler warning. With this fix, a negative time can be converted to a struct timeval and back to the original nanoseconds correctly.
|
254894 |
26-Aug-2013 |
dumbbell |
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.
|
254885 |
25-Aug-2013 |
dumbbell |
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
|
254880 |
25-Aug-2013 |
dumbbell |
drm: Use the new drm_atomic.h, following the merge of projects/atomic64
Submitted by: jkim@
|
254879 |
25-Aug-2013 |
dumbbell |
drm/ttm: Remove unused VM_ALLOC_DMA32 define
|
254878 |
25-Aug-2013 |
dumbbell |
drm/ttm: Fix a reversed condition and add missing locks
This allows to run OpenGL applications on at least two test machines with the Radeon driver.
Approved by: kib@
|
254877 |
25-Aug-2013 |
dumbbell |
drm/ttm: Fix style in ttm_bo_release_mmap()
|
254876 |
25-Aug-2013 |
dumbbell |
drm/ttm: Fix unmap of buffer object
Add a new ttm_bo_release_mmap() function to unmap pages in a vm_object_t. Pages are freed when the buffer object is later released.
This function is called in ttm_bo_unmap_virtual_locked(), replacing Linux' unmap_mapping_range(). In particular this is called when a buffer object is about to be moved, so that its mapping is invalidated.
However, we don't use this function in ttm_bo_vm_dtor(), because the vm_object_t is already marked as OBJ_DEAD and the pages will be unmapped.
Approved by: kib@
|
254875 |
25-Aug-2013 |
dumbbell |
ttm: "to_page->valid = VM_PAGE_BITS_ALL" before vm_page_dirty(to_page)
Approved by; kib@
|
254874 |
25-Aug-2013 |
dumbbell |
drm/ttm: Improve comment in ttm_bo_vm_ctor() about lack of ref acquisition
Approved by: kib@
|
254873 |
25-Aug-2013 |
dumbbell |
drm/ttm: When removing a range of pages from a pool, remove all of them
Submitted by: Mark Kettenis and Jonathan Gray from OpenBSD Approved by: kib@
|
254871 |
25-Aug-2013 |
dumbbell |
drm/ttm: Fix style errors
|
254870 |
25-Aug-2013 |
dumbbell |
drm/ttm: Make ttm_bo_wait() call uninterruptible in page fault handler
This fixes a crash where a SIGLALRM, heavily used by X.Org, would interrupt the wait, causing the page fault to fail and the "Xorg" process to receive a SIGSEGV.
Approved by: kib@
|
254868 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit ff7c60c580d9722f820d85c9c58ca55ecc1ee7c4
Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Mon Jan 14 15:08:14 2013 +0100
drm/ttm: fix fence locking in ttm_buffer_object_transfer, 2nd try
This fixes up
commit e8e89622ed361c46bf90ba4828e685a8b603f7e5 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Dec 18 22:25:11 2012 +0100
drm/ttm: fix fence locking in ttm_buffer_object_transfer
which leaves behind a might_sleep in atomic context, since the fence_lock spinlock is held over a kmalloc(GFP_KERNEL) call. The fix is to revert the above commit and only take the lock where we need it, around the call to ->sync_obj_ref.
v2: Fixup things noticed by Maarten Lankhorst: - Brown paper bag locking bug. - No need for kzalloc if we clear the entire thing on the next line. - check for bo->sync_obj (totally unlikely race, but still someone else could have snuck in) and clear fbo->sync_obj if it's cleared already.
Reported-by: Dave Airlie <airlied@gmail.com> Cc: Jerome Glisse <jglisse@redhat.com> Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Approved by: kib@
|
254867 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit 014b34409fb2015f63663b6cafdf557fdf289628
Author: Dave Airlie <airlied@gmail.com> Date: Wed Jan 16 15:58:34 2013 +1000
ttm: on move memory failure don't leave a node dangling
if we have a move notify callback, when moving fails, we call move notify the opposite way around, however this ends up with *mem containing the mm_node from the bo, which means we double free it. This is a follow on to the previous fix.
Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Approved by: kib@
|
254866 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit 630541863b29f88c7ab34e647758344e4cd1eafd
Author: Dave Airlie <airlied@gmail.com> Date: Wed Jan 16 14:25:44 2013 +1000
ttm: don't destroy old mm_node on memcpy failure
When we are using memcpy to move objects around, and we fail to memcpy due to lack of memory to populate or failure to finish the copy, we don't want to destroy the mm_node that has been copied into old_copy.
While working on a new kms driver that uses memcpy, if I overallocated bo's up to the memory limits, and eviction failed, then machine would oops soon after due to having an active bo with an already freed drm_mm embedded in it, freeing it a second time didn't end well.
Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Approved by: kib@
|
254865 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit cc4c0c4de3c775be22072ec3251f2e581b63d9a0
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com> Date: Tue Jan 15 14:57:28 2013 +0100
drm/ttm: unexport ttm_bo_wait_unreserved
All legitimate users of this function outside ttm_bo.c are gone, now it's only an implementation detail.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Approved by: kib@
|
254864 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit f2d476a110bc24fde008698ae9018c99e803e25c
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com> Date: Tue Jan 15 14:57:10 2013 +0100
drm/ttm: use ttm_bo_reserve_slowpath_nolru in ttm_eu_reserve_buffers, v2
This requires re-use of the seqno, which increases fairness slightly. Instead of spinning with a new seqno every time we keep the current one, but still drop all other reservations we hold. Only when we succeed, we try to get back our other reservations again.
This should increase fairness slightly as well.
Changes since v1: - Increase val_seq before calling ttm_bo_reserve_slowpath_nolru and retrying to take all entries to prevent a race.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Approved by: kib@
|
254863 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit 5e45d7dfd74100d622f9cdc70bfd1f9fae1671de
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com> Date: Tue Jan 15 14:57:05 2013 +0100
drm/ttm: add ttm_bo_reserve_slowpath
Instead of dropping everything, waiting for the bo to be unreserved and trying over, a better strategy would be to do a blocking wait.
This can be mapped a lot better to a mutex_lock-like call.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Approved by: kib@
|
254862 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit 7a1863084c9d90ce4b67d645bf9b0f1612e68f62
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com> Date: Tue Jan 15 14:56:48 2013 +0100
drm/ttm: cleanup ttm_eu_reserve_buffers handling
With the lru lock no longer required for protecting reservations we can just do a ttm_bo_reserve_nolru on -EBUSY, and handle all errors in a single path.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
|
254861 |
25-Aug-2013 |
dumbbell |
drm/ttm: Import Linux commit 63d0a4195560362e2e00a3ad38fc331d34e1da9b
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com> Date: Tue Jan 15 14:56:37 2013 +0100
drm/ttm: remove lru_lock around ttm_bo_reserve
There should no longer be assumptions that reserve will always succeed with the lru lock held, so we can safely break the whole atomic reserve/lru thing. As a bonus this fixes most lockdep annotations for reservations.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
|
254860 |
25-Aug-2013 |
dumbbell |
drm: Update drm_atomic.h, now that projects/atomic64 is in HEAD
Submitted by: jkim@
|
254858 |
25-Aug-2013 |
dumbbell |
drm: Add missing bits to drmP.h, required by the Radeon driver
Some of the FreeBSD-specific definitions are moved to drm_os_freebsd.h. But there's still work to do to clean it up and reduce the diff with Linux' drmP.h.
|
254853 |
25-Aug-2013 |
dumbbell |
drm: Import drm_fixed.h from Linux 3.8
|
254852 |
25-Aug-2013 |
dumbbell |
drm: Update drm_pciids.h based on Linux 3.8
This header can be easily updated using the new "gen-drm_pciids" script, available in tools/tools/drm. The script uses the Linux' drm_pciids.h header for new IDs, the FreeBSD's one because we add the name of the device to each IDs, and the PCI IDs database (misc/pciids port) to fill this name automatically for new IDS.
To call the script: tools/tools/drm/gen-drm_pciids \ /path/to/linux/drm_pciids.h \ /path/to/freebsd/drm_pciids.h \ /path/to/pciids/pci.ids
|
254848 |
25-Aug-2013 |
dumbbell |
drm: Import drm_pcie_get_speed_cap_mask() in drm_pci.c
This comes with several PCI_VENDOR_ID_* defines which should go in a more central place.
|
254841 |
25-Aug-2013 |
dumbbell |
drm: Import list_for_each_entry_safe_from() macro
|
254840 |
25-Aug-2013 |
dumbbell |
drm: Use DRM_IF_MAJOR & DRM_IF_MINOR from drm_core.h
|
254838 |
25-Aug-2013 |
dumbbell |
drm: In drm_gem_name_create(), verify argument before acquiring lock
Submitted by: J.R. Oldroyd <jr@opal.com>
|
254837 |
25-Aug-2013 |
dumbbell |
drm: Call "gem_close_object" driver callback from drm_gem_object_release_handle()
This fixes leakage of "bo_va" for Cayman and following card generations.
|
254836 |
25-Aug-2013 |
dumbbell |
drm: Support gem_open_object() and gem_close_object() callbacks
... in struct drm_driver_info.
|
254835 |
25-Aug-2013 |
dumbbell |
drm: Fix typo in KASSERT message: s/Dandling/Dangling/
|
254833 |
25-Aug-2013 |
dumbbell |
drm: Import Linux commit cd004b3f4cd4169815c82bf9e424fda06978898a
Author: Shirish S <s.shirish@samsung.com> Date: Thu Aug 30 07:04:06 2012 +0000
drm: edid: add support for E-DDC
The current logic for probing ddc is limited to 2 blocks (256 bytes), this patch adds support for the 4 block (512) data.
To do this, a single 8-bit segment index is passed to the display via the I2C address 30h. Data from the selected segment is then immediately read via the regular DDC2 address using a repeated I2C 'START' signal.
Signed-off-by: Shirish S <s.shirish@samsung.com> Reviewed-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ville Syrjala <ville.syrjala@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
|
254822 |
25-Aug-2013 |
dumbbell |
drm: In drm_mmap_single, try ttm_bo_mmap_single() before drm_gem_mmap_single()
In drivers such as the Radeon driver, the DRIVER_GEM features flag is set but TTM is used to mmap buffer object.
|
254821 |
25-Aug-2013 |
dumbbell |
drm: Fix cleanup if device initialization fails
This plugs some memory leaks.
|
254820 |
25-Aug-2013 |
dumbbell |
drm: Use driver-provided "use_msi" callback to determine if MSI is blacklisted
For now, keep the static array for i915. But eventually, it should be moved to a callback in the driver itself.
|
254819 |
25-Aug-2013 |
dumbbell |
drm: Don't delete already deleted iicbus child from drm_iic_dp_aux
The iic_dp_aux_detach callback is therefore useless: it's replaced by bus_generic_detach. This fixes a "General protection fault" panic during second (incorrect) deletion of the child.
Tested by: kwm@ Reviewed by: ray@
|
254818 |
24-Aug-2013 |
dumbbell |
drm: Move definition of EREMOTEIO to drmP.h
It will be used by both i915 and radeon drivers.
Add ERESTARTSYS definition at the same time.
|
254817 |
24-Aug-2013 |
dumbbell |
drm: Import drm_dp_helper.c from Linux 3.8-rc3
While here, update drm_dp_helper.h to better match Linux one.
|
254798 |
24-Aug-2013 |
dumbbell |
drm: Fix leak of connector->edid_blob_ptr
|
254797 |
24-Aug-2013 |
dumbbell |
drm: Const'ify the 1st "drm_display_mode" passed to "mode_fixup" callbacks
This will be needed by the Radeon KMS driver.
|
254796 |
24-Aug-2013 |
dumbbell |
drm/i915: Import Linux commit 71244653a8fb0f46bc12ae421f1d5f72af6a75da
Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Mon Jun 4 18:39:20 2012 +0200
drm/i915: adjusted_mode->clock in the dp mode_fixup
... instead of changing mode->clock, which we should leave as-is.
After the previous patch we only touch that if it's a panel, and then adjusted mode->clock equals adjusted_mode->clock. Outside of intel_dp.c we only use ajusted_mode->clock in the mode_set functions.
Within intel_dp.c we only use it to calculate the dp dithering and link bw parameters, so that's the only thing we need to fix up.
As a temporary ugliness (until the cleanup in the next patch) we pass the adjusted_mode into dp_dither for both parameters (because that one still looks at mode->clock).
Note that we do overwrite adjusted_mode->clock with the selected dp link clock, but that only happens after we've calculated everything we need based on the dotclock of the adjusted output configuration.
Outside of intel_dp.c only intel_display.c uses adjusted_mode->clock, and that stays the same after this patch (still equals the selected dp link clock). intel_display.c also needs the actual dotclock (as target_clock), but that has been fixed up in the previous patch.
v2: Adjust the debug message to also use adjusted_mode->clock.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
254794 |
24-Aug-2013 |
dumbbell |
drm: Import drm_buffer.[ch] from Linux 3.8-rc3
This will be used by the Radeon KMS driver.
|
254792 |
24-Aug-2013 |
dumbbell |
drm: Call drm_global_init() & drm_global_release() at module load/unload
|
254649 |
22-Aug-2013 |
kib |
Remove the deprecated VM_ALLOC_RETRY flag for the vm_page_grab(9). The flag was mandatory since r209792, where vm_page_grab(9) was changed to only support the alloc retry semantic.
Suggested and reviewed by: alc Sponsored by: The FreeBSD Foundation
|
254182 |
10-Aug-2013 |
kib |
Different consumers of the struct vm_page abuse pageq member to keep additional information, when the page is guaranteed to not belong to a paging queue. Usually, this results in a lot of type casts which make reasoning about the code correctness harder.
Sometimes m->object is used instead of pageq, which could cause real and confusing bugs if non-NULL m->object is leaked. See r141955 and r253140 for examples.
Change the pageq member into a union containing explicitly-typed members. Use them instead of type-punning or abusing m->object in x86 pmaps, uma and vm_page_alloc_contig().
Requested and reviewed by: alc Sponsored by: The FreeBSD Foundation
|
254141 |
09-Aug-2013 |
attilio |
On all the architectures, avoid to preallocate the physical memory for nodes used in vm_radix. On architectures supporting direct mapping, also avoid to pre-allocate the KVA for such nodes.
In order to do so make the operations derived from vm_radix_insert() to fail and handle all the deriving failure of those.
vm_radix-wise introduce a new function called vm_radix_replace(), which can replace a leaf node, already present, with a new one, and take into account the possibility, during vm_radix_insert() allocation, that the operations on the radix trie can recurse. This means that if operations in vm_radix_insert() recursed vm_radix_insert() will start from scratch again.
Sponsored by: EMC / Isilon storage division Reviewed by: alc (older version) Reviewed by: jeff Tested by: pho, scottl
|
254138 |
09-Aug-2013 |
attilio |
The soft and hard busy mechanism rely on the vm object lock to work. Unify the 2 concept into a real, minimal, sxlock where the shared acquisition represent the soft busy and the exclusive acquisition represent the hard busy. The old VPO_WANTED mechanism becames the hard-path for this new lock and it becomes per-page rather than per-object. The vm_object lock becames an interlock for this functionality: it can be held in both read or write mode. However, if the vm_object lock is held in read mode while acquiring or releasing the busy state, the thread owner cannot make any assumption on the busy state unless it is also busying it.
Also: - Add a new flag to directly shared busy pages while vm_page_alloc and vm_page_grab are being executed. This will be very helpful once these functions happen under a read object lock. - Move the swapping sleep into its own per-object flag
The KPI is heavilly changed this is why the version is bumped. It is very likely that some VM ports users will need to change their own code.
Sponsored by: EMC / Isilon storage division Discussed with: alc Reviewed by: jeff, kib Tested by: gavin, bapt (older version) Tested by: pho, scottl
|
254025 |
07-Aug-2013 |
jeff |
Replace kernel virtual address space allocation with vmem. This provides 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
|
253710 |
27-Jul-2013 |
kib |
MFgem r251960: re-check the mgt device object for the requested page after the object was relocked.
Tested by: dumbbell Sponsored by: The FreeBSD Foundation MFC after: 1 week
|
253709 |
27-Jul-2013 |
kib |
The pmap_qenter() and pmap_qremove() perform TLB invalidation on its own, no need to call pmap_invalidate_range() one more time.
Noted by: alc MFC after: 1 week
|
253497 |
20-Jul-2013 |
kib |
Use the right name for the vm_map_find(9) flag to specify shared mapping. The MAP_SHARED and MAP_INHERIT_SHARE values are identical.
Noted by: alc MFC after: 3 days
|
253471 |
19-Jul-2013 |
jhb |
Be more aggressive in using superpages in all mappings of objects: - Add a new address space allocation method (VMFS_OPTIMAL_SPACE) for vm_map_find() that will try to alter the alignment of a mapping to match any existing superpage mappings of the object being mapped. If no suitable address range is found with the necessary alignment, vm_map_find() will fall back to using the simple first-fit strategy (VMFS_ANY_SPACE). - Change mmap() without MAP_FIXED, shmat(), and the GEM mapping ioctl to use VMFS_OPTIMAL_SPACE instead of VMFS_ANY_SPACE.
Reviewed by: alc (earlier version) MFC after: 2 weeks
|
252864 |
06-Jul-2013 |
kib |
Remove unneeded page lock around vm_page_insert().
Submitted by: alc
|
251961 |
18-Jun-2013 |
kib |
On some generations of the Intel GPU, disabling of the VGA Display stops updating the vertical retrace indicator. The text mouse renderer in syscons is executing from the callout and spins waiting for the start of next frame. As result, after the X server finishes, since the VGA cannot be turned on, but syscons does not know about this, the clock swi spins forever.
Hack around the problem by disabling wait for the retrace if KMS is activated.
Diagnosed and tested by: Michiel Boland <boland37@xs4all.nl> Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
|
251960 |
18-Jun-2013 |
kib |
Since the gem pagefault handler relocks the vm object lock, other thread might fault on the same GTT offset meantime and instantiate the mapping. Recheck that the mgt device object still does not have a page at the current offset after relocking, and return a possibly installed page.
Reported by: Oleg Sidorkin <osidorkin@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
|
251959 |
18-Jun-2013 |
kib |
Remove stray empty line.
MFC after: 3 days
|
251452 |
06-Jun-2013 |
alc |
Don't busy the page unless we are likely to release the object lock.
Reviewed by: kib Sponsored by: EMC / Isilon Storage Division
|
251281 |
03-Jun-2013 |
kib |
The vm_page lock is not needed around the call to vm_page_insert().
Submitted by: alc MFC after: 1 week
|
249249 |
08-Apr-2013 |
dumbbell |
drm: Right-shift I2C slave address before passing it to aux channel
In r249041, I2C slave addresses were left-shifted at creation time to have the same behavior between i915 and radeon (not committed yet). This change broke the aux channel. The user-visible change was that display port on i915 didn't work anymore.
To fix this, we right-shift the address back to restore the original value.
Reported by: Olivier Cochard-Labbé <olivier@cochard.me> Tested by: Olivier Cochard-Labbé <olivier@cochard.me> Reviewed by: kib@
|
249041 |
03-Apr-2013 |
dumbbell |
drm and i915: Left-shift iic_msg.slave at creation time
This is required because, in the radeon driver, we can't left-shift in a central place, like it was done in the i915 driver.
Reviewed by: kib@, kan@, avg@ Tested by: kib@, avg@
|
248666 |
23-Mar-2013 |
kib |
Do not call malloc(M_WAITOK) while bodev->fence_lock mutex is held. The ttm_buffer_object_transfer() does not need the mutex locked at all, except for the call to the driver sync_obj_ref() method.
Reported and tested by: dumbbell MFC after: 2 weeks
|
248663 |
23-Mar-2013 |
dumbbell |
drm/ttm: Fix a typo: s/pTTM]/[TTM]/
|
248661 |
23-Mar-2013 |
dumbbell |
drm/ttm: Explain why we don't need to acquire a ref in ttm_bo_vm_ctor()
|
248657 |
23-Mar-2013 |
dumbbell |
drm/ttm: Fix TTM buffer object refcount
This fixes memory leaks in the radeonkms driver.
Reviewed by: Konstantin Belousov (kib@) Tested by: J.R. Oldroyd <jr@opal.com>
|
248084 |
09-Mar-2013 |
attilio |
Switch the vm_object mutex to be a rwlock. This will enable in the 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
|
248061 |
08-Mar-2013 |
dumbbell |
Import Linux commit a1b7736dac5f2d5876e68c47a0fce3f423840070 Author: Sascha Hauer <s.hauer@pengutronix.de> Date: Wed Feb 1 11:38:22 2012 +0100
drm drm_fb_helper: destroy modes
drm_setup_crtcs allocated modes using drm_mode_duplicate. Free them in drm_fb_helper_crtc_free.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Discussed with: Konstantin Belousov (kib@)
|
248060 |
08-Mar-2013 |
dumbbell |
drm: Fix a call to free(9) with an incorrect malloc type
While here, the call to free(9) is moved to drm_global.c, near the initial malloc(9).
Reviewed by: Konstantin Belousov (kib@)
|
247849 |
05-Mar-2013 |
kib |
Fix build with gcc, do not use unnamed union.
Reported and tested by: gjb MFC after: 1 month
|
247848 |
05-Mar-2013 |
kib |
Fix build with gcc, remove redundand declarations.
Reported and tested by: gjb MFC after: 1 month
|
247839 |
05-Mar-2013 |
dumbbell |
drm_global.c: Destroy sx in drm_global_release()
This fixes a build error at the same time (unused variable "item"), if the kernel is compiled without INVARIANTS.
Reported by: Hartmann, O. <ohartman@zedat.fu-berlin.de> (build error) Reviewed by: Konstantin Belousov (kib@)
|
247838 |
05-Mar-2013 |
kib |
Correct the r247832.
Noted by: marius, rdivacky MFC after: 1 month
|
247835 |
05-Mar-2013 |
kib |
Import the preliminary port of the TTM.
The early commit is done to facilitate the off-tree work on the porting of the Radeon driver.
Sponsored by: The FreeBSD Foundation Debugged and tested by: dumbbell MFC after: 1 month
|
247834 |
05-Mar-2013 |
kib |
Import the drm_global references helpers.
Sponsored by: The FreeBSD Foundation MFC after: 1 month
|
247833 |
05-Mar-2013 |
kib |
Import the drm_mm_debug_table() function.
Sponsored by: The FreeBSD Foundation MFC after: 1 month
|
247832 |
05-Mar-2013 |
kib |
Import the likely() compat macro.
Sponsored by: The FreeBSD Foundation MFC after: 1 month
|
242467 |
02-Nov-2012 |
glebius |
- If DRM_DEBUG_DEFAULT_ON is defined, then initialize drm_debug_flagi to all supported debugging bits. - If DRM_DEBUG_DEFAULT_ON isn't defined, then initialize drm_debug_flag to zero.
DRM_DEBUG_DEFAULT_ON is defined when module is build with -DDEBUG_DRM or if kernel config has 'options DEBUG_DRM'.
Reviewed by: kib
|
241394 |
10-Oct-2012 |
kevlo |
Revert previous commit...
Pointyhat to: kevlo (myself)
|
241370 |
09-Oct-2012 |
kevlo |
Prefer NULL over 0 for pointers
|
240917 |
25-Sep-2012 |
mav |
Reduce delays in several wait loops from 10ms to 10us, same is it is done in Linux. This substantially increases graphics performance on Ivy Bridge.
Submitted by: avg@ Reviewed by: kib@
|
240539 |
15-Sep-2012 |
ed |
Prefer __containerof() above member2struct().
The first does proper checking of the argument types, while the latter does not.
|
239375 |
18-Aug-2012 |
kib |
Add drm and i915 ioctl translations for 32 bit process on 64 bit host.
Submitted by: meowthink@gmail.com MFC after: 2 weeks
|
239303 |
15-Aug-2012 |
hselasky |
Streamline use of cdevpriv and correct some corner cases.
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
|
237718 |
28-Jun-2012 |
mav |
Fix millisecond to ticks conversion in drm_msleep().
On systems with HZ=100 it caused Intel eDP video output initialization (and Xorg startup) to take several minutes instead of several seconds.
Reviewed by: kib MFC after: 3 days
|
237411 |
21-Jun-2012 |
emaste |
Add PCI IDs for Ivy Bridge
|
237131 |
15-Jun-2012 |
kib |
Use right size when freeing unneeded GTT mapping.
MFC after: 3 days
|
236199 |
28-May-2012 |
alc |
A small simplification to i915_gem_pager_fault().
Reviewed by: kib
|
236183 |
28-May-2012 |
kib |
Disable end of buffer fixup by default. New DDX does not need this, and since batch_len is unused by Linux driver, it seems that it is sometimes gets passed wrong. This causes command buffer corruption and GPU hung.
Old GEMified DDX drivers that needs this workaround are not supported.
MFC after: 1 month
|
236182 |
28-May-2012 |
kib |
Fix calculation of the execution buffer end in the mapped pages when it is spilled into the next page.
MFC after: 1 month
|
235925 |
24-May-2012 |
dim |
Fix the following clang warning in drm2:
sys/dev/drm2/i915/intel_display.c:8861:3: error: expression result unused [-Werror,-Wunused-value] _intel_wait_for(dev, ^~~~~~~~~~~~~~~~~~~~ @/dev/drm2/i915/intel_drv.h:55:2: note: expanded from macro '_intel_wait_for' ret; \ ^~~
Reviewed by: kib MFC after: 1 week
|
235783 |
22-May-2012 |
kib |
Add the code for new Intel GPU driver, which supports GEM, KMS and works with new generations of GPUs (IronLake, SandyBridge and supposedly IvyBridge).
The driver is not connected to the build yet.
Sponsored by: The FreeBSD Foundation MFC after: 1 week
|