Commit Graph

910 Commits (2df2c70e20caa3d6d1a1ac12da6fe3cc0689d51f)

Author SHA1 Message Date
Thomas Hellstrom 7bcb62b45d Rework buffer object vm code to use nopfn() for kernels >= 2.6.19. 2007-02-14 10:49:37 +01:00
Thomas Hellstrom 6b289db054 Remove debug printout. 2007-02-13 20:47:30 +01:00
Thomas Hellstrom e1460426b8 Bugzilla Bug #9457
Add refcounting of user waiters to the DRM hardware lock, so that we can use the
DRM_LOCK_CONT flag more conservatively.

Also add a kernel waiter refcount that if nonzero transfers the lock for the kernel context,
when it is released. This is useful when waiting for idle and can be used
for very simple fence object driver implementations for the new memory manager.

It also resolves the AIGLX startup deadlock for the sis and the via drivers.
i810, i830 still require that the hardware lock is really taken so the deadlock remains
for those two. I'm not sure about ffb. Anyone familiar with that code?
2007-02-13 20:47:30 +01:00
Thomas Hellstrom 9efdae317c More bugfixes.
Fixed memory, pinned buffers and unmappable memory now seems
fully functional.
2007-02-13 20:05:32 +01:00
Adam Jackson 5bd13c5e15 Fix some outdated URLs, remove others. 2007-02-12 15:45:51 -05:00
Thomas Hellstrom 398913dc0e Lindent. 2007-02-12 20:34:50 +01:00
Thomas Hellstrom b0c5339ed6 More bugfixes. 2007-02-12 20:32:03 +01:00
Thomas Hellstrom f02f83ee08 Cleanup and fix support for pinned buffers. 2007-02-12 17:47:57 +01:00
Thomas Hellstrom 85ee2a8d04 Various bugfixes. 2007-02-10 12:06:36 +01:00
Thomas Hellstrom 53aee3122a I915 accelerated blit copy functional.
Fixed - to System memory copies are implemented by
flipping in a cache-coherent TTM,
blitting to it, and then flipping it out.
2007-02-09 16:36:53 +01:00
Thomas Hellstrom 57df398072 Reinstate some LRU handling. 2007-02-09 12:43:18 +01:00
Thomas Hellstrom d32b21e016 Remove some code that should have gone in
commit 6a49d9a8ab
2007-02-09 00:11:53 +01:00
Thomas Hellstrom 99acdaee48 Fix copyright statements. 2007-02-09 00:07:29 +01:00
Thomas Hellstrom 6a49d9a8ab Fix evict_mutex locking range.
Implement unmappable buffers. (fault moves them to mappable when needed).
Various bugfixes.
2007-02-09 00:02:02 +01:00
Thomas Hellstrom b2bcbf874b Add an accelerated buffer copy cleanup helper.
Export helper functions and make some important buffer-object functions non-static.
Add an i915 accelerated blit buffer move for pci memory buffers.
2007-02-08 21:28:33 +01:00
Thomas Hellstrom a0ed808d05 Don't create a ttm just to copy from. 2007-02-08 19:06:39 +01:00
Thomas Hellstrom bf8f46d4c6 Fix mm_block leak.
Some other minor fixes.
2007-02-08 18:59:02 +01:00
Thomas Hellstrom e4b2da4406 A minor function interface change and some memcpy bugfixing.
Hooray!! it sort of works with a fixed AGP area as faked VRAM.
2007-02-08 16:21:38 +01:00
Thomas Hellstrom 1257907fa9 Simplify external ttm page allocation.
Implement a memcpy fallback for copying between buffers.
2007-02-08 13:29:08 +01:00
Thomas Hellstrom 09984ad77b Update memory compatibility tests.
Now only pinned buffers are broken.
2007-02-08 11:55:24 +01:00
Thomas Hellstrom c1fbd8a566 Checkpoint commit.
Flag handling and memory type selection cleanup.
glxgears won't start.
2007-02-07 17:25:13 +01:00
Thomas Hellstrom af24465b2e Fix a stray unlock_kernel() in drm_vm.c
Add a file for memory move helpers, drm_bo_move.c
Implement generic memory move.
Cached, no_move and unmapped memory temporarily broken.
2007-02-07 12:52:23 +01:00
Thomas Hellstrom 71b9e876f9 Simplify pci map vs no pci map choice. 2007-02-06 16:59:45 +01:00
Thomas Hellstrom 40ce53dfde Implement a drm_mem_reg_t substructure in the buffer object type. 2007-02-06 15:56:43 +01:00
Thomas Hellstrom 609e3b0375 Implement a policy for selecting memory types. 2007-02-06 14:20:33 +01:00
Thomas Hellstrom 2d962332de i915: Add copy-blit operation. 2007-02-05 16:13:32 +01:00
Stephane Marchesin ebf22aed9a nouveau: add missing nv04_graph.c symlink. 2007-02-03 06:02:12 +01:00
Stephane Marchesin d69902db3b nouveau: fix nv04 graph routines for new register names. 2007-02-03 05:25:36 +01:00
Thomas Hellstrom 63f2abd721 Make also later kernels work with buffer object vm
and clean up some function names.
2007-02-02 19:49:11 +01:00
Thomas Hellstrom c269d560e4 Make vm handle buffer objects instead of ttm objects.
Remove ttm objects.
Make vm aware of PCI memory type buffer objects.
(Only works for pre 2.6.16 kernels for now).
2007-02-02 14:47:44 +01:00
Thomas Hellstrom dd733dea38 Fix missing ttm_open_vma call from previous commit.
Honour the ttm backend cant-use-aperture flag.
2007-02-01 13:19:05 +01:00
Thomas Hellstrom 9677c5ecc6 Prepare for removal of the ttm_object type. 2007-02-01 10:53:55 +01:00
Thomas Hellstrom 333c6af47a Protect drm_mmap against disappearing maps.
The map lists and hash tables are protected using dev->struct_mutex,
but drm_mmap strangely never locked this mutex.
2007-02-01 00:38:57 +01:00
Thomas Hellstrom 3024f23c65 memory manager: Make device driver aware of different memory types.
Memory types are either fixed (on-card or pre-bound AGP) or not fixed
(dynamically bound) to an aperture. They also carry information about:

1) Whether they can be mapped cached.
2) Whether they are at all mappable.
3) Whether they need an ioremap to be accessible from kernel space.

In this way VRAM memory and, for example, pre-bound AGP appear
identical to the memory manager.

This also makes support for unmappable VRAM simple to implement.
2007-01-31 14:50:57 +01:00
Thomas Hellstrom 36d50687dd Fix an error-path oops. 2007-01-31 11:03:53 +01:00
Thomas Hellstrom d399fcf46f Add a buffer object transfer function.
Creates a placeholder for the old buffer contents
when it is transfered to / from static memory like VRAM.
2007-01-30 16:20:23 +01:00
Thomas Hellstrom 9bbdc0fb10 Clean up buffer object destruction somewhat. 2007-01-30 12:35:49 +01:00
Thomas Hellstrom 9a654e71bd Use pre-defined list_splice function. 2007-01-29 13:37:02 +01:00
Thomas Hellstrom 45418bb1b1 s/buf/bo/ for consistency. 2007-01-29 13:37:02 +01:00
Thomas Hellstrom 1e4c7d69f5 Some cleanup. A buffer object should only have one active memory type. 2007-01-29 13:37:02 +01:00
Thomas Hellstrom 582637641a Remove a scary error printed when we were leaking memory caches.
We don't use memory caches anymore...

Fix memory accounting initialization to only use low or DMA32 memory.
2007-01-25 14:27:29 +01:00
Matthieu Castet f04347f371 nouveau: nv20 graph ctx switch.
Untested...
2007-01-13 23:19:41 +01:00
Matthieu Castet cd5f543b2f nouveau: first step to make graph ctx works
It is still not working, but now we could use some 3D commands
without needed to run nvidia blob before.
2007-01-13 21:44:50 +01:00
Dave Airlie 69a98d89d5 nouveau: add missing symlink 2007-01-13 08:43:15 +11:00
Jeremy Kolb 4297a83b48 nouveau: get nv30 context switching to work.
* Pulled in some registers from nv10reg.h.  Needed for context switching.
* Filled in nv30 graphics context (based on nv40_graph.c).
* Figure out nv30 context table, set up on context creation.  Allows the cards automatic switching to work.
2007-01-12 00:14:54 -05:00
Dave Airlie 125f3ff367 Revert "nouveau: Fill in context_init for nv10-nv3x."
This reverts ac076cb9af commit.

Well it didn't do anything interesting...
2007-01-10 15:19:47 +11:00
Jeremy Kolb jkolb@brandeis.edu ac076cb9af nouveau: Fill in context_init for nv10-nv3x.
Fill in the context with the values from PFIFO_CACH1. This should work from nv10 through the nv30 series.
2007-01-09 23:12:37 -05:00
Stephane Marchesin ec12209c76 nouveau: Don't use DRIVER_USE_MTRR, we already setup our own mtrr over vram. 2007-01-10 04:42:09 +01:00
Dave Airlie f6ba3b2603 ttm: make ttm alloc/free into alloc_pages/free_pages
Add a vmalloc flag to the page flags
2007-01-09 15:51:29 +11:00
Dave Airlie 22821cf01d add export symbol for memory manager 2007-01-08 22:27:27 +11:00
Dave Airlie 5bf60c9d6c i830: complete fix for i830 maps 2007-01-08 13:09:51 +11:00
Christoph Hellwig b147c39263 drm: remove drm_follow_page, and drm_ioremap and ioremapfree
This comes from the Re: [patch] paravirt: isolate module ops on lkml
It needs some testing, please report any regressions caused.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-01-08 11:47:15 +11:00
Dave Airlie fe5770b89e fixup i810/i830 to use drm_core_ioremap instead of drm_ioremap 2007-01-08 11:46:54 +11:00
Stephane Marchesin 025f281bbf nouveau: Add an mtrr over the whole FB 2007-01-05 20:49:34 +01:00
Michel Dänzer 972074b5d6 linux-core: Make git ignore generated module symbol version files. 2007-01-02 10:02:44 +01:00
Ben Skeggs 0e0d954584 nouveau: Add nv40-specific PGRAPH code, not hooked up yet. 2007-01-02 14:52:43 +11:00
Dave Airlie 2dcbf6a599 make build against 2.6.20 hopefully 2007-01-01 11:30:38 +11:00
Dave Airlie 87faf62fae fixup permission along line of kernel 2007-01-01 11:22:35 +11:00
Thomas Hellstrom 975136d6e5 Proper allocation of AGP pages for ttms. 2006-12-27 15:32:09 +01:00
Thomas Hellstrom 72cb361c5c Bug #9120.
Require at least agpgart version 0.102 for the AGP TTM backend.
This should hopefully avoid crashes when the wrong agpgart
driver is installed.
2006-12-21 12:05:49 +01:00
Thomas Hellstrom ae58225613 Improve memory manager accounting printout formatting. 2006-12-21 10:43:47 +01:00
Thomas Hellstrom a467d24829 Fix buggy aligned allocations. 2006-12-21 10:43:46 +01:00
Thomas Hellstrom 9acd4a13f2 Remove the stupid root_node field from the core memory manager. 2006-12-20 19:33:50 +01:00
Thomas Hellstrom 672593f611 Replace vmalloc_32.
The vmalloc_32 function together with the memset to clear
the new pages are replaced with a vmalloc_user.

A pre-2.6.18 compat vmalloc_user is added.

Please replace any breakage on machines with > 1GB of memory.
2006-12-20 14:40:36 +01:00
Thomas Hellstrom 3b47b27558 Some via PCI posting flushes. 2006-12-20 13:04:21 +01:00
Dave Airlie e5c4a26a29 Merge branch 'nouveau-1' 2006-12-20 10:30:16 +11:00
Dave Airlie dc1b68aacb fixup symlinks via Makefile 2006-12-20 10:29:43 +11:00
Dave Airlie 744f9ac9c7 add nouveau symlinks via git 2006-12-20 10:28:55 +11:00
Thomas Hellstrom 3b8e6ccd25 Security fix. Zero pages before they are handed to user space.
TTM pages were not cleared when allocated and handed to user space.
Sensitive information may leak.
2006-12-19 23:45:59 +01:00
Thomas Hellstrom 72b5d1507a Security fix. Zero pages before they are handed to user space.
Shared memory areas were not cleared when they are allocated and
handed to user space. Sensitive information may leak.
2006-12-19 23:23:17 +01:00
Thomas Hellstrom 81251bf78f Reclaim buffers locked fixup.
Avoid calling reclaim_buffers_locked if we don't have a
hardware lock.

Improve reclaim_buffers_locked deadlock error formatting.
2006-12-19 23:14:11 +01:00
Dave Airlie 737c73d1a0 add kcalloc compat for before 2.6.10 2006-12-19 22:10:34 +11:00
Dave Airlie bc4c835731 remove do munmap 4 args 2006-12-19 21:51:30 +11:00
Dave Airlie 6333bfdb58 fixup inclusion of agp.h 2006-12-19 21:37:50 +11:00
Dave Airlie aa07b2ab0e remove drm pci from 2.5 days 2006-12-19 21:33:47 +11:00
Dave Airlie ff4b5ccdb4 remove legacy taskqueue code 2006-12-19 21:30:27 +11:00
Dave Airlie 86ff2aeb9b drm: remove all 2.4 support for drm development tree.
Bye bye 2.4 you served us well..
2006-12-19 20:29:03 +11:00
Dave Airlie 656c3a3737 [SPARC]: Respect vm_page_prot in io_remap_page_range().
Make sure the callers do a pgprot_noncached() on
    vma->vm_page_prot.

    Pointed out by Hugh Dickens.

Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-19 18:27:20 +11:00
Dave Airlie 0ab48b0841 [PATCH] mm: incorrect VM_FAULT_OOM returns from drivers
Some drivers are returning OOM when it is not in response to a memory
    shortage.

Signed-off-by: Nick Piggin <npiggin@suse.de>
2006-12-19 18:24:44 +11:00
Dave Airlie 303307d254 fix irq args compatiblity with pre 2.6.19 2006-12-19 18:03:20 +11:00
Dave Airlie 2253e334cc make sizeof match the copy struct 2006-12-19 17:58:14 +11:00
Dave Airlie 6c8712ba8a use spin_lock_init in via dmablit 2006-12-19 17:58:07 +11:00
Dave Airlie 696f2bfbd1 Revert "drm: ioremap balanced with iounmap for drivers/char/drm"
This reverts cc22cd8bde commit.

I put this patch incorrectly in .. will fix now
2006-12-19 16:44:57 +11:00
Dave Airlie cc22cd8bde drm: ioremap balanced with iounmap for drivers/char/drm
ioremap must be balanced by an iounmap and failing to do so can result
in a memory leak.

Tested (compilation only) to make sure the files are compiling without
any warning/error due to new changes

Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-12-19 16:41:10 +11:00
Michael Buesch b3c88d31e1 drm/linux-core: drmP.h compilation fix
I need the following patch to fix compilation of
latest drm/linux-core on my ppc64 machine.

/home/mb/develop/git/drm/linux-core/savage_bci.c: In function ‘savage_driver_firstopen’:
/home/mb/develop/git/drm/linux-core/savage_bci.c:587: error: ‘DRM_MTRR_WC’ undeclared (first use in this function)
/home/mb/develop/git/drm/linux-core/savage_bci.c:587: error: (Each undeclared identifier is reported only once
/home/mb/develop/git/drm/linux-core/savage_bci.c:587: error: for each function it appears in.)
/home/mb/develop/git/drm/linux-core/savage_bci.c: In function ‘savage_driver_lastclose’:
/home/mb/develop/git/drm/linux-core/savage_bci.c:664: error: ‘DRM_MTRR_WC’ undeclared (first use in this function)

I looked at in-kernel drmP.h and it actually
has the same fix in it.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
2006-12-16 11:27:22 +01:00
Thomas Hellstrom 38ed67196f Remove the memory caches for fence objects and memory manager nodes,
since the support for memory caches has gone from 2.6.20.
2006-12-15 12:37:24 +01:00
Michel Dänzer a97bb85c2a Unshare drm_drawable.c again for now.
The current version didn't build on BSD, where the new functionality isn't used
yet anyway. Whoever changes that will hopefully be able to make the OSes share
this file as well.
2006-12-01 10:46:21 +01:00
Michel Dänzer 4a0e61d910 Track linux-core symlinks in git. 2006-12-01 10:37:55 +01:00
Dave Airlie f7affda35b drm: fixup page alignment on SAREA map on ppc64 2006-11-06 11:44:36 +11:00
Dave Airlie 1e90b7ee8c Merge branch 'master' into nouveau-1
Conflicts:

	linux-core/Makefile.kernel
2006-11-06 08:03:18 +11:00
Dave Airlie 94ab96c4d8 nouveau: add compat ioc32 support 2006-11-05 20:39:13 +11:00
Dave Airlie 1e118aeb39 remove config.h 2006-11-05 19:46:30 +11:00
Thomas Hellstrom 4b04c0cc45 Bugzilla Bug #8819
Build fixes for powerpc.
Reported by Katerina Barone-Adesi
2006-10-30 11:18:44 +01:00
Thomas Hellstrom f6d5fecdd2 Last minute changes to support multi-page size buffer offset alignments.
This will come in very handy for tiled buffers on intel hardware.
Also add some padding to interface structures to allow future binary backwards
compatible changes.
2006-10-27 11:28:37 +02:00
Thomas Hellstrom e09544a2d3 New mm function names. Update header. 2006-10-26 21:20:34 +02:00
Thomas Hellstrom 47dbfc4e4a Add improved alignment functionality to the core memory manager.
This makes an allocated block actually align itself and returns any
wasted space to the manager.

Also add some functions to grow and shrink the managed area.
This will be used in the future to manage the buffer object swap cache.
2006-10-26 21:17:43 +02:00
Thomas Hellstrom b4fba1679b Add a one-page hole in the file offset space between buffers. 2006-10-26 21:14:23 +02:00
Thomas Hellstrom 7ea059ae07 Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm 2006-10-21 14:20:28 +02:00
Thomas Hellstrom 9ed4656799 The CPU cache must be flushed _before_ we start modifying the kernel map ptes,
otherwise data will be missing, which becomes apparent when the kernel evicts
batch buffers which are likely to be written into in the evicted state,
and then rebound to the AGP aperture.
This means we cannot rely on the AGP module to flush the
cache for us.
2006-10-21 14:17:51 +02:00
Tilman Sauerbeck a8909a0ebc Bug #1746: Set dev_priv_size for the MGA driver. 2006-10-20 17:05:07 +02:00