aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon
AgeCommit message (Collapse)Author
2009-06-17drm/radeon/kms: remove the _DRM_DRIVER from the KMS paths.Dave Airlie
This causes an issue since we fixed the drm mappings to do the right thing, so its just a copy and pasto. Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-16Merge branch 'drm-linus' of ↵Linus Torvalds
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: drm/radeon: switch to using late_initcall radeon legacy chips: tv dac bg/dac adj updates drm/radeon: introduce kernel modesetting for radeon hardware drm: Add the TTM GPU memory manager subsystem. drm: Memory fragmentation from lost alignment blocks drm/radeon: fix mobility flags on new PCI IDs.
2009-06-17drm/radeon: switch to using late_initcallDave Airlie
This fixes an issue where we get inited before fbcon when built-in. Ideally this should work as a non late_initcall, but this fixes it for now. We also don't suggest people build this in (at least distro maintainers). Reported-by: Ryan Hope <rmh3093@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-15radeon legacy chips: tv dac bg/dac adj updatesAlex Deucher
COMBIOS - fallback to table values if there are no tv dac or lvds bios tables ATOMBIOS - add support for looking up these values from the bios table Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-15drm/radeon: introduce kernel modesetting for radeon hardwareJerome Glisse
Add kernel modesetting support to radeon driver, use the ttm memory manager to manage memory and DRM/GEM to provide userspace API. In order to avoid backward compatibility issue and to allow clean design and code the radeon kernel modesetting use different code path than old radeon/drm driver. When kernel modesetting is enabled the IOCTL of radeon/drm driver are considered as invalid and an error message is printed in the log and they return failure. KMS enabled userspace will use new API to talk with the radeon/drm driver. The new API provide functions to create/destroy/share/mmap buffer object which are then managed by the kernel memory manager (here TTM). In order to submit command to the GPU the userspace provide a buffer holding the command stream, along this buffer userspace have to provide a list of buffer object used by the command stream. The kernel radeon driver will then place buffer in GPU accessible memory and will update command stream to reflect the position of the different buffers. The kernel will also perform security check on command stream provided by the user, we want to catch and forbid any illegal use of the GPU such as DMA into random system memory or into memory not owned by the process supplying the command stream. This part of the code is still incomplete and this why we propose that patch as a staging driver addition, future security might forbid current experimental userspace to run. This code support the following hardware : R1XX,R2XX,R3XX,R4XX,R5XX (radeon up to X1950). Works is underway to provide support for R6XX, R7XX and newer hardware (radeon from HD2XXX to HD4XXX). Authors: Jerome Glisse <jglisse@redhat.com> Dave Airlie <airlied@redhat.com> Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-12Merge branch 'drm-linus' of ↵Linus Torvalds
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) ...
2009-06-12drm/radeon: add support for RV790.Alex Deucher
This adds the PCI IDs for the rv790 which are equiv to the rv770. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-12drm/radeon: add rv740 drm support.Alex Deucher
This adds drm support for the RV740 family of chips to the r600 support code. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-06-11radeon: remove _DRM_DRIVER from the preadded sarea mapDave Airlie
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>
2009-06-04drm/radeon: fix ring free alignment calculationsDave Airlie
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>
2009-04-24drm/radeon: bump minor version for occlusion queries supportMaciej Cencora
We already added support, just need to let userspace know when it can use them. Signed-off-by: Maciej Cencora <m.cencora@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-04-03drm/radeon: load the right microcode on rs780Alex Deucher
Copy/paste error. The RV670 microcode should work ok, so it's not a show stopper. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-29drm/radeon: add regs required for occlusion queries supportMaciej Cencora
[airlied: cleaned up slightly for drm-next] Signed-off-by: Maciej Cencora <m.cencora@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-18drm/radeon: fix logic in r600_page_table_init() to match ati_gartAlex Deucher
This fixes page table init on rs600. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: r600 ptes are 64-bit, cleanup cleanup function.Dave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: don't call irq changes on r600 suspend/resumeDave Airlie
Until we sort out r600 IRQs don't do this. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: fix r600 writeback across suspend/resumeDave Airlie
This update was done in mainline radeon, but not in the r600. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: fix r600 writeback setup.Dave Airlie
This fixes 2 bugs: 1. the AGP calculation wasn't consistent with the PCI(E) calc for the RPTR_ADDR registers. This consolidates the writes and fixes it up. 2. The scratch address was being incorrectly calculated, this breaks it out into a lot more linear steps. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: NULL noise: drivers/gpu/drm/radeon/radeon_*.cHannes Eder
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>
2009-03-13drm/radeon: fix r600 pci mapping calls.Dave Airlie
This realigns the r600 pci mapping calls with the ati pcigart ones, fixing the direction and using the correct interface. Suggested by Jerome Glisse. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: r6xx/r7xx: fix possible oops in r600_page_table_cleanup()Alex Deucher
Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13radeon: call the correct idle function, logic got inverted.Dave Airlie
This calls the correct idle function for the R600 and previous chips. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: RS600: fix interrupt handlingAlex Deucher
the checks weren't updated when RS600 support was added. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-03-13drm/r600: fix rptr address along lines of previous fixes to radeon.Dave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/r600: fixup r600 gart table accessor like ati_pcigart.cDave Airlie
This attempts to fixup the r600 GART accessors so they work on other arches. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13radeon: add support for rs600 GPUsAlex Deucher
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>
2009-03-13radeon: fix r600 AGP supportAlex Deucher
This fixes the ioremap issues with r600 AGP. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: add initial support for R6xx/R7xx GPUsAlex Deucher
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>
2009-03-13drm/radeon: add r6xx/r7xx microcodeAlex Deucher
This uses the same microcode system as the current radeon code. It should be converted to the new microcode loader I suppose, though really I need a lot more proof of the worth of me maintaining firmware blobs externally. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: prep for r6xx/r7xx supportAlex Deucher
- 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>
2009-03-13drm/radeon: split busmaster enable out to a separate functionDave Airlie
this is just a code cleanup from the kms tree. Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm/radeon: align ring writes to 16 dwords boundaries.Dave Airlie
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>
2009-03-13drm: radeon: Fix unaligned access in r300_scratch().David Miller
In compat mode, the cmdbuf->buf 64-bit address cookie can potentially be only 32-bit aligned. Dereferencing this as 64-bit causes expensive unaligned traps on platforms like sparc64. Use get_unaligned() to fix. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2009-03-13drm: radeon: Use surface for PCI GART table.David Miller
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>
2009-03-13drm: radeon: Fix calculation of RB_RPTR_ADDR in non-AGP case.David Miller
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>
2009-03-13drm: radeon: Fix RADEON_*_EMITED defines.David Miller
These are not supposed to be booleans, they are supposed to be bit masks. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-03-13drm: radeon: Fix ring_rptr accesses.David Miller
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>
2009-03-13drm: Drop unused and broken dri_library_name sysfs attribute.Kristian Høgsberg
The kernel shouldn't be in the business of telling user space which driver to load. The kernel defers mapping PCI IDs to module names to user space and we should do the same for DRI drivers. And in fact, that's how it does work today. Nothing uses the dri_library_name attribute, and the attribute is in fact broken. For intel devices, it falls back to the default behaviour of returning the kernel module name as the DRI driver name, which doesn't work for i965 devices. Nobody has ever hit this problem or filed a bug about this. Signed-off-by: Kristian Høgsberg <krh@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-03-13drm: Make drm_local_map use a resource_size_t offsetBenjamin Herrenschmidt
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>
2009-03-13drm: Use resource_size_t for drm_get_resource_{start, len}Benjamin Herrenschmidt
The DRM uses its own wrappers to obtain resources from PCI devices, which currently convert the resource_size_t into an unsigned long. This is broken on 32-bit platforms with >32-bit physical address space. This fixes them, along with a few occurences of unsigned long used to store such a resource in drivers. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Dave Airlie <airlied@linux.ie>
2009-02-20drm/radeon: update sarea copies of last_ variables on resume.etienne
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>
2009-02-08drm/radeon: fix ioremap conflict with AGP mappingsDave Airlie
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>
2008-12-29drm/radeon: use locked rmmap to remove sarea mapping.Dave Airlie
this exports the locked version of the symbol as struct_mutex locks it all. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-12-29drm/radeon: fix missing hunk from the master changes.Dave Airlie
Thanks to Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> for reporting this. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-12-29drm/radeon: fix warning due to PAGE_SIZE maxDave Airlie
Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-12-29drm: move to kref per-master structures.Dave Airlie
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>
2008-12-23drm/radeon: fix correctness of irq_enabled check for radeon.Dave Airlie
This check was introduced with the logic the wrong way around. Fixes regression: http://bugzilla.kernel.org/show_bug.cgi?id=12216 Tested-by: François Valenduc <francois.valenduc@tvcablenet.be> Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-12-09drm/radeon: don't actually enable the IRQ regs until irq is enabledDave Airlie
vblank can try and enable the IRQ registers before we've set the interrupt handler up. Signed-off-by: Dave Airlie <airlied@redhat.com>
2008-11-25drm: move drm vblank initialization/cleanup to driver load/unloadKeith Packard
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>
2008-11-11drm/radeon: map registers at load timeDave Airlie
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>