summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2009-12-23drm/radeon: fix build on 64-bit with some compilers.Dave Airlie1-2/+2
drivers/gpu/drm/radeon/radeon_test.c:45: undefined reference to `__udivdi3' Reported-by: Mr. James W. Laferriere <babydr@baby-dragons.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-23drivers/gpu: Use kzalloc for allocating only one thingJulia Lawall1-2/+2
Use kzalloc rather than kcalloc(1,...) The use of the allocated memory that looks like an array is &p->relocs[0], but this should be the same as p->relocs. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ @@ - kcalloc(1, + kzalloc( ...) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-23DRM: Rename clamp variableAndi Kleen1-3/+3
linux/kernel.h has a "clamp" macro, but r300_cmdbuf also uses a variable with the same name. Right now it doesn't seem to include the header, but sooner or later someone will. So better rename the variable now. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-18drm: convert drm_ioctl to unlocked_ioctlArnd Bergmann21-140/+89
drm_ioctl is called with the Big Kernel Lock held, which shows up very high in statistics on vfs_ioctl. Moving the lock into the drm_ioctl function itself makes sure we blame the right subsystem and it gets us one step closer to eliminating the locked version of fops->ioctl. Since drm_ioctl does not require the lock itself, we only need to hold it while calling the specific handler. The 32 bit conversion handlers do not interact with any other code, so they don't need the BKL here either and can just call drm_ioctl. As a bonus, this cleans up all the other users of drm_ioctl which now no longer have to find the inode or call lock_kernel. [airlied: squashed the non-driver bits of the second patch in here, this provides the flag for drivers to use to select unlocked ioctls - but doesn't modify any drivers]. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.sourceforge.net Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-18Merge branch 'drm-linus' into drm-core-nextDave Airlie26-66/+1065
2009-12-18Merge remote branch 'korg/drm-vmware-staging' into drm-core-nextDave Airlie28-1/+11394
2009-12-16drm/radeon/kms: fix r100->r500 CS checker for compressed textures. (v2)Dave Airlie4-9/+70
This adds support for compressed textures to the r100->r500 CS checker, it lets me run openarena and the demos in mesa fine. Thanks to Maciej Cencora for initial comments. Changes since v1: fix calculations with Maciej formulas Reviewed-by: Maciej Cencora <m.cencora@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/radeon/kms: allow for texture tilingMaciej Cencora1-1/+9
This adds the relocations for texture tiling for KMS. Signed-off-by: Maciej Cencora <m.cencora@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16Merge remote branch 'korg/drm-radeon-next' into drm-linusDave Airlie4-2/+11
* korg/drm-radeon-next: drm/radeon/kms: init pm on all chipsets
2009-12-16drm/radeon/kms: init pm on all chipsetsRafał Miłecki4-2/+11
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16Merge remote branch 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next into ↵Dave Airlie6-18/+22
drm-linus * 'nouveau/for-airlied' of /ssd/git/drm-nouveau-next: drm/nouveau: remove use of -ERESTART nouveau: Fix endianness with new context program loader drm/nouveau: fix build with CONFIG_AGP=n drm/nouveau: fix ch7006 build
2009-12-16drm/radeon/kms: HDMI support for R600 KMSChristian Koenig9-6/+895
Adding basic HDMI support for R600 KMS, ported from radeonhd ddx. [airlied:- checkpatch cleanups] Signed-off-by: Christian Koenig <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/radeon/kms: make sure mc is initialized before mapping blit boAlex Deucher2-12/+16
We need to make sure the the MC is intialized before we map the blit shader object on r6xx+. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/radeon/kms: Return to userspace on ERESTARTSYSJerome Glisse1-11/+5
radeon_object.h wasn't converted to ERESTARTSYS change. No each time we got an ERESTARTSYS we return to userspace (ie we were interrupted by a signal and we let the userspace reschedule the ioctl). Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/radeon/gem: don't leak a gem object if reserve fails on get tiling (v2)Dave Airlie1-1/+2
Not sure it ever happens in practice, spotted during code review. spare brace snuck in Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/radeon/kms: don't report allocate failure on ERESTARTSYSDave Airlie1-2/+3
if we fail with ERESTARTSYS during alloc, we'll get a retry from userspace so don't report it in dmesg. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/radeon/kms: Check if bo we got from ttm are radeon object or notJerome Glisse3-4/+30
If they are not radeon object don't do anythings special for them, this avoid rare oops than can happen in a complex use case. [airlied: additional fixups] Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/radeon/kms: If no placement is supplied fallback to systemJerome Glisse1-0/+2
Do as we did before rework, if no placement is supplied at bo creation time, fallback to allocating bo from system ram. This will fix most of the creation failed issue report we got since the rework get merged. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/ttm: Fix memory type manager debug information printingJerome Glisse1-10/+9
System memory type doesn't have a drm_mm manager associated to it. This patch avoid trying to call drm_mm_debug on unitialized drm_mm when printing debug info on the system memory manager. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/ttm: Fix printk format & compute bo->mem.size at bo initializationJerome Glisse1-2/+3
Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/ttm: Fix potential ttm_mem_evict_first races.Thomas Hellstrom1-5/+31
1) The function was previously called with a potentially empty LRU list which would have lead to an OOPS or servere corruption. 2) In rare cases, after reservation has succeeded, another process may already have evicted it or even pinned it. We must revalidate the buffer status after releasing the lru lock. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/ttm: Delayed delete fixes.Thomas Hellstrom1-3/+4
1) Remove from lru before reserving so we avoid competing with evicting processes. 2) Avoid calling kref_put() on bo::list_kref while spinlocked. 3) Additional refcounting bug-checking. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/ttm: fix two bugs in new placement routines.Dave Airlie1-5/+5
a) the loops were going to <= not <, leading to illegal memory access b) the busy placement checks were using the placement arrays not the busy placement ones. Acked-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-16drm/ttm: fix incorrect logic in ttm_bo_io pathDave Airlie1-1/+1
This path isn't used by radeon yet, but future drivers will want it, so fix it right. Reported-by: Luca Barbieri <luca@luca-barbieri.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-15drm/nouveau: remove use of -ERESTARTBen Skeggs2-8/+1
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15nouveau: Fix endianness with new context program loaderBenjamin Herrenschmidt1-8/+12
When switching to request_firmware() to load the context programs, some endian fixes need to be applied. This makes it work again on my quad g5 nvidia 6600. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15drm/nouveau: fix build with CONFIG_AGP=nBen Skeggs2-0/+6
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15drm/nouveau: fix ch7006 buildRandy Dunlap1-2/+3
The ch7006 driver could be built even when nouveau was not enabled, but the build fails in that case, so make it depend on DRM_NOUVEUA. Also make the I2c encoder/helper chips menu depend on I2C (no build error, just visual inspection). ERROR: "drm_helper_probe_single_connector_modes" [drivers/gpu/drm/i2c/ch7006.ko] undefined! Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2009-12-15drm/vmwgfx: Add DRM driver for VMware Virtual GPUJakob Bornecrantz22-0/+7915
This commit adds the vmwgfx driver for the VWware Virtual GPU aka SVGA. The driver is under staging the same as Nouveau and Radeon KMS. Hopefully the 2D ioctls are bug free and don't need changing, so that part of the API should be stable. But there there is a pretty big chance that the 3D API will change in the future. Signed-off-by: Thomas Hellström <thellstrom@vmware.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-15drm/vmwgfx: Add svga headers for vmwgfx driverJakob Bornecrantz5-0/+3474
These headers are shared between multiple place where different coding standards apply. They will be fixed up at a later time. Signed-off-by: Thomas Hellström <thellstrom@vmware.com> Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-15drm/ttm: Add more driver type enumsJakob Bornecrantz1-1/+5
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-11drm/nouveau: Add DRM driver for NVIDIA GPUsBen Skeggs85-0/+36161
This adds a drm/kms staging non-API stable driver for GPUs from NVIDIA. This driver is a KMS-based driver and requires a compatible nouveau userspace libdrm and nouveau X.org driver. This driver requires firmware files not available in this kernel tree, interested parties can find them via the nouveau project git archive. This driver is reverse engineered, and is in no way supported by nVidia. Support for nearly the complete range of nvidia hw from nv04->g80 (nv50) is available, and the kms driver should support driving nearly all output types (displayport is under development still) along with supporting suspend/resume. This work is all from the upstream nouveau project found at nouveau.freedesktop.org. The original authors list from nouveau git tree is: Anssi Hannula <anssi.hannula@iki.fi> Ben Skeggs <bskeggs@redhat.com> Francisco Jerez <currojerez@riseup.net> Maarten Maathuis <madman2003@gmail.com> Marcin Kościelnicki <koriakin@0x04.net> Matthew Garrett <mjg@redhat.com> Matt Parnell <mparnell@gmail.com> Patrice Mandin <patmandin@gmail.com> Pekka Paalanen <pq@iki.fi> Xavier Chantry <shiningxc@gmail.com> along with project founder Stephane Marchesin <marchesin@icps.u-strasbg.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-11drm/ttm: export some functions useful to drivers using ttmBen Skeggs1-0/+4
These are functions required by nouveau which will be merged later. Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-11drm/radeon/kms/avivo: fix typo in new_pll module descriptionAlex Deucher1-1/+1
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-11drm/radeon/kms: Convert radeon to new ttm_bo_initJerome Glisse1-30/+9
Now bo init use placement structure like bo validation does. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-11drm/ttm: Convert ttm_buffer_object_init to use ttm_placementJerome Glisse2-106/+87
Convert ttm_buffer_object_init to use struct ttm_placement and rename to ttm_bo_init for consistency with function naming. This allow to give more complex placement at buffer creation. For instance you ask to allocate bo into vram first but if there is not enough vram you can give system as a second possible placement. It also allow to create buffer in a specific range. Also rename ttm_buffer_object_validate to ttm_bo_validate. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-10drm/radeon/kms: fix warning about cur_placement being uninitialised.Dave Airlie1-1/+1
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-10Merge remote branch 'korg/drm-radeon-next' of into drm-linusDave Airlie32-512/+849
This merges some TTM overhauls to allow us to do better object placement for certain radeon GPUs that need scanout+cursor within range of each other, along with an API change to not return ERESTART to userspace, but to use ERESTARTSYS properly internally and have it convert to EINTR and catch that correctly. Also lots of radeon fixes across the board.
2009-12-10Merge remote branch 'anholt/drm-intel-next' into drm-linusDave Airlie8-27/+32
Pull more Intel changes in, especially one to init the GTT properly
2009-12-10drm/ttm: Print debug information on memory manager when eviction failsJerome Glisse1-13/+57
This add helper function to print information on eviction placements and memory manager status when eviction fails to allocate memory space. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-10drm: Add memory manager debug functionJerome Glisse2-0/+21
drm_mm_debug_table will print the memory manager state in table allowing to give a snapshot of the manager at given point in time. Usefull for debugging. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-10drm/radeon/kms: restore surface registers on resume.Dave Airlie11-7/+23
On resume on my rv530 laptop surface cntl was left disabled, so wierd stuff would happen with rendering to a tiled front buffer. This checks if the surface regs are assigned to bos and reprograms the surface registers on resume using the same path that clears them all on init. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-10drm/radeon/kms/r600/r700: fallback gracefully on ucode failureAlex Deucher2-25/+25
Sent the wrong patch earlier. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-12-10drm/ttm: Initialize eviction placement in case the driver callback doesn'tJerome Glisse1-0/+4
This would allow to catch driver callback error of not properly setting the eviction placement structure. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-12-10drm/radeon/kms: cleanup structure and module if initialization failsJerome Glisse1-22/+20
This would allow us to properly unload others module like TTM if initialization fails after we initiliazed TTM structure. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-12-10drm/radeon/kms: actualy set the eviction placements we chooseJerome Glisse1-0/+1
Stupid bug, somehow copying the eviction placements into the result structure was missing. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-12-10drm/radeon/kms: Fix NULL ptr dereferenceJerome Glisse1-2/+4
radeon_atombios_fini might be call while there is not valid atombios structure allocated, thus test for a not null ptr before trying to access this structure. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-12-10drm/radeon/kms/avivo: add support for new pll selection algoAlex Deucher6-3/+120
Supported on all AVIVO-based asics. Can be disabled via the new_pll module parameter: new_pll=0 - disable new_pll=1 - enable enabled by default [airlied: fixed to use do_div] Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-12-10drm/radeon/kms/avivo: fix some bugs in the display bandwidth setupAlex Deucher3-5/+28
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-12-10drm/radeon/kms: fix return value from fence function.Dave Airlie1-1/+1
We only want to return here for errors, the wait functions return a positive timeout otherwise, which gets back to userspace and causes X to crash here. Signed-off-by: Dave Airlie <airlied@redhat.com>