Commit graph

373 commits

Author SHA1 Message Date
Jesse Barnes 123f794fa7 i915: Fix GR register array size off-by-one bug
Make sure we have enough room for all the GR registers or we'll end up
clobbering the AR index register (which should actually be harmless
unless the BIOS is making an assumption about it).

Noticed-by: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-07 11:35:13 -08:00
Dave Airlie 3d5e2c13b1 drm: add initial r500 drm support
This adds CP support for the r500 series of chips, and allows
accel 2D support on these chips with a new radeon driver.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-07 15:13:40 +10:00
Roland Scheidegger 576cc458a6 radeon: setup the ring buffer fetcher to be less agressive.
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:12:07 +10:00
Dave Airlie 9d5b3ffc42 drm: fixup some of the ioctl function exit paths
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:12:00 +10:00
Dave Airlie 19a8f59ab8 drm: the drm really should call pci_set_master..
perhaps bonghits could turn on my bus-mastering because the drm
certainly never bothered doing it before.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:40 +10:00
Zhenyu Wang 5f5f9d4c7b i915: Add chipset id for Intel Integrated Graphics Device
This adds new chipset id in drm.

Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-02-07 15:09:40 +10:00
Márton Németh 3e684eae58 drm: cleanup DRM_DEBUG() parameters
As DRM_DEBUG macro already prints out the __FUNCTION__ string (see
drivers/char/drm/drmP.h), it is not worth doing this again. At some
other places the ending "\n" was added.

airlied:- I cleaned up a few that this patch missed also

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Carlos Martín 4d1f78880e drm/i915: add support for E7221 chipset
E7221 chipset is a server version of the i915.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Li Zefan d5b0d1b5bd drm: don't cast a pointer to pointer of list_head
The casting is safe only when the list_head member is the first member of
the structure.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Jesper Juhl a96ca105a6 mga_dma: return 'err' not just zero from mga_do_cleanup_dma()
While reading some code I stumbled across the use of 'err' in
drivers/char/drm/mga_dma.c::mga_do_cleanup_dma() and I think there's a small
problem.

The variable is only used inside #if __OS_HAS_AGP which is fine, but all that
ever happens is an assignment to the variable - it is never actually used for
anything.  The variable is nicely initialized to zero which is also what the
return statement at the end of function returns (always at the moment).

It looks to me like that function should be returning 'err' instead of always
just returning 0.  Here's a patch to do that.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Dave Airlie e3236a1173 drm: add _DRM_DRIVER flag, and re-order unload.
Allow drivers to addmaps that won't be removed by lastclose or unload.
The unload needs to be re-ordered to avoid removing the hashs before
the driver has removed the final maps.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Dave Airlie 77e27e9fe5 drm: enable udev node creation
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Eric Anholt b018fcdaa5 drm: Make DRM_IOCTL_GET_CLIENT return EINVAL when it can't find client #idx.
Fixes the getclient test and dritest -c.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Dave Airlie 3260f9fdfe drm: move drm_mem_init to proper place in startup sequence
For TTM this needs to be called later.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Dave Airlie 2716a02f60 drm: call driver load function after initialising AGP
needed to intel chipset flushing

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Ian Romanick 7ffa05e051 drm: Fix ioc32 compat layer
Previously any ioctls that weren't explicitly listed in the compat ioctl
table would fail with ENOTTY.  If the incoming ioctl number is outside the
range of the table, assume that it Just Works, and pass it off to drm_ioctl.
This make the fence related ioctls work on 64-bit PowerPC.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:39 +10:00
Eric Anholt 47a184a808 drm: fd.o bug #11895: Only add the AGP base to map offset if the caller didn't.
The i830 and newer intel 2D code adds the AGP base to map offsets already,
because it wasn't doing the AGP enable which used to set dev->agp->base.

Credit goes to Zhenyu for finding the issue.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:38 +10:00
Jesse Barnes ba8bbcf6ff i915: add suspend/resume support
Add suspend/resume support to the i915 driver.  Moves some of the
initialization into the driver load routine, and fixes up places where we
assumed no dev_private existed in some of the cleanup paths.  This allows
us to suspend/resume properly even if X isn't running.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:38 +10:00
Jesse Barnes e8b962b6df drm: update DRM sysfs support
Make DRM devices use real Linux devices instead of class devices, which are
going away.  While we're at it, clean up some of the interfaces to take
struct drm_device * or struct device * and use the global drm_class where
needed instead of passing it around.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:38 +10:00
Eric Anholt 8b40958032 drm: Initialize the AGP structure's base address at init rather than enable.
Not all drivers call enable (intel), but they would still like to use this
member in driver code.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:38 +10:00
Dave Airlie ded23359cc drm: move two function extern into the correct block 2008-02-07 15:09:38 +10:00
Dave Airlie bc5f4523f7 drm: run cleanfile across drm tree
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:38 +10:00
Dave Airlie 8562b3f25d drm: some minor cleanups and changes to make memory manager merging easier.
Signed-off-by: Dave Airlie <airlied@linux.ie>
2008-02-07 15:09:38 +10:00
Linus Torvalds f5bb3a5e9d Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (79 commits)
  Jesper Juhl is the new trivial patches maintainer
  Documentation: mention email-clients.txt in SubmittingPatches
  fs/binfmt_elf.c: spello fix
  do_invalidatepage() comment typo fix
  Documentation/filesystems/porting fixes
  typo fixes in net/core/net_namespace.c
  typo fix in net/rfkill/rfkill.c
  typo fixes in net/sctp/sm_statefuns.c
  lib/: Spelling fixes
  kernel/: Spelling fixes
  include/scsi/: Spelling fixes
  include/linux/: Spelling fixes
  include/asm-m68knommu/: Spelling fixes
  include/asm-frv/: Spelling fixes
  fs/: Spelling fixes
  drivers/watchdog/: Spelling fixes
  drivers/video/: Spelling fixes
  drivers/ssb/: Spelling fixes
  drivers/serial/: Spelling fixes
  drivers/scsi/: Spelling fixes
  ...
2008-02-04 07:58:52 -08:00
Nick Piggin 2f98735c9c vm audit: add VM_DONTEXPAND to mmap for drivers that need it
Drivers that register a ->fault handler, but do not range-check the
offset argument, must set VM_DONTEXPAND in the vm_flags in order to
prevent an expanding mremap from overflowing the resource.

I've audited the tree and attempted to fix these problems (usually by
adding VM_DONTEXPAND where it is not obvious).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-04 07:55:38 -08:00
Joe Perches 8dfba4d71b drivers/char/: Spelling fixes
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2008-02-03 17:11:42 +02:00
Carlos Martín 53256f5911 drm/i915: add support for E7221 chipset
E7221 chipset is a server version of the i915.

Signed-off-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-23 18:04:55 -08:00
Li Zefan 246a3d186a drm: DRM: fix memset size error
The size passing to memset is wrong.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-11-06 10:12:44 +10:00
Dave Airlie 747824c67b drm: remove remnants of DRM_COPY_FROM/TO_USER_IOCTL
This is a bug in the savage driver since I introduced these changes.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-11-06 10:11:12 +10:00
Dave Airlie f9618ac08b drm: remove second forward decleration of drm device struct.
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-11-06 10:11:12 +10:00
Roel Kluin 038477aa15 drm/sis: missing mutex unlock in error path.
airlied: separated this out from a patch on lkml.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-11-05 10:53:18 +10:00
Dave Airlie 7fc86860cf radeon: set the address to access the GART table on the CPU side correctly
This code relied on the CPU and GPU address for the aperture being the same,
On some r5xx hardware I was playing with I noticed that this isn't always true.
This fixes issues seen on some r400 cards. (bugs.freedesktop.org 9957)

Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-11-05 10:49:04 +10:00
Jan Engelhardt 96de0e252c Convert files to UTF-8 and some cleanups
* Convert files to UTF-8.

  * Also correct some people's names
    (one example is Eißfeldt, which was found in a source file.
    Given that the author used an ß at all in a source file
    indicates that the real name has in fact a 'ß' and not an 'ss',
    which is commonly used as a substitute for 'ß' when limited to
    7bit.)

  * Correct town names (Goettingen -> Göttingen)

  * Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313)

Signed-off-by: Jan Engelhardt <jengelh@gmx.de>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19 23:21:04 +02:00
Pavel Emelyanov ba25f9dcc4 Use helpers to obtain task pid in printks
The task_struct->pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.

The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.

[akpm@linux-foundation.org: git-drm went and changed lots of stuff]
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-19 11:53:43 -07:00
Randy Dunlap 179b025fea video gfx: merge kconfig menus
Move AGP and DRM menus into the video graphics support menu.
  They use 'menuconfig' so that they can all be disabled with
  one selection.
Make the console menu use 'menuconfig' so that it can all be
  disabled with one selection.
Make the frame buffer menu use 'menuconfig' so that it can all be
  disabled with one selection.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 09:43:20 -07:00
Adrian Bunk f75a71f51b radeon_driver_vblank_do_wait() static
radeon_driver_vblank_do_wait() can become static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 09:43:15 -07:00
Xavier Bachelot ace3dff5b7 via invalid device ids removal
0x1106, 0x7204 is unknown and thus is not an IGP/GPU.
0x1106, 0x3304 is K8M800 hostbridge, not an IGP/GPU.
None of them are in drm git tree.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-10-15 11:09:35 +10:00
chaohong guo eed0f722b3 radeon: Commit the ring after each partial texture upload blit.
This makes sure each blit starts as early as possible, which may improve
texture upload performance in some cases.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-10-15 10:45:49 +10:00
Dave Airlie 54583bf4ef i915: fix vbl swap allocation size.
Oops...

Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-10-15 10:42:27 +10:00
Eric Anholt c153f45f9b drm: Replace DRM_IOCTL_ARGS with (dev, data, file_priv) and remove DRM_DEVICE.
The data is now in kernel space, copied in/out as appropriate according to t
This results in DRM_COPY_{TO,FROM}_USER going away, and error paths to deal
with those failures.  This also means that XFree86 4.2.0 support for i810 DR
is lost.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-10-15 10:38:20 +10:00
Dave Airlie b589ee5943 drm: remove XFREE86_VERSION macros.
These are no longer needed or being used.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2007-10-15 10:38:20 +10:00
Eric Anholt 6c340eac02 drm: Replace filp in ioctl arguments with drm_file *file_priv.
As a fallout, replace filp storage with file_priv storage for "unique
identifier of a client" all over the DRM.  There is a 1:1 mapping, so this
should be a noop.  This could be a minor performance improvement, as everyth
on Linux dereferenced filp to get file_priv anyway, while only the mmap ioct
went the other direction.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-10-15 10:38:20 +10:00
Eric Anholt 20caafa6ec drm: Remove DRM_ERR OS macro.
This was used to make all ioctl handlers return -errno on linux and errno on
*BSD.  Instead, just return -errno in shared code, and flip sign on return f
shared code to *BSD code.

Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-10-15 10:38:19 +10:00
Dave Airlie e4a7b1d1d9 i915: make vbl interrupts work properly on i965g/gm hw.
This code is ported from the DRM git tree and allows the vblank interrupts
to function on the i965 hw. It also requires a change in Mesa's 965 driver
to actually use them.

[ Without this patch, my 965GM drops vblank interrupts  - Jesse ]

Signed-off-by: Dave Airlie <airlied@linux.ie>
Acked-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-09-27 19:47:28 -07:00
Linus Torvalds 6869ce1c14 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: ioremap return value checks
  drm/via: Fix dmablit when blit queue is full
  drm_rmmap_ioctl(): remove dead code
2007-08-25 08:01:06 -07:00
Scott Thompson 0769d39c99 drm: ioremap return value checks
Signed-off-by: Scott Thompson <postfail <at> hushmail.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-08-25 18:17:49 +10:00
Dave Airlie 21f1628927 drm/i915: Fix i965 secured batchbuffer usage
This 965G and above chipsets moved the batch buffer non-secure bits to
another place. This means that previous drm's allowed in-secure batchbuffers
to be submitted to the hardware from non-privileged users who are logged
into X and and have access to direct rendering.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-08-06 17:46:23 -07:00
Simon Farnsworth 22c806c23f drm/via: Fix dmablit when blit queue is full
fd.o bug 11542

Acked-by: Thomas Hellstrom
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-23 18:32:01 +10:00
Adrian Bunk 7ea4d4bd5e drm_rmmap_ioctl(): remove dead code
This patch removes some obviously dead code spotted by the Coverity
checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Dave Airlie <airlied@linux.ie>
2007-07-23 18:29:41 +10:00
Yoann Padioleau dd00cc486a some kmalloc/memset ->kzalloc (tree wide)
Transform some calls to kmalloc/memset to a single kzalloc (or kcalloc).

Here is a short excerpt of the semantic patch performing
this transformation:

@@
type T2;
expression x;
identifier f,fld;
expression E;
expression E1,E2;
expression e1,e2,e3,y;
statement S;
@@

 x =
- kmalloc
+ kzalloc
  (E1,E2)
  ...  when != \(x->fld=E;\|y=f(...,x,...);\|f(...,x,...);\|x=E;\|while(...) S\|for(e1;e2;e3) S\)
- memset((T2)x,0,E1);

@@
expression E1,E2,E3;
@@

- kzalloc(E1 * E2,E3)
+ kcalloc(E1,E2,E3)

[akpm@linux-foundation.org: get kcalloc args the right way around]
Signed-off-by: Yoann Padioleau <padator@wanadoo.fr>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Bryan Wu <bryan.wu@analog.com>
Acked-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Dave Airlie <airlied@linux.ie>
Acked-by: Roland Dreier <rolandd@cisco.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Acked-by: Pierre Ossman <drzeus-list@drzeus.cx>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: "David S. Miller" <davem@davemloft.net>
Acked-by: Greg KH <greg@kroah.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-19 10:04:50 -07:00