History log of /freebsd-9.3-release/sys/dev/drm2/
Revision Date Author Comments
267654 20-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


267430 12-Jun-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.

Before this change, running a 32bit OpenGL application would trigger a
kernel panic.

This is an MFC of r265262.

Submitted by: Jan Kokemüller <jan.kokemueller@gmail.com>
Approved by: re (gjb)


267057 04-Jun-2014 marius

MFC: r266792

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
Approved by: re (gjb)
Sponsored by: Bally Wulff Games & Entertainment GmbH


265439 06-May-2014 kib

MFC r265102:
Fix one cases of recursive acquisitions of the vm object lock, only
possible in rare failure situations. The second part of r265102 is
not applicable to stable/9 since vm_page_insert() cannot fail there.


263817 27-Mar-2014 ray

MFC 219886, 226100, 226111, 226341, 242529, 259015, 259016, 259019, 259049,
259071, 259102, 259110, 259129, 259130, 259178, 259179, 259203, 259221,
259261, 259532, 259615, 259650, 259651, 259667, 259680, 259727, 259761,
259772, 259776, 259777, 259830, 259882, 259915, 260160, 260449, 260450,
260688, 260888, 260953, 261269, 261547, 261551, 261552, 261553, 261585
o Merge vt(4) virtual terminal (a.k.a. newcons) to stable/9.
o Merge teken updates.
o Add few more tty methods required by vt(4).
o Update syscons(4) to work with fresh teken.

Sponsored by: The FreeBSD Foundation


263170 14-Mar-2014 dumbbell

MFC Radeon KMS driver

FreeBSD 9 already had modern Intel GPUs support, now this is the case for
Radeon GPUs too. This will ease the work on ports, where there won't be a
need to distinguish between FreeBSD 9/10 and different hardware vendors.

Help from: jhb@, jkim@, kan@, kib@,
J.R. Oldroyd <fbsd@opal.com> (previous version of the patch)

The following revisions were merged in this single commit:

r254885:
drm/radeon: Import the Radeon KMS driver

This driver is based on Linux 3.8 and a previous effort by kan@.

More informations about this project can be found on the FreeBSD wiki:
https://wiki.freebsd.org/AMD_GPU

The driver is split into:

sys/dev/drm2:
The driver sources.

sys/modules/drm2/radeonkmw:
The driver main kernel module's Makefile.

sys/modules/drm2/radeonkmsfw:
All firmware kernel module Makefiles. There's one directory and one
Makefile for each firmware.

sys/contrib/dev/drm2/radeonkmsfw:
All firmware binary sources.

tools/tools/drm/radeon
Tools to update firmwares or regenerate some headers.

Merging the driver to FreeBSD 9.x may be possible but not a priority for
now.

Help from: kib@, kan@
Tested by: avg@, kwm@, ray@,
Alexander Yerenkow <yerenkow@gmail.com>,
Anders Bolt-Evensen <andersbo87@me.com>,
Denis Djubajlo <stdedjub@googlemail.com>,
J.R. Oldroyd <fbsd@opal.com>,
Mikaël Urankar <mikael.urankar@gmail.com>,
Pierre-Emmanuel Pédron <pepcitron@gmail.com>,
Sam Fourman Jr. <sfourman@gmail.com>,
Wade <wade-is-great@live.com>,
(probably other I forgot...)
HW donations: kyzh, Yakaz

r254894:
drm/radeon: Rename the (S)DEBUG macros in atom.c to avoid conflicts

For instance, DEBUG is already defined in the LINT kernel configuration.
This fixes the build of LINT.

r254899:
drm/radeon: Disable build on i386/pc98

r255572:
drm/radeon: Fix usage of vga_pci_map_bios()

vga_pci_(un)map_bios() takes a vgapci device as argument, not a drmn
one. This fixes a bug where the BIOS couldn't be mapped if the device
wasn't the boot display.

Approved by: re (kib; blanket for following drm2/radeon commits)

r255573:
drm/radeon: Fix usage of pci_save_state() and pci_restore_state()

Calling those functions with the drmn device as argument causes a panic,
because it's not a direct child of pci$N. They must be called with the
vgapci device instead.

This fix is not enough to make suspend/resume work reliably.

Approved by: re (blanket)

r255587:
drm/radeon: Add missing "return false" after unmapping invalid BIOS

Without that, we would try to copy the unmapped BIOS.

Submitted by: Christoph Mallon <christoph.mallon@gmx.de>
Approved by: re (blanket)

r256771:
drm/radeon: radeonkms depends on firmware(9)

Submitted by: tijl@

r257869:
drm: Initialize "handle" to 0 before calling drm_gem_handle_create()

This is variable is being checked in drm_gem_name_create() before being
set.

r257870:
drm/radeon: Wake up userland after page flip

For instance, this caused issues in KDE, such as stuttered animations
(with desktop effects enabled).

r259003:
Initialize modesetting sysctls in radeonkms.

This is intended for MFC if re@ permits.

Reviewed by: kib, dumbbell
Tested by: Steven Chamberlain <steven@pyro.eu.org>
MFC after: 3 days

r259101:
drm/radeon: agp_info->ai_aperture_size is in bytes, not Mbytes

This fixes radeon_agp_init() and gtt_size is now correct. However, this
is not enough to make Radeon AGP cards work: ttm_agp_backend.c isn't
implemented yet.

Submitted by: tijl@

r259104:
drm/radeon: radeon_dp_i2c_aux_ch() must return 0 on FreeBSD

The code was unmodified compared to Linux and returned the amount of
received bytes from the i2c bus. This led to non-working i2c bus and
failure to eg. read monitor's EDID, if connected to DisplayPort.

MFC after: 3 days
Tested by: Mikaël Urankar <mikael.urankar@gmail.com>

r259684:
drm/ttm, drm/radeon: Replace EINTR/ERESTART by ERESTARTSYS...

... for msleep/cv_*wait() return values, where wait_event*() is used
on Linux. ERESTARTSYS is the return code expected by callers when the
operation was interrupted.

For instance, this is the case of radeon_cs_ioctl() (radeon_cs.c): if
an error occurs, and the code isn't ERESTARTSYS (eg. EINTR), it logs an
error.

Note that ERESTARTSYS is defined as ERESTART, but this keeps callers'
code close to Linux.

Submitted by: avg@ (previous version)

r261497:
Abort when firmware isn't present in R600+ models.

More details at:
http://anonscm.debian.org/viewvc/kernel/dists/trunk/linux/debian/patches/bugfix/all/radeon-firmware-is-required-for-drm-and-kms-on-r600-onward.patch?revision=20909&view=co

Reviewed by: dumbbell
MFC after: 1 week


263119 13-Mar-2014 dumbbell

MFC changes to atomic.h usage in DRM code

This commit follows the merge of atomic.h changes in r262807 and r262823.
The original work is from Jung-uk Kim (jkim@).

The following revisions were merged in this single commit:

r255009:
Fix a compiler warning. With this fix, a negative time can be converted to
a struct timeval and back to the original nanoseconds correctly.

r255012:
Fix a compiler warning and add couple of VM map types.

r255013:
Correct atomic operations in i915.

r255037:
Fix atomic operations on context_flag without altering semantics.

r255039:
- Remove test_and_set_bit() macro. It is unused since r255037.
- Relax atomic_read() and atomic_set() macros. Linux does not require any
memory barrier. Also, these macros may be even reordered or optimized away
according to the API documentation:

https://www.kernel.org/doc/Documentation/atomic_ops.txt

r255041:
Clarify confusions between atomic_t and bitmap. Fix bitmap operations
accordingly.

r255042:
Fix the incomplete conversion from atomic_t to long for test_bit().

r255044:
Partially revert r254880. The bitmap operations actually use long type now.

r255045:
'u_long' is consistently spelled 'unsigned long' in this file. Fix it.


262988 10-Mar-2014 dumbbell

MFC TTM, a memory manager used by video drivers

This is the last step before the merge of the Radeon KMS driver. Other
changes to TTM will be merged with radeonkms.

The following revisions were merged in this single commit:

r247835:
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

r247848:
Fix build with gcc, remove redundand declarations.

Reported and tested by: gjb
MFC after: 1 month

r247849:
Fix build with gcc, do not use unnamed union.

Reported and tested by: gjb
MFC after: 1 month

r248060:
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@)

r248657:
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>

r248661:
drm/ttm: Explain why we don't need to acquire a ref in ttm_bo_vm_ctor()

r248663:
drm/ttm: Fix a typo: s/pTTM]/[TTM]/

r248666:
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

r252864:
Remove unneeded page lock around vm_page_insert().

Submitted by: alc

r253710:
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

r254822:
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.

r254858:
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.

r254860:
drm: Update drm_atomic.h, now that projects/atomic64 is in HEAD

Submitted by: jkim@

r254861:
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>

r254862:
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>

r254863:
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@

r254864:
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@

r254865:
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@

r254866:
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@

r254867:
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@

r254868:
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@

r254870:
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@

r254871:
drm/ttm: Fix style errors

r254873:
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@

r254874:
drm/ttm: Improve comment in ttm_bo_vm_ctor() about lack of ref acquisition

Approved by: kib@

r254875:
ttm: "to_page->valid = VM_PAGE_BITS_ALL" before vm_page_dirty(to_page)

Approved by; kib@

r254876:
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@

r254877:
drm/ttm: Fix style in ttm_bo_release_mmap()

r254878:
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@

r254879:
drm/ttm: Remove unused VM_ALLOC_DMA32 define

r254880:
drm: Use the new drm_atomic.h, following the merge of projects/atomic64

Submitted by: jkim@

r259612:
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


261675 09-Feb-2014 dumbbell

MFC r259717:

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>


261674 09-Feb-2014 dumbbell

MFC r258549:

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.


261673 09-Feb-2014 dumbbell

MFC r258262:

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>


261672 09-Feb-2014 dumbbell

MFC r254852:

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


261669 09-Feb-2014 dumbbell

MFC r254853:

drm: Import drm_fixed.h from Linux 3.8


261667 09-Feb-2014 dumbbell

MFC r254848, r258930:

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.


261666 09-Feb-2014 dumbbell

MFC r254841:

drm: Import list_for_each_entry_safe_from() macro


261665 09-Feb-2014 dumbbell

MFC r254840:

drm: Use DRM_IF_MAJOR & DRM_IF_MINOR from drm_core.h


261664 09-Feb-2014 dumbbell

MFC r254838:

drm: In drm_gem_name_create(), verify argument before acquiring lock

Submitted by: J.R. Oldroyd <jr@opal.com>


261662 09-Feb-2014 dumbbell

MFC r254836, r254837:

drm: Support gem_open_object() and gem_close_object() callbacks

... in struct drm_driver_info.


261661 09-Feb-2014 dumbbell

MFC r254835:

drm: Fix typo in KASSERT message: s/Dandling/Dangling/


261660 09-Feb-2014 dumbbell

MFC r254833:

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>


261659 09-Feb-2014 dumbbell

MFC r254821:

drm: Fix cleanup if device initialization fails

This plugs some memory leaks.


261658 09-Feb-2014 dumbbell

MFC r254820:

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.


261654 09-Feb-2014 dumbbell

MFC r254819:

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@


261653 09-Feb-2014 dumbbell

MFC r254818:

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.


261652 09-Feb-2014 dumbbell

MFC r254817:

drm: Import drm_dp_helper.c from Linux 3.8-rc3

While here, update drm_dp_helper.h to better match Linux one.


261632 08-Feb-2014 dumbbell

MFC r254798:

drm: Fix leak of connector->edid_blob_ptr


261631 08-Feb-2014 dumbbell

MFC r254797:

drm: Const'ify the 1st "drm_display_mode" passed to "mode_fixup" callbacks

This will be needed by the Radeon KMS driver.


261630 08-Feb-2014 dumbbell

MFC r254796:

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>


261629 08-Feb-2014 dumbbell

MFC r254794:

drm: Import drm_buffer.[ch] from Linux 3.8-rc3

This will be used by the Radeon KMS driver.


261626 08-Feb-2014 dumbbell

MFC r254792:

drm: Call drm_global_init() & drm_global_release() at module load/unload


261625 08-Feb-2014 dumbbell

MFC r249041, r249249:

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@,
Olivier Cochard-Labbé <olivier@cochard.me>


261624 08-Feb-2014 dumbbell

MFC r248061:

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@)


258870 03-Dec-2013 jhb

MFC 253471,253620,254430,254538:
Change mmap() to more optimally use superpages and provide support for
tweaking alignment of virtual mappings.
- 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(), shm_map(), and the GEM mapping
ioctl to use VMFS_OPTIMAL_SPACE instead of VMFS_ANY_SPACE.
- MAP_ALIGNED(n) requests a mapping aligned on a boundary of (1 << n).
Requests for n >= number of bits in a pointer or less than the size of
a page fail with EINVAL. This matches the API provided by NetBSD.
- MAP_ALIGNED_SUPER is a special case of MAP_ALIGNED. It can be used
to optimize the chances of using large pages. By default it will align
the mapping on a large page boundary (the system is free to choose any
large page size to align to that seems best for the mapping request).
However, if the object being mapped is already using large pages, then
it will align the virtual mapping to match the existing large pages in
the object instead.
- Internally, VMFS_ALIGNED_SPACE is now renamed to VMFS_SUPER_SPACE, and
VMFS_ALIGNED_SPACE(n) is repurposed for specifying a specific alignment.
MAP_ALIGNED(n) maps to using VMFS_ALIGNED_SPACE(n), while
MAP_ALIGNED_SUPER maps to VMFS_SUPER_SPACE.
- mmap() of a device object now uses VMFS_OPTIMAL_SPACE rather than
explicitly using VMFS_SUPER_SPACE. All device objects are forced to
use a specific color on creation, so VMFS_OPTIMAL_SPACE is effectively
equivalent.

PR: ports/184173 (exp-run)


257312 29-Oct-2013 kib

MFC r256848:
Use plain register read for waiting of the reset completion
notification, to avoid gt_lock recursion.


254023 07-Aug-2013 kib

MFC r253709:
The pmap_qenter() and pmap_qremove() perform TLB invalidation on its
own, no need to call pmap_invalidate_range() one more time.


254022 07-Aug-2013 kib

MFC r253497:
Use the right name for the vm_map_find(9) flag to specify shared mapping.


252497 02-Jul-2013 kib

MFC r251961:
Disable wait for the retrace if KMS is activated.


252496 02-Jul-2013 kib

MFC r251960:
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.


252054 21-Jun-2013 kib

MFC r251959:
Remove stray empty line.


251592 10-Jun-2013 kib

MFC r251591:
The vm_page lock is not needed around the call to vm_page_insert().


249082 04-Apr-2013 kib

MFC r247834:
Import the drm_global references helpers.

MFC r247839 (by dumbbell):
Destroy sx in drm_global_release().


249081 04-Apr-2013 kib

MFC r247833:
Import the drm_mm_debug_table() function.


249080 04-Apr-2013 kib

MFC r247832:
Import the likely() compat macro.

MFC r247838:
Correct the r247832.


243442 23-Nov-2012 glebius

Merge r242467 from head:
- 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


241091 01-Oct-2012 mav

MFC r240917:
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@


241088 01-Oct-2012 hselasky

MFC r239303:
Streamline use of cdevpriv and correct some corner cases.


239965 01-Sep-2012 kib

MFC r239375:
Add drm and i915 ioctl translations for 32 bit process on 64 bit host.


237882 01-Jul-2012 mav

MFC r237718:
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


237662 27-Jun-2012 gavin

Merge r237411 from head (originally by emast):

Add PCI IDs for Ivy Bridge

Requested by: emaste


237201 17-Jun-2012 kib

MFC r237131:
Use right size when freeing unneeded GTT mapping.


236933 11-Jun-2012 kib

MFC r236183:
Disable end of buffer fixup by default.


236932 11-Jun-2012 kib

MFC r236182:
Fix calculation of the execution buffer end in the mapped pages
when it is spilled into the next page.


236931 11-Jun-2012 kib

MFC r235925 (by dim):
Fix a clang warning in drm2.


236927 11-Jun-2012 kib

MFC r235783:
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.


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