| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
after discussions with beck deraadt kettenis.
|
|
|
|
| |
ok guenther
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
is included by a lot of files.
|
|
|
|
|
|
|
|
| |
before we truly start quiescing the device and don't unblock until we've
finished waking the device up. Fixes issues with suspend/resume on inteldrm(4)
and perhaps radeondrm(4) as well.
i"it is the right place to stall" deraadt@
|
|
|
|
| |
discussed with kettenis some time last year
|
|
|
|
|
|
| |
sure /dev/drm0 always matches the primary display.
ok mpi@
|
|
|
|
|
| |
logic for uvm objects; it's not necessary anymore as far as I can tell, at
least as long as we run all this code under the kernel lock.
|
| |
|
| |
|
|
|
|
|
| |
return values. Fixes at least one bug where userland would see a negative
errno value and hopefully doesn't introduce any new ones.
|
|
|
|
|
|
| |
Linux.
ok jsg@
|
|
|
|
| |
ok jsg@
|
|
|
|
|
| |
the necessary adjustments to reference counting of GEM objects. Matches what
Linux does these days.
|
| |
|
|
|
|
|
|
|
|
| |
Some free functions (radeon) grab sleeping locks. Instead when we ahve
taken the object off the tree we unlock and unref, then regrab before
looking again.
from oga in bitrig, ok kettenis@
|
|
|
|
|
| |
non integrated radeon >= r600 parts will now try to enable PCIe 2.0/3.0
speeds when the PCIe root port advertises the relevant speeds.
|
| |
|
|
|
|
|
| |
enable all the code in the various radeon pcie_gen2_enable() functions.
no functional change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Includes kernel modesetting, framebuffer console and support
for newer hardware.
Firmware needs to be present for acceleration and in some cases
modesetting to work. It can be installed via fw_update
or manually via pkg_add.
With lots of help from kettenis@ some macppc bits from mpi@
and some ttm refcount/queue bits from FreeBSD.
Thanks to M:Tier and the OpenBSD Foundation for sponsoring this work.
|
|
|
|
|
|
|
| |
closer to the Linux 3.8.13 codebase. Almost certainly squashes a few more
bugs.
ok jsg@
|
|
|
|
|
|
| |
"struct uvm_object" gets defined on macppc as well.
ok miod@, deraadt@
|
|
|
|
|
|
| |
responsible for allocating and freeing them. This is what Linux has been
doing for a while now, and will be needed for radeondrm(4) in the near
future.
|
|
|
|
|
|
|
|
| |
DRM_I915_GEM_MMAP and DRM_I915_GEM_MMAP_GTT ioctls to be compatible with
Linux. This also is the first step that moves us away from accessing all
graphics memory through the GTT, which should make things faster.
ok tedu@ (for the uvm bits)
|
|
|
|
|
|
| |
ifdef to be able to compile DRM on macppc.
ok kettenis@
|
|
|
|
|
|
|
|
|
|
|
| |
the blitter, scroll by double-mapping the framebuffer and reprogramming the
registers that determine the first visible pixel, much in the same way as the
vga text console uses the 6845. This makes scrolling very fast, and since we
no longer need to issue commands to any of the rings, we can enable this when
X is running and safely scroll when printing panic messages or if we've
entered ddb.
Testes by many.
|
|
|
|
| |
ok millert@
|
|
|
|
|
|
| |
Return EINVAL instead of EBADF if the same object is specified twice in
an execbuffer2 call.
This is what Linux does.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and update our device independent DRM code and the Intel DRM code
to be mostly in sync with Linux 3.8.3. Among other things this
brings support for kernel modesetting and enables use of
the rings on gen6+ Intel hardware.
Based on some earlier work from matthieu@ with some hints from FreeBSD
and with lots of help from kettenis@ (including a beautiful accelerated
wscons framebuffer console!)
Thanks to M:Tier and the OpenBSD Foundation for sponsoring this work.
|
|
|
|
|
|
|
|
|
|
|
|
| |
that do not support remapping for processor accesses.
Add new functions to map/unmap/mmap agp memory and let the agp layer
decides how these memory regions should be accessed. It's assumed here
that the bridge does not support remapping if its aperture address is 0.
This is the last diff required for having drm(4) on macppc using agp(4).
Joint work with and ok kettenis@
|
|
|
|
|
|
|
| |
support, wrap all the agp glue with 'if __OS_HAS_AGP' in such form that it
is true if the agp(4) driver is present.
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
|
|
|
|
| |
The vm hackers don't use it, don't maintain it and have to look at it all the
time. About time this 800 lines of code hit /dev/null.
``never liked it'' tedu@. ariane@ was very happy when i told her i wrote
this diff.
|
|
|
|
|
|
|
|
| |
that's ever used it, and it's long since been changed to use
DVACT_{QUIESCE,SUSPEND,RESUME} instead.
ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it
up a few weeks ago
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Allocating with M_WAITOK, checking for NULL, and calling panic() is
pointless (malloc() will panic if it can't allocate) so remove the check
and the call.
2) Allocating with M_WAITOK, checking for NULL, and then gracefully
handling failure to allocate is pointless. Instead also pass M_CANFAIL
so malloc() doesn't panic so we can actually handle it gracefully.
1) was done using Coccinelle.
Input from oga.
ok miod.
|
|
|
|
| |
'go for it' oga@
|
| |
|
|
|
|
| |
ok matthew@ tedu@, also eyeballed by at least krw@ oga@ kettenis@ jsg@
|
|
|
|
|
|
|
| |
a physical address [more precisely, something suitable to pass to pmap_enter()'sphysical address argument].
This allows MI drivers to implement mmap() routines without having to know
about the pmap_phys_address() implementation and #ifdef obfuscation.
|
|
|
|
| |
ok oga@
|
|
|
|
|
|
| |
strict locking diff.
ok oga@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, if userland wanted to wait on a certain vertical blank, it
had to call an ioctl which slept. Now, they can ask for an even on the
drm fd, which is then read off, and can be poll(4)ed on. For dri2 this
fits better into the workflow since the fd gets added to the xserver
main loop, and replies to the dri2 clients happen upon recieving the
events.
This functionality is only used with xserver 1.8 (and for the intel
driver in our tree, this support is currently #if 0ed out due to bugs
with vblanks on 945 that are still being chased)
matthieu@ ok.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For now they are unmaintained, and work on kernel modesetting has very
large inferface changes needing to be made. Also, when the radeon driver
has been converted over, we will no longer support X with the DRI1
protocol, only DRI2.
When the upheaval has finished, these drivers may be brought back after
work to switch them to DRI2 style memory management and kernel
modesetting has been done, but until then they are unsupported and
probably broken (i know at least two of them have been reported broken
before now). ragedrm will likely come back as a component of radeon
(their interfaces are still fairly similar). The other drivers require
rewriting.
I have been threatening to do this for over a year. Discussed with
deraadt@ and matthieu@ at various points since then.
|
|
|
|
|
|
|
|
|
|
|
|
| |
places in the tree need to be touched to update the object
initialisation with respect to that.
So, make a function (uvm_initobj) that takes the refcount, object and
pager ops and does this initialisation for us. This should save on
maintainance in the future.
looked good to fgs@. Tedu complained about the British spelling but OKed
it anyway.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, as well as being kinda nasty there was a very definite race, if
the last reference to an object was removed by uvm (a map going away),
then the free path happened unlocked, this could cause all kinds of
havoc.
In order to deal with this, move to fine-grained locking. Since uvm
object locks are spinlocks, and we need to sleep in operations that will
wait on the gpu, provide a DRM_BUSY flag that is set on a locked object
that then allows us to unlock and sleep (this is similar to several
things done in uvm on pages and some object types).
The rwlock stays around to ensure that execbuffer can have acces to the
whole gtt, so ioctls that bind to the gtt need a read lock, and
execuffer gets a write lock. otherwise most ioctls just need to busy the
object that they operate on. Lists also have their own locks.
Some cleanup could be done to make this a little prettier, but it is
much more correct than previously.
Tested very very vigorously on 855 (x40) and 965 (x61s), this found numerous
bugs. Also, the I can no longer crash the kernel at will.
A bunch of asserts hidden under DRMLOCKDEBUG have been left in the code for
debugging purposes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Manager api.
This is currently disabled by default under ifdef INTELDRM_GEM (option
INTELDRM_GEM in a kernel config or a patch to i915_drv.h needed to
enable), mostly because the intel X driver currently in tree does not
always play well with GEM and needs to be switched to UXA accelmethod
(which is the only option on later drivers).
While based on the intel drm code in the linux kernel this has come cleanups and
some obvious behaviour changes:
1) mmap through the GTT is entirely coherent with the gpu cache, removing
mappings whenever the cache dirties so you can not race with userland to write
to memory at the same time as the gpu.
2) pread/pwrite access is tiling-correct, so userland does not need to tile
manually (mesa has already been fixed for this a while ago). The straw that
broke the camels back here was the bit17 swizzling stuff on some mobile gpus
meansing that while userland did the swizzle itself, the kernel had to do
*extra* swizzling, this was frankly retarded so the option was dropped.
3) there is no option to map via the cpu from userland, again due to
coherency issues.
4) additional integer overflow checking in some areas.
5) we only support the newer EXECBUFFER2 command submission ioctl. the
old one is not supported at all (libdrm was fixed WRT over a week ago).
now the TODOs:
1) the locking is funky and is only correct due to biglock. it does
however work due to that. This will be fixed in tree, the design in
formulating in my head as I type.
2) there are currently no memory limits on drm memory, this needs to be
changed.
3) we really need PAT support for the machines where MTRRs are useless, else drm
uses quite a lot of cpu (this is a bug that continues from the older code
though, nothing new).
4) gpu resetting support on other than 965 is not written yet.
5) currently a lot of the code is in inteldrm, when memory management
comes to other chipset common code will be factored out into the drm
midlayer.
Tested on: 855 (x40), GM965 and 915 by me. 945 by armani@ and jkmeuser@,
gm45 by armani@ and marco@. More testing is needed before I enable this
by default though. Others also provided testing by what they tested
escapes me right now.
In order to test this enable INTELDRM_GEM in a kernel and add the following line
to the driver section in xorg.conf (I am working on a patch to autodetect the X
stuff):
Option "AccelMethod" "UXA"
|
|
|
|
|
|
| |
This is needed for the addition of further suspend/resume actions.
Okay deraadt@, marco@.
|
|
|
|
|
| |
for this prevents it to be invoked with DVACT_DEACTIVATE later. This had
been sweeped some time ago already, but bad constructs crept in again.
|
|
|
|
| |
it had to be fucking different. This has been irritating me.
|