Commit Graph

247 Commits (225e7e274f49d5e01fa1ad3fbbb9f1499865fe67)

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 145d2d610b i915: Since FreeBSD doesn't have gem support yet, don't advertise it.
This allows us to not crash X when using newer Intel ddx drivers.
2008-10-27 14:39:05 -04:00
Matthias Hopf 1d930fc75b drm/i915: fix ioremap of a user address for non-root (CVE-2008-3831)
Olaf Kirch noticed that the i915_set_status_page() function of the i915
kernel driver calls ioremap with an address offset that is supplied by
userspace via ioctl. The function zeroes the mapped memory via memset
and tells the hardware about the address. Turns out that access to that
ioctl is not restricted to root so users could probably exploit that to
do nasty things. We haven't tried to write actual exploit code though.

It only affects the Intel G33 series and newer.
2008-10-25 12:15:50 -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 6f2479c674 [FreeBSD] Ensure that drm_pci_alloc is never called while locks are held. 2008-09-06 18:37:06 -04:00
Robert Noland 3f915f68e8 i915: fix i915_ring_validate() 2008-09-05 12:38:41 -04: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 739b01dde4 i915: Clear sarea_priv during lastclose.
sarea_priv needs to be NULL before i915_initialized is called to
properly reset it.  The stale value produces a panic any time something
opens/closes drm without calling initialize.  i.e. version checking
2008-08-24 15:25:20 -04:00
Robert Noland 1f3c4dd938 i915: Free dev->dev_private on unload. 2008-08-24 15:25:19 -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
Dave Airlie 9dff806802 i915: fixup from last merge hopefully 2008-08-14 09:43:23 +10:00
Dave Airlie 2d4420c666 Merge branch 'radeon-gem-cs' into modesetting-gem
Conflicts:

	libdrm/xf86drm.c
	linux-core/Makefile.kernel
	linux-core/drmP.h
	linux-core/drm_compat.h
	linux-core/drm_drv.c
	linux-core/drm_stub.c
	linux-core/drm_vm.c
	shared-core/i915_dma.c
	shared-core/r300_cmdbuf.c
	shared-core/radeon_drv.h
2008-08-14 09:36:34 +10: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
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 d2d7f3069d drm: userspace rip out TTM API 2008-07-31 13:31:30 +10:00
Dave Airlie 9b8d71b5eb TTM: remove API and userspace objects.
This removes all the TTM userspace API and all userspace objects.

It also removes the drm_bo_lock.c code
2008-07-31 12:54:48 +10:00
Eric Anholt ccbaad52f7 intel-gem: Replace version bump signalling GEM with I915_PARAM_HAS_GEM. 2008-07-30 14:10:36 -07:00
Dave Airlie 02b09d271c i915: add version checks for opregion on old kernels 2008-07-30 16:26:59 +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
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
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
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 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 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
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
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 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 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
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
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 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
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
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
Robert Noland 116870a908 I915 suspend/resume for FreeBSD 2008-06-08 13:56:14 -04:00
Keith Packard c2fc142ea7 [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.
2008-06-06 21:54:38 +01:00
Keith Packard 6cd0ef06a6 [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.
2008-06-06 13:26:03 -07:00
Keith Packard 9f46c6935d [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.
2008-06-06 13:00:47 -07:00
Keith Packard a708106c77 [intel] free the hardware status page at driver_unload
This goes with the other hardware status page patch.
2008-06-06 13:00:46 -07:00
Keith Packard 56a96841d0 [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.
2008-06-06 13:00:46 -07:00
Keith Packard 5f5badb26f [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.
2008-06-06 13:00:46 -07:00
Keith Packard 84162ccb7d Ignore X server provided mmio address 2008-06-06 13:00:46 -07: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
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 7cf3fd29fe [intel-gem] Add DRM_I915_GEM_BUSY ioctl to check for idle buffers.
This new ioctl returns whether re-using the buffer would force a wait.
2008-05-25 20:45:20 -07:00