summaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
Commit message (Collapse)AuthorAgeFilesLines
* drm: reorganise drm tree to be more future proof.Dave Airlie2008-07-14103-63858/+0Star
| | | | | | | | | | | | | | With the coming of kernel based modesetting and the memory manager stuff, the everything in one directory approach was getting very ugly and starting to be unmanageable. This restructures the drm along the lines of other kernel components. It creates a drivers/gpu/drm directory and moves the hw drivers into subdirectores. It moves the includes into an include/drm, and sets up the unifdef for the userspace headers we should be exporting. Signed-off-by: Dave Airlie <airlied@redhat.com>
* DRM/i915: only use tiled blits on 965+Jesse Barnes2008-07-031-2/+2
| | | | | | | | | | | | | When scheduled swaps occur, we need to blit between front & back buffers. If the buffers are tiled, we need to set the appropriate XY_SRC_COPY tile bit, but only on 965 chips, since it will cause corruption on pre-965 (e.g. 945). Bug reported by and fix tested by Tomas Janousek <tomi@nomi.cz>. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Acked-by: Dave Airlie <airlied@linux.ie> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* enable bus mastering on i915 at resume timeJie Luo2008-06-241-0/+1
| | | | | | | | | | On 9xx chips, bus mastering needs to be enabled at resume time for much of the chip to function. With this patch, vblank interrupts will work as expected on resume, along with other chip functions. Fixes kernel bugzilla #10844. Signed-off-by: Jie Luo <clotho67@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm: only trust core drm ioctls - driver ioctls are a mess.Dave Airlie2008-06-201-4/+3Star
| | | | | | So driver ioctls need a full auditing before we can make this change. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: add support for Intel series 4 chipsets.Zhenyu Wang2008-06-202-2/+12
| | | | | Signed-off-by: Zhenyu Wang <zhenyu.z.wang@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: add hier-z registers for r300 and r500 chipsetsDave Airlie2008-06-192-59/+189
|
* drm/radeon: use DSTCACHE_CTLSTAT rather than RB2D_DSTCACHE_CTLSTATAlex Deucher2008-06-192-8/+9
| | | | | | | According to the hw guys, you should use DSTCACHE_CTLSTAT to flush the 2D dst cache rather than RB2D_DSTCACHE_CTLSTAT. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: switch IGP gart to use radeon_write_agp_base()Alex Deucher2008-06-191-8/+4Star
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: Restore sw interrupt on resumeDennis Kasprzyk2008-06-193-1/+3
| | | | | | Fixes performance drop after suspend/resume on some systems. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/r500: add support for AGP based cards.Dave Airlie2008-06-192-3/+27
| | | | | | AGP registers weren't programmed properly for r500 cards. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fix texture uploads with large 3d textures (bug 13980)Roland Scheidegger2008-06-191-3/+11
| | | | | | | | Texture uploads could hit the blitter coordinate limit, adjust the texture offset when uploading the pieces. Make sure to check the end address of the upload too. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: add initial r500 support.Dave Airlie2008-06-194-12/+135
| | | | | | | This contains all the command buffer processing for the r500 cards. It doesn't yet contain vblank support. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: init pipe setup in kernel code.Alex Deucher2008-06-194-0/+75
| | | | | | | This inits the card pipes in the kernel and lets userspace getparam the correct setup. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fixup radeon_do_engine_resetAlex Deucher2008-06-191-23/+26
| | | | | | Cleanup do engine reset for different chip families. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fix pixcache and purge/cache flushing registersAlex Deucher2008-06-193-18/+65
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: write AGP_BASE_2 on chips that support it.Alex Deucher2008-06-191-0/+2
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: merge IGP chip setup and fixup RS400 vs RS480 supportAlex Deucher2008-06-193-165/+138Star
| | | | | | | We only support RS480 (AMD based IGP) at the moment not RS400 (Intel based IGP) ones. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: IGP clean up register and magic numbers.Alex Deucher2008-06-192-82/+110
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/rs690: set base 2 to 0.Dave Airlie2008-06-192-0/+3
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/rs690: set all of gart base address.Dave Airlie2008-06-191-2/+3
| | | | | | Docs state bits 4-11 maps to bits 32-39 of the 40-bit range Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: add production microcode from AMDAlex Deucher2008-06-192-784/+1893
| | | | | | This adds production microcode for r100->r500 from AMD. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: pcigart use proper pci map interfaces.Dave Airlie2008-06-191-5/+3Star
| | | | | | Switch to using more correct pci dma mapping interfaces. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: the sg alloc ioctl should write back the handle to userspaceDave Airlie2008-06-131-1/+1
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: use drms ioctl cmd not what we get passed from userspace.Johannes Weiner2008-06-131-0/+2
| | | | | | | | | | | This enforces us to use the drm ioctl types so read/write works correctly and not believe what userspace tells us. It does this hopefully without breaking the drm api. Fixes bug from thread: BUG: unable to handle kernel NULL pointer dereference (drm_getunique) Signed-off-by: Dave Airlie <airlied@redhat.com>
* remove debug printk from DRM suspend pathJesse Barnes2008-05-231-2/+0Star
| | | | | | | | | Not sure how this snuck upstream, but it really doesn't belong there. We don't need a KERN_ERR printk in the suspend path to know what's going on (at least not anymore). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm/i915: save and restore dsparb and d_state registers.Keith Packard2008-05-072-0/+17
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: fix off by one in VGA save/restore of AR & CR regs.Jesse Barnes2008-05-072-6/+6
| | | | | | turns out it's important to save/restore AR14 in particular. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: disable tasklets not IRQs when taking the drm lock spinlockThomas Hellstrom2008-05-072-25/+17Star
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* Revert "drm/vbl rework: rework how the drm deals with vblank."Dave Airlie2008-05-0720-1372/+473Star
| | | | | | | | | | This reverts commit ac741ab71bb39e6977694ac0cc26678d8673cda4. Okay this looks like wasn't as fully baked as I'd led myself to believe. Revert for now for further baking. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drivers/char: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-308-23/+23
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drivers: atm, char fix integer as NULL pointer warningsHarvey Harrison2008-04-291-1/+1
| | | | | | | | | drivers/atm/nicstar.c:418:25: warning: Using plain integer as NULL pointer drivers/char/drm/r128_cce.c:820:25: warning: Using plain integer as NULL pointer drivers/char/tty_io.c:1183:10: warning: Using plain integer as NULL pointer Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm: _end is shadowing real _end, just rename it.Dave Airlie2008-04-261-2/+2
| | | | Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/vbl rework: rework how the drm deals with vblank.Jesse Barnes2008-04-2620-473/+1372
| | | | | | | | | | | | | Other Authors: Michel Dänzer <michel@tungstengraphics.com> mga: Ian Romanick <idr@us.ibm.com> via: Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> This re-works the DRM internals to provide a better interface for drivers to expose vblank on multiple crtcs. It also includes work done by Michel on making i915 triple buffering and pageflipping work properly. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: reorganise minor number handling using backported modesetting code.Dave Airlie2008-04-2610-184/+230
| | | | | | rips out the head crap and replaces it with an idr and drm_minor structure Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i915: Handle tiled buffers in vblank taskletKeith Packard2008-04-262-4/+16
| | | | | | | The vblank tasklet update code must build 2D blt commands with the appropriate tiled flags Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/i965: On I965, use correct 3DSTATE_DRAWING_RECTANGLE command in vblankKeith Packard2008-04-261-10/+20
| | | | | | | | The batchbuffer submission paths were fixed to use the 965-specific command, but the vblank tasklet was not. When the older version is sent, the 965 will lock up. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Remove unneeded dma sync in ATI pcigart allocBenjamin Herrenschmidt2008-04-261-7/+0Star
| | | | | | | | Now that the ATI pcigart code uses dma_alloc_coherent, we don't need the dma_sync_single_for_device() that we used to have here. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Fix mismerge of non-coherent DMA patchBenjamin Herrenschmidt2008-04-261-1/+1
| | | | | | | | | The patch for supporting non coherent PCI DMA in the DRM was mismerged causing the page protection to be updated for the wrong type of mapping. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
* DRM: remove unused dev_classGreg Kroah-Hartman2008-04-201-1/+0Star
| | | | | | | | | | | | | The struct class_device *dev_class is not used in the struct drm_head structure at all, so remove it as class_device is being removed entirely from the kernel. Cc: David Airlie <airlied@linux.ie> Cc: Tony Jones <tonyj@suse.de> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* fix IS_I9XX macro in i915 DRM driverJesse Barnes2008-04-071-2/+2
| | | | | | | | | | | | | | Now that we're mapping registers in the DRM driver at load time, the driver actually checks the PCI ID, so we need to make sure the macros have all the right bits (and longer term use the DRM headers as the sole copy of the PCI & register definitions). This patch adds 945GME support to the DRM headers, fixing a regression reported in http://bugzilla.kernel.org/show_bug.cgi?id=10395. Tested-by: Alexander Oltu <alexander@all-2.com> Signed-off-by: Jesse Barnes <jesse.barnes@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm: fix for non-coherent DMA PowerPCBenjamin Herrenschmidt2008-03-293-6/+31
| | | | | | | | | | | | | | | | This patch fixes bits of the DRM so to make the radeon DRI work on non-cache coherent PCI DMA variants of the PowerPC processors. It moves the few places that needs change to wrappers to that other architectures with similar issues can easily add their own changes to those wrappers, at least until we have more useful generic kernel API. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: radeon: fix sparse integer as NULL pointer warnings in radeon_mem.cHarvey Harrison2008-03-291-4/+4
| | | | | | | | | | | | drivers/char/drm/radeon_mem.c:91:23: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:116:28: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:124:28: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:177:26: warning: Using plain integer as NULL pointer drivers/char/drm/radeon_mem.c:177:53: warning: Using plain integer as NULL pointer Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/i915: fix oops on agp=offDave Airlie2008-03-291-0/+3
| | | | | | | From Kernel BZ 10289 - not sure why anyone would boot an intel with no agp but it shouldn't crash. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/r300: fix bug in r300 userspace hardware wait emissionDave Airlie2008-03-292-12/+54
| | | | | | | | | | | This interface was originally designed wrong, confusing bit-fields and integers, major brown paper bag going back many years... But userspace only ever used 4 values so fix the interface for new users and fix the implementation to deal with the 4 values userspace has ever emitted (0x1, 0x2, 0x3, 0x6). Signed-off-by: Dave Airlie <airlied@redhat.com>
* drivers/char/drm/ati_pcigart.c: fix printk warningAndrew Morton2008-03-281-2/+3
| | | | | | | | | | drivers/char/drm/ati_pcigart.c: In function 'drm_ati_pcigart_init': drivers/char/drm/ati_pcigart.c:125: warning: format '%08X' expects type 'unsigned int', but argument 3 has type 'dma_addr_t' Cc: Dave Airlie <airlied@linux.ie> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drm/ati_pcigart: fix the PCIGART to use drm_pci to allocate GART table.Dave Airlie2008-03-174-69/+27Star
| | | | | | | This fixes a problem on 64-bit with 4GB with ATI RS690 chipsets. It makes sure the pcigart table is allocated in coherent memory for DMA operations. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fixup RV550 chip familyAlex Deucher2008-03-171-3/+4
| | | | | | | This fixes up the RV550 chips which are based on RV515, not RV530. It also adds another RS690 PCI ID. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/via: attempt again to stabilise the AGP DMA command submission.Thomas Hellstrom2008-03-172-7/+54
| | | | | | | | | It's worth remembering that all new bright ideas on how to make this command reader work properly and according to docs will probably fail :( Bring in some old code. Also allow a larger SG-DMA download stride, and remove unnecessary waits for command regulators pauses. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Fix race that can lockup the kernelMike Isely2008-03-172-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i915_vblank_swap() function schedules an automatic buffer swap upon receipt of the vertical sync interrupt. Such an operation is lengthy so it can't be allowed to happen in normal interrupt context, thus the DRM implements this by scheduling the work in a kernel softirq-scheduled tasklet. In order for the buffer swap to work safely, the DRM's central lock must be taken, via a call to drm_lock_take() located in drivers/char/drm/drm_irq.c within the function drm_locked_tasklet_func(). The lock-taking logic uses a non-interrupt-blocking spinlock to implement the manipulations needed to take the lock. This semantic would be safe if all attempts to use the spinlock only happen from process context. However this buffer swap happens from softirq context which is really a form of interrupt context. Thus we have an unsafe situation, in that drm_locked_tasklet_func() can block on a spinlock already taken by a thread in process context which will never get scheduled again because of the blocked softirq tasklet. This wedges the kernel hard. To trigger this bug, run a dual-head cloned mode configuration which uses the i915 drm, then execute an opengl application which synchronizes buffer swaps against the vertical sync interrupt. In my testing, a lockup always results after running anywhere from 5 minutes to an hour and a half. I believe dual-head is needed to really trigger the problem because then the vertical sync interrupt handling is no longer predictable (due to being interrupt-sourced from two different heads running at different speeds). This raises the probability of the tasklet trying to run while the userspace DRI is doing things to the GPU (and manipulating the DRM lock). The fix is to change the relevant spinlock semantics to be the interrupt-blocking form. After this change I am no longer able to trigger the lockup; the longest test run so far was 20 hours (test stopped after that point). Note: I have examined the places where this spinlock is being employed; all are reasonably short bounded sequences and should be suitable for interrupts being blocked without impacting overall kernel interrupt response latency. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* i915: fix AR register restore.Jesse Barnes2008-02-231-0/+1
| | | | | | | | | | Make sure the restoration correctly restores the AR registers by flipping the ARX register into index mode before doing anything. Without this, some people have had the text mode restore all green. Signed-off-by: Jesse Barnes <jesse.barnes@intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>