Commit Graph

2126 Commits (f60d9a04b892904e5dde7dd1d2876b6bd9eb80ef)

Author SHA1 Message Date
Dave Airlie df9871064e radeon: add initial atombios modesetting and GEM -> TTM translation layer.
This is an initial import of the atom bios parser with modesetting support
for r500 hw using atombios. It also includes a simple memory manager
layer that translates a radeon GEM style interface onto TTM internally.

So far this memory manager has only been used for pinned object allocation
for the DDX to test modesetting.
2008-07-26 08:56:23 +10:00
Dave Airlie 31da9492a4 Merge remote branch 'origin/modesetting-101' into modesetting-gem 2008-07-26 08:46:38 +10:00
Dave Airlie 7fd7ba87f3 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.
2008-07-26 08:46:09 +10:00
Dave Airlie 66723c09f5 modesetting: pass file priv to cursor 2008-07-26 08:43:59 +10:00
Dave Airlie 2be292f6ea nv50: remove TRUE/FALSE 2008-07-26 08:43:01 +10:00
Dave Airlie 11d3075087 modesetting: pass file_priv into cursor set functions 2008-07-26 08:41:01 +10:00
Dave Airlie fb05c4d621 Merge remote branch 'origin/modesetting-101' into modesetting-gem 2008-07-26 08:38:59 +10:00
Dave Airlie 50db5aefa1 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.
2008-07-25 13:30:08 +10:00
Dave Airlie 5342845375 drm: use correct mode destructor 2008-07-24 15:22:44 +10:00
Eric Anholt 6d258ddf77 intel-gem: Fix pread math and logic errors.
Fixes an oops in fbotexture from walking off the end of the page list.
2008-07-23 11:49:25 -07:00
Eric Anholt 439d710683 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.
2008-07-23 10:10:54 -07:00
Eric Anholt bddb952578 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.
2008-07-23 10:10:48 -07:00
Eric Anholt a5d8f35f0f intel-gem: Move /proc debugging to a separate file. 2008-07-23 10:10:44 -07:00
Eric Anholt e31d27857f intel-gem: Remove recently added pci_read_base prototype.
This is in pci.h in the fixed patch to the kernel.
2008-07-21 14:21:16 -07:00
Eric Anholt 67d1521566 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.
2008-07-21 14:19:53 -07:00
Maarten Maathuis 4d5b9f4848 NV50: Don't create a "native" mode for LVDS when there is none. 2008-07-21 16:57:25 +02:00
Maarten Maathuis 147ef45873 NV50: don't fail on LVDS by default 2008-07-21 16:40:55 +02:00
Maarten Maathuis 03f8208ab0 NV50: Use bios table for load pattern when possible. 2008-07-21 14:50:07 +02:00
Maarten Maathuis d00644c27d NV50: Do detect with hpd and load detect if possible.
- Appropriate error messages when an unknown situation is encountered are included.
- Fallback to i2c will occur when needed.
2008-07-21 14:29:13 +02:00
Michel Dänzer 4be367b84b Reinstate dev->vblank_enabled[].
I incorrectly thought it was obsolete.
2008-07-21 11:48:04 +02:00
Michel Dänzer f529a510d2 Drop workaround for driver vblank counter going backwards.
The driver code that caused this is no longer necessary and has been dropped.
2008-07-21 08:16:59 +02:00
Michel Dänzer 205aff6a5c vblank-rework rework cleanups.
Remove some dead/obsolete code and make drm_update_vblank_count() static.
2008-07-21 08:16:55 +02:00
Michel Dänzer 014935b680 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.
2008-07-21 08:13:45 +02:00
Maarten Maathuis 685bca02fe NV50: delay changing gpu<->non-gpu scaling modes until next modeset 2008-07-20 15:40:40 +02:00
Maarten Maathuis e51cd78cac modesetting-101: Only store property value when set_property was successful. 2008-07-20 14:58:46 +02:00
Maarten Maathuis f1e4785d4c NV50: LVDS always needs some kind of gpu scaling 2008-07-20 14:55:59 +02:00
Maarten Maathuis 3ef1d05001 modesetting-101: set_property should return an int, not a bool 2008-07-20 14:51:22 +02:00
Maarten Maathuis 65803e53a6 modesetting-101: implement optional scaling and dithering properties 2008-07-20 13:49:18 +02:00
Maarten Maathuis e2ffee839e drm: As a workaround don't tear down sg with a modesetting driver.
- This allows me to maintain a useful prototype driver.
2008-07-20 00:09:06 +02:00
Jesse Barnes 6ac1f8a760 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.
2008-07-19 13:21:38 -04:00
Ian Romanick 4d83a751b4 drm-gem: Fix build
On some distros missing prototypes cause kernel builds to fail.  These
are hack to make the code build.
2008-07-18 12:42:43 -07:00
Eric Anholt f5c2f00e2f intel-gem: Leave 8xx tiling on until we find any issues. 2008-07-18 12:10:41 -07:00
Jesse Barnes 2204f926ab 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.
2008-07-17 13:55:24 -04:00
Hong Liu dfd441cf96 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>
2008-07-15 10:14:17 -07:00
Dave Airlie 764573f3b8 drm: fix missing symbol export 2008-07-15 20:27:14 +10:00
Dave Airlie abdd523c75 drm: add fix for PAT on radeon with 2.6.26 2008-07-15 16:18:22 +10:00
Dave Airlie 76c8e19a29 drm/pcigart: fix warning 2008-07-15 16:18:04 +10:00
Eric Anholt 78f1fc9cbc 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.
2008-07-14 09:16:45 -07:00
Dave Airlie a9089c4557 modesetting/helper: fix array overrun - count should be reset here 2008-07-12 16:32:09 +10:00
Eric Anholt a0474be4e7 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.
2008-07-11 18:58:02 -07:00
Dave Airlie 2556341f8b Merge remote branch 'origin/modesetting-101' into modesetting-gem 2008-07-09 14:53:47 +10:00
martin capitanio eac0933be7 xgi: use true/false instead of TRUE/FALSE 2008-07-08 17:58:10 +10:00
Kristian Høgsberg 38a5f6686c Add back flink, open and close ioctls.
They fell through the cracks in 86accbcb.
2008-07-07 18:00:23 -04:00
Eric Anholt 1f9a5307ac [intel-gem] typo fix in DRM_ERROR 2008-07-07 12:49:01 -07:00
Kristian Høgsberg 3e02f7fd31 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
2008-07-07 15:43:43 -04:00
Kristian Høgsberg 7fd8a5de63 Use lowercase bool constants. 2008-07-07 12:04:35 -04:00
Alan Hourihane 0b7d9a97bd Synchronize the DDC EDID read to it's fb_ddc.c counterpart 2008-07-07 15:11:48 +01:00
Maarten Maathuis d5d3f31b10 NV50: init gamma storage 2008-07-06 12:51:43 +02:00
Maarten Maathuis 88f668a0b9 NV50: fix minor bug in fbcon crtc selection 2008-07-06 11:23:17 +02:00
Maarten Maathuis 6738e7b00b modesetting-101: Rename DPMS modes to avoid compatibility issues with xorg definitions. 2008-07-06 11:08:49 +02:00
Maarten Maathuis e810cb9243 modesetting-101: rename modeflags, as to avoid conflicts with the xorg definitions 2008-07-06 10:52:25 +02:00
Maarten Maathuis d495a6e28f NV50: minor fix 2008-07-06 10:11:33 +02:00
Maarten Maathuis e1cd21bcc8 NV50: remove edid when monitor is gone, improve fbcon, misc fixes
- This should avoid switching crtc's when going to fbcon.
2008-07-05 20:17:49 +02:00
Maarten Maathuis c48cddc7ef NV50: fix switch_fb and connector_is_digital 2008-07-05 16:54:26 +02:00
Maarten Maathuis 7cbc5f6145 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.
2008-07-05 12:04:07 +02:00
Maarten Maathuis be31a0fa73 modesetting-101: tv_left_margin_property shouldn't be immutable. 2008-07-04 18:47:59 +02:00
Maarten Maathuis 0028ca33e9 Forgot the 0'th element for the tv property. 2008-07-04 17:37:45 +02:00
Maarten Maathuis c9915d695d modesetting-101: Move some defines used for enumeration into the public header.
- Otherwise userspace has no idea of the meaning.
2008-07-04 17:28:04 +02:00
Maarten Maathuis b29578103f [modesetting-101] Add subconnector and select_subconnector properties.
- These facilitate DVI-I and tv-out that can drive multiple types of signals.
2008-07-04 17:19:11 +02:00
Dave Airlie 142a309604 modesetting: rip out all of the generation code.
not needed, hotplug will work just as well hopefully.
2008-07-04 09:34:24 +10:00
Maarten Maathuis 062d850620 nv50: s/FALSE/false && s/TRUE/true 2008-07-03 09:08:01 +02:00
Maarten Maathuis d5ca5c9cd3 [drm-sysfs] connected is ambigious in the context of a connector, replace with enabled 2008-07-03 08:07:35 +02:00
Maarten Maathuis 47c8f31741 NV50: replace active by enabled 2008-07-03 07:18:18 +02:00
Maarten Maathuis 02b30739f7 [modeseting-101] add connected field to sysfs 2008-07-03 01:05:07 +02:00
Dave Airlie 59a9a756e2 modesetting: lookup blob using correct identifier.
blob is a blob not a connector
2008-07-03 08:06:44 +10:00
Dave Airlie 70ba087191 drm: fix encoders get permissions 2008-07-03 08:00:39 +10:00
Maarten Maathuis f1fe9178f1 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.
2008-07-02 16:14:48 +02:00
Jesse Barnes 94dcc83ad2 Revert "i915: only use tiled blits on 965+"
This reverts commit 727d4f1d16, somehow git
deleted the symlink and replaced it with the file.
2008-07-01 16:09:02 -07:00
Jesse Barnes 727d4f1d16 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>
2008-07-01 12:25:16 -07:00
Jie Luo e935925cd7 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>
2008-07-01 12:22:54 -07:00
Maarten Maathuis 2b9c5719c0 NV50: switch to fixed point scale factor calculations 2008-07-01 16:00:09 +02:00
Maarten Maathuis bc32d1798a NV50: some i2c cleanup 2008-07-01 15:14:30 +02:00
Maarten Maathuis 91c742663a NV50: use list_head item instead of list_head head to avoid confusion 2008-06-27 18:58:13 +02:00
Maarten Maathuis 9f28da80f6 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.
2008-06-27 18:45:08 +02:00
Maarten Maathuis 71906e86e8 [modesetting-101] Actually store properties when being changed. 2008-06-27 16:30:25 +02:00
Maarten Maathuis 01ee5eda9a NV50: A minor change. 2008-06-27 01:29:30 +02:00
Maarten Maathuis 701011224c NV50: Implement DPMS. 2008-06-27 01:16:36 +02:00
Maarten Maathuis d88616555d [modesetting-101] tab-cleanup 2008-06-26 23:21:01 +02:00
Maarten Maathuis 087e3f577d Revert "modesetting-101: Make dpms property optional + misc cleanup."
This reverts commit 13943fe582.
2008-06-26 23:12:04 +02:00
Maarten Maathuis 13943fe582 modesetting-101: Make dpms property optional + misc cleanup.
- intel_crt seems the only one to provide it, so init it there.
2008-06-26 21:28:29 +02:00
Maarten Maathuis 4d85d5d251 NV50: i misunderstood NOUVEAU_MEM_INTERNAL, so remove it 2008-06-25 15:27:07 +02:00
Maarten Maathuis 09b67dda0b NV50: Some cleanup and fixes. 2008-06-25 15:16:38 +02:00
root d55629a13d silence warning 2008-06-24 23:18:29 +01:00
Jesse Barnes d726eb2e5e i915: remove unused variable
Leftover dev_priv from the move of the suspend/resume code into shared-core.
2008-06-24 12:57:21 -07:00
Jesse Barnes 893cd01a1d 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.
2008-06-24 12:51:29 -07:00
Maarten Maathuis 5dbcb7551f NV50: minor change 2008-06-24 20:29:08 +02:00
Keith Packard 2c6feb7a5a [intel-gem] Include drm_compat.h to get kmap_atomic_prot_pfn 2008-06-24 09:52:43 -07:00
Keith Packard c0043155ad 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.
2008-06-24 09:52:33 -07:00
Keith Packard ed73651d47 [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...
2008-06-24 09:52:14 -07:00
Keith Packard 71d975072c [intel-gem] pwrite through GTT
Pin/copy_from_user/unpin through the GTT to eliminate clflush costs.
Benchmarks say this helps quite a bit.
2008-06-24 09:52:05 -07:00
Maarten Maathuis 14522b3e1b NV50: fix a few misc things 2008-06-24 12:38:57 +02:00
Maarten Maathuis 315fef7ee4 NV50: fix cursor hide/show 2008-06-24 10:16:52 +02:00
Maarten Maathuis e7582cfff6 NV50: These are actually errors. 2008-06-24 09:41:13 +02:00
Maarten Maathuis 5072a2911e NV50: fix some misc bugs 2008-06-24 00:00:02 +02:00
Maarten Maathuis 246b41fea4 [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.
2008-06-23 22:59:17 +02:00
Maarten Maathuis 0a45f15066 NV50: Improve set_config and fix some minor bugs. 2008-06-23 20:33:32 +02:00
Maarten Maathuis b0b0f37443 NV50: Fix a few more possible leaks. 2008-06-22 19:04:22 +02:00
Maarten Maathuis 7c9551a464 fix typo 2008-06-22 18:58:04 +02:00
Maarten Maathuis e67cd7dda9 NV50: A few minor added safeties + cleanup. 2008-06-22 18:47:51 +02:00
Maarten Maathuis 3809209349 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.
2008-06-22 17:01:30 +02:00
Maarten Maathuis 473a1997ac NV50: Initial import of kernel modesetting. 2008-06-22 16:29:00 +02:00
Dave Airlie 11f2a2ed6f agp: use true/false instead of TRUE/FALSE 2008-06-22 18:25:22 +10:00
Keith Packard 8be6ec491f [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.
2008-06-21 00:13:18 -07:00
Keith Packard f4bd566e0b [intel-gem] Remove unused variable. 2008-06-21 00:10:10 -07:00
Keith Packard 54817317e9 [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.
2008-06-20 21:10:42 -07:00
Keith Packard 71b1623e22 [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.
2008-06-20 21:07:46 -07:00
Keith Packard 2bd9799e4c Add device-specific proc_init and proc_cleanup hooks
This allows device drivers to add proc files
2008-06-20 16:40:14 -07:00
Keith Packard 918420deef [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.
2008-06-20 00:21:57 -07:00
Keith Packard 52e5d24fae [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.
2008-06-20 00:21:57 -07:00
Dave Airlie 1915de2c56 drm: only use kernel ioctl cmd when doing a core ioctl.
Need to overhaul the mess that is driver ioctls
2008-06-20 15:35:47 +10:00
Dave Airlie 8712f0a17b drm: fix the ioctl to not believe userspace.
believing userspace causes oopses
2008-06-20 12:03:41 +10:00
Jesse Barnes f58e21c7d0 i915: add blanking support to intelfb
Got tired of not having my LCD actually turn off when I left the machine at the
console.
2008-06-18 16:49:51 -07:00
Jesse Barnes 57b8837b4e 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.
2008-06-18 15:31:48 -07:00
Jesse Barnes 86accbcb34 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
2008-06-18 15:25:54 -07:00
Jesse Barnes c843d47b90 i915: use WC mapping for framebuffer screen_base 2008-06-18 14:51:46 -07:00
Jesse Barnes 241ff808b0 Merge branch 'modesetting-101' into modesetting-gem 2008-06-18 14:01:47 -07:00
Jesse Barnes 7010d50007 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.
2008-06-18 13:57:39 -07:00
Eric Anholt e7424e4580 [intel] Quirk away MSI support on 945G/GM.
The PCI caps register reports MSI support even though it isn't really there.
2008-06-16 15:15:02 -07:00
Eric Anholt c847271179 [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.
2008-06-16 15:09:11 -07:00
Keith Packard 3e48e14499 [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.
2008-06-13 19:49:47 -07:00
Keith Packard 19c3418848 [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.
2008-06-13 19:47:23 -07:00
Keith Packard 93c2871ecc [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.
2008-06-13 19:43:40 -07:00
Keith Packard 68856b619b [intel-gem] Debugging -- verify inactive list invariants
Inactive list elements may not be pinned, active or have non-CPU write
domains.
2008-06-13 19:40:16 -07:00
Keith Packard 732b196074 [intel-gem] whitespace fixes 2008-06-13 19:37:44 -07:00
Keith Packard a7139cb851 [intel-gem] show total GTT space in /proc/dri/*/gem_objects 2008-06-13 19:35:22 -07:00
Keith Packard 73bc18cad8 [intel-gem] Wait for rendering to complete before unbinding.
Moving to the CPU domain doesn't ensure that rendering is finished, the
buffer may still be in use as a texture or other data source.
2008-06-13 17:06:35 -07:00
Keith Packard 217beb9c8d [intel-gem] add gtt and pin counts to /proc/dri/*/gem_objects
Not quite portable, but these are useful for intel. Some more general
mechanism could be done...
2008-06-13 15:43:02 -07:00
Keith Packard 4086cdb655 [intel-gem] Left the last exec buffer pinned. oops.
Loop end variable 'pinned' was set one too low.
2008-06-13 15:38:13 -07:00
Keith Packard baf5213694 [intel-gem] Pin objects during execbuffer
Pinning the objects avoids accidentally evicting them while binding
other objects.
2008-06-13 14:29:46 -07:00
Keith Packard ced9ebf645 [intel-gem] throttle based on frames rather than time. Reduces jitter.
Record the last execbuffer sequence for each client.
Record that sequence in the throttle ioctl as the 'throttle sequence'.
Wait for the last throttle sequence in the throttle ioctl.
2008-06-13 14:29:46 -07:00
Keith Packard 6b2cba1ecc [intel-gem] evict_something was failing when wait_request freed objects
When i915_wait_request clears object from the active list, it may end up
freeing them and not moving them to the inactive list. This ends up
unbinding objects from the GTT without there ever being new objects visible
to i915_gem_evict_something on the inactive list. As the only success
condition required the presence of objects on the inactive list, this would
falsely assume that no GTT space had been made available, and end up
returning -ENOMEM to the application.
2008-06-13 14:29:46 -07:00
Keith Packard 3762c9ea67 [intel] Enable MSI for i915 IRQ 2008-06-13 14:29:46 -07:00
Keith Packard 462af73149 [intel-gem] Use a delayed_work instead of a timer + work_struct
We want request retirement to occur about once a second when the request
queue is non-empty. This was done with a timer that queued a work_struct,
using a delayed_work instead makes a lot more sense.
2008-06-13 14:29:46 -07:00
Keith Packard e5364914ac [intel-gem] Reorder i915_add_request to schedule work last
i915_add_request was calling schedule_delayed_work before adding the request
to the list; it makes more sense to do that last.
2008-06-13 14:29:45 -07:00
Keith Packard f378319b56 Use /bin/pwd instead of trusting shell built-in 2008-06-13 14:29:45 -07:00
Eric Anholt c892e26bdf [gem] Don't require the lock in execbuf now that it's not needed for the ring. 2008-06-13 09:49:05 -07:00
Ian Romanick 5d99e79c3e xgi: Bump kernel version
This should have been bumped when the fence interface was changed the
other day.  Better late than never, I suppose.
2008-06-12 15:36:48 -07:00
Eric Anholt b2606e325a [gem] Remove the drm_client_lock_take in set_domain.
We no longer need to use it to protect against shared ringbuffer access.
2008-06-11 16:19:23 -07:00
Jesse Barnes 4a2e29bf99 Use GEM in modesetting
Use GEM for ring buffer setup and framebuffer allocation.  This means reworking
the hardware status page stuff a bit (just use the basic range allocator for
vram for now) and #ifdef'ing out the TTM & DRI2 code.  Works well enough to
load/unload several times and display fbcon on my T61 (though there's still
some unexplained console corruption).
2008-06-11 15:59:01 -07:00
Eric Anholt 846d792ac1 [gem] Another round of cleanups from checkpatch.pl 2008-06-11 15:51:17 -07:00
Eric Anholt 2655005762 [gem] Move potentially device-specific ioctls to the intel driver.
This is the create (may want location flags), pread/pwrite/mmap
(performance tuning hints), and set_domain (will 32 bits be enough for
everyone?) ioctls.  Left in the generic set are just flink/open/close.

The 2D driver must be updated for this change, and API but not ABI is broken
for 3D.  The driver version is bumped to mark this.
2008-06-11 14:42:40 -07:00
Eric Anholt 2a35d857b3 Remove override of drm module list in preparation for merge. 2008-06-11 12:20:56 -07:00
Eric Anholt dac3bcb414 [gem] Remove carefully-sprinkled i915_kernel_lost_context().
They are not unnecessary since the kernel's the only thing touching the ring.
2008-06-11 11:28:20 -07:00
Jesse Barnes f5412a944f Merge commit 'origin/drm-gem' into modesetting-gem
Use new GEM based ring buffer initialization.  Still need to init GEM & use it
for framebuffer allocation etc.

Conflicts:

	shared-core/i915_dma.c
	shared-core/i915_drv.h
2008-06-11 10:25:45 -07:00
Eric Anholt 2150da5d1a [gem] Manage the ringbuffer from the kernel in the GEM case.
This requires that the X Server use the execbuf interface for buffer
submission, as it no longer has direct access to the ring.  This is
therefore a flag day for the gem interface.

This also adds enter/leavevt ioctls for use by the X Server.  These would
get stubbed out in a modesetting implementation, but are required while
in an environment where the device's state is only managed by the DRM while
X has the VT.
2008-06-10 22:57:07 -07:00
Ian Romanick b535567ee9 xgixp: Remove dependency on TTM fences 2008-06-10 22:18:14 -07:00
Jesse Barnes a1d9600724 Merge commit 'origin/drm-gem' into modesetting-gem
Passed the compile test; it's ready to ship.

Conflicts:

	libdrm/Makefile.am
	linux-core/Makefile.kernel
	linux-core/drmP.h
	linux-core/drm_memrange.c
	linux-core/drm_stub.c
	shared-core/drm.h
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2008-06-10 17:31:54 -07:00
Ian Romanick 4f3da2f200 xgi: Fix 64-bit kernel / 32-bit user issue. 2008-06-10 11:29:15 -07:00
Dave Airlie cdd0cb0ab3 ati_pcigart: split out the page insert function 2008-06-10 16:27:50 +10:00
Jesse Barnes c987e76d95 Add EDID quirk handling
Port over EDID quirks from X.Org so we can handle more monitors.  This meant
adding size info to the drm_display_mode struct, but other than that the
changes were isolated to the DRM EDID handling code (as they should be).
2008-06-09 16:20:45 -07:00