platform/upstream/libdrm.git
15 years agoMerge commit 'origin/master' into drm-gem
Eric Anholt [Mon, 28 Jul 2008 22:17:21 +0000 (15:17 -0700)]
Merge commit 'origin/master' into drm-gem

Conflicts:

linux-core/Makefile.kernel
shared-core/i915_dma.c
shared-core/i915_drv.h
shared-core/i915_irq.c

15 years agointel-gem: Another checkpatch.pl pass.
Eric Anholt [Mon, 28 Jul 2008 18:45:22 +0000 (11:45 -0700)]
intel-gem: Another checkpatch.pl pass.

15 years agointel-gem: Fix regression tests.
Eric Anholt [Mon, 28 Jul 2008 18:24:00 +0000 (11:24 -0700)]
intel-gem: Fix regression tests.

Main fix is an oops that was triggered by the gtt pwrite path when we don't
have the gtt initialized.  Also, settle on -EBADF for "bad object handle",
and -EINVAL for "reading/writing beyond object boundary".

15 years agointel-gem: Speed up tiled readpixels by tracking which pages have been flushed.
Eric Anholt [Sun, 27 Jul 2008 02:28:14 +0000 (19:28 -0700)]
intel-gem: Speed up tiled readpixels by tracking which pages have been flushed.

This is around 3x or so speedup, since we would read wide rows at a time, and
clflush each tile 8 times as a result.  We'll want code related to this anyway
when we do fault-based per-page clflushing for sw fallbacks.

15 years agointel-gem: Move debug-only functions to a separate file.
Eric Anholt [Sun, 27 Jul 2008 02:51:58 +0000 (19:51 -0700)]
intel-gem: Move debug-only functions to a separate file.

15 years agoradeon: Add suspend/resume hooks for saving/clearing/restoring interrupts.
Stefan Becker [Sat, 26 Jul 2008 14:49:14 +0000 (16:49 +0200)]
radeon: Add suspend/resume hooks for saving/clearing/restoring interrupts.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16799 .

15 years agor300_cmdbuf: Always emit INDX_BUFFER immediately after DRAW_INDEX
Nicolai Haehnle [Sat, 26 Jul 2008 09:39:10 +0000 (11:39 +0200)]
r300_cmdbuf: Always emit INDX_BUFFER immediately after DRAW_INDEX

DRAW_INDEX writes a vertex count to VAP_VF_CNTL. Docs say that behaviour
is undefined (i.e. lockups happen) when this write is not followed by the
right number of vertex indices.

Thus we used to do the wrong thing when drawing across many cliprects was
necessary, because we emitted a sequence
 DRAW_INDEX, DRAW_INDEX, INDX_BUFFER, INDX_BUFFER
instead of
 DRAW_INDEX, INDX_BUFFER, DRAW_INDEX, INDX_BUFFER
The latter is what we're doing now and which ought to be correct.

15 years ago[FreeBSD] Duh, we need to actually define the drm_modeset_ctl...
Robert Noland [Fri, 25 Jul 2008 17:46:28 +0000 (13:46 -0400)]
[FreeBSD] Duh, we need to actually define the drm_modeset_ctl...

15 years agodrm: don't set the signal blocker on the master process.
Dave Airlie [Fri, 25 Jul 2008 03:30:08 +0000 (13:30 +1000)]
drm: don't set the signal blocker on the master process.

this lets us debug the X server through xkb startup.

Not sure what the correct answer is, probably X needs to drop
the lock when execing stuff, with input hotplug it can get
xkb stuff at any time I believe.

15 years ago[FreeBSD] Catch up to linux on vblank-rework
Robert Noland [Thu, 24 Jul 2008 04:21:00 +0000 (00:21 -0400)]
[FreeBSD] Catch up to linux on vblank-rework

15 years agoi915: Move all of the irq install/uninstall to load time.
Robert Noland [Wed, 23 Jul 2008 23:55:06 +0000 (19:55 -0400)]
i915: Move all of the irq install/uninstall to load time.

This resolves a panic on FreeBSD which was caused by trying
to re-initialize the swap lock.  It's just much easier to
initialize all of the locks at load time.  It should also
ensure that the vblank structures are available earlier.

15 years agointel-gem: Fix pread math and logic errors.
Eric Anholt [Wed, 23 Jul 2008 18:49:25 +0000 (11:49 -0700)]
intel-gem: Fix pread math and logic errors.

Fixes an oops in fbotexture from walking off the end of the page list.

15 years agointel-gem: Add a quick hack to reduce clflushing on pread.
Eric Anholt [Wed, 23 Jul 2008 17:07:16 +0000 (10:07 -0700)]
intel-gem: Add a quick hack to reduce clflushing on pread.

This increases overhead for the large-readpixels case due to the repeated
page cache accessing, but greatly reduces overhead for the small-readpixels
case.

15 years agointel-gem: Don't do the GTT-pwrite shortcut on tiled buffers.
Eric Anholt [Wed, 23 Jul 2008 15:36:54 +0000 (08:36 -0700)]
intel-gem: Don't do the GTT-pwrite shortcut on tiled buffers.

These will be covered by the fence, while pread/pwrite are supposed to be
CPU-perspective writes, with manual detiling done by the client.

15 years agointel-gem: Move /proc debugging to a separate file.
Eric Anholt [Mon, 21 Jul 2008 21:33:55 +0000 (14:33 -0700)]
intel-gem: Move /proc debugging to a separate file.

15 years agoradeon: fix typo with a better typo
Dave Airlie [Tue, 22 Jul 2008 08:47:27 +0000 (18:47 +1000)]
radeon: fix typo with a better typo

15 years agoradeon: fix type DST vs Z cache flush
Dave Airlie [Tue, 22 Jul 2008 08:10:03 +0000 (18:10 +1000)]
radeon: fix type DST vs Z cache flush

15 years ago[FreeBSD] Improve upper_32_bits define.
Robert Noland [Mon, 21 Jul 2008 22:04:02 +0000 (18:04 -0400)]
[FreeBSD] Improve upper_32_bits define.

Thanks to airlied.

15 years agointel-gem: Remove recently added pci_read_base prototype.
Eric Anholt [Mon, 21 Jul 2008 21:21:16 +0000 (14:21 -0700)]
intel-gem: Remove recently added pci_read_base prototype.

This is in pci.h in the fixed patch to the kernel.

15 years agointel-gem: Set up HWS when it needs a vaddr during GEM init.
Eric Anholt [Tue, 1 Jul 2008 19:31:37 +0000 (12:31 -0700)]
intel-gem: Set up HWS when it needs a vaddr during GEM init.

This requires an updated 2D driver to not try to set it up as well.

15 years agoRemove accidental leftover tests.
Michel Dänzer [Mon, 21 Jul 2008 11:43:12 +0000 (13:43 +0200)]
Remove accidental leftover tests.

Thanks to Nicolai Haehnle for pointing this out on IRC.

15 years agoReinstate dev->vblank_enabled[].
Michel Dänzer [Mon, 21 Jul 2008 09:48:04 +0000 (11:48 +0200)]
Reinstate dev->vblank_enabled[].

I incorrectly thought it was obsolete.

15 years agoDrop workaround for driver vblank counter going backwards.
Michel Dänzer [Mon, 21 Jul 2008 06:16:59 +0000 (08:16 +0200)]
Drop workaround for driver vblank counter going backwards.

The driver code that caused this is no longer necessary and has been dropped.

15 years agoradeon: Post-vblank-rework-rework cleanups.
Michel Dänzer [Mon, 21 Jul 2008 06:16:59 +0000 (08:16 +0200)]
radeon: Post-vblank-rework-rework cleanups.

Thanks to the reworked vblank-rework, we can just use the hardware frame
counter directly, and make the RADEON_PARAM_VBLANK_CRTC getparam just return
what was set by the corresponding setparam.

15 years agovblank-rework rework cleanups.
Michel Dänzer [Mon, 21 Jul 2008 06:16:55 +0000 (08:16 +0200)]
vblank-rework rework cleanups.

Remove some dead/obsolete code and make drm_update_vblank_count() static.

15 years agoRemove obsolete dev->vblank_suspend[crtc] tests.
Michel Dänzer [Mon, 21 Jul 2008 06:13:45 +0000 (08:13 +0200)]
Remove obsolete dev->vblank_suspend[crtc] tests.

Caused drm_update_vblank_count() not to do its thing when called from
drm_modeset_ctl() -> drm_vblank_get().

The vblank functionality no longer needs to be suspended during a modeset, so
rename the field to vblank_inmodeset.

15 years agoi915: convert to using drm_vblank_get/put around vblank counter usage
Jesse Barnes [Sat, 19 Jul 2008 17:18:02 +0000 (13:18 -0400)]
i915: convert to using drm_vblank_get/put around vblank counter usage

All interrupt off vblank count updates are done in drm_vblank_get/put
now, so convert users of the vblank counter over to that interface.

15 years agoUpdate vblank code to new API
Jesse Barnes [Sat, 19 Jul 2008 17:15:23 +0000 (13:15 -0400)]
Update vblank code to new API

In my last push I forgot to convert users of drm_update_vblank_count
over to drm_vblank_get/put, since that's where any interrupt off->on
update accounting is done now.  Since the modeset ioctl did something
similar (an open coded update of the counter) convert it over to using
get/put too, which saves us from having to deal with every combination
of interrupt off & on between calls.

15 years agodrm-gem: Fix build
Ian Romanick [Fri, 18 Jul 2008 19:42:43 +0000 (12:42 -0700)]
drm-gem: Fix build

On some distros missing prototypes cause kernel builds to fail.  These
are hack to make the code build.

15 years agointel-gem: Leave 8xx tiling on until we find any issues.
Eric Anholt [Thu, 17 Jul 2008 23:56:42 +0000 (16:56 -0700)]
intel-gem: Leave 8xx tiling on until we find any issues.

15 years agoradeon: remove microcode version
Dave Airlie [Fri, 18 Jul 2008 04:30:57 +0000 (14:30 +1000)]
radeon: remove microcode version

15 years agodrm/radeon: fixup 0 vs NULL
Dave Airlie [Thu, 19 Jun 2008 01:38:43 +0000 (11:38 +1000)]
drm/radeon: fixup 0 vs NULL

15 years ago[FreeBSD] drm_irq.c updates for vblank fixes.
Robert Noland [Thu, 17 Jul 2008 18:01:04 +0000 (14:01 -0400)]
[FreeBSD] drm_irq.c updates for vblank fixes.

15 years agoi915: remove old broken vblank code
Jesse Barnes [Thu, 17 Jul 2008 17:51:24 +0000 (13:51 -0400)]
i915: remove old broken vblank code

Remove the unused (and broken) "in vblank" code now that the core has
been fixed to use a counter while interrupts are enabled.  Also make the
vblank pipe get/set ioctls into dumb stub functions, since with the new
code we can no longer let userspace control whether vblank interrupts
are enabled, or the core code will misbehave.

15 years agoAvoid incorrect vblank wakeups
Jesse Barnes [Thu, 17 Jul 2008 17:48:14 +0000 (13:48 -0400)]
Avoid incorrect vblank wakeups

The current code uses the hw vblank counter exclusively, which can lead
to wakeups during the active period rather than during the vblank period
if the hw counter counts displayed frames rather than vblank periods.

This change coverts the code over to using the counter while interrupts
are enabled, fixing that issue.  It also includes a couple of related
changes:  one to not enable the new enable/disable behavior until the
modeset ioctl is called (to preserve old client behavior) and another to
account for lost events due to mode setting with the new counter scheme.

BSD will require similar changes to its drm_irq.c code, but they should
be straightforward.

15 years agoFreeBSD: Fix radeon build
Robert Noland [Thu, 17 Jul 2008 03:39:25 +0000 (23:39 -0400)]
FreeBSD: Fix radeon build

15 years agoBSD: change drm_locked_task*() to use the same scheme as linux.
Owain Gordon Ainsworth [Mon, 7 Jul 2008 16:23:48 +0000 (17:23 +0100)]
BSD: change drm_locked_task*() to use the same scheme as linux.

The current code can sleep in an interrupt handler, that is bad. So
instead if we can't grab the lock, flag it and run the tasklet on
unlock.

Signed-off-by: Robert Noland <rnoland@2hip.net>
15 years ago[FreeBSD] We aren't allowed to hold locks over bus_dma_tag_create or bus_dmamem_alloc.
Robert Noland [Mon, 9 Jun 2008 12:54:53 +0000 (08:54 -0400)]
[FreeBSD] We aren't allowed to hold locks over bus_dma_tag_create or bus_dmamem_alloc.

15 years agoThis is a modified version of Hong's patch from last month, with a few
Hong Liu [Tue, 15 Jul 2008 17:14:17 +0000 (10:14 -0700)]
This is a modified version of Hong's patch from last month, with a few
modifications to make it work correctly on my test hardware (altered the
backlight write function, made it enable the legacy backlight controller
interrupts on mobile hardware, sorted the interrupt function so we don't
get an excessive number of vblank interrupts). This lets the backlight
keys on my T61 work properly, though there's a 750msec or so delay
between the request and the brightness actually changing - this sounds
awfully like the hardware spinning waiting for a status flag to become
ready, but as far as I can tell they're all set correctly. If anyone can
figure out what's wrong here, it'd be nice to know.

Some of the functions are still stubs and just tell the hardware that
the request was successful. These can be filled in as kernel modesetting
gets integrated. I think it's worth getting this in anyway, since it's
required for backlight control to work properly on some new platforms.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
15 years agodrm: fix missing symbol export
Dave Airlie [Tue, 15 Jul 2008 10:27:14 +0000 (20:27 +1000)]
drm: fix missing symbol export

15 years agodrm: add fix for PAT on radeon with 2.6.26
Dave Airlie [Tue, 15 Jul 2008 06:18:22 +0000 (16:18 +1000)]
drm: add fix for PAT on radeon with 2.6.26

15 years agodrm/pcigart: fix warning
Dave Airlie [Tue, 15 Jul 2008 06:18:04 +0000 (16:18 +1000)]
drm/pcigart: fix warning

15 years agointel-gem: Disable tiling if we get junk from the MCHBAR read.
Eric Anholt [Mon, 14 Jul 2008 16:16:45 +0000 (09:16 -0700)]
intel-gem: Disable tiling if we get junk from the MCHBAR read.

One of our systems has been returning 0xffffffff from all MCHBAR reads, which
means we'll need to figure out why, or add an alternate detection method.

15 years agointel-gem: Add two new ioctls for managing tiling on objects.
Eric Anholt [Fri, 11 Jul 2008 21:47:33 +0000 (14:47 -0700)]
intel-gem: Add two new ioctls for managing tiling on objects.

Various chips have exciting interactions between the CPU and the GPU's
different ways of accessing interleaved memory, so we need some kernel
assistance in determining how it works.

Only fully tested on GM965 so far.

15 years agoxgi: use true/false instead of TRUE/FALSE
martin capitanio [Tue, 8 Jul 2008 07:58:10 +0000 (17:58 +1000)]
xgi: use true/false instead of TRUE/FALSE

15 years agonouveau: interface changes for nv5x 3d
Ben Skeggs [Tue, 24 Jun 2008 18:39:32 +0000 (04:39 +1000)]
nouveau: interface changes for nv5x 3d

15 years ago[intel-gem] typo fix in DRM_ERROR
Eric Anholt [Thu, 26 Jun 2008 16:35:14 +0000 (09:35 -0700)]
[intel-gem] typo fix in DRM_ERROR

15 years agoi915: official name for GM45 chipset
Zhenyu Wang [Wed, 2 Jul 2008 16:49:19 +0000 (00:49 +0800)]
i915: official name for GM45 chipset

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
15 years agoi915: only use tiled blits on 965+
Jesse Barnes [Tue, 1 Jul 2008 23:10:01 +0000 (16:10 -0700)]
i915: only use tiled blits on 965+

When scheduled swaps occur, we need to blit between front & back buffers.  I
the buffers are tiled, we need to set the appropriate XY_SRC_COPY tile bit,
only on 965 chips, since it will cause corruption on pre-965 (e.g. 945).

Bug reported by and fix tested by Tomas Janousek <tomi@nomi.cz>.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoRevert "i915: only use tiled blits on 965+"
Jesse Barnes [Tue, 1 Jul 2008 23:09:02 +0000 (16:09 -0700)]
Revert "i915: only use tiled blits on 965+"

This reverts commit 727d4f1d1667e43b3558bd5f6ed6dc2cd9c29401, somehow git
deleted the symlink and replaced it with the file.

15 years agoi915: only use tiled blits on 965+
Jesse Barnes [Tue, 1 Jul 2008 19:25:16 +0000 (12:25 -0700)]
i915: only use tiled blits on 965+

When scheduled swaps occur, we need to blit between front & back buffers.  If
the buffers are tiled, we need to set the appropriate XY_SRC_COPY tile bit, but
only on 965 chips, since it will cause corruption on pre-965 (e.g. 945).

Bug reported by and fix tested by Tomas Janousek <tomi@nomi.cz>.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agoi915: enable bus mastering on i915 at resume time
Jie Luo [Tue, 24 Jun 2008 17:38:31 +0000 (10:38 -0700)]
i915: enable bus mastering on i915 at resume time

On 9xx chips, bus mastering needs to be enabled at resume time for much of the
chip to function.  With this patch, vblank interrupts will work as expected
on resume, along with other chip functions.   Fixes kernel bugzilla #10844.

Signed-off-by: Jie Luo <clotho67@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15 years agonv50: when destroying a channel make sure it's not still current on PFIFO
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().

15 years ago[intel] Get vblank pipe from irq_mask_reg instead of hardware enable reg
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.

15 years ago[intel] Create functions to enable/disable interrupts
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

15 years agoi915: remove unused variable
Jesse Barnes [Tue, 24 Jun 2008 19:57:21 +0000 (12:57 -0700)]
i915: remove unused variable

Leftover dev_priv from the move of the suspend/resume code into shared-core.

15 years agoi915: register definition & header file cleanup
Jesse Barnes [Tue, 24 Jun 2008 19:50:29 +0000 (12:50 -0700)]
i915: register definition & header file cleanup

It would be nice if one day the DRM driver was the canonical source for
register definitions and core macros.  To that end, this patch cleans things up
quite a bit, removing redundant definitions (some with different names
referring to the same register) and generally tidying up the header file.

15 years agoMerge branch 'drm-gem' into drm-gem-965
Keith Packard [Tue, 24 Jun 2008 17:03:05 +0000 (10:03 -0700)]
Merge branch 'drm-gem' into drm-gem-965

15 years ago[intel-gem] Include drm_compat.h to get kmap_atomic_prot_pfn
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

15 years agodrm_compat: it's CONFIG_HIGHMEM, not CONFIG_HIMEM
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.

15 years ago[intel-gem] Use I915_GEM_DOMAIN_GTT in dri_gem_bo_wait_rendering.
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.

15 years ago[intel-gem] Recover resources from wedged hardware.
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...

15 years ago[intel-gem] pwrite through GTT
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.

15 years agoWas using irq_enable_reg in the use_mask_reg path
Keith Packard [Tue, 24 Jun 2008 16:46:51 +0000 (09:46 -0700)]
Was using irq_enable_reg in the use_mask_reg path

15 years ago[intel-gem] Include drm_compat.h to get kmap_atomic_prot_pfn
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

15 years agodrm_compat: it's CONFIG_HIGHMEM, not CONFIG_HIMEM
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.

15 years ago[intel-gem] Use I915_GEM_DOMAIN_GTT in dri_gem_bo_wait_rendering.
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.

15 years ago[intel] leave interrupts disabled in ISR only on MSI again
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.

15 years ago[intel-gem] Recover resources from wedged hardware.
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...

15 years ago[intel] Switch to using IMR instead of IER
Keith Packard [Mon, 23 Jun 2008 17:07:47 +0000 (10:07 -0700)]
[intel] Switch to using IMR instead of IER

15 years ago[intel-gem] pwrite through GTT
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.

15 years ago[intel] allow the irq code to use either enable or mask registers
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.

15 years agonv50: oops, keep VRAM allocations aligned at 64KiB - that's our page size..
Ben Skeggs [Sun, 22 Jun 2008 16:42:15 +0000 (02:42 +1000)]
nv50: oops, keep VRAM allocations aligned at 64KiB - that's our page size..

15 years agonv50: use same dma object for fb/tt access
Ben Skeggs [Sun, 22 Jun 2008 15:24:11 +0000 (01:24 +1000)]
nv50: use same dma object for fb/tt access

We depend on the VM fully now for memory protection, separate DMA objects
for VRAM and GART are unneccesary.  However, until the next interface break
(soon) a client can't depend on the objects being the same and must still
call NV_OBJ_SET_DMA_* methods appropriately.

15 years agonouveau: allocate drm-use vram buffers from end of vram.
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.

15 years agoagp: use true/false instead of TRUE/FALSE
Dave Airlie [Sun, 22 Jun 2008 08:25:22 +0000 (18:25 +1000)]
agp: use true/false instead of TRUE/FALSE

15 years agoRADEON: 0x1002 0x5657 is actually an RV410
Alex Deucher [Sat, 21 Jun 2008 14:46:55 +0000 (10:46 -0400)]
RADEON: 0x1002 0x5657 is actually an RV410

See bug 14289

15 years ago[intel] Use IMR instead of IER to pend interrupts during ISR
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 &

15 years ago[intel-gem] Add /proc/dri/*/i915_gem_interrupt
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.

15 years ago[intel] Count received interrupts
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.

15 years ago[intel-gem] Remove unused variable.
Keith Packard [Sat, 21 Jun 2008 07:10:10 +0000 (00:10 -0700)]
[intel-gem] Remove unused variable.

15 years ago[intel-gem] Use polling in i915_gem_idle instead of interrupts.
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.

15 years ago[intel-gem] Add intel-specific /proc entries to help monitor gem operation
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.

15 years agoAdd device-specific proc_init and proc_cleanup hooks
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

15 years ago[intel-gem] Use shmem_getpage instead of find_or_create_page
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.

15 years ago[intel-gem] Add DRM_IOCTL_I915_GEM_SW_FINISH to flag CPU writes
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.

15 years agodrm: only use kernel ioctl cmd when doing a core ioctl.
Dave Airlie [Fri, 20 Jun 2008 05:35:47 +0000 (15:35 +1000)]
drm: only use kernel ioctl cmd when doing a core ioctl.

Need to overhaul the mess that is driver ioctls

15 years agor300: fix warning
Dave Airlie [Fri, 20 Jun 2008 05:35:16 +0000 (15:35 +1000)]
r300: fix warning

15 years agodrm: fix the ioctl to not believe userspace.
Dave Airlie [Fri, 20 Jun 2008 02:03:41 +0000 (12:03 +1000)]
drm: fix the ioctl to not believe userspace.

believing userspace causes oopses

15 years agoi915: Add support for Intel 4 series chipsets
Zhenyu Wang [Wed, 18 Jun 2008 06:19:38 +0000 (14:19 +0800)]
i915: Add support for Intel 4 series chipsets

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
15 years ago[intel] Quirk away MSI support on 945G/GM.
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.

15 years ago[linux] Use the device's irq for handler setup instead of stale dev->irq.
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.

15 years agoradeon: *really* fix screen corruption thanks to Lukasz Krotowski
Jerome Glisse [Sun, 15 Jun 2008 18:18:29 +0000 (20:18 +0200)]
radeon: *really* fix screen corruption thanks to Lukasz Krotowski

15 years agoradeon: actualy try to fix the corruption
Jerome Glisse [Sun, 15 Jun 2008 17:31:02 +0000 (19:31 +0200)]
radeon: actualy try to fix the corruption

15 years agoradeon: fix screen corruption introduced by last patch
Jerome Glisse [Sun, 15 Jun 2008 16:49:47 +0000 (18:49 +0200)]
radeon: fix screen corruption introduced by last patch

16 years ago[intel-gem] Execute MI_FLUSH in leavevt_ioctl
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.

16 years ago[intel-gem] inactive list may contain objects in CPU write domain
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.

16 years ago[intel-gem] BUG_ON active objects in gem_object_unbind
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.

16 years ago[intel-gem] Debugging -- verify inactive list invariants
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.

16 years ago[intel-gem] whitespace fixes
Keith Packard [Sat, 14 Jun 2008 02:37:44 +0000 (19:37 -0700)]
[intel-gem] whitespace fixes