OSDN Git Service

android-x86/external-libdrm.git
16 years agoChange some obviously wrong things about property blobs, still broken though.
Maarten Maathuis [Fri, 27 Jun 2008 16:45:08 +0000 (18:45 +0200)]
Change some obviously wrong things about property blobs, still broken though.

- I do not fully understand these blobs, so i'm leaving it at this for the moment.

16 years ago[modesetting-101] Actually store properties when being changed.
Maarten Maathuis [Fri, 27 Jun 2008 14:30:25 +0000 (16:30 +0200)]
[modesetting-101] Actually store properties when being changed.

16 years agoNV50: A minor change.
Maarten Maathuis [Thu, 26 Jun 2008 23:29:30 +0000 (01:29 +0200)]
NV50: A minor change.

16 years agoNV50: Implement DPMS.
Maarten Maathuis [Thu, 26 Jun 2008 23:16:36 +0000 (01:16 +0200)]
NV50: Implement DPMS.

16 years ago[modesetting-101] tab-cleanup
Maarten Maathuis [Thu, 26 Jun 2008 21:21:01 +0000 (23:21 +0200)]
[modesetting-101] tab-cleanup

16 years agoRevert "modesetting-101: Make dpms property optional + misc cleanup."
Maarten Maathuis [Thu, 26 Jun 2008 21:12:04 +0000 (23:12 +0200)]
Revert "modesetting-101: Make dpms property optional + misc cleanup."

This reverts commit 13943fe5823c45759091c1a1f487a4abe377421e.

16 years agomodesetting-101: Make dpms property optional + misc cleanup.
Maarten Maathuis [Thu, 26 Jun 2008 19:28:29 +0000 (21:28 +0200)]
modesetting-101: Make dpms property optional + misc cleanup.

- intel_crt seems the only one to provide it, so init it there.

16 years agoNV50: i misunderstood NOUVEAU_MEM_INTERNAL, so remove it
Maarten Maathuis [Wed, 25 Jun 2008 13:27:07 +0000 (15:27 +0200)]
NV50: i misunderstood NOUVEAU_MEM_INTERNAL, so remove it

16 years agoNV50: Some cleanup and fixes.
Maarten Maathuis [Wed, 25 Jun 2008 13:16:38 +0000 (15:16 +0200)]
NV50: Some cleanup and fixes.

16 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().

16 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.

16 years agosilence warning
root [Tue, 24 Jun 2008 22:18:29 +0000 (23:18 +0100)]
silence warning

16 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.

16 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

16 years agoNV50: minor change
Maarten Maathuis [Tue, 24 Jun 2008 18:29:08 +0000 (20:29 +0200)]
NV50: minor change

16 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

16 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

16 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.

16 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.

16 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...

16 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.

16 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

16 years agoNV50: fix a few misc things
Maarten Maathuis [Tue, 24 Jun 2008 10:38:57 +0000 (12:38 +0200)]
NV50: fix a few misc things

16 years agoNV50: fix cursor hide/show
Maarten Maathuis [Tue, 24 Jun 2008 08:16:52 +0000 (10:16 +0200)]
NV50: fix cursor hide/show

16 years agoNV50: These are actually errors.
Maarten Maathuis [Tue, 24 Jun 2008 07:41:13 +0000 (09:41 +0200)]
NV50: These are actually errors.

16 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

16 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.

16 years agoNV50: fix some misc bugs
Maarten Maathuis [Mon, 23 Jun 2008 22:00:02 +0000 (00:00 +0200)]
NV50: fix some misc bugs

16 years ago[modesetting-101] update mode count after fill_modes.
Maarten Maathuis [Mon, 23 Jun 2008 20:59:17 +0000 (22:59 +0200)]
[modesetting-101] update mode count after fill_modes.

- This avoids returning with a mode count of 0, thus not allocating space for the 2nd ioctl.

16 years agolibdrm: check for allocation failure
Maarten Maathuis [Mon, 23 Jun 2008 19:15:54 +0000 (21:15 +0200)]
libdrm: check for allocation failure

16 years agoNV50: Improve set_config and fix some minor bugs.
Maarten Maathuis [Mon, 23 Jun 2008 18:33:32 +0000 (20:33 +0200)]
NV50: Improve set_config and fix some minor bugs.

16 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.

16 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.

16 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...

16 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

16 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.

16 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.

16 years agonouveau: disable KMS for pre-NV50 even when specifically enabled
Maarten Maathuis [Sun, 22 Jun 2008 17:31:55 +0000 (19:31 +0200)]
nouveau: disable KMS for pre-NV50 even when specifically enabled

16 years agoNV50: Fix a few more possible leaks.
Maarten Maathuis [Sun, 22 Jun 2008 17:04:22 +0000 (19:04 +0200)]
NV50: Fix a few more possible leaks.

16 years agofix typo
Maarten Maathuis [Sun, 22 Jun 2008 16:58:04 +0000 (18:58 +0200)]
fix typo

16 years agoNV50: A few minor added safeties + cleanup.
Maarten Maathuis [Sun, 22 Jun 2008 16:47:51 +0000 (18:47 +0200)]
NV50: A few minor added safeties + cleanup.

16 years agoUndo something i didn't want to change.
Maarten Maathuis [Sun, 22 Jun 2008 15:01:30 +0000 (17:01 +0200)]
Undo something i didn't want to change.

- I made it consistent with recent kernel fb code (maybe this is older bugged code?)
- Still i don't use this and i should leave it to others.

16 years agoNV50: Initial import of kernel modesetting.
Maarten Maathuis [Sun, 22 Jun 2008 14:29:00 +0000 (16:29 +0200)]
NV50: Initial import of kernel modesetting.

16 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 &

16 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.

16 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.

16 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.

16 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.

16 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.

16 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

16 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.

16 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.

16 years agoi915: add blanking support to intelfb
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.

16 years agoi915: cleanup PCI state before disabling MSI
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.

16 years agoMerge commit 'origin/drm-gem' into modesetting-gem
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

16 years agoi915: use WC mapping for framebuffer screen_base
Jesse Barnes [Wed, 18 Jun 2008 21:51:46 +0000 (14:51 -0700)]
i915: use WC mapping for framebuffer screen_base

16 years agoMerge branch 'modesetting-101' into modesetting-gem
Jesse Barnes [Wed, 18 Jun 2008 21:01:47 +0000 (14:01 -0700)]
Merge branch 'modesetting-101' into modesetting-gem

16 years agoi915: switch back to fbcon on panic
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.

16 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.

16 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.

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

16 years ago[intel-gem] show total GTT space in /proc/dri/*/gem_objects
Keith Packard [Sat, 14 Jun 2008 02:35:22 +0000 (19:35 -0700)]
[intel-gem] show total GTT space in /proc/dri/*/gem_objects

16 years ago[intel-gem] Wait for rendering to complete before unbinding.
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.

16 years ago[libdrm] Restart all ioctls on signal receipt
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.

16 years ago[intel-gem] add gtt and pin counts to /proc/dri/*/gem_objects
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...

16 years ago[intel-gem] Left the last exec buffer pinned. oops.
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.

16 years ago[intel-gem] Pin objects during execbuffer
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.

16 years ago[intel-gem] throttle based on frames rather than time. Reduces jitter.
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.

16 years ago[intel-gem] evict_something was failing when wait_request freed objects
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.

16 years ago[intel] Enable MSI for i915 IRQ
Keith Packard [Fri, 13 Jun 2008 17:27:39 +0000 (10:27 -0700)]
[intel] Enable MSI for i915 IRQ

16 years ago[intel] Restructure irq to pend all work until after iir write.
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.

16 years ago[intel-gem] Use a delayed_work instead of a timer + work_struct
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.

16 years ago[intel-gem] Reorder i915_add_request to schedule work last
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.

16 years agoUse /bin/pwd instead of trusting shell built-in
Keith Packard [Wed, 11 Jun 2008 00:53:32 +0000 (17:53 -0700)]
Use /bin/pwd instead of trusting shell built-in

16 years agoFix i915_wait_irq in the presence of interrupt masking.
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.

16 years ago[gem] Catch -EINTR from blocking ioctls and restart them.
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.

16 years ago[gem] Remove the interrupt handler for retiring requests.
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.

16 years ago[gem] Don't require the lock in execbuf now that it's not needed for the ring.
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.

16 years agoBump libdrm version to 2.4.0.
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.

16 years agoDon't clear USER_INTERRUPT if we're not handling it.
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.

16 years ago[gem] Remove the drm_client_lock_take in set_domain.
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.

16 years agoUse GEM in modesetting
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).

16 years agoMove the renaming of mm.c symbols to #defines in the header.
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.

16 years ago[gem] Another round of cleanups from checkpatch.pl
Eric Anholt [Wed, 11 Jun 2008 22:51:17 +0000 (15:51 -0700)]
[gem] Another round of cleanups from checkpatch.pl

16 years ago[gem] Move potentially device-specific ioctls to the intel driver.
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.

16 years agoRemove override of drm module list in preparation for merge.
Eric Anholt [Wed, 11 Jun 2008 19:20:56 +0000 (12:20 -0700)]
Remove override of drm module list in preparation for merge.

16 years ago[gem] Remove carefully-sprinkled i915_kernel_lost_context().
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.

16 years agoMerge commit 'origin/drm-gem' into modesetting-gem
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

16 years ago[intel] Fix BUG_ON trigger in irq masking if you did on/off with irqs disabled.
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.

16 years ago[gem] Manage the ringbuffer from the kernel in the GEM case.
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.

16 years agoMerge commit 'origin/drm-gem' into modesetting-gem
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

16 years agoAdd EDID quirk handling
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).

16 years ago[gem] Don't forget to munmap in the non-bo-reuse object-freeing case.
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.

16 years ago [intel] remove settable use_mi_batchbuffer_start
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.

16 years ago[intel] remove settable use_mi_batchbuffer_start
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.

16 years ago[intel-gem] Use timers to retire requests periodically.
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.