Kristian Høgsberg [Mon, 7 Jul 2008 15:56:59 +0000 (11:56 -0400)]
Use lowercase bool constants.
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
Keith Packard [Sat, 14 Jun 2008 02:35:22 +0000 (19:35 -0700)]
[intel-gem] show total GTT space in /proc/dri/*/gem_objects
Keith Packard [Sat, 14 Jun 2008 00:06:35 +0000 (17:06 -0700)]
[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.
Keith Packard [Fri, 13 Jun 2008 23:03:22 +0000 (16:03 -0700)]
[libdrm] Restart all ioctls on signal receipt
Receiving a signal should be ignored by the library, so just restart any
ioctl which returns EINTR or EAGAIN.
Keith Packard [Fri, 13 Jun 2008 22:43:02 +0000 (15:43 -0700)]
[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...
Keith Packard [Fri, 13 Jun 2008 22:38:13 +0000 (15:38 -0700)]
[intel-gem] Left the last exec buffer pinned. oops.
Loop end variable 'pinned' was set one too low.
Keith Packard [Fri, 13 Jun 2008 21:28:18 +0000 (14:28 -0700)]
[intel-gem] Pin objects during execbuffer
Pinning the objects avoids accidentally evicting them while binding
other objects.
Keith Packard [Fri, 13 Jun 2008 19:06:13 +0000 (12:06 -0700)]
[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.
Keith Packard [Fri, 13 Jun 2008 18:33:27 +0000 (11:33 -0700)]
[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.
Keith Packard [Fri, 13 Jun 2008 17:27:39 +0000 (10:27 -0700)]
[intel] Enable MSI for i915 IRQ
Keith Packard [Wed, 11 Jun 2008 01:19:19 +0000 (18:19 -0700)]
[intel] Restructure irq to pend all work until after iir write.
The interrupt identity register must be writen before any work occurs lest
we drop an interrupt on the floor. This patch just shuffles code around to
make sure that IIR is written as early as possible.
Keith Packard [Fri, 13 Jun 2008 16:19:30 +0000 (09:19 -0700)]
[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.
Keith Packard [Wed, 11 Jun 2008 01:11:15 +0000 (18:11 -0700)]
[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.
Keith Packard [Wed, 11 Jun 2008 00:53:32 +0000 (17:53 -0700)]
Use /bin/pwd instead of trusting shell built-in
Eric Anholt [Fri, 13 Jun 2008 17:47:33 +0000 (10:47 -0700)]
Fix i915_wait_irq in the presence of interrupt masking.
In the short-circuit code for the breadcrumb already being new enough, we
need to update the sarea_priv copy of the breadcrumb just as if we had
waited. Otherwise userland error checking will notice that we returned
too early based on its wrong information, and call wait_irq again (leading
to spinning until someone else comes along and updates the sarea_priv).
This bug was hidden when we had interrupt masking disabled, such as in
master, since the interrupt handler would update sarea_priv.
Eric Anholt [Fri, 13 Jun 2008 17:04:14 +0000 (10:04 -0700)]
[gem] Catch -EINTR from blocking ioctls and restart them.
Thanks to Thomas Hellstrom for catching the issue, no thanks to the kernel
developer who authoritatively told me that they would get restarted on their
own.
Eric Anholt [Fri, 13 Jun 2008 16:53:36 +0000 (09:53 -0700)]
[gem] Remove the interrupt handler for retiring requests.
This was insufficient once we started masking interrupts to only when someone
was waiting for them (and would thus retire requests themselves). It was
replaced by the retire_timer.
Eric Anholt [Fri, 13 Jun 2008 16:49:05 +0000 (09:49 -0700)]
[gem] Don't require the lock in execbuf now that it's not needed for the ring.
Eric Anholt [Thu, 12 Jun 2008 20:22:40 +0000 (13:22 -0700)]
Bump libdrm version to 2.4.0.
We need a version to depend on from the other components that require GEM and
the bufmgr code. Some interfaces will be removed before the 2.4.0 release.
Eric Anholt [Thu, 12 Jun 2008 17:56:37 +0000 (10:56 -0700)]
Don't clear USER_INTERRUPT if we're not handling it.
This fixes a regression from commit
d434b64f6a760d85295e32298a9a1f3624ee1b69
which could cause us to fail to wake up for user interrupts if we lost a race.
Eric Anholt [Wed, 11 Jun 2008 23:19:23 +0000 (16:19 -0700)]
[gem] Remove the drm_client_lock_take in set_domain.
We no longer need to use it to protect against shared ringbuffer access.
Jesse Barnes [Wed, 11 Jun 2008 22:59:01 +0000 (15:59 -0700)]
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).
Eric Anholt [Wed, 11 Jun 2008 22:58:33 +0000 (15:58 -0700)]
Move the renaming of mm.c symbols to #defines in the header.
This reduces the diff from Mesa and reduces the illegibility of what I did.
Eric Anholt [Wed, 11 Jun 2008 22:51:17 +0000 (15:51 -0700)]
[gem] Another round of cleanups from checkpatch.pl
Eric Anholt [Wed, 11 Jun 2008 21:42:40 +0000 (14:42 -0700)]
[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.
Eric Anholt [Wed, 11 Jun 2008 19:20:56 +0000 (12:20 -0700)]
Remove override of drm module list in preparation for merge.
Eric Anholt [Wed, 11 Jun 2008 18:28:20 +0000 (11:28 -0700)]
[gem] Remove carefully-sprinkled i915_kernel_lost_context().
They are not unnecessary since the kernel's the only thing touching the ring.
Jesse Barnes [Wed, 11 Jun 2008 17:25:45 +0000 (10:25 -0700)]
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
Eric Anholt [Wed, 11 Jun 2008 06:10:33 +0000 (23:10 -0700)]
[intel] Fix BUG_ON trigger in irq masking if you did on/off with irqs disabled.
Eric Anholt [Tue, 10 Jun 2008 22:30:23 +0000 (15:30 -0700)]
[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.
Jesse Barnes [Wed, 11 Jun 2008 00:31:54 +0000 (17:31 -0700)]
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
Jesse Barnes [Mon, 9 Jun 2008 23:20:45 +0000 (16:20 -0700)]
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).
Eric Anholt [Sat, 7 Jun 2008 00:13:16 +0000 (17:13 -0700)]
[gem] Don't forget to munmap in the non-bo-reuse object-freeing case.
Keith Packard [Fri, 6 Jun 2008 20:54:38 +0000 (21:54 +0100)]
[intel] remove settable use_mi_batchbuffer_start
The driver can know what hardware requires MI_BATCH_BUFFER vs
MI_BATCH_BUFFER_START; there's no reason to let user mode configure this.
Keith Packard [Fri, 6 Jun 2008 20:26:03 +0000 (13:26 -0700)]
[intel] remove settable use_mi_batchbuffer_start
The driver can know what hardware requires MI_BATCH_BUFFER vs
MI_BATCH_BUFFER_START; there's no reason to let user mode configure this.
Keith Packard [Fri, 6 Jun 2008 19:59:52 +0000 (12:59 -0700)]
[intel-gem] Use timers to retire requests periodically.
Without the user IRQ running constantly, there's no wakeup when the ring
empties to go retire requests and free buffers. Use a 1 second timer to make
that happen more often.
Keith Packard [Fri, 6 Jun 2008 19:58:41 +0000 (12:58 -0700)]
[intel] free the hardware status page at driver_unload
This goes with the other hardware status page patch.
Keith Packard [Fri, 6 Jun 2008 19:57:01 +0000 (12:57 -0700)]
[intel-gem] Add explicit throttle ioctl
Instead of throttling and execbuffer time, have the application ask to
throttle explicitly. This allows the throttle to happen less often, and
without holding the DRM lock.
Keith Packard [Thu, 5 Jun 2008 23:05:35 +0000 (16:05 -0700)]
[libdrm/intel] Eliminate extra dri_gem_bo_bucket_entry structure
Place the buffer reuse links right into the dri_bo_gem object.
Keith Packard [Thu, 5 Jun 2008 22:58:55 +0000 (15:58 -0700)]
[libdrm/intel] Remove unused intel_validate_entry structure
Keith Packard [Thu, 5 Jun 2008 22:58:09 +0000 (15:58 -0700)]
[libdrm/intel] Reuse entire dri_bo_gem structure
The code was discarding the dri_bo_gem structure and saving only the kernel
handle. This lost the mmap address, causing pain when the next buffer user
wanted to map the buffer.
Keith Packard [Thu, 5 Jun 2008 21:09:57 +0000 (14:09 -0700)]
[intel] Allocate hardware status page at driver load time
I couldn't get the re-allocated HWS to work on my 965GM, so I just gave up
and made it persist across the lifetime of the driver instead.
Keith Packard [Thu, 5 Jun 2008 20:49:21 +0000 (13:49 -0700)]
Ignore X server provided mmio address
Keith Packard [Thu, 5 Jun 2008 20:47:41 +0000 (13:47 -0700)]
[intel-gem] Dump error status on wait_request failure
Dave Airlie [Fri, 6 Jun 2008 06:24:27 +0000 (16:24 +1000)]
drm: fix up fb resize again
Dave Airlie [Fri, 6 Jun 2008 05:38:53 +0000 (15:38 +1000)]
intel: don't set the mode on the framebuffer if isn't set to scanout our framebuffer
Dave Airlie [Fri, 6 Jun 2008 05:21:57 +0000 (15:21 +1000)]
Merge remote branch 'origin/modesetting-101' into modesetting-101-fb
Dave Airlie [Fri, 6 Jun 2008 05:21:22 +0000 (15:21 +1000)]
intelfb: add multi fb paths
Dave Airlie [Fri, 6 Jun 2008 04:55:03 +0000 (14:55 +1000)]
intelfb: remove duplicate define
Dave Airlie [Fri, 6 Jun 2008 04:53:34 +0000 (14:53 +1000)]
intelfb: admit fbdev is crap and punt on trying to resize to a larger fbdev.
Dave Airlie [Fri, 6 Jun 2008 02:02:51 +0000 (12:02 +1000)]
intelfb: move mode sets into the intel crtcs
better place to store them.
Dave Airlie [Fri, 6 Jun 2008 00:38:35 +0000 (10:38 +1000)]
drm/intel: make hotplug just be an event
Dave Airlie [Fri, 6 Jun 2008 00:31:36 +0000 (10:31 +1000)]
intel: if no spare crtc exists don't just take one.
Jesse Barnes [Thu, 5 Jun 2008 22:58:43 +0000 (15:58 -0700)]
sysfs registration/teardown fixups
A check in drm_sysfs_connector_remove was supposed to allow it to be called
even with unregistered objects, to make cleanup paths a little simpler.
However, device_is_regsitered didn't always seem to return what we thought it
would, so we'd sometimes end up leaving objects lying around rather than
unregistering them.
Fix this situation up by requiring devices to be registered before being
removed. Any problems resulting from this change should be easier to track
down than the alternative (which is leaving kobjects registered after unload).
Eric Anholt [Thu, 5 Jun 2008 15:44:46 +0000 (08:44 -0700)]
Add a function to bufmgr_fake to evict all buffers in the GTT.
This will be used by the X Server for VT switch.
Dave Airlie [Thu, 5 Jun 2008 06:32:41 +0000 (16:32 +1000)]
drm/modeset: add more debugging and fixup some fb enable/disabe bits
Dave Airlie [Thu, 5 Jun 2008 05:55:03 +0000 (15:55 +1000)]
drm/modesetting: more fb interface cleanups
Dave Airlie [Thu, 5 Jun 2008 05:21:07 +0000 (15:21 +1000)]
drm/modesetting: attempt to make fb code more sane
Dave Airlie [Thu, 5 Jun 2008 03:40:08 +0000 (13:40 +1000)]
drm: modesetting unify the hotplug init paths a lot.
remove fb callbacks, just probe into the driver to sort it out
Dave Airlie [Thu, 5 Jun 2008 01:43:48 +0000 (11:43 +1000)]
modesetting: fix fb clearing up
Dave Airlie [Thu, 5 Jun 2008 01:24:57 +0000 (11:24 +1000)]
modesetting: use surface width height for buffer allocs
Dave Airlie [Thu, 5 Jun 2008 01:20:52 +0000 (11:20 +1000)]
modesetting: add surface width/heights
Dave Airlie [Thu, 5 Jun 2008 01:11:22 +0000 (11:11 +1000)]
modesetting: initial attempt at debonging fb
Jesse Barnes [Wed, 4 Jun 2008 19:50:03 +0000 (12:50 -0700)]
i915: use kzalloc to allocate intel_output for lvds
Better to initialize all the struct fields to 0. Also more consistent with
other output init routines.
Jesse Barnes [Wed, 4 Jun 2008 16:38:44 +0000 (09:38 -0700)]
Fix crash in drm_mode_connector_update_edid_property
We need to initialize the edid_blob_ptr to NULL when we init a connector,
otherwise drm_mode_connector_update_edid_property may think there's a valid
EDID lying around and try to destroy it, causing a crash.
Dave Airlie [Wed, 4 Jun 2008 05:17:13 +0000 (15:17 +1000)]
drm: fix hotplug oops
Dave Airlie [Wed, 4 Jun 2008 05:17:00 +0000 (15:17 +1000)]
intel: report a known connector
Keith Packard [Wed, 4 Jun 2008 04:49:51 +0000 (21:49 -0700)]
Drop struct_mutex while waiting in drm_client_lock_take
struct_mutex cannot be held while blocking on DRM lock.
Dave Airlie [Wed, 4 Jun 2008 03:53:33 +0000 (13:53 +1000)]
libdrm: shouldn't rely on this
Dave Airlie [Wed, 4 Jun 2008 03:49:43 +0000 (13:49 +1000)]
drm: introduce generation counter to interface.
Idea being if you want to add new crtc/output/encoder dynamically later,
you just increase the generation counter and userspace should re-read
all the resources
Dave Airlie [Wed, 4 Jun 2008 03:16:49 +0000 (13:16 +1000)]
drm/sysfs: don't try an unregister if not registered
Dave Airlie [Wed, 4 Jun 2008 03:09:20 +0000 (13:09 +1000)]
intel: use kzalloc
Dave Airlie [Wed, 4 Jun 2008 03:09:05 +0000 (13:09 +1000)]
drm/modesetting: bo not used anymore
Dave Airlie [Wed, 4 Jun 2008 03:03:23 +0000 (13:03 +1000)]
drm: remove sysfs in driver for now.. should probably be in helper
Dave Airlie [Wed, 4 Jun 2008 03:00:31 +0000 (13:00 +1000)]
drm/modesetting: pass object handle to driver !bo
Dave Airlie [Wed, 4 Jun 2008 01:59:28 +0000 (11:59 +1000)]
drm/modesetting: overhaul the fb create/delete.
Move TTM code into the driver
Dave Airlie [Wed, 4 Jun 2008 00:34:34 +0000 (10:34 +1000)]
drm: make mode comparison more betterer.
This compares the clocks after converting to fb pico timings so we
get the same answer if the X and fb modes are the same.
Eric Anholt [Tue, 3 Jun 2008 21:34:54 +0000 (14:34 -0700)]
Fix libdrm to actually include the new code instead of just building it.
Eric Anholt [Tue, 3 Jun 2008 17:20:49 +0000 (10:20 -0700)]
Fix and hook up bufmgr code to the build.
Eric Anholt [Tue, 3 Jun 2008 16:27:37 +0000 (09:27 -0700)]
Import bufmgr code to libdrm. Not yet hooked up to the build.
Keith Packard [Mon, 2 Jun 2008 19:37:10 +0000 (12:37 -0700)]
[intel-gem] reloc_and_validate_object → object_bind_and_relocate
Just renaming this function and related parameters to match terminology used
elsewhere in the driver.
Keith Packard [Mon, 2 Jun 2008 17:59:15 +0000 (10:59 -0700)]
[intel-gem] Propagate set_domain errors.
set_domain can block waiting for rendering to complete. If that process is
interrupted by a signal, it can return -EINTR. Catch this error in all
callers and correctly deal with the result.
Alan Hourihane [Mon, 2 Jun 2008 09:44:29 +0000 (10:44 +0100)]
more checks for NULL encoder so we don't segfault.
Alan Hourihane [Mon, 2 Jun 2008 09:03:28 +0000 (10:03 +0100)]
Fix warnings
Dave Airlie [Mon, 2 Jun 2008 06:45:44 +0000 (16:45 +1000)]
drm: initial mode object groups.
This creates a default group attached to the legacy drm minor nodes.
It covers all the objects in the set. make set resources only return
objects for this set. Need to fix up other functions to only work on
objects in their allowed set.
Dave Airlie [Mon, 2 Jun 2008 06:19:21 +0000 (16:19 +1000)]
drm/modesetting: redo object handles around a core object.
handle crtc/encoders/connectors/fb/mode/property/blob using this system.
Dave Airlie [Mon, 2 Jun 2008 04:33:42 +0000 (14:33 +1000)]
drm: only report framebuffers available on this fd.
Not 100% sure this is a good idea, but I think I'd rather things
communicate with bo handles not fb ids.