aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_cp.c
Commit message (Collapse)AuthorAgeFilesLines
* samsung update 1codeworkx2012-06-021-1/+5
|
* Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* drm: rework PCI/platform driver interface.Dave Airlie2011-02-071-2/+2
| | | | | | | | | | | This abstracts the pci/platform interface out a step further, we can go further but this is far enough for now to allow USB to be plugged in. The drivers now just call the init code directly for their device type. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Remove drm_resource wrappersJordan Crouse2010-06-011-4/+4
| | | | | | | | | | | Remove the drm_resource wrappers and directly use the actual PCI and/or platform functions in their place. [airlied: fixup nouveau properly to build] Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: 9800 SE has only one quadpipeTormod Volden2010-04-231-2/+7
| | | | | | | | | | | | | | Although these cards have 2 pipelines on the silicon only the first passed the QA and the other should be disabled. http://www.digital-daily.com/video/ati-radeon9800se/ http://www.rojakpot.com/showarticle.aspx?artno=101&pgno=1 agd5f: add some other SE cards as well; fix up kms Signed-off-by: Tormod Volden <debian.tormod@gmail.com> Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: R300 AD only has one quad pipe.Michel Dänzer2010-04-061-4/+6
| | | | | | | | | | Gleaned from the Mesa code. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=27355 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: r100/r200 ums: block ability for userspace app to trash 0 page ↵Dave Airlie2010-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and beyond radeon's have a special ability to passthrough writes in their internal memory space directly to PCI, this ability means that if some of the internal surfaces like the depth buffer point at 0x0, any writes to these will go directly to RAM at 0x0 via PCI busmastering. Now mesa used to always emit clears after emitting state, since the radeon mesa driver was refactored a year or more ago, it was found it could generate a clear request without ever sending any setup state to the card. So the clear would attempt to clear the depth buffer at 0x0, which would overwrite main memory at this point. fs corruption ensues. Also once one app did this correctly, it would never get set back to 0 making this messy to reproduce. The kernel should block this from happening as mesa runs without privs, though it does require the user be connected to the current running X session. This patch implements a check to make sure the depth offset has been set before a depth clear occurs and if it finds one it prints a warning and ignores the depth clear request. There is also a mesa fix to avoid sending the badness going into mesa. This only affects r100/r200 GPUs in user modesetting mode. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: fix memory leakJiri Slaby2010-01-071-0/+1
| | | | | | | | Stanse found a memory leak in radeon_master_create. master_priv is not freed/assigned on all paths. Fix that. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: A bit of cleanup work on radeon_freelist_get()Robert Noland2009-10-261-41/+4
| | | | | | | | Fix the main loop to search all buffers before sleeping. Remove dead code Signed-off-by: Robert Noland <rnoland@2hip.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: some r420s have a CP race with the DMA engine.Alex Deucher2009-09-211-0/+23
| | | | | | | | | This patch makes sure the CP doesn't DMA do VRAM while 2D is active by inserting a CP resync token. todo: port to kms. Signed-off-by: Dave Airlie <airlied@redhat.com>
* Merge intel drm-intel-next branchDave Airlie2009-09-071-0/+9
|\ | | | | | | | | | | | | | | | | Merge remote branch 'anholt/drm-intel-next' of ../anholt-2.6 into drm-next Conflicts: drivers/gpu/drm/i915/intel_display.c drivers/gpu/drm/i915/intel_drv.h drivers/gpu/drm/i915/intel_sdvo.c
| * drm/radeon: add GET_PARAM/INFO support for Z pipesAlex Deucher2009-08-211-0/+9
| | | | | | | | | | | | | | Needed for occlusion queries on rv530 chips. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* | radeon: Use request_firmware()Ben Hutchings2009-08-311-45/+83
|/ | | | | | | | | | | | | | | | | | | | | | | | Loosely based on a patch by Jaswinder Singh Rajput <jaswinderlinux@gmail.com>. KMS support by Dave Airlie <airlied@redhat.com>. For Radeon 100- to 500-series, firmware blobs look like: struct { __be32 datah; __be32 datal; } cp_ucode[256]; For Radeon 600-series, there are two separate firmware blobs: __be32 me_ucode[PM4_UCODE_SIZE * 3]; __be32 pfp_ucode[PFP_UCODE_SIZE]; For Radeon 700-series, likewise: __be32 me_ucode[R700_PM4_UCODE_SIZE]; __be32 pfp_ucode[R700_PFP_UCODE_SIZE]; Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Remove memory debugging infrastructure.Eric Anholt2009-06-181-5/+4
| | | | | | | | It hasn't been used in ages, and having the user tell your how much memory is being freed at free time is a recipe for disaster even if it was ever used. Signed-off-by: Eric Anholt <eric@anholt.net>
* Merge branch 'drm-linus' of ↵Linus Torvalds2009-06-121-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6 * 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (50 commits) drm: include kernel list header file in hashtab header drm: Export hash table functionality. drm: Split out the mm declarations in a separate header. Add atomic operations. drm/radeon: add support for RV790. drm/radeon: add rv740 drm support. drm_calloc_large: check right size, check integer overflow, use GFP_ZERO drm: Eliminate magic I2C frobbing when reading EDID drm/i915: duplicate desired mode for use by fbcon. drm/via: vfree() no need checking before calling it drm: Replace DRM_DEBUG with DRM_DEBUG_DRIVER in i915 driver drm: Replace DRM_DEBUG with DRM_DEBUG_MODE in drm_mode drm/i915: Replace DRM_DEBUG with DRM_DEBUG_KMS in intel_sdvo drm/i915: replace DRM_DEBUG with DRM_DEBUG_KMS in intel_lvds drm: add separate drm debugging levels radeon: remove _DRM_DRIVER from the preadded sarea map drm: don't associate _DRM_DRIVER maps with a master drm: simplify kcalloc() call to kzalloc(). intelfb: fix spelling of "CLOCK" drm: fix LOCK_TEST_WITH_RETURN macro drm/i915: Hook connector to encoder during load detection (fixes tv/vga detect) ...
| * radeon: remove _DRM_DRIVER from the preadded sarea mapDave Airlie2009-06-111-1/+1
| | | | | | | | | | | | | | This shouldn't be there and is what broke r600 late in the 2.6.30 release cycle with Ben's patch. Signed-off-by: Dave Airlie <airlied@redhat.com>
* | drm/radeon: fix ring free alignment calculationsDave Airlie2009-06-041-2/+2
|/ | | | | | | | | | fd.o bz#21849 We were aligning to +16 dwords, instead of to the next 16dword boundary in the ring. Fix the calculation to go to the next 16dword boundary when space checking. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: add regs required for occlusion queries supportMaciej Cencora2009-03-291-1/+1
| | | | | | | [airlied: cleaned up slightly for drm-next] Signed-off-by: Maciej Cencora <m.cencora@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: NULL noise: drivers/gpu/drm/radeon/radeon_*.cHannes Eder2009-03-131-1/+1
| | | | | | | | | | Fix this sparse warning: drivers/gpu/drm/radeon/r600_cp.c:1811:52: warning: Using plain integer as NULL pointer drivers/gpu/drm/radeon/radeon_cp.c:1363:52: warning: Using plain integer as NULL pointer drivers/gpu/drm/radeon/radeon_state.c:1983:61: warning: Using plain integer as NULL pointer Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: call the correct idle function, logic got inverted.Dave Airlie2009-03-131-1/+1
| | | | | | This calls the correct idle function for the R600 and previous chips. Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: add support for rs600 GPUsAlex Deucher2009-03-131-4/+123
| | | | | | | | | RS600s are an AMD IGP for Intel CPUs, that look like RS690s from a lot of perspectives but look like r600s from a memory controller point of view. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: add initial support for R6xx/R7xx GPUsAlex Deucher2009-03-131-47/+141
| | | | | | | | This adds support for 2D/Xv acceleration in the X.org 2D driver, to the drm. It doesn't yet provide any 3D support hooks. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: prep for r6xx/r7xx supportAlex Deucher2009-03-131-0/+14
| | | | | | | | | - add r6xx/r7xx regs and macros - add r6xx/r7xx chip families - fix register access for regs with offsets >= 0x10000 Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: split busmaster enable out to a separate functionDave Airlie2009-03-131-15/+20
| | | | | | this is just a code cleanup from the kms tree. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: align ring writes to 16 dwords boundaries.Dave Airlie2009-03-131-0/+32
| | | | | | | | | On some radeon GPUs this appears to introduce another level of stability around interacting with the ring. Its pretty much what fglrx appears to do. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: radeon: Use surface for PCI GART table.David Miller2009-03-131-1/+57
| | | | | | | | | | | | | | | | | | This allocates a physical surface for the PCI GART table, this way no matter what other surface configurations exist the GART table will always be seen by the hardware properly. We encode the file pointer of the virtual surface allocate using a special cookie value, called PCIGART_FILE_PRIV. On the last close, we release that surface. Just to be doubly safe, we run the pcigart table setup with the main surface control register clear. Based upon ideas from David Airlie and Ben Benjamin Herrenschmidt. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: radeon: Fix calculation of RB_RPTR_ADDR in non-AGP case.David Miller2009-03-131-11/+4
| | | | | | | | The address needs to be a GART relative address, rather than a PCI DMA address. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: radeon: Fix ring_rptr accesses.David Miller2009-03-131-12/+58
| | | | | | | | | | | | | | | | | | | The memory behind ring_rptr can either be in ioremapped memory or a vmalloc() normal kernel memory buffer. However, the code unconditionally uses DRM_{READ,WRITE}32() (and thus readl() and writel()) to access it. Basically, if RADEON_IS_AGP then it's ioremap()'d memory else it's vmalloc'd memory. Adjust all of the ring_rptr access code as needed. While we're here, kill the 'scratch' pointer in drm_radeon_private. It's only used in the one place where it is initialized. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm: Make drm_local_map use a resource_size_t offsetBenjamin Herrenschmidt2009-03-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | This changes drm_local_map to use a resource_size for its "offset" member instead of an unsigned long, thus allowing 32-bit machines with a >32-bit physical address space to be able to store there their register or framebuffer addresses when those are above 4G, such as when using a PCI video card on a recent AMCC 440 SoC. This patch isn't as "trivial" as it sounds: A few functions needed to have some unsigned long/int changed to resource_size_t and a few printk's had to be adjusted. But also, because userspace isn't capable of passing such offsets, I had to modify drm_find_matching_map() to ignore the offset passed in for maps of type _DRM_FRAMEBUFFER or _DRM_REGISTERS. If we ever support multiple _DRM_FRAMEBUFFER or _DRM_REGISTERS maps for a given device, we might have to change that trick, but I don't think that happens on any current driver. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/radeon: update sarea copies of last_ variables on resume.etienne2009-02-201-6/+15
| | | | | | | | | | This fixes a regression reported in bug #12613. [airlied: not I tweaked the patch slightly and fixed it by etienne did all the hardwork so gets authorship] Signed-off-by: etienne <etienne.basset@numericable.fr> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fix ioremap conflict with AGP mappingsDave Airlie2009-02-081-3/+3
| | | | | | | | this solves a regression from http://bugzilla.kernel.org/show_bug.cgi?id=12441 Reported-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: use locked rmmap to remove sarea mapping.Dave Airlie2008-12-291-1/+1
| | | | | | this exports the locked version of the symbol as struct_mutex locks it all. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fix warning due to PAGE_SIZE maxDave Airlie2008-12-291-1/+1
| | | | Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: move to kref per-master structures.Dave Airlie2008-12-291-15/+58
| | | | | | | | | | | | | | | | This is step one towards having multiple masters sharing a drm device in order to get fast-user-switching to work. It splits out the information associated with the drm master into a separate kref counted structure, and allocates this when a master opens the device node. It also allows the current master to abdicate (say while VT switched), and a new master to take over the hardware. It moves the Intel and radeon drivers to using the sarea from within the new master structures. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: move drm vblank initialization/cleanup to driver load/unloadKeith Packard2008-11-251-0/+6
| | | | | | | | | drm vblank initialization keeps track of the changes in driver-supplied frame counts across vt switch and mode setting, but only if you let it by not tearing down the drm vblank structure. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: map registers at load timeDave Airlie2008-11-111-6/+9
| | | | | | | | | | | | | | | Now that the radeon driver has suspend/resume functions, it needs to map its registers at load time or it will likely crash if a suspend operation occurs before the driver has been initialized. This patch moves the register mapping code from firstopen to load and makes the mapping into a _DRM_DRIVER one so that the core won't remove it at lastclose time. Fixes (at least partially) kernel bz #11891. Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/radeon: fixup further bus mastering confusion.Alex Deucher2008-10-281-7/+8
| | | | | | rs400/480 are like previous chips not like rs6xx chips. Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: fix PCI bus mastering support enables.Alex Deucher2008-10-181-2/+14
| | | | | | | | Someone noticed these registers moved around for later chips, so we redo the codepaths per-chip. PCIE chips don't appear to require explicit enables. Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: add RS400 family support.Alex Deucher2008-10-181-2/+4
| | | | | | This adds support for the RS400 family of IGPs for Intel CPUs. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: add support for RS740 IGP chipsets.Alex Deucher2008-10-181-8/+16
| | | | | | This adds support for the HS2100 IGP chipset. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: Rework vblank-wait handling to allow interrupt reduction.Jesse Barnes2008-10-181-1/+1
| | | | | | | | | | | | | | | Previously, drivers supporting vblank interrupt waits would run the interrupt all the time, or all the time that any 3d client was running, preventing the CPU from sleeping for long when the system was otherwise idle. Now, interrupts are disabled any time that no client is waiting on a vblank event. The new method uses vblank counters on the chipsets when the interrupts are turned off, rather than counting interrupts, so that we can continue to present accurate vblank numbers. Co-author: Michel Dänzer <michel@tungstengraphics.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: fix writeback across suspend/resume.Dave Airlie2008-10-181-2/+3
| | | | | | Make writeback not get disabled on resume. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: downgrade debug message from info to debug.Dave Airlie2008-09-011-2/+2
| | | | | | | | | If this triggers its bad, however some machines seem to have been triggering it for ages and we didn't know until we added the debug. So downgrade the debug now so people don't call this a regression. Signed-off-by: Dave Airlie <airlied@redhat.com>
* radeon: fix some hard lockups on r3/4/500sJerome Glisse2008-08-251-20/+18
| | | | | | | | This patch should fix hard lockup and convert them in softlockup (ie you can ssh the box but the gpu is busted and we are waiting in loop for it to come back to reason). Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: fixup issue with radeon and PAT support.Dave Airlie2008-07-151-1/+1
| | | | | | | With new userspace libpciaccess we can get a conflicting mapping on the PCIE GART table in the video RAM. Always try and map it _wc. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm: reorganise drm tree to be more future proof.Dave Airlie2008-07-141-0/+1773
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>