Dave Airlie [Wed, 9 Jul 2008 04:53:47 +0000 (14:53 +1000)]
Merge remote branch 'origin/modesetting-101' into modesetting-gem
Kristian Høgsberg [Mon, 7 Jul 2008 22:00:23 +0000 (18:00 -0400)]
Add back flink, open and close ioctls.
They fell through the cracks in
86accbcb.
Kristian Høgsberg [Mon, 7 Jul 2008 19:43:43 +0000 (15:43 -0400)]
Merge commit 'origin/drm-gem' into ms-gem
Conflicts:
linux-core/drmP.h
linux-core/drm_drv.c
linux-core/drm_stub.c
linux-core/i915_drv.c
linux-core/i915_gem.c
shared-core/i915_drv.h
shared-core/i915_irq.c
Kristian Høgsberg [Mon, 7 Jul 2008 15:56:59 +0000 (11:56 -0400)]
Use lowercase bool constants.
Alan Hourihane [Mon, 7 Jul 2008 14:11:48 +0000 (15:11 +0100)]
Synchronize the DDC EDID read to it's fb_ddc.c counterpart
Maarten Maathuis [Sun, 6 Jul 2008 10:51:43 +0000 (12:51 +0200)]
NV50: init gamma storage
Maarten Maathuis [Sun, 6 Jul 2008 09:23:17 +0000 (11:23 +0200)]
NV50: fix minor bug in fbcon crtc selection
Maarten Maathuis [Sun, 6 Jul 2008 09:08:49 +0000 (11:08 +0200)]
modesetting-101: Rename DPMS modes to avoid compatibility issues with xorg definitions.
Maarten Maathuis [Sun, 6 Jul 2008 08:52:25 +0000 (10:52 +0200)]
modesetting-101: rename modeflags, as to avoid conflicts with the xorg definitions
Maarten Maathuis [Sun, 6 Jul 2008 08:11:33 +0000 (10:11 +0200)]
NV50: minor fix
Maarten Maathuis [Sat, 5 Jul 2008 18:17:49 +0000 (20:17 +0200)]
NV50: remove edid when monitor is gone, improve fbcon, misc fixes
- This should avoid switching crtc's when going to fbcon.
Maarten Maathuis [Sat, 5 Jul 2008 14:54:26 +0000 (16:54 +0200)]
NV50: fix switch_fb and connector_is_digital
Maarten Maathuis [Sat, 5 Jul 2008 10:04:07 +0000 (12:04 +0200)]
modesetting-101: Make the interface variable names a little more consistent + modeprint changes.
- All things are now called _id when they are id's.
- modeprint now accepts driver name as first argument.
Maarten Maathuis [Fri, 4 Jul 2008 16:47:59 +0000 (18:47 +0200)]
modesetting-101: tv_left_margin_property shouldn't be immutable.
Maarten Maathuis [Fri, 4 Jul 2008 15:37:45 +0000 (17:37 +0200)]
Forgot the 0'th element for the tv property.
Maarten Maathuis [Fri, 4 Jul 2008 15:28:04 +0000 (17:28 +0200)]
modesetting-101: Move some defines used for enumeration into the public header.
- Otherwise userspace has no idea of the meaning.
Maarten Maathuis [Fri, 4 Jul 2008 15:17:11 +0000 (17:17 +0200)]
[modesetting-101] Add subconnector and select_subconnector properties.
- These facilitate DVI-I and tv-out that can drive multiple types of signals.
Dave Airlie [Thu, 3 Jul 2008 23:34:24 +0000 (09:34 +1000)]
modesetting: rip out all of the generation code.
not needed, hotplug will work just as well hopefully.
Maarten Maathuis [Thu, 3 Jul 2008 15:25:37 +0000 (17:25 +0200)]
libdrm: fix typo in comment
Maarten Maathuis [Thu, 3 Jul 2008 07:08:01 +0000 (09:08 +0200)]
nv50: s/FALSE/false && s/TRUE/true
Maarten Maathuis [Thu, 3 Jul 2008 06:07:35 +0000 (08:07 +0200)]
[drm-sysfs] connected is ambigious in the context of a connector, replace with enabled
Maarten Maathuis [Thu, 3 Jul 2008 05:18:18 +0000 (07:18 +0200)]
NV50: replace active by enabled
Maarten Maathuis [Wed, 2 Jul 2008 23:05:07 +0000 (01:05 +0200)]
[modeseting-101] add connected field to sysfs
Maarten Maathuis [Wed, 2 Jul 2008 22:30:00 +0000 (00:30 +0200)]
Forgot to fix the modeprint test.
Maarten Maathuis [Wed, 2 Jul 2008 22:25:06 +0000 (00:25 +0200)]
[libdrm] count connectors and such has no place in a crtc object
Dave Airlie [Wed, 2 Jul 2008 22:05:51 +0000 (08:05 +1000)]
modesetting: lookup blob using correct identifier.
blob is a blob not a connector
Jakob Bornecrantz [Wed, 2 Jul 2008 22:03:48 +0000 (00:03 +0200)]
tests: Fix faulty error messages in modeprint
Dave Airlie [Wed, 2 Jul 2008 22:00:39 +0000 (08:00 +1000)]
drm: fix encoders get permissions
Jakob Bornecrantz [Wed, 2 Jul 2008 21:12:33 +0000 (23:12 +0200)]
tests: modeprint s/fb/fd/
Jakob Bornecrantz [Wed, 2 Jul 2008 20:46:44 +0000 (22:46 +0200)]
tests: Updated modeprint
Maarten Maathuis [Wed, 2 Jul 2008 14:13:54 +0000 (16:13 +0200)]
NV50: basic fbcon + misc fixes
- There is one fb, used for as many outputs as possible.
- Eventually smaller screens will be scaled to see the full console, but for the moment this'll do.
Jakob Bornecrantz [Wed, 2 Jul 2008 11:59:19 +0000 (13:59 +0200)]
tests: Improved and renamed the mode app to modeprint
Maarten Maathuis [Tue, 1 Jul 2008 14:00:09 +0000 (16:00 +0200)]
NV50: switch to fixed point scale factor calculations
Maarten Maathuis [Tue, 1 Jul 2008 13:14:30 +0000 (15:14 +0200)]
NV50: some i2c cleanup
Maarten Maathuis [Fri, 27 Jun 2008 16:58:13 +0000 (18:58 +0200)]
NV50: use list_head item instead of list_head head to avoid confusion
Maarten Maathuis [Fri, 27 Jun 2008 16:45:08 +0000 (18:45 +0200)]
Change some obviously wrong things about property blobs, still broken though.
- I do not fully understand these blobs, so i'm leaving it at this for the moment.
Maarten Maathuis [Fri, 27 Jun 2008 14:30:25 +0000 (16:30 +0200)]
[modesetting-101] Actually store properties when being changed.
Maarten Maathuis [Thu, 26 Jun 2008 23:29:30 +0000 (01:29 +0200)]
NV50: A minor change.
Maarten Maathuis [Thu, 26 Jun 2008 23:16:36 +0000 (01:16 +0200)]
NV50: Implement DPMS.
Maarten Maathuis [Thu, 26 Jun 2008 21:21:01 +0000 (23:21 +0200)]
[modesetting-101] tab-cleanup
Maarten Maathuis [Thu, 26 Jun 2008 21:12:04 +0000 (23:12 +0200)]
Revert "modesetting-101: Make dpms property optional + misc cleanup."
This reverts commit
13943fe5823c45759091c1a1f487a4abe377421e.
Maarten Maathuis [Thu, 26 Jun 2008 19:28:29 +0000 (21:28 +0200)]
modesetting-101: Make dpms property optional + misc cleanup.
- intel_crt seems the only one to provide it, so init it there.
Maarten Maathuis [Wed, 25 Jun 2008 13:27:07 +0000 (15:27 +0200)]
NV50: i misunderstood NOUVEAU_MEM_INTERNAL, so remove it
Maarten Maathuis [Wed, 25 Jun 2008 13:16:38 +0000 (15:16 +0200)]
NV50: Some cleanup and fixes.
Ben Skeggs [Wed, 25 Jun 2008 06:45:41 +0000 (16:45 +1000)]
nv50: when destroying a channel make sure it's not still current on PFIFO
We won't get a PFIFO context switch when the same channel ID is recreated if
the hw still thinks the channel is already active, which causes fun issues.
Should allow X to be stopped and started without tearing down the entire
card state in lastclose().
Ben Skeggs [Sun, 22 Jun 2008 15:00:42 +0000 (01:00 +1000)]
nouveau: allocate drm-use vram buffers from end of vram.
This avoids seeing garbage from engine setup etc before X gets around
to pointing the CRTCs at a new scanout buffer. Not actually a noticable
problem before G80 as PRAMIN is forced to the end of VRAM by the hardware
already.
root [Tue, 24 Jun 2008 22:18:29 +0000 (23:18 +0100)]
silence warning
Keith Packard [Tue, 24 Jun 2008 20:39:25 +0000 (13:39 -0700)]
[intel] Get vblank pipe from irq_mask_reg instead of hardware enable reg
With the interrupt enable/disable using only the mask register, it was wrong
to use the enable register to detect which pipes had vblank detection
turned on. Also, as we keep a local copy of the mask register around, and
MSI machines smack the hardware during the interrupt handler, it is more
efficient and more correct to use the local copy.
Keith Packard [Tue, 24 Jun 2008 20:08:04 +0000 (13:08 -0700)]
[intel] Create functions to enable/disable interrupts
This shares common code sequences for managing the interrupt register bits
Maarten Maathuis [Tue, 24 Jun 2008 18:29:08 +0000 (20:29 +0200)]
NV50: minor change
Keith Packard [Tue, 24 Jun 2008 17:03:05 +0000 (10:03 -0700)]
Merge branch 'drm-gem' into drm-gem-965
Keith Packard [Tue, 24 Jun 2008 05:03:33 +0000 (22:03 -0700)]
[intel-gem] Include drm_compat.h to get kmap_atomic_prot_pfn
Keith Packard [Tue, 24 Jun 2008 05:03:06 +0000 (22:03 -0700)]
drm_compat: it's CONFIG_HIGHMEM, not CONFIG_HIMEM
A mis-spelled config option (was it spelled that way in the past?)
eliminated kmap_atomic_prot_pfn from core DRM.
Keith Packard [Mon, 23 Jun 2008 18:21:30 +0000 (11:21 -0700)]
[intel-gem] Use I915_GEM_DOMAIN_GTT in dri_gem_bo_wait_rendering.
I915_GEM_DOMAIN_CPU is very expensive to wait for -- it generally requires
clflushing the frame buffer.
Keith Packard [Mon, 23 Jun 2008 17:16:35 +0000 (10:16 -0700)]
[intel-gem] Recover resources from wedged hardware.
Clean up queues, free objects. On the next entervt, unmark the hardware to
let the user try again (presumably after resetting the chip). Someday we'll
automatically recover...
Keith Packard [Mon, 23 Jun 2008 07:53:53 +0000 (00:53 -0700)]
[intel-gem] pwrite through GTT
Pin/copy_from_user/unpin through the GTT to eliminate clflush costs.
Benchmarks say this helps quite a bit.
Keith Packard [Tue, 24 Jun 2008 16:46:51 +0000 (09:46 -0700)]
Was using irq_enable_reg in the use_mask_reg path
Maarten Maathuis [Tue, 24 Jun 2008 10:38:57 +0000 (12:38 +0200)]
NV50: fix a few misc things
Maarten Maathuis [Tue, 24 Jun 2008 08:16:52 +0000 (10:16 +0200)]
NV50: fix cursor hide/show
Maarten Maathuis [Tue, 24 Jun 2008 07:41:13 +0000 (09:41 +0200)]
NV50: These are actually errors.
Keith Packard [Tue, 24 Jun 2008 05:03:33 +0000 (22:03 -0700)]
[intel-gem] Include drm_compat.h to get kmap_atomic_prot_pfn
Keith Packard [Tue, 24 Jun 2008 05:03:06 +0000 (22:03 -0700)]
drm_compat: it's CONFIG_HIGHMEM, not CONFIG_HIMEM
A mis-spelled config option (was it spelled that way in the past?)
eliminated kmap_atomic_prot_pfn from core DRM.
Maarten Maathuis [Mon, 23 Jun 2008 22:00:02 +0000 (00:00 +0200)]
NV50: fix some misc bugs
Maarten Maathuis [Mon, 23 Jun 2008 20:59:17 +0000 (22:59 +0200)]
[modesetting-101] update mode count after fill_modes.
- This avoids returning with a mode count of 0, thus not allocating space for the 2nd ioctl.
Maarten Maathuis [Mon, 23 Jun 2008 19:15:54 +0000 (21:15 +0200)]
libdrm: check for allocation failure
Maarten Maathuis [Mon, 23 Jun 2008 18:33:32 +0000 (20:33 +0200)]
NV50: Improve set_config and fix some minor bugs.
Keith Packard [Mon, 23 Jun 2008 18:21:30 +0000 (11:21 -0700)]
[intel-gem] Use I915_GEM_DOMAIN_GTT in dri_gem_bo_wait_rendering.
I915_GEM_DOMAIN_CPU is very expensive to wait for -- it generally requires
clflushing the frame buffer.
Keith Packard [Mon, 23 Jun 2008 18:20:17 +0000 (11:20 -0700)]
[intel] leave interrupts disabled in ISR only on MSI again
While debugging the 915, I tried this trick there and accidentally left it
set.
Keith Packard [Mon, 23 Jun 2008 17:16:35 +0000 (10:16 -0700)]
[intel-gem] Recover resources from wedged hardware.
Clean up queues, free objects. On the next entervt, unmark the hardware to
let the user try again (presumably after resetting the chip). Someday we'll
automatically recover...
Keith Packard [Mon, 23 Jun 2008 17:07:47 +0000 (10:07 -0700)]
[intel] Switch to using IMR instead of IER
Keith Packard [Mon, 23 Jun 2008 07:53:53 +0000 (00:53 -0700)]
[intel-gem] pwrite through GTT
Pin/copy_from_user/unpin through the GTT to eliminate clflush costs.
Benchmarks say this helps quite a bit.
Keith Packard [Mon, 23 Jun 2008 07:53:04 +0000 (00:53 -0700)]
[intel] allow the irq code to use either enable or mask registers
still not sure which works best on which hardware; this will make it easier
to experiment.
Maarten Maathuis [Sun, 22 Jun 2008 17:31:55 +0000 (19:31 +0200)]
nouveau: disable KMS for pre-NV50 even when specifically enabled
Maarten Maathuis [Sun, 22 Jun 2008 17:04:22 +0000 (19:04 +0200)]
NV50: Fix a few more possible leaks.
Maarten Maathuis [Sun, 22 Jun 2008 16:58:04 +0000 (18:58 +0200)]
fix typo
Maarten Maathuis [Sun, 22 Jun 2008 16:47:51 +0000 (18:47 +0200)]
NV50: A few minor added safeties + cleanup.
Maarten Maathuis [Sun, 22 Jun 2008 15:01:30 +0000 (17:01 +0200)]
Undo something i didn't want to change.
- I made it consistent with recent kernel fb code (maybe this is older bugged code?)
- Still i don't use this and i should leave it to others.
Maarten Maathuis [Sun, 22 Jun 2008 14:29:00 +0000 (16:29 +0200)]
NV50: Initial import of kernel modesetting.
Keith Packard [Sat, 21 Jun 2008 07:33:07 +0000 (00:33 -0700)]
[intel] Use IMR instead of IER to pend interrupts during ISR
Noting that the interrupt mask register was more reliable than the interrupt
enable register for managing interrupts in user_irq_on/user_irq_off, this
patch replaces the remaining IER frobbing with IMR instead.
The test which exposes IER related failures is:
$ glxgears & glxgears & glxgears
(reposition the glxgears windows away from the upper left corner)
$ while :; do x11perf -rect100 -reps 800 -repeat 1; sleep 1; done &
$ while :; do runoa; runet; done &
Keith Packard [Sat, 21 Jun 2008 07:13:18 +0000 (00:13 -0700)]
[intel-gem] Add /proc/dri/*/i915_gem_interrupt
This tracks most of the interrupt-related status, including the
interrupt registers in the chip and the sequence number variables.
Keith Packard [Sat, 21 Jun 2008 07:12:21 +0000 (00:12 -0700)]
[intel] Count received interrupts
Another patch adds this to a /proc/dri file for debugging and monitoring.
Keith Packard [Sat, 21 Jun 2008 07:10:10 +0000 (00:10 -0700)]
[intel-gem] Remove unused variable.
Keith Packard [Sat, 21 Jun 2008 04:10:42 +0000 (21:10 -0700)]
[intel-gem] Use polling in i915_gem_idle instead of interrupts.
While waiting for the hardware to idle on leavevt or lastclose, poll
for the sync sequence number instead of waiting for an interrupt. This
allows the code to bail if the hardware hangs for some reason. Also, this
avoids issues with signals as the exisiting wait function is interruptible.
Keith Packard [Sat, 21 Jun 2008 04:07:46 +0000 (21:07 -0700)]
[intel-gem] Add intel-specific /proc entries to help monitor gem operation
This adds gem_active, gem_flushing, gem_inactive, gem_request and gem_seqno
entries to monitor gem operation and help debug issues.
Keith Packard [Fri, 20 Jun 2008 23:40:14 +0000 (16:40 -0700)]
Add device-specific proc_init and proc_cleanup hooks
This allows device drivers to add proc files
Keith Packard [Fri, 20 Jun 2008 07:21:37 +0000 (00:21 -0700)]
[intel-gem] Use shmem_getpage instead of find_or_create_page
find_or_create_page doesn't quite set up pages correctly; any newly created
pages aren't hooked into the shmem object quite right; user space mmaps of
those pages end up mapping pages full of zeros which then get written to the
real pages inappropriately. This patch requires that the kernel export
shmem_getpage.
Keith Packard [Fri, 20 Jun 2008 07:19:42 +0000 (00:19 -0700)]
[intel-gem] Add DRM_IOCTL_I915_GEM_SW_FINISH to flag CPU writes
When a software fallback has completed, usermode must notify the kernel so
that any scanout buffers can be synchronized. This ioctl should be called
whenever a fallback completes to flush CPU and chipset caches.
Jesse Barnes [Wed, 18 Jun 2008 23:49:51 +0000 (16:49 -0700)]
i915: add blanking support to intelfb
Got tired of not having my LCD actually turn off when I left the machine at the
console.
Jesse Barnes [Wed, 18 Jun 2008 22:31:48 +0000 (15:31 -0700)]
i915: cleanup PCI state before disabling MSI
Core MSI code will BUG() if an interrupt handler is still registered when
pci_disable_msi() is called.
Jesse Barnes [Wed, 18 Jun 2008 22:25:54 +0000 (15:25 -0700)]
Merge commit 'origin/drm-gem' into modesetting-gem
Lots of conflicts, seems to load ok, but I'm sure some bugs snuck in.
Conflicts:
linux-core/drmP.h
linux-core/drm_lock.c
linux-core/i915_gem.c
shared-core/drm.h
shared-core/i915_dma.c
shared-core/i915_drv.h
shared-core/i915_irq.c
Jesse Barnes [Wed, 18 Jun 2008 21:51:46 +0000 (14:51 -0700)]
i915: use WC mapping for framebuffer screen_base
Jesse Barnes [Wed, 18 Jun 2008 21:01:47 +0000 (14:01 -0700)]
Merge branch 'modesetting-101' into modesetting-gem
Jesse Barnes [Wed, 18 Jun 2008 20:57:39 +0000 (13:57 -0700)]
i915: switch back to fbcon on panic
Normally when X is running, panic messages will be invisible and the machine
will just appear to hard hang. This patch adds support for switching back to
the fbcon framebuffer on panic (through the use of a panic notifier
registration) so we can see what happened.
Note that in order to be really useful, X will have to run its VT in something
other than KD_GRAPHICS mode. Also, not all kernel errors result in panics,
some go through BUG() which may trigger another type of event, not resulting in
a switch.
Eric Anholt [Mon, 16 Jun 2008 22:15:02 +0000 (15:15 -0700)]
[intel] Quirk away MSI support on 945G/GM.
The PCI caps register reports MSI support even though it isn't really there.
Eric Anholt [Mon, 16 Jun 2008 20:09:31 +0000 (13:09 -0700)]
[linux] Use the device's irq for handler setup instead of stale dev->irq.
This fixes registration when MSI is set up after the stub function fills in
dev->irq. Otherwise /proc/interrupts would report attachment to the fasteoi
interrupt. dev->irq is still exposed (and updated at IRQ setup)
for the drivers that use it for whatever reason.
Keith Packard [Sat, 14 Jun 2008 02:49:47 +0000 (19:49 -0700)]
[intel-gem] Execute MI_FLUSH in leavevt_ioctl
In leavevt_ioctl, queue an MI_FLUSH and then block waiting for it to
complete. This will empty the active and flushing lists. That leaves only
the inactive list to evict.
Keith Packard [Sat, 14 Jun 2008 02:47:23 +0000 (19:47 -0700)]
[intel-gem] inactive list may contain objects in CPU write domain
Pin/unpin need to know whether to remove/add objects from the inactive list,
inactive objects cannot be in any GPU write domain as those would be on the
flushing list instead. However, inactive objects may be in the CPU write
domain.
Keith Packard [Sat, 14 Jun 2008 02:43:40 +0000 (19:43 -0700)]
[intel-gem] BUG_ON active objects in gem_object_unbind
Now that gem_object_unbind waits for rendering to complete, objects should
not be active when they are being pulled from the GTT. BUG_ON if this is
broken.
Keith Packard [Sat, 14 Jun 2008 02:40:16 +0000 (19:40 -0700)]
[intel-gem] Debugging -- verify inactive list invariants
Inactive list elements may not be pinned, active or have non-CPU write
domains.
Keith Packard [Sat, 14 Jun 2008 02:37:44 +0000 (19:37 -0700)]
[intel-gem] whitespace fixes