Commit Graph

648 Commits

Author SHA1 Message Date
riastradh 9cd3310279 Snapshot of nouveau. Doesn't build yet, but progress. 2014-08-06 13:35:13 +00:00
riastradh d74a76853b merge re-imported nouveau 2014-08-06 12:52:19 +00:00
riastradh 9c88fc4ef0 Tweak fence locking again with a broader view of the code paths. 2014-08-06 12:47:13 +00:00
riastradh fcd768afa5 Reimport Nouveau from Linux 3.15.
This renames .c files to avoid basename clashes, and adds RCS IDs.

Generated using nouveau2netbsd.
2014-08-06 12:36:23 +00:00
riastradh fd839182c7 Use surface_width/height, not fb_width/height.
This matches the sizes the upstream code uses.
2014-08-05 20:28:56 +00:00
riastradh e004225d1e Tweak heuristic for placing __KERNEL_RCSID in nouveau2netbsd. 2014-08-05 19:49:13 +00:00
riastradh d630126e7b Add kludgey nouveau2netbsd script in preparation for re-import. 2014-08-05 17:39:07 +00:00
skrll b69cb7b037 Remove #ifdef DIAGNOSTIC around sc from the root interrupt abort methods
now it's always used.
2014-08-05 10:33:46 +00:00
skrll 85254c5b77 Prevent the root hub sending updates once the root interrupt abort is
called.
2014-08-05 08:33:50 +00:00
skrll 9d539301e4 Simplify the freeing of the interrupt pipe transfer. Inspired by OpenBSD. 2014-08-05 06:35:24 +00:00
wiz 87561671c1 defintion -> definition 2014-08-03 19:14:24 +00:00
riastradh e365af9461 Linux wq locks are taken with spin locks held, so need IPL_VM. 2014-07-29 17:36:06 +00:00
riastradh 93aca6c17d Take rdev->fence_lock around the wakeup. 2014-07-28 12:59:39 +00:00
riastradh de33f07ea6 radeon depends on firmload.
Noted by rjs@.
2014-07-28 00:02:50 +00:00
riastradh 6dedd04ff8 Linux work is queued in intr context, so block intrs when locking.
(Yes, this getting out of hand.)
2014-07-27 14:02:48 +00:00
dholland 9b97857eeb Fix misplaced parenthesis, from Henning Petersen in PR 44804. 2014-07-27 03:49:25 +00:00
riastradh d2298a8f97 Revert ttm_bo.c 1.3 and try to fix the double-free properly.
bo->destroy doesn't ttm_tt_destroy or ttm_tt_fini anything.  Trouble
is that ttm_tt_fini expects the swap storage to still be there, and
ttm_tt_destroy -- which is what calls ttm_tt_fini by way of
ttm->func->destroy -- has already nulled it out.
2014-07-27 00:40:39 +00:00
riastradh 3996e8af0d Break overlong lines. 2014-07-26 21:36:40 +00:00
riastradh a7dd8986b4 Don't forget to decrement the acquired count too. 2014-07-26 21:35:06 +00:00
riastradh e44e30710d Make sure the low bits, not the high bits, of the offset are zero! 2014-07-26 21:19:45 +00:00
riastradh ae23e861e3 Let the drm driver decide what part of what object gets mmapped.
Pass the file around too so radeon/ttm can get at it to verify access.

Add drm_gem_or_legacy_mmap_object for drivers to choose the previous
behaviour, like i915.
2014-07-26 21:15:45 +00:00
riastradh 609cad5551 drmkms_ttm is not split into a module (yet). 2014-07-26 21:12:43 +00:00
alnsn 5577ba7875 Don't destroy mutexes because the module can't be unload. 2014-07-26 21:07:45 +00:00
riastradh 322d2c791f Move CONFIG_X86 from files.i915drmkms to drm_os_netbsd.h. 2014-07-26 18:13:44 +00:00
riastradh d9c17c4088 Avoid needless #ifdef __i386__ with judicious use of MIN. 2014-07-26 14:27:40 +00:00
riastradh e5a34f8222 Fix __raw_i915_read64 on i386. From rjs@. 2014-07-26 14:26:04 +00:00
riastradh d8efb7e997 Use tvtohz instead of ad-hacking it myself, suggested by apb@. 2014-07-26 14:24:08 +00:00
rjs e3f09db334 Fix non debug build. 2014-07-26 12:27:57 +00:00
skrll 23f4f87d63 Recover from channel halt errors by using the 3 strikes xacterr rule.
Adapted from the RaspberryPI linux driver.

This allows the rum(4) I was sent to be somewhat usable. Need to
investigate further what is causing the problem in the first place.

Might help PR/49019 (RPI: interrupt storm when url0 is up)
2014-07-26 09:18:53 +00:00
riastradh a0687f1f96 Report the same PCI domain (cf_unit) as everything else in NetBSD. 2014-07-26 07:53:14 +00:00
riastradh 6bfd56b042 Rename radeondrmkms to just plain radeon.
radeondrmkmsfb will stay as is until the name radeonfb is available
(currently taken by legacy dev/pci/radeonfb.c).
2014-07-26 07:36:09 +00:00
riastradh 16f359e554 Defer real radeon attachment until mountroot so we can load firmware. 2014-07-26 07:32:18 +00:00
riastradh 197797e410 Fix radeon framebuffer mmapping.
The framebuffer is not a system-RAM-backed, TTM-managed object;
rather, it is a VRAM-backed object.  So we have to use its bus
address, which is a little less sketchy with bus_space_mmap anyway.
2014-07-26 07:02:13 +00:00
riastradh a43616ecf0 Fix botched conversion from ALIGN to round_up (not DIV_ROUND_UP!). 2014-07-26 06:37:53 +00:00
riastradh 64cf35771b Don't ttm_tt_destroy bo->ttm if bo->destroy will destroy it too. 2014-07-26 06:34:12 +00:00
riastradh be24e7e5e3 Fill in i2c_bit_add_bus. 2014-07-26 06:26:39 +00:00
riastradh a261475311 Make Linux usecs_to_jiffies work with hz up to 2000. 2014-07-26 06:20:25 +00:00
riastradh 57692d89d2 Fix some dumb thinkos in radeon_gart.c. 2014-07-26 05:45:53 +00:00
riastradh 5108afdd0f Fix little arithmetic mistakes in radeon_gart.c.
Unlikely to fix the failing ring tests on boot, though.
2014-07-26 05:23:11 +00:00
riastradh 4c3d39e63e Disable reusing graphics stolen memory in i915drmkms for now.
Sometimes the GTT is located in graphics stolen memory, and who knows
what else the BIOS might have done with it.  Upstream has a patch to
sneak around the GTT, but disabling it altogether is simpler and
probably safer.
2014-07-25 21:57:54 +00:00
riastradh 88570f3a5e Prettify intelfb/radeondrmkmsfb autoconf output. 2014-07-25 16:35:43 +00:00
riastradh c733f159c7 This case is not supposed to fall through! 2014-07-25 16:15:12 +00:00
riastradh b1e702b01e dctx->obj may still be null here! 2014-07-25 12:53:30 +00:00
riastradh 77be005404 Forgot this file for radeondrmkmsfb. 2014-07-25 12:48:34 +00:00
riastradh f427372682 Declare radeon_device_private.
Not used right now, but harmless and needed by a local patch and I
accidentally committed the definition already.
2014-07-25 12:47:18 +00:00
riastradh c33e688be3 Hook up radeondrmkmsfb code.
Builds, not testable yet.
2014-07-25 12:35:03 +00:00
riastradh b26a72fc46 Don't forget to set ret on the way out. 2014-07-25 12:18:13 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
riastradh 0f976a8e0b Tweak i915drmkms_detach to be more robust. 2014-07-24 22:13:23 +00:00
riastradh b4b1c190b7 Make `#include "intelfb.h"' NetBSD-specific. 2014-07-24 22:00:02 +00:00
riastradh a728921c74 Remove leftover debugging kludge. 2014-07-24 21:45:03 +00:00
riastradh 14ce3bce83 Make ddb enter/exit work while X is running with i915drmkms. 2014-07-24 21:37:35 +00:00
riastradh 37240c7862 Expose drm fb helpers for ddb enter/exit. 2014-07-24 21:36:39 +00:00
riastradh 01b7eb4932 Fix WSDISPLAYIO_GET_BUSID on new intelfb(4).
Need to pass the PCI device, not one of its children (which intelfb
is), to wsdisplayio_busid_pci.

Fixes starting X.
2014-07-24 21:28:44 +00:00
riastradh 32189458a8 Rework Intel framebuffer attachment.
Turns out genfb_softc must be at the start of its own device_private,
so we can't have it in the middle of a structure, and certainly can't
have potentially multiple genfbs per graphics device.  Failing to do
this is why entering ddb didn't work with an i915drmkms console.

Instead of putting a genfb_softc into each drm_fb_helper, put a
device_t into each drm_fb_helper and create a new intelfb(4) device
for each Intel framebuffer.  This will be more flexible, too, in case
we want accelerated framebuffers later on.  (XXX Need to adapt the
radeon code, which I'm disabling until that happens to avoid breaking
the build.)

While here, defer disabling VGA, vga_cndetach, and genfb_attach until
we're actually ready to do them all together along with the mode
switch.  This should reduce the amount of time during which the
screen is blanked, in case it hangs.
2014-07-24 21:18:40 +00:00
alnsn 582402eab5 Rename sljitarch.h to sljit_machdep.h. 2014-07-23 18:19:43 +00:00
riastradh 486447f25f Omit redundant vga_is_console test.
This was a copypasta error -- before it tested iot then memt -- but I
see no evidence that passing memt to vga_is_console is ever sensible.
2014-07-23 18:05:44 +00:00
riastradh 7447ac1141 Free temporary segs on the way out of bus_dmamap_load_pglist. 2014-07-22 22:14:22 +00:00
riastradh bafa0fb861 Fix ttm swap storage destruction. 2014-07-22 15:15:22 +00:00
riastradh b446b204df Make Linux ww_mutex use a spin lock inside, not an adaptive lock. 2014-07-22 02:38:31 +00:00
riastradh 7eb16937b4 Avoid bus_space_read/write_8 on i386. 2014-07-21 20:03:31 +00:00
riastradh f5b73cbde0 Avoid bus_space_read/write_8 on i386.
Would be nice if there were a clearer way to detect it than _LP64,
and if its absence caused a compile error instead of a link error.
2014-07-21 20:01:18 +00:00
prlw1 1e3587440f The lua 5.1 to 5.3 update added isprint to libkern.h 2014-07-20 17:56:44 +00:00
lneto 4ab4902eb2 lua: updated from 5.1 to 5.3 work3
* lua(1):
  - changed lua_Integer to intmax_t
  - updated distrib/sets/lists and etc/mtree
  - updated bsd.lua.mk
  - fixed bozohttpd (lua-bozo.c)
  - compatibilized bindings: gpio, sqlite
* lua(4):
  - removed floating-point and libc dependencies using '#ifndef _KERNEL'
  - fixed division by zero and exponentiation
  - libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
  - acpica: removed isprint() from acnetbsd.h
  - libc: moved strcspn.c, strpbrk.c and strspn.c to common
  - removed stub headers
  - compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE
2014-07-19 18:38:33 +00:00
riastradh 2ef9395ae2 Fix formatting and locking errors.
Format time_t by casting to intmax_t and using PRIdMAX, since we have
no PRIxyz for time_t.

We already hold the irq lock on entry to i915_record_ring_state, so
don't take it again.
2014-07-18 19:48:34 +00:00
alnsn a168439b5a Disable FPU in kernel space. 2014-07-18 19:38:02 +00:00
riastradh adbb470385 Don't cast ptrdiff_t to unsigned long before formatting it with %td.
Noted by Robert Swindells and Patrick Welche.
2014-07-18 19:34:59 +00:00
riastradh 34216073bb Don't forget to pmap_update after pmap_kremove! 2014-07-18 03:11:55 +00:00
riastradh 2f97720d54 We need just a VA, not wired physical pages too. 2014-07-18 00:00:51 +00:00
riastradh 964a628c0e Don't double-free obj->pages, with two different allocators to boot! 2014-07-17 21:14:24 +00:00
riastradh db544f2dc6 Destroy the DMA subregion tag on error in drm_pci_detach.
Now that drm_pci_attach calls the driver load function, rather than
deferring it to the caller, the DMA subregion tag can be created
here.
2014-07-17 21:13:49 +00:00
riastradh df1a87486b Elide up to one excess driver-named component from firmware pathnames. 2014-07-17 20:56:14 +00:00
riastradh 5820ca24c6 In radeon_device_init, use ddev->dev, not &pdev->dev, for rdev->dev.
ddev->dev is the actual device_t, and we need it for firmware load.
&pdev->dev is a dummy structure that serves no purpose except some
kludge in our Linux PCI compatibility crap.  In Linux the two should
be the same, so no need to #ifdef __NetBSD__ this.
2014-07-17 20:41:22 +00:00
riastradh 852bd97d54 Tweak failure case for Linux firmware API.
request_firmware is guaranteed to yield null on failure;
release_firmware on null is guaranteed to be a no-op.
2014-07-17 20:37:01 +00:00
riastradh 08846c0307 intel_dp_aux_wait_done can run while cold. 2014-07-17 17:52:39 +00:00
riastradh 8880b5313f Do a post-write DMA sync pos-write, not a pre-write one. 2014-07-17 17:29:39 +00:00
riastradh 6f1e96281f Don't forget to advance the array index as we walk the queue... 2014-07-17 17:19:42 +00:00
riastradh 4fb1005df1 Lock the right lock around the gmbus condvar. 2014-07-17 17:17:24 +00:00
riastradh ced0e0f361 Put in dummy gem uvm ops for radeon (uses ttm for real mmap). 2014-07-17 15:09:00 +00:00
riastradh 3c8e94233f Correct return values of Linux test-and-set operations (PR 48999).
Linux's Documentation/atomic_ops.txt says in no uncertain terms these
must return 0 or 1, not zero or nonzero.  I don't think this has
caused an issue for drm (yet), but better to have it right.
2014-07-17 14:30:33 +00:00
riastradh 27f0ac970f Add non-atomic Linux test-and-set operations. 2014-07-17 14:28:28 +00:00
riastradh 174002a657 Remove defunct declarations of alloc_page/free_page. 2014-07-17 14:07:44 +00:00
riastradh f0ac8cd0d3 Push -Wno-missing-prototypes into specific radeon source files.
Don't apply it willy-nilly to the whole kernel!
2014-07-17 14:05:12 +00:00
riastradh 26083f6ccc Remove needless linux_gfp.c.
Trying to make do with Linux's page allocation interface is pretty
much always wrong: either we let uvm allocate pages in uvm objects
for us, or we use bus_dma.
2014-07-17 13:52:22 +00:00
riastradh 180ed50cef Initialize the drm_global stuff. 2014-07-17 13:47:19 +00:00
riastradh 0a36a05ab2 Actually hook up the radeon_ttm uvm pager ops! 2014-07-17 03:34:13 +00:00
riastradh cd1be69630 Import the part of Nouveau that got eaten by CVS default ignore patterns.
No, this is *not* a core file.  This is a directory with most of the
source code!
2014-07-17 01:50:57 +00:00
jmcneill f0744b1ae9 From 517d5c1c9c
> Fix for ALSA driver crash
> Avoids an issue when closing and opening vchiq where a message can arrive before service handle has been written
2014-07-16 23:59:58 +00:00
riastradh b358313ab0 Get suspend/resume sorta working for i915drm. 2014-07-16 23:25:18 +00:00
riastradh b8f558054f Remove needless pci_map_rom error messages. 2014-07-16 23:24:23 +00:00
riastradh 14004d2c4d Explain why i915_gem_release_mmap is broken. 2014-07-16 21:48:53 +00:00
riastradh e6dd66eb71 Restore error message tweak that got lost in the merge. 2014-07-16 21:28:50 +00:00
riastradh ae3742a4e9 I thought I removed this troublemaker already. 2014-07-16 21:11:47 +00:00
riastradh b81c64e1b2 First whack at radeon driver.
No hardware to test yet, but it builds.
2014-07-16 20:59:57 +00:00
riastradh 77b5597a2b Make it build and boot on my test machines.
Screen blanks on boot on the Ivy Bridge system with

   DRM error in cpt_serr_int_handler: PCH transcoder A FIFO underrun

But after that everything is OK.  Appears to be an upstream problem.
To investigate...

I think there's a cache flushing issue somewhere -- there are little
display artefacts on my T60.
2014-07-16 20:56:24 +00:00
riastradh e51b4cca97 Delete troublesome drm_trace.h and drm_trace_points.c. 2014-07-16 20:08:37 +00:00
riastradh 3c6dde82cc fix merge conflicts 2014-07-16 20:03:56 +00:00
riastradh 9d20d9267f Import drm from Linux 3.15 (commitid 1860e379875dfe7271c649058aeddffe5afd9d0d).
drivers/gpu/drm      -> sys/external/bsd/drm2/dist/drm
   include/drm          -> sys/external/bsd/drm2/dist/include/drm
   include/uapi/drm     -> sys/external/bsd/drm2/dist/uapi/drm

GPL sources excluded.
2014-07-16 19:35:23 +00:00
christos 2c90fe4f6d print the error from bus_space_map. 2014-07-13 15:15:06 +00:00
mlelstv a80912bfb7 The vga driver now detaches wscons. 2014-07-13 01:17:15 +00:00