Commit Graph

214 Commits (f1fe9178f1a2aef272c7feeb15c8de42c8c609d5)

Author SHA1 Message Date
Hong Liu 1cde3cc1ac i915: check dummy page before freeing
The dummy read page will point to NULL if drm_bo_driver_init failed at
firstopen (modeset is not enabled), and will cause kernel oops at
subsequent drm_lastclose call, so be sure to check it.
2008-05-22 10:35:55 -07:00
Hong Liu b2dee13f5d free dummy read page if fail to init mm
Since drm_bo_driver_init will be called in driver_load, we need to free
what it alloced when error to avoid memory leak.
2008-05-12 12:07:27 -07:00
Thomas Hellstrom 7f269bec7e Merge branch 'master' into modesetting-101
Conflicts:

	linux-core/Makefile.kernel
	linux-core/drm_compat.c
	linux-core/drm_fops.c
	linux-core/drm_lock.c
	shared-core/drm.h
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2008-04-28 12:10:44 +02:00
Thomas Hellstrom 1ad1bd5bd9 Fix buffer object map wait error.
Add some branch prediction hints.
2008-04-14 13:52:33 +02:00
Thomas Hellstrom c5955c6523 Fix buffer object creation validation.
BO lock fixes.
2008-04-14 12:14:20 +02:00
Thomas Hellstrom c9b73ef6da Unlock the BO mutex while waiting for idle, unmapped, unfenced.
Move unfenced checking into idle checking.
Never time out while waiting for software events like unmapped or unfenced.
2008-04-14 12:13:33 +02:00
Thomas Hellstrom 65dd0e68ff Fix up buffer manager locking. 2008-04-14 12:13:17 +02:00
Thomas Hellstrom 1f4ba62567 [i915] Report buffer state _after_ fence submission to user-space.
This fixes a problem where the wrong bo->fence_type was reported, and
also saves some memory space.
[bo core] export the drm_bo_fill_rep_arg function.
2008-03-30 15:14:45 +02:00
Alan Hourihane b6dc381fab 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
	shared-core/i915_irq.c
2008-03-12 10:18:33 +00:00
Thomas Hellstrom 5bebcd7a0b Dont allow !sysadmin clients to alter the memory type of
NO_EVICT buffers.
2008-03-12 10:19:36 +01:00
Thomas Hellstrom 7bcce66a1d Fix kernel crash when we hit OOM conditions.
(Alan Hourihane)
2008-03-12 10:07:56 +01:00
Thomas Hellstrom f1a681ebe5 Avoid duplicate calls to drm_ttm_bind in some cases. 2008-03-12 10:02:09 +01:00
Dave Airlie f96baf1e1e Merge branch 'master' of ../../drm into modesetting-101 2008-03-07 11:59:21 +11:00
Dave Airlie 92a30dd608 drm/bo: allow non-suser priv to add kernel BOs.
modprobe can be run with dropped capabilities we still want the kernel bos
to work.
2008-03-06 14:43:23 +10:00
Dave Airlie e00dea812d Merge branch 'master' of ../../drm into modesetting-101
Conflicts:

	linux-core/drmP.h
	linux-core/drm_drv.c
	linux-core/drm_proc.c
	linux-core/drm_stub.c
	linux-core/drm_sysfs.c
2008-03-06 05:26:23 +10:00
Dave Airlie 12574590cd drm: reorganise minor number handling using code from modesetting branch
Rip out the whole head thing and replace it with an idr and drm_minor
structure.
2008-03-06 05:21:50 +10:00
Dave Airlie d5c0101252 ttm: make sure userspace can't destroy kernel create memory managers
this adds something to say the kernel initialised the memory region not
the userspace. and blocks userspace from deallocating kernel areas
2008-03-06 05:37:54 +10:00
Dave Airlie 180c9188f4 drm/ttm: add ioctl to get back memory managed area sized
taken from modesetting branch but could be useful outside it.
2008-03-06 05:31:50 +10:00
Xiang, Haihao 638353103d i915: Evict if relocatee buffer is CACHED_MAPPED before
writting relocations, otherwise the GPU probably sees some
inconsistent data. Fix fd.o bug#14656
2008-03-05 15:09:17 +08:00
Alan Hourihane a72399da2a silence warning 2008-02-22 11:39:21 +00:00
Dave Airlie cdad850ebc add ioctl to get back memory managed area sized - used for kernel inited areas 2008-02-22 13:49:51 +10:00
Dave Airlie 2c409f9a07 ttm: make sure userspace can't destroy kernel create memory managers 2008-02-20 11:27:22 +10:00
Alan Hourihane f24ed2ad6c Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Conflicts:

	linux-core/i915_fence.c
	linux-core/via_fence.c
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2008-02-18 22:35:46 +00:00
Thomas Hellstrom f1edb7ad91 Simplify the fencing code and differentiate between flushes and
waiting types.
Add a "command_stream_barrier" method to the bo driver.
2008-01-30 22:06:02 +01:00
Dave Airlie e7a41d7f5b Merge remote branch 'origin/master' into modesetting-101
Conflicts:

	linux-core/drm_bo.c
	linux-core/drm_drv.c
	shared-core/drm.h
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
	shared-core/radeon_irq.c
2008-01-25 15:27:53 +10:00
Dave Airlie 10937cf20b drm: move drm_head to drm_minor and fix up users 2008-01-04 16:12:24 +11:00
Keith Packard da3601e43a Change drm_bo_type_dc to drm_bo_type_device and comment usage of this value.
I couldn't figure out what drm_bo_type_dc was for; Dave Airlie finally clued
me in that it was the 'normal' buffer objects with kernel allocated pages
that could be mmapped from the drm device file.

I thought that 'drm_bo_type_device' was a more descriptive name.

I also added a bunch of comments describing the use of the type enum values and
the functions that use them.
2007-12-21 12:16:29 -08:00
Keith Packard d1187641d6 Rename inappropriately named 'mask' fields to 'proposed_flags' instead.
Flags pending validation were stored in a misleadingly named field, 'mask'.
As 'mask' is already used to indicate pieces of a flags field which are
changing, it seems better to use a name reflecting the actual purpose of
this field. I chose 'proposed_flags' as they may not actually end up in
'flags', and in an case will be modified when they are moved over.

This affects the API, but not ABI of the user-mode interface.
2007-12-21 12:16:29 -08:00
Keith Packard 881ee70ab7 Move dummy_read_page from drm_ttm_set_user to drm_ttm_create.
I'm hoping to use the dummy_read_page for kernel allocated buffers to avoid
allocating extra pages for read-only buffers (like vertex and batch buffers).
This also eliminates the 'write' parameter to drm_ttm_set_user and just
has DRM_TTM_PAGE_WRITE passed into drm_ttm_create.
2007-12-21 12:16:29 -08:00
Keith Packard 6d44f48002 Clean up and document drm_ttm.c APIs. drm_bind_ttm -> drm_ttm_bind.
Aside from changing drm_bind_ttm to drm_ttm_bind, this patch
adds only documentation and fixes the functions inside drm_ttm.c
to all be prefixed with drm_ttm_.
2007-12-21 12:16:29 -08:00
Dave Airlie 629231c626 Merge branch 'modesetting-airlied' into modesetting-101 2007-12-18 19:18:21 +11:00
Dave Airlie b13dc383df remove output names 2007-12-18 17:41:20 +11:00
Jakob Bornecrantz e239882b1e Modesetting Hotplug 2007-12-18 02:21:08 +01:00
Keith Packard 9d17373ffb Document drm_buffer_object_validate function.
Just add documentation for this function, no code changes.
2007-12-15 12:10:42 -08:00
Keith Packard 7461519fed Document fence_class mess in drm_bo_setstatus_ioctl
drmBOSetStatus does not bother to set the fence_class parameter.
Fortunately, drm_bo_setstatus_ioctl doesn't end up using it as it
calls drm_bo_handle_validate with use_old_fence_class = 1.
2007-12-15 12:10:42 -08:00
Keith Packard 5f23519b14 Document drm_bo_handle_validate. Match drm_bo_do_validate parameter order.
Document parameters and usage for drm_bo_handle_validate. Change parameter
order to match drm_bo_do_validate (fence_class has been moved to after
flags, hint and mask values). Existing users of this function have been
changed, but out-of-tree users must be modified separately.
2007-12-15 12:10:42 -08:00
Keith Packard b5181d2506 Document drm_bo_do_validate. Remove spurious 'do_wait' parameter.
Add comments about the parameters to drm_bo_do_validate, along
with comments for the DRM_BO_HINT options. Remove the 'do_wait'
parameter as it is duplicated by DRM_BO_HINT_DONT_BLOCK.
2007-12-15 12:10:42 -08:00
Keith Packard b0bc5f1ae5 Make ttm create/destroy APIs consistent. Pass page_flags in create.
Creating a ttm was done with drm_ttm_init while destruction was done with
drm_destroy_ttm. Renaming these to drm_ttm_create and drm_ttm_destroy makes
their use clearer. Passing page_flags to the create function will allow that
to know whether user or kernel pages are needed, with the goal of allowing
kernel ttms to be saved for later reuse.
2007-12-15 12:10:41 -08:00
Alan Hourihane f62a300547 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101 2007-12-13 10:41:23 +00:00
Alan Hourihane 35a8b61317 catch an out of memory condition 2007-12-13 10:40:36 +00:00
Thomas Hellstrom d1b0258b32 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101 2007-11-15 10:42:47 +01:00
Thomas Hellstrom 6206091e5f mm fixups. 2007-11-15 10:39:41 +01:00
Thomas Hellstrom c07dd80269 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Conflicts:

	linux-core/Makefile.kernel
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2007-11-06 10:01:52 +01:00
Thomas Hellstrom 40fb079aeb Avoid buffers not ending up on a list in some cases. 2007-11-06 09:47:57 +01:00
Thomas Hellstrom 5ce43a346c Merge branch 'master' into modesetting-101
Conflicts:

	linux-core/drm_bufs.c
	shared-core/i915_dma.c
	shared-core/i915_drv.h
	shared-core/i915_irq.c
2007-11-05 13:46:06 +01:00
Thomas Hellstrom 44ad6f409d Fix a user-buffer check. 2007-11-05 13:20:16 +01:00
Dave Airlie 7ad3890707 drm/ttm: kernel coding style for bo.c and objects.h 2007-11-05 19:05:32 +10:00
Dave Airlie 7f6bf84c23 drm: remove lots of spurious whitespace.
Kernel "cleanfile" script run.
2007-11-05 12:42:22 +10:00
Dave Airlie a2e8e294d8 drm: fix oops since user objects.. 2007-11-04 11:01:27 +11:00
Thomas Hellstrom 9906c7e54b Merge branch 'master' into modesetting-101 2007-11-02 16:07:36 +01:00