Commit Graph

176 Commits (a1345338feb7af25c0a9fe02ec16c2b9cce83a9e)

Author SHA1 Message Date
Jesse Barnes 9583c099b4 Revert "Merge branch 'modesetting-gem'"
This reverts commit 6656db1055.

We really just want the libdrm and ioctl bits, not all the driver
stuff.
2008-12-10 15:50:22 -08:00
Jesse Barnes 965b4d662a Merge branch 'master' into modesetting-gem
Conflicts:

	libdrm/Makefile.am
	libdrm/intel/intel_bufmgr.h
	libdrm/intel/intel_bufmgr_fake.c
	libdrm/intel/intel_bufmgr_gem.c
	shared-core/drm.h
	shared-core/i915_dma.c
	shared-core/i915_irq.c
	shared-core/radeon_cp.c
	shared-core/radeon_drv.h
2008-11-13 15:30:06 -08:00
Robert Noland a8f73c214d i915: Cleanup interrupt handling 2008-10-09 22:11:55 -04:00
Dave Airlie 972f657265 Merge remote branch 'origin/master' into modesetting-gem
Conflicts:

	libdrm/Makefile.am
	libdrm/dri_bufmgr.h
	linux-core/drm_irq.c
	linux-core/drm_sysfs.c
	linux-core/drm_ttm.c
	shared-core/i915_dma.c
	shared-core/i915_irq.c
	shared-core/nouveau_drv.h
	shared-core/radeon_cp.c
2008-09-30 14:13:49 +10:00
Robert Noland c8fd8d3a0d i915: Fix i915 build on FreeBSD
ifdef out all the gem stuff for now.  Also, the msi stuff isn't portable
the way it is... I'll try and fix that up sometime soon.
2008-08-24 15:53:17 -04:00
Robert Noland d0acbe4553 i915: Convert vblank on disabled pipe DRM_ERROR to DRM_DEBUG. 2008-08-24 15:25:20 -04:00
Robert Noland 16c1a87580 i915: Move spinlock init / destroy to load / unload time.
This resolves the panic on FreeBSD during VT switch, without attempting
any of the more lofty goals for the time being.
2008-08-24 15:25:19 -04:00
Jesse Barnes a2adc69656 i915: finish removing TTM bits
Makes it build again.
2008-08-16 12:09:24 -07:00
Jesse Barnes 2f03ba4aad Merge branch 'master' into modesetting-gem
Conflicts:

	libdrm/Makefile.am
	libdrm/xf86drm.h
	shared-core/i915_dma.c
	shared-core/i915_irq.c
2008-08-13 10:08:02 -07:00
Eric Anholt e1b8e79796 Merge branch 'drm-gem'
Conflicts:

	shared-core/i915_dma.c

This brings in kernel support and userland interface for intel GEM.
2008-08-08 14:05:01 -07:00
Jesse Barnes 8074b2e83d Make modesetting-gem build with recent kernels
Needed to merge in VM fault changes & pci_read_base API update.
2008-08-07 17:15:50 -07:00
Kristian Høgsberg 086716c8e2 Merge commit 'origin/drm-gem' into modesetting-gem
Conflicts:
	linux-core/Makefile.kernel
	linux-core/drmP.h
	linux-core/drm_mm.c
	linux-core/drm_stub.c
	linux-core/i915_gem.c
	linux-core/i915_opregion.c
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2008-08-01 13:35:56 -04:00
Dave Airlie 4585787bd1 Revert "i915: Move all of the irq install/uninstall to load time."
This reverts commit 965a72202b.

Please re-do over properly
2008-08-01 07:43:58 +10:00
Kristian Høgsberg 5052e966ec Merge commit 'origin/master' into modesetting-gem
Conflicts:
	linux-core/Makefile.kernel
	linux-core/ati_pcigart.c
	linux-core/drm_compat.h
	linux-core/drm_irq.c
	linux-core/drm_lock.c
	linux-core/i915_drv.c
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
	shared-core/nouveau_mem.c
	shared-core/radeon_cp.c
	shared-core/radeon_drv.h
2008-07-31 15:18:32 -04:00
Dave Airlie 95c02743c9 i915: more version checks 2008-07-30 16:52:13 +10:00
Eric Anholt 1d2bb68d28 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
2008-07-28 23:12:26 -07:00
Robert Noland 965a72202b 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.
2008-07-23 19:55:06 -04:00
Jesse Barnes 04893aa99a 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.
2008-07-19 13:21:38 -04:00
Jesse Barnes a9427cf318 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.
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
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
Jesse Barnes 301d984ea8 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>
2008-07-01 16:10:01 -07:00
Keith Packard d250a55fc6 [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.
2008-06-24 13:39:25 -07:00
Keith Packard e36da6a133 [intel] Create functions to enable/disable interrupts
This shares common code sequences for managing the interrupt register bits
2008-06-24 13:08:04 -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
Keith Packard a369bf0e57 [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 &
2008-06-21 00:33:07 -07:00
Keith Packard 33114e4a11 [intel] Count received interrupts
Another patch adds this to a /proc/dri file for debugging and monitoring.
2008-06-21 00:12:21 -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
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
Keith Packard 3762c9ea67 [intel] Enable MSI for i915 IRQ 2008-06-13 14:29:46 -07:00
Keith Packard 5957470ca3 [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.
2008-06-13 14:29:46 -07:00
Eric Anholt df4ef348c8 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.
2008-06-13 10:47:33 -07:00
Eric Anholt 0558d99c01 [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.
2008-06-13 09:54:14 -07:00
Eric Anholt cc74ac3590 Don't clear USER_INTERRUPT if we're not handling it.
This fixes a regression from commit d434b64f6a
which could cause us to fail to wake up for user interrupts if we lost a race.
2008-06-12 10:56:37 -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 62a3be962f [intel] Fix BUG_ON trigger in irq masking if you did on/off with irqs disabled. 2008-06-10 23:11:09 -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
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
Dave Airlie 25c1bb334f drm/intel: make hotplug just be an event 2008-06-06 10:39:58 +10:00
Eric Anholt 461bfa3da6 Merge commit 'origin/master' into drm-gem
Conflicts:

	linux-core/Makefile.kernel
	shared-core/i915_drv.h
	shared-core/nouveau_state.c
2008-05-30 14:42:08 -07:00
Dave Airlie 9d38448ed3 modesetting: the great renaming.
Okay we have crtc, encoder and connectors.

No more outputs exposed beyond driver internals

I've broken intel tv connector stuff.
Really for TV we should have one TV connector, with a sub property for the
type of signal been driven over it
2008-05-30 15:10:04 +10:00
Dave Airlie 98c5cf7f6f modesetting: reorganise out crtc/outputs are allocated.
Use subclassing from the drivers to allocate the objects. This saves
two objects being allocated for each crtc/output and generally makes
exit paths cleaner.
2008-05-30 11:25:41 +10:00
Dave Airlie df8cd54286 modesetting: reorganise code into core and helper functions.
This splits a lot of the core modesetting code out into a file of
helper functions, that are only called from themselves and/or the driver.

The driver gets called into more often or can call these functions from itself
if it is a helper using driver.

I've broken framebuffer resize doing this but I didn't like the API for that
in any case.
2008-05-29 14:02:14 +10:00
Alan Hourihane 3a3f39d144 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Conflicts:

	shared-core/i915_dma.c
	shared-core/i915_drv.h
2008-05-28 21:01:18 +01:00
Robert Noland 8cd045079e [FreeBSD] Add vblank-rework support and get drivers building.
The i915 driver now works again.
2008-05-27 14:25:20 -07:00
Keith Packard d434b64f6a [i915] leave interrupts masked off when not in use.
The interrupt enable register cannot be used to temporarily disable
interrupts, instead use the interrupt mask register.

Note that this change means that a pile of buffers will be left stuck on the
chip as the final interrupts will not be recognized to come and drain things.
2008-05-26 03:25:16 -07:00
Eric Anholt 5e662f90d1 [gem] Release GEM buffers from work task scheduled from IRQ.
There are now 3 lists.  Active is buffers currently in the ringbuffer.
Flushing is not in the ringbuffer, but needs a flush before unbinding.
Inactive is as before.  This prevents object_free → unbind →
wait_rendering → object_reference and a kernel oops about weird refcounting.

This also avoids an synchronous extra flush and wait when freeing a buffer
which had a write_domain set (such as a temporary rendered to and then from
using the 2d engine).  It will sit around on the flushing list until the
appropriate flush gets emitted, or we need the GTT space for another
operation.
2008-05-22 22:00:21 -07:00
Jesse Barnes ee631e1b86 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-05-13 14:44:17 -07:00
Jesse Barnes d32ce7f621 i915: TV hotplug fixes
In order to avoid recursive ->detect->interrupt->detect->interrupt->...
we need to disable TV hotplug interrupts in
intel_tv.c:intel_tv_detect_type.  We also need to enable the TV interrupt
detection and hotplug sequence properly in i915_irq.c.
2008-05-12 15:47:19 -07:00
Dave Airlie 4466fea7ba Revert "i915: fix vbl swap for multi-master"
This reverts commit 2a78ad2264.
2008-05-08 17:12:16 +10:00