Thomas Hellstrom [Mon, 28 Apr 2008 10:10:44 +0000 (12:10 +0200)]
Merge branch 'master' into modesetting-101
Conflicts:
linux-core/Makefile.kernel
linux-core/drm_compat.c
linux-core/drm_fops.c
linux-core/drm_lock.c
shared-core/drm.h
shared-core/i915_dma.c
shared-core/i915_drv.h
shared-core/i915_irq.c
Jesse Barnes [Sun, 27 Apr 2008 16:42:17 +0000 (09:42 -0700)]
Use fixed sized types in new ioctls
Make both crtc and the command argument 32 bits to avoid any 32-on-64 compat
issues.
Jesse Barnes [Sun, 27 Apr 2008 00:11:18 +0000 (17:11 -0700)]
Enum-ectomy of vblank modesetting ioctl
Enum can be of pretty much any size since C leaves the choice of size up to the implementation. So avoid using it in new interfaces like the vblank pre- & post-modeset ioctl. Thanks to hch for spotting this.
Kristian Høgsberg [Wed, 23 Apr 2008 16:43:52 +0000 (12:43 -0400)]
Make via compile.
Chase the lock to it's new location.
Kristian Høgsberg [Wed, 23 Apr 2008 16:42:26 +0000 (12:42 -0400)]
Make radeon_ms compile.
Remove lock functions and use pci_map_rom() instead of pci_map_rom_copy().
Thomas Hellstrom [Wed, 23 Apr 2008 15:33:09 +0000 (17:33 +0200)]
Don't disable IRQs, just tasklets, when taking the drm lock spinlock.
Jakob Bornecrantz [Wed, 23 Apr 2008 10:43:30 +0000 (12:43 +0200)]
Fixed unlock check on EAGAIN
Xiang, Haihao [Wed, 23 Apr 2008 09:17:16 +0000 (17:17 +0800)]
i915: fix for compatibility mode
Jesse Barnes [Wed, 23 Apr 2008 01:41:28 +0000 (18:41 -0700)]
i915: allocate devname at init time
Since it'll be freed at unload time, we should alloc devname rather than
pointing to the DRIVER_NAME string.
Hong Liu [Fri, 18 Apr 2008 08:52:04 +0000 (16:52 +0800)]
add sysfs entry for DVO output
forget to add it in the previous DVO porting patch.
Signed-off-by: Hong Liu <hong.liu@intel.com>
Hong Liu [Fri, 18 Apr 2008 08:49:23 +0000 (16:49 +0800)]
clear interrupt status before install irq
On my 865G machine, it seems the CPU will receive interrupt before
irq_postinstall is called. This will cause kernel oops because vblank is not
inited at that time. Clear interrupt status before install seems fixing this
problem.
Signed-off-by: Hong Liu <hong.liu@intel.com>
Hong Liu [Fri, 18 Apr 2008 08:26:41 +0000 (16:26 +0800)]
fix removing output_attrs
fix a typo in removing output sysfs.
Signed-off-by: Hong Liu <hong.liu@intel.com>
Pekka Paalanen [Sun, 20 Apr 2008 17:47:38 +0000 (20:47 +0300)]
linux-core Makefile: add GIT_REVISION
This tries to automatically fetch a git revision string and if succeeds,
it #defines GIT_REVISION string macro. Packagers can override it by
'make GIT_REVISION=foo'.
Update Nouveau to use GIT_REVISION, if defined, instead of DRIVER_DATE
in struct drm_driver.
Signed-off-by: Pekka Paalanen <pq@iki.fi>
Dave Airlie [Tue, 22 Apr 2008 06:08:17 +0000 (16:08 +1000)]
i915: gfx hw and i945gme fixes from upstream
From Jesse and Zhenyu originally.
Keith Packard [Sun, 20 Apr 2008 23:10:05 +0000 (16:10 -0700)]
[I915] Handle tiled buffers in vblank tasklet
The vblank tasklet update code must build 2D blt commands with the
appropriate tiled flags.
Keith Packard [Sun, 20 Apr 2008 08:55:57 +0000 (01:55 -0700)]
On I965, use correct 3DSTATE_DRAWING_RECTANGLE command in vblank
The batchbuffer submission paths were fixed to use the 965-specific command,
but the vblank tasklet was not. When the older version is sent, the 965 will
lock up.
Hong Liu [Thu, 17 Apr 2008 08:51:00 +0000 (16:51 +0800)]
Porting DVO stuff
Ported from Xorg intel 2d driver. Changed interfaces definitions, which needed
to be changed later if other device wants to use these DVO stuff.
Thomas Hellstrom [Mon, 14 Apr 2008 11:52:33 +0000 (13:52 +0200)]
Fix buffer object map wait error.
Add some branch prediction hints.
Thomas Hellstrom [Mon, 14 Apr 2008 10:10:50 +0000 (12:10 +0200)]
Fix buffer object creation validation.
BO lock fixes.
Thomas Hellstrom [Sun, 13 Apr 2008 12:49:14 +0000 (14:49 +0200)]
Unlock the BO mutex while waiting for idle, unmapped, unfenced.
Move unfenced checking into idle checking.
Never time out while waiting for software events like unmapped or unfenced.
Thomas Hellstrom [Fri, 11 Apr 2008 07:36:12 +0000 (09:36 +0200)]
Fix up buffer manager locking.
Keith Packard [Thu, 27 Mar 2008 18:40:04 +0000 (11:40 -0700)]
Save and restore dsparb and d_state regs
Jerome Glisse [Fri, 11 Apr 2008 22:15:47 +0000 (00:15 +0200)]
Merge branch 'modesetting-101' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Jerome Glisse [Fri, 11 Apr 2008 22:15:12 +0000 (00:15 +0200)]
radeon_ms: rework command submission ioctl & cleanup
Jesse Barnes [Fri, 11 Apr 2008 03:31:31 +0000 (20:31 -0700)]
Fixup Intel TV property code
Use the new TV property creation routine and fixup the set_property code
to actually do a mode set call when properties change.
Jesse Barnes [Fri, 11 Apr 2008 03:30:12 +0000 (20:30 -0700)]
Split TV property creation into its own routine
It needs to take arguments from the caller about supported TV formats,
so declare it in drm_crtc.h and export it.
Jesse Barnes [Fri, 11 Apr 2008 02:02:53 +0000 (19:02 -0700)]
Remove structure fields & code
Cleanup some random cruft left over from the initial port.
Jesse Barnes [Thu, 10 Apr 2008 18:27:39 +0000 (11:27 -0700)]
Fix masking in get_load_detect_pipe
Start i at -1 so that the masking works right.
Jesse Barnes [Thu, 10 Apr 2008 18:23:55 +0000 (11:23 -0700)]
Keep display info in struct display_info
Some fields had snuck into the drm_output structure. Put them back and
fill in more stuff from the EDID block.
Jesse Barnes [Wed, 9 Apr 2008 21:12:56 +0000 (14:12 -0700)]
Add TV out hotplug detection
Doesn't yet work on my i915 test machine, but most of the necessary bits
should be there.
Jesse Barnes [Wed, 9 Apr 2008 21:09:29 +0000 (14:09 -0700)]
Fix TV load detection
Now that we can allocate load detect pipes, we can perform TV out load
detection correctly. Call the new routines and enable proper TV
detection.
Jesse Barnes [Wed, 9 Apr 2008 21:07:55 +0000 (14:07 -0700)]
Port pipe reservation code for load detection
TV out needs to do load detection, which means we have to find an
available pipe to use for the detection. Port over the pipe reservation
code for this purpose.
Jesse Barnes [Wed, 9 Apr 2008 21:06:36 +0000 (14:06 -0700)]
Add newline to debug output for output add
Alan Hourihane [Wed, 9 Apr 2008 21:07:40 +0000 (22:07 +0100)]
Older kernels don't have kobject_uevent_env(), so punt
the event for these older kernels.
Jesse Barnes [Wed, 9 Apr 2008 18:30:15 +0000 (11:30 -0700)]
Fixup sysfs output registration
Put off registering new outputs with sysfs until they're properly configured,
or we may get duplicates if the type hasn't been set yet (as is the case with
SDVO initialization). This also means moving de-registration into the cleanup
function instead of output destroy, since the latter occurs during the normal
course of setup when an output isn't found (and therefore not registered with
sysfs yet.
Jesse Barnes [Tue, 8 Apr 2008 19:48:41 +0000 (12:48 -0700)]
Merge branch 'modesetting-101' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Jesse Barnes [Tue, 8 Apr 2008 19:44:52 +0000 (12:44 -0700)]
Add devname in modeset case
If the driver is 'modeset' enabled, it'll register it's interrupt
handler at load time. Set the devname in this case so that
/proc/interrupts makes sense.
Jesse Barnes [Tue, 8 Apr 2008 19:42:23 +0000 (12:42 -0700)]
Improved DRM sysfs support
This patch ties outputs, output properties and hotplug events into the
DRM core. Each output has a corresponding directory under the primary
DRM device (usually card0) containing dpms, edid, modes, and connection
status files.
New hotplug change events occur when outputs are added or hotplug events
are detected.
Jerome Glisse [Tue, 8 Apr 2008 00:18:14 +0000 (02:18 +0200)]
radeon_ms: command buffer validation use array of function pointer
Patrice Mandin [Mon, 7 Apr 2008 20:24:24 +0000 (22:24 +0200)]
Missing KERNEL_VERSION macro
Jerome Glisse [Mon, 7 Apr 2008 18:49:36 +0000 (20:49 +0200)]
radeon_ms: another fb fix reset mode if fb changed
Hasso Tepper [Mon, 7 Apr 2008 12:27:43 +0000 (15:27 +0300)]
Add DragonFly BSD support for device creation
DragonFly behaves just like FreeBSD in this regard.
Ben Skeggs [Mon, 7 Apr 2008 03:29:11 +0000 (13:29 +1000)]
nouveau: enable accelerated move to sysmem
Ben Skeggs [Mon, 7 Apr 2008 03:05:51 +0000 (13:05 +1000)]
nouveau: enable m2mf for tt<->vram moves, fix fence_poll
Jerome Glisse [Sun, 6 Apr 2008 17:23:20 +0000 (19:23 +0200)]
radeon_ms: fix framebuffer code
Jerome Glisse [Sun, 6 Apr 2008 17:01:31 +0000 (19:01 +0200)]
radeon_ms: check for NULL fb
Thomas Hellstrom [Sun, 6 Apr 2008 09:21:22 +0000 (11:21 +0200)]
Place highmem pages last in the ttm page array.
Thomas Hellstrom [Sun, 6 Apr 2008 08:32:02 +0000 (10:32 +0200)]
Use clflush() when available for cache flushing.
Thomas Hellstrom [Sun, 6 Apr 2008 07:46:29 +0000 (09:46 +0200)]
[I915] Fix VRAM eviction.
Thomas Hellstrom [Sun, 6 Apr 2008 07:33:50 +0000 (09:33 +0200)]
Fix emergency allocation accounting.
Maarten Maathuis [Sat, 5 Apr 2008 19:02:00 +0000 (21:02 +0200)]
nv50: primitive i2c interrupt handler
Jerome Glisse [Thu, 3 Apr 2008 01:15:47 +0000 (03:15 +0200)]
radeon_ms: add crtc set base callback & fix palette
Jerome Glisse [Thu, 3 Apr 2008 01:14:52 +0000 (03:14 +0200)]
radeon_ms: fixes fb handling
Maarten Maathuis [Wed, 2 Apr 2008 23:13:31 +0000 (01:13 +0200)]
nv50: primitive display interrupt handler.
Jerome Glisse [Mon, 31 Mar 2008 19:50:02 +0000 (21:50 +0200)]
radeon_ms: small fix & cleanup to command checking
Dave Airlie [Mon, 31 Mar 2008 01:34:48 +0000 (11:34 +1000)]
nouveau: fix return from function..
dude kernel moduless use kernel errors :)
this fixes an oops on init when this codepath hits.
Jerome Glisse [Sun, 30 Mar 2008 22:55:05 +0000 (00:55 +0200)]
radeon_ms: initial pass at command buffer validation
Thomas Hellstrom [Sun, 30 Mar 2008 19:30:43 +0000 (21:30 +0200)]
Initialize the fence::error member.
Thomas Hellstrom [Sun, 30 Mar 2008 13:14:45 +0000 (15:14 +0200)]
[i915] Report buffer state _after_ fence submission to user-space.
This fixes a problem where the wrong bo->fence_type was reported, and
also saves some memory space.
[bo core] export the drm_bo_fill_rep_arg function.
Thomas Hellström [Thu, 6 Mar 2008 16:35:56 +0000 (17:35 +0100)]
Don't call fence::poll during irq if there are no waiters.
Maarten Maathuis [Sun, 30 Mar 2008 12:50:41 +0000 (14:50 +0200)]
nouveau: forgot to add a break
Maarten Maathuis [Sun, 30 Mar 2008 12:46:45 +0000 (14:46 +0200)]
nouveau: Add ctx values for nv86.
- Note that this may not work for all nv86.
Jerome Glisse [Sun, 30 Mar 2008 10:45:57 +0000 (12:45 +0200)]
radeon_ms: add hang debuging helper functions
Dave Airlie [Sat, 29 Mar 2008 21:33:39 +0000 (07:33 +1000)]
drm/r300: fix wait interface mixup
This interface was defined completely wrong, however userspace has only
ever used 4 values from it (0x1, 0x2, 0x3 and 0x6), so fix the interface to do what userspace actually expected but define new defines for new users to use
it properly.
Oliver McFadden [Sat, 29 Mar 2008 17:25:44 +0000 (17:25 +0000)]
r300: Correctly translate the value for the R300_CMD_WAIT command.
Previously, the R300_CMD_WAIT command would write the passed directly to the
hardware. However this is incorrect because the R300_WAIT_* values used are
internal interface values that do not map directly to the hardware.
The new function I have added translates the R300_WAIT_* values into appropriate
values for the hardware before writing the register.
Thanks to John Bridgman for pointing this out. :-)
Jerome Glisse [Thu, 27 Mar 2008 19:08:37 +0000 (20:08 +0100)]
radeon_ms: this is a modesetting driver, bring things up to date
Dave Airlie [Thu, 27 Mar 2008 05:55:49 +0000 (15:55 +1000)]
drm: remove authentication on master exit.
using contexts for this is bad for multiple masters
Stuart Bennett [Tue, 25 Mar 2008 18:30:05 +0000 (18:30 +0000)]
nouveau: nv20 bios does not initialise PTIMER
The wait functions depend on PTIMER, so write the old (incorrect, but working) values for uninitialised hw
Dave Airlie [Mon, 24 Mar 2008 08:52:26 +0000 (18:52 +1000)]
i915: fix oops on agp=off
Kernel bug 10289.
Dave Airlie [Mon, 24 Mar 2008 08:47:50 +0000 (18:47 +1000)]
Merge branch 'r500-fp'
Ben Skeggs [Sun, 23 Mar 2008 16:22:42 +0000 (03:22 +1100)]
nouveau: silence warning
Ben Skeggs [Sun, 23 Mar 2008 16:20:59 +0000 (03:20 +1100)]
nv40: voodoo - not quite.
Ben Skeggs [Sun, 23 Mar 2008 16:13:05 +0000 (03:13 +1100)]
nv40: allocate massive amount of PRAMIN for grctx on all chipsets.
More or less a workaround for issues on some chipsets where a context
switch results in critical data in PRAMIN being overwritten by the GPU.
The correct fix is known, but may take some time before it's a feasible
option.
Dave Airlie [Fri, 21 Mar 2008 06:59:52 +0000 (16:59 +1000)]
r500: fragment program upload is also used to upload constants.
Limit frag address to 8 bits
Jerome Glisse [Thu, 20 Mar 2008 16:44:32 +0000 (17:44 +0100)]
Merge branch 'modesetting-101' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Jerome Glisse [Thu, 20 Mar 2008 16:43:43 +0000 (17:43 +0100)]
radeon_ms: fix fence
Dave Airlie [Thu, 20 Mar 2008 04:20:53 +0000 (14:20 +1000)]
drm: fixup r500fp submission
Stuart Bennett [Tue, 18 Mar 2008 23:12:28 +0000 (23:12 +0000)]
nouveau: do not set on-board timer's numerator/denominator to bad values
Alex Deucher [Wed, 19 Mar 2008 19:37:56 +0000 (15:37 -0400)]
RADEON: switch over to new production microcode
This needs to be tested thoroughly before pushing to the
kernel.
Alex Deucher [Wed, 19 Mar 2008 18:57:42 +0000 (14:57 -0400)]
RADEON: production microcode for all radeons, r1xx-r6xx
This updated microcode is not in use yet.
Dave Airlie [Wed, 19 Mar 2008 06:10:37 +0000 (16:10 +1000)]
move some more r300 regs into not allowed on r500
Dave Airlie [Mon, 17 Mar 2008 23:07:45 +0000 (09:07 +1000)]
drm: add new rs690 pci id
Thomas Hellstrom [Mon, 17 Mar 2008 10:37:10 +0000 (11:37 +0100)]
Evict cached_mapped relocatee before applying reloc.
Fix that got left out after the intel-post-reloc merge.
Dave Airlie [Mon, 17 Mar 2008 06:37:46 +0000 (16:37 +1000)]
drm: add master set/drop protocol
this may not survive long - just need something for testing
Dave Airlie [Mon, 17 Mar 2008 06:34:15 +0000 (16:34 +1000)]
i915: safety check the sarea map still exists
Dave Airlie [Mon, 17 Mar 2008 06:33:15 +0000 (16:33 +1000)]
drm: pick correct master for cleaning up
When a master is exiting, make sure we clean it up and not the currently
in charge master.
Dave Airlie [Mon, 17 Mar 2008 06:32:27 +0000 (16:32 +1000)]
drm: select the correct master to attempt to remove the lock from.
When destroying DRI sarea, make sure you use the master associated with the
sarea and not the one currently in charge
Dave Airlie [Mon, 17 Mar 2008 01:08:03 +0000 (11:08 +1000)]
initial r500 RS and FP register and upload code
Dave Airlie [Sun, 16 Mar 2008 21:05:46 +0000 (07:05 +1000)]
drm/pcigart: fix the pci gart to use the drm_pci wrapper.
This is the correct fix for the RS690 and hopefully the dma coherent work.
For now we limit everybody to a 32-bit DMA mask but it is possible for
RS690 to use a 40-bit DMA mask for the GART table itself,
and the PCIE cards can use 40-bits for the table entries.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Thomas Hellstrom [Sun, 16 Mar 2008 19:07:14 +0000 (20:07 +0100)]
Avoid unnecessary waits for command regulator pause.
Thomas Hellstrom [Sun, 16 Mar 2008 10:44:35 +0000 (11:44 +0100)]
[via] Remove some leftover vars.
Thomas Hellstrom [Sun, 16 Mar 2008 10:39:18 +0000 (11:39 +0100)]
[via] Allow a little larger stride for SG DMA DownloadFromScreen.
Thomas Hellstrom [Sun, 16 Mar 2008 10:37:17 +0000 (11:37 +0100)]
[via] The millionth fixup for the millionth-1 attempt to stabilize the AGP
DMA command submission. It's worth remembering that all new bright ideas on how
to make this command reader work properly and according to docs
will probably fail :( Bring in some old code.
Thomas Hellstrom [Sun, 16 Mar 2008 10:29:57 +0000 (11:29 +0100)]
[via] Fix driver after vblank-rework merge.
Dave Airlie [Sun, 16 Mar 2008 05:01:27 +0000 (15:01 +1000)]
ati: fix rs690 igp gart by allocating the page table in 32-bit memory
Dave Airlie [Sun, 16 Mar 2008 04:00:16 +0000 (14:00 +1000)]
drm/rs690: set AGP_BASE_2 to 0
Dave Airlie [Sun, 16 Mar 2008 02:58:07 +0000 (12:58 +1000)]
drm: set rs690 gart base completly.
The docs state bits 4-11 represent bits 32-39 of a 40-bit address
Dave Airlie [Sun, 16 Mar 2008 02:56:11 +0000 (12:56 +1000)]
drm: this u32 should be a dma_addr_t
doesn't fix anything but just making it consistent
Alan Hourihane [Fri, 14 Mar 2008 00:25:42 +0000 (00:25 +0000)]
fix build problems
Mike Isely [Thu, 13 Mar 2008 23:53:05 +0000 (09:53 +1000)]
drm: Fix race that can lockup the kernel
The i915_vblank_swap() function schedules an automatic buffer swap
upon receipt of the vertical sync interrupt. Such an operation is
lengthy so it can't be allowed to happen in normal interrupt context,
thus the DRM implements this by scheduling the work in a kernel
softirq-scheduled tasklet. In order for the buffer swap to work
safely, the DRM's central lock must be taken, via a call to
drm_lock_take() located in drivers/char/drm/drm_irq.c within the
function drm_locked_tasklet_func(). The lock-taking logic uses a
non-interrupt-blocking spinlock to implement the manipulations needed
to take the lock. This semantic would be safe if all attempts to use
the spinlock only happen from process context. However this buffer
swap happens from softirq context which is really a form of interrupt
context. Thus we have an unsafe situation, in that
drm_locked_tasklet_func() can block on a spinlock already taken by a
thread in process context which will never get scheduled again because
of the blocked softirq tasklet. This wedges the kernel hard.
To trigger this bug, run a dual-head cloned mode configuration which
uses the i915 drm, then execute an opengl application which
synchronizes buffer swaps against the vertical sync interrupt. In my
testing, a lockup always results after running anywhere from 5 minutes
to an hour and a half. I believe dual-head is needed to really
trigger the problem because then the vertical sync interrupt handling
is no longer predictable (due to being interrupt-sourced from two
different heads running at different speeds). This raises the
probability of the tasklet trying to run while the userspace DRI is
doing things to the GPU (and manipulating the DRM lock).
The fix is to change the relevant spinlock semantics to be the
interrupt-blocking form. After this change I am no longer able to
trigger the lockup; the longest test run so far was 20 hours (test
stopped after that point).
Note: I have examined the places where this spinlock is being
employed; all are reasonably short bounded sequences and should be
suitable for interrupts being blocked without impacting overall kernel
interrupt response latency.
Signed-off-by: Mike Isely <isely@pobox.com>