Commit Graph

164 Commits

Author SHA1 Message Date
Dave Airlie
5d23fafb1b drm: possible cleanups
This patch contains the following possible cleanups:
- make the following needlessly global function static:
 - drm_bufs.c: drm_addbufs_fb()
- remove the following unused EXPORT_SYMBOL's:
 - drm_agpsupport.c: drm_agp_bind_memory
 - drm_bufs.c: drm_rmmap_locked
 - drm_bufs.c: drm_rmmap
 - drm_stub.c: drm_get_dev

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-04-23 18:26:40 +10:00
Dave Airlie
caa98c41c0 drm: fixup r300 scratch on BE machines
This fixes the r300 scratch stuff to work on PPC,
from Ben Herrenschmidt on IRC.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-04-23 18:14:00 +10:00
Jayachandran C
d253258c80 drm: Fix further issues in drivers/char/drm/via_irq.c
Fix de-reference of 'dev_priv' before NULL check.

Signed-off-by: Jayachandran C. <c.jayachandran@gmail.com>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@osdl.org>
2006-04-18 21:04:48 +10:00
Adrian Bunk
031de96af0 drivers/char/drm/drm_memory.c: possible cleanups
- #if 0 the following unused global function:
  - drm_ioremap_nocache()

- make the following needlessly global functions static:
  - agp_remap()
  - drm_lookup_map()

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@osdl.org>
2006-04-18 21:03:51 +10:00
Dave Airlie
31f64bd101 drm: deline a few large inlines in DRM code
This patch moves a few large functions from drm_memory.h
to drm_memory.c, with the following effect:

  text    data     bss     dec     hex filename
 46305    1304      20   47629    ba0d new/drm.ko
 46367    1304      20   47691    ba4b org/drm.ko
 12969    1372       0   14341    3805 new/i810.ko
 14712    1372       0   16084    3ed4 org/i810.ko
 16447    1364       0   17811    4593 new/i830.ko
 18198    1364       0   19562    4c6a org/i830.ko
 11875    1324       0   13199    338f new/i915.ko
 13025    1324       0   14349    380d org/i915.ko
 23936   29288       0   53224    cfe8 new/mga.ko
 27280   29288       0   56568    dcf8 org/mga.ko

Please apply.

Signed-off-by: Denis Vlasenko <vda@ilport.com.ua>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-04-07 16:55:43 +10:00
Dave Airlie
11bab7d2c8 drm: remove master setting from add/remove context
Clients can do this in the miniglx setups.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-04-05 18:13:13 +10:00
Dave Airlie
195b3a2d57 drm: drm_pci needs dma-mapping.h
On alpha:

WARNING: "dma_free_coherent" [drivers/char/drm/drm.ko] undefined!
WARNING: "dma_alloc_coherent" [drivers/char/drm/drm.ko] undefined!

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-04-05 18:12:18 +10:00
Dave Airlie
86678dfddb [PATCH] drm: Fix issue reported by Coverity in drivers/char/drm/via_irq.c
This patch tries to fix an issue reported in drivers/char/drm/via_irq.c by
Coverity, please review and apply if correct.

Error reported:
CID: 3444 Checker: REVERSE_INULL (help)
File: /export2/p4-coverity/mc2/linux26/drivers/char/drm/via_irq.c
Function: via_driver_irq_wait
Description: Pointer "dev_priv" dereferenced before NULL check

Patch Description:
 Move de-referencing dev_priv to after the NULL check.

Signed-off-by: Jayachandran C. <c.jayachandran at gmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-04-05 18:10:11 +10:00
Linus Torvalds
63e8d9114d Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
  drm: remove drm_{alloc,free}_pages
  drm: sis fix compile warning
  drm: add new radeon PCI ids..
  drm: read breadcrumb in IRQ handler
  drm: fixup i915 breadcrumb read/write
  drm:  remove pointless checks in radeon_state
  drm: fixup improper cast.
  drm: rationalise some pci ids
  drm: Add general-purpose packet for manipulating scratch registers (r300)
  drm: rework radeon memory map (radeon 1.23)
  drm: update r300 register names
  drm: fixup PCI DMA support
2006-03-30 14:26:27 -08:00
Dave Airlie
55eb061326 drm: remove drm_{alloc,free}_pages
drm_alloc_pages and drm_free_pages can now be removed.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-29 08:16:12 +10:00
Dave Airlie
d2b58b5883 drm: sis fix compile warning
Prevent a gcc warning in the SIS DRM driver.  offset is a unsigned int and
the printk wants a long.

Signed-off-by: Jon Mason <jdmason@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-29 08:12:52 +10:00
Arjan van de Ven
99ac48f54a [PATCH] mark f_ops const in the inode
Mark the f_ops members of inodes as const, as well as fix the
ripple-through this causes by places that copy this f_ops and then "do
stuff" with it.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-28 09:16:05 -08:00
Dave Airlie
f3dd5c3738 drm: add new radeon PCI ids..
This adds all the r300 and r400 PCI ids from DRM CVS, it also
makes these cards only initialise when the new xorg driver is
used, as otherwise the DRM can cause lockups.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-25 18:09:46 +11:00
David S. Miller
14778d9072 [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-03-22 01:15:13 -08:00
Adrian Bunk
7b9af3455b remove dead Radeon URL
This patch removes a dead Radeon URL from two Kconfig files.

This isue was noted by Reto Gantenbein <ganto82@gmx.ch> in
Kernel Bugzilla #4446.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-03-20 20:23:13 +01:00
Dave Airlie
6e5fca53c7 drm: read breadcrumb in IRQ handler
From: Keith Whitwell <keithw@tungstengraphics.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-20 18:34:29 +11:00
Dave Airlie
e7f947b908 drm: fixup i915 breadcrumb read/write
Some minor issues in the i915 breadcrumb code.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 20:28:19 +11:00
Dave Airlie
2fab58d1a1 drm: remove pointless checks in radeon_state
If these were valid checks, we'd have already oopsed several
lines above where we were already dereferencing them.

DA: these used to be valid but other changes made them unnecessary.

Coverity: 776,777,778
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 20:15:41 +11:00
Dave Airlie
f15e92d702 drm: fixup improper cast.
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 20:12:23 +11:00
Dave Airlie
dfab11542f drm: rationalise some pci ids
This is the start of some work from Roland Scheidegger to align
the X DDX pci ids and the drm ones, however we don't want to put
r300 ids in the kernel just yet, they destabilise a few machines.

From: Roland Scheidegger (via DRM CVS)
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 20:01:37 +11:00
Dave Airlie
ee4621f011 drm: Add general-purpose packet for manipulating scratch registers (r300)
From: Aapo Tahkola (via DRM CVS)
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 19:45:26 +11:00
Dave Airlie
d5ea702f1e drm: rework radeon memory map (radeon 1.23)
This code reworks the radeon memory map so it works better
for newer r300 chips and for a lot of older PCI chips.

It really requires a new X driver in order to take advantage of this code.

From: Ben Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 19:37:55 +11:00
Dave Airlie
45f17100bf drm: update r300 register names
Update some of the DRM register names from DRM CVS

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 19:12:10 +11:00
Dave Airlie
ddf19b973b drm: fixup PCI DMA support
This patch makes the PCI support use the correct Linux interfaces finally.
Tested in DRM CVS on PCI MGA card.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-03-19 18:56:12 +11:00
Dave Airlie
73d72cffe5 drm: fix brace placement
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-02-18 16:30:54 +11:00
Dave Airlie
4e5e2e2560 drm: radeon add r300 TX_CNTL and verify bitblt packets
The Xgl on r300 doesn't work unless you add a verify bitblt function to the
DRM, and we need to pass TX_CNTL to flush texture caches.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-02-18 15:51:35 +11:00
Dave Airlie
91e3738ebc drm: fixup i915 interrupt on X server exit
Fixes: IRQ disabled (i915?) when switchig between gnome themes (gnome-theme-manager)

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-02-18 15:17:04 +11:00
Dave Jones
75c0141ca2 [PATCH] Remove "RV370 5B60 [Radeon X300 (PCIE)]" from DRI list
I get a machine check exception, triple fault, or NMI watchdog lockup
when DRI gets enabled on this card.

(And Mauro Tassinari <mtassinari@cmanet.it> reports hung kernels too in
http://lkml.org/lkml/2006/1/26/97)

[ Adrian Bunk also states that this is the only RV350 entry for an RV370
  in our lists, which implies that it's just buggy ]

Cc: Adrian Bunk <bunk@stusta.de>
Cc: Dave Jones <davej@redhat.com>
Cc: Mauro Tassinari <mtassinari@cmanet.it>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-13 11:14:45 -08:00
Greg Kroah-Hartman
0650fd5824 [PATCH] DRM: fix up classdev interface for drm core
Current drm code doesn't work with userspace programs that listen only
to the kernel event netlink socket as it is trying to create its own dev
interface.  Turns out lots of code can just be deleted as the driver
core can do all of this work automatically for you.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-02-06 12:17:17 -08:00
Linus Torvalds
cf41f8ac38 Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2006-02-02 07:49:43 -08:00
Dave Airlie
30e2fb1881 sem2mutex: drivers/char/drm/
From: Arjan van de Ven <arjan@infradead.org>

Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-02-02 19:37:46 +11:00
Dave Airlie
ce60fe02fb drm: drivers/char/drm/: make some functions static
From: Adrian Bunk <bunk@stusta.de>

This patch makes some needlessly global functions static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-02-02 19:21:38 +11:00
Dave Airlie
339363c4c6 drm: Fixes sparse warnings in via_dmablit.c
Fixes the following sparse warnings:

 drivers/char/drm/via_dmablit.c:111:35: warning: Using plain integer as NULL pointer
 drivers/char/drm/via_dmablit.c:584:23: warning: Using plain integer as NULL pointer

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-26 08:32:14 +11:00
Dave Airlie
de227f5f32 drm: i915 patches from Tungsten Graphics
Fix CMDBUFFER path, add heap destroy and flesh out sarea for rotation
(Tungsten Graphics)

From: Alan Hourihane <alanh@tungstengraphics.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-25 15:31:43 +11:00
Dave Airlie
507d256bae drm: ati_pcigart: simplify page_count manipulations
From: Nick Piggin <npiggin@suse.de>

Allocate a compound page for the user mapping instead of tweaking the page
refcounts.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-25 14:58:58 +11:00
Dave Airlie
f1e5c03d34 drm: use NULL instead of 0
From: Randy Dunlap <rdunlap@xenotime.net>

Use NULL instead of 0 (sparse warnings):

drivers/char/drm/ati_pcigart.c:64:10: warning: Using plain integer as NULL
pointer
drivers/char/drm/ati_pcigart.c:130:21: warning: Using plain integer as NULL
pointer
drivers/char/drm/ati_pcigart.c:171:14: warning: Using plain integer as NULL
pointer

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-25 14:54:15 +11:00
Dave Airlie
2fed3bd743 drm: add X600 PCI IDs
From: Brice Goglin <Brice.Goglin@ens-lyon.org>

Now that Xorg 6.9/7.0 has been released, DRI is supported on more Radeon
cards without ATI proprietary drivers.  I got my X300 to work without
problem.  But, another Radeon X600 required to add its PCI ids to the
Radeon driver.  Patch is attached.

I can't be sure about the "CHIP_RV350", I copied it from the X300 entry
(from http://dri.freedesktop.org/wiki/ATIRadeon, X600 is a rv380 chip while
X300 is a rv370).  But, at least it works now.

Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-25 14:52:43 +11:00
Dave Airlie
5457f38e01 drm: add i945GM PCI ID
From: Charles F. Johnson <charles.f.johnson@intel.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-25 14:34:33 +11:00
Dave Airlie
d59cc22f7c drm: Fix sparce warning in radeon driver
From: Luiz Fernando Capitulino <lcapitulino@mandriva.com.br>

drivers/char/drm/radeon_cp.c:1643:31: warning: Using plain integer as NULL
pointer

Signed-off-by: Luiz Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-25 14:31:45 +11:00
Arjan van de Ven
858119e159 [PATCH] Unlinline a bunch of other functions
Remove the "inline" keyword from a bunch of big functions in the kernel with
the goal of shrinking it by 30kb to 40kb

Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-14 18:27:06 -08:00
Linus Torvalds
37ef4399a6 Merge branch 'drm-forlinus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 2006-01-12 13:53:40 -08:00
Dave Airlie
9c7d462eda drm: fix issues with systems with no MTRR
On systems with no MTRR we should still define the interface.

Original bug from apkm.
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-12 20:44:30 +11:00
Dave Airlie
aab8df141f drm: cleanup properly on drm module unload
Cleanup multiple cards properly

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-11 22:32:51 +11:00
Dave Airlie
8d2ea62581 drm: fixup drm bufs being just under the EOM
If the mapping was just under the end of memory it would fail.
Lets DRM start on my PCI card.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-11 20:48:09 +11:00
Christoph Hellwig
7ff92053dd [PATCH] don't include ioctl32.h in drivers
These days ioctl32.h is only used for communication of fs/compat.c and
fs/compat_ioctl.c and doesn't contain anything of interest to drivers.

Remove inclusion in various drivers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-10 08:01:34 -08:00
Dave Airlie
f8e0f2905b drm: fix radeon warnings on 64-bit
From: Andrew Morton <akpm@osdl.org>

drivers/char/drm/radeon_state.c: In function `radeon_cp_dispatch_texture':
drivers/char/drm/radeon_state.c:1653: warning: int format, different type arg
(arg 3)
drivers/char/drm/radeon_state.c:1661: warning: int format, different type arg
(arg 3)
drivers/char/drm/radeon_state.c:1689: warning: int format, different type arg
(arg 3)

sizeof() doesn't return an int.

Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-10 19:56:17 +11:00
Dave Airlie
2185200cd2 drm: fix warning on alpha
From: Andrew Morton <akpm@osdl.org>

On alpha:

drivers/char/drm/via_dmablit.h:44: error: field `direction' has incomplete type

Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-10 19:53:54 +11:00
Dave Airlie
4e4c62bd45 drm: remove is_pci flag completely...
this snuck back in, in the last merge.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-03 22:25:29 +11:00
Dave Airlie
97f2aab669 drm: merge in Linus mainline 2006-01-03 18:18:01 +11:00
Dave Airlie
d985c10881 drm: major update from CVS for radeon and core
This patch pull in a lot of changes from CVS to the main core DRM,
and updates the radeon driver to 1.21.0 that supports r300 texrect
and radeon card type ioctl.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2006-01-02 21:32:48 +11:00