aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAge
* drm/radeon/kms: allow STRMOUT_BASE_UPDATE on RS780 and RS880Marek Olšák2012-09-27
| | | | | | | | This is required to make streamout work there. Signed-off-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: add 2-level VM pagetables support v9Dmitry Cherkasov2012-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PDE/PTE update code uses CP ring for memory writes. All page table entries are preallocated for now in alloc_pt(). It is made as whole because it's hard to divide it to several patches that compile and doesn't break anything being applied separately. Tested on cayman card. v2: rebased on top of "refactor set_page chipset interface v3", code cleanups v3: switched offsets calc macros to inline funcs where possible, remove pd_addr from radeon_vm, switched RADEON_BLOCK_SIZE define, to 9 (and PTE_COUNT to 1 << BLOCK_SIZE) v4 (ck): move "incr" documentation to previous patch, cleanup and document RADEON_VM_* constants, change commit message to our usual format, simplify patch allot by removing everything current not necessary, disable SI workaround. v5: (agd5f): Fix typo in tables_size calculation in radeon_vm_alloc_pt(). Second line should have been '+=' rather than '='. v6: fix npdes calculation. In scenario when pfns to be mapped overlap two PDE spans: +-----------+-------------+ | PDE span | PDE span | +-----------+----+--------+ | | +---------+ | pfns | +---------+ the following npdes calculation gives incorrect result: npdes = (nptes >> RADEON_VM_BLOCK_SIZE) + 1; For the case above picture it should give npdes = 2, but gives one. This patch corrects it by rounding last pfn up to 512 border, first - down to 512 border and then subtracting and dividing by 512. v7: Make npde calculation clearer, fix ndw calculation. v8: (agd5f): reserve enough for 2 full VM PTs, add some additional comments. v9: fix typo in npde calculation Signed-off-by: Dmitry Cherkasov <Dmitrii.Cherkasov@amd.com> Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: refactor set_page chipset interface v5Christian König2012-09-27
| | | | | | | | | | | | | | | | | | | | | Cleanup the interface in preparation for hierarchical page tables. v2: add incr parameter to set_page for simple scattered PTs uptates added PDE-specific flags to r600_flags and radeon_drm.h removed superfluous value masking with 0xffffffff v3: removed superfluous bo_va->valid checking changed R600_PTE_VALID to R600_ENTRY_VALID to handle PDE too v4 (ck): fix indention style, rework and fix typos in commit message, add documentation for incr parameter, also use incr parameter for system pages v5 (agd5f): use upper_32_bits() and minor white space fixes Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Dmitry Cherkassov <Dmitrii.Cherkasov@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: Fix scratch register leak in IB test.Michel Dänzer2012-09-27
| | | | | | | | | | Restructure the code to jump out via labels instead of directly returning early. Also make error reporting consistent across all hardware generations. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Simon Kitching <skitching@vonos.net> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: restore backlight level on resumeAlex Deucher2012-09-27
| | | | | | | | | | | | | Restore the backlight level on resume. Some systems need to explicitly restore the backlight level on resume. Fixes panel resume on my Trinity laptop and may fix the following bugs: https://bugs.freedesktop.org/show_bug.cgi?id=43829 https://bugzilla.kernel.org/show_bug.cgi?id=46241 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: add get_backlight_level callbackAlex Deucher2012-09-27
| | | | | | | Read back the backlight level from the hw. Needed for proper backlight restoration on resume. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: only adjust default clocks on NI GPUsAlex Deucher2012-09-27
| | | | | | | | SI asics store voltage information differently so we don't have a way to deal with it properly yet. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
* drm/radeon: validate PPLL in crtc fixupAlex Deucher2012-09-27
| | | | | | | | This allows us to bail if we can't support the requested setup from a PPLL perspective. Prevents broken setups from being attempted. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: work around KMS modeset limitations in PLL allocation (v2)Alex Deucher2012-09-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the current KMS API sets the mode independantly on each crtc, we may end up with resource conflicts. The PLL allocation is one of those cases. In the following example we have 3 crtcs in use driving 2 DVI connectors and 1 DP connector. On the initial kernel modeset for fbdev, the display topology ends up as follows: crtc0 -> DP-0 crtc1 -> DVI-0 crtc2 -> DVI-1 Because this is the first modeset, all of the PLLs are available as none have been assigned. So we end up with the following: crtc0 uses DCPLL crtc1 uses PPLL2 crtc2 uses PPLL1 When X starts, it assigns a different topology: crtc0 -> DVI-0 crtc1 -> DP-0 crtc2 -> DVI-1 However, since the KMS API is per crtc, we set the mode on each crtc independantly. When it comes time to set the mode on crtc0, the topology for crtc1 and crtc2 are still intact. crtc1 and crtc2 are already assigned PPLL2 and PPLL1 so when it comes time to set the mode on crtc0, crtc1 and crtc2 have not been torn down yet, so there appears to be no PLLs available. In reality, we are reconfiguring the entire display topology, however, since each crtc is handled independantly, we don't know that in the driver at each crtc mode set time. This patch checks to see if the same connector is being driven by another crtc, and if so, uses the PLL already associated with it. v2: store connector in the radeon crtc struct, simplify checking. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: make non-DP PPLL sharing more robustAlex Deucher2012-09-20
| | | | | | | | Compare the adjusted clock as well as the crtc mode clock. This handles cases where the driver adjusts the clock for specific special cases. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: store the encoder in the radeon_crtcAlex Deucher2012-09-20
| | | | | | This saves lots of lookups later. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: rework crtc pll setup to better support PPLL sharingAlex Deucher2012-09-20
| | | | | | | We need the calculate the pixel clock before allocating a PPLL in order to insure the clocks really match. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: allow PPLL sharing on non-DP displaysAlex Deucher2012-09-20
| | | | | | | | | | | | | | | | | | If several non-DP displays use the same pixel clock we can use the same PPLL for all of them. If all relevant displays have the same pixel clock, this allows the driver to: - use fewer PPLLs which saves power - support more than two non-DP displays on DCE4+ The current drm modesetting infrastructure doesn't really provide a good framework for validating combinations that work or won't work, so it's possible you could go from a working configuration to a non-working one by changing the mode a one of the displays. However, there this is better than what was there before. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/dce3: use a single PPLL for all DP displaysAlex Deucher2012-09-20
| | | | | | | If possible, use a single PPLL for multiple DP displays on DCE3.x. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: rework pll selection (v4)Alex Deucher2012-09-20
| | | | | | | | | | | | | | | | | | | | | For DP we can use the same PPLL for all active DP encoders. Take advantage of that to prevent cases where we may end up sharing a PPLL between DP and non-DP which won't work. Also clean up the code a bit. v2: - fix missing pll_id assignment in crtc init v3: - fix DP PPLL check - document functions - break in main encoder search loop after matching. no need to keep checking additional encoders. v4: - same as v3, but re-apply to drm-next as the corner cases are fixed properly in subsequent patches. fixes: https://bugs.freedesktop.org/show_bug.cgi?id=54471 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: fix typo in atombios_get_encoder_modeAlex Deucher2012-09-20
| | | | | | comparing the encoder mode to the encoder id for DVO. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon/atom: fix typo in SetPixelClock handlingAlex Deucher2012-09-20
| | | | | | | | MiscInfo field should be programmed with the crtc id rather than the pll id. However, at this point the two are the same for chips with this version of the table. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: white space cleanup in transmitter setupAlex Deucher2012-09-20
| | | | | | Makes it more consistent with the surrounding code. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: clean up encoder dp checksAlex Deucher2012-09-20
| | | | | | | | Use the proper struct in the union. That field has the same offset in every struct, so no functional change. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: rework the VM code a bit more (v2)Christian König2012-09-20
| | | | | | | | | | | | | Roughly based on how nouveau is handling it. Instead of adding the bo_va when the address is set add the bo_va when the handle is opened, but set the address to zero until userspace tells us where to place it. This fixes another bunch of problems with glamor. v2: agd5f: fix build after dropping patch 7/8. Signed-off-by: Christian König <deathsimple@vodafone.de>
* drm/radeon: fix gem_close_object handlingChristian König2012-09-20
| | | | | | | Make the reserve non interruptible. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: let bo_reserve take no_intr instead of no_wait paramChristian König2012-09-20
| | | | | | | | The no_wait param isn't used anywhere, and actually isn't very usefull at all. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: move and rename radeon_bo_va functionChristian König2012-09-20
| | | | | | | | It doesn't really belong into the object functions, also rename it to avoid collisions with struct radeon_bo_va. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: move IB pool to 1MB offsetChristian König2012-09-20
| | | | | | | | Even GPUs can have a null pointer dereference, so move the IB pool to another offset to catch those. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: fix VA overlap checkChristian König2012-09-20
| | | | | Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: fix VA range checkChristian König2012-09-20
| | | | | | | The end offset is exclusive not inclusive. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: fix VM syncing with multiple ringsChristian König2012-09-20
| | | | | | | | When a VM is used on more than one ring we need to sync to the last user. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: Remove unused functionsLauri Kasanen2012-09-20
| | | | | | | This applies on top of drm/radeon: Mark all possible functions / structs as static. Signed-off-by: Lauri Kasanen <cand@gmx.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: Mark all possible functions / structs as staticLauri Kasanen2012-09-20
| | | | | | | | | Let's allow GCC to optimize better. This exposed some five unused functions, but this patch doesn't remove them. Signed-off-by: Lauri Kasanen <cand@gmx.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: remove dead function defAlex Deucher2012-09-20
| | | | | | Was removed in the async VM update series. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: implement bounds checking on thermal controller lookupAlex Deucher2012-09-20
| | | | | | | Don't read past the end of the array if we encounter an unknown thermal controller. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: document async VM changes in ni.cAlex Deucher2012-09-20
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: make page table updates async v2Christian König2012-09-20
| | | | | | | | | Currently doing the update with the CP. v2: Rebased on Jeromes bugfix. Make validity comparison more human readable. Signed-off-by: Christian König <deathsimple@vodafone.de>
* drm/radeon: make sure ib bo is properly bound and up to date in vm spaceJerome Glisse2012-09-20
| | | | | | | | Make sure that the ib bo is bound and is page table is up to date in the virtual address space. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com>
* drm/radeon: Move looping over the PTEs into chip codeChristian König2012-09-20
| | | | | | | Makes it easier to move it into the rings. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: rework VM page table handlingChristian König2012-09-20
| | | | | | | | | Removing the need to wait for anything. Still not ideal, since we need to free pt on va remove. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: rework VMID handlingChristian König2012-09-20
| | | | | | | Move binding onto the ring, simplifying handling a bit. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: make VM flushs a ring operationChristian König2012-09-20
| | | | | | | | Move flushing the VMs as function into the rings. First step to make VM operations async. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: add sync helper functionChristian König2012-09-20
| | | | | Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: remove vm_unbindChristian König2012-09-20
| | | | | | | It actually isn't very useful. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: move VM funcs into asic structureChristian König2012-09-20
| | | | | | | So it looks more like the rest of the driver. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon: cleanup VM id handling a bitChristian König2012-09-20
| | | | | | | | Store a reference to the VM into the IB structure, that makes calculating the IBs address a bit less complicated. Signed-off-by: Christian König <deathsimple@vodafone.de> Reviewed-by: Jerome Glisse <jglisse@redhat.com>
* drm/radeon/atom: add consolidate bpc codeAlex Deucher2012-09-20
| | | | | | | | Several encoder setup functions had the same duplicated code for selecting the proper bpc setting for various atom tables. Consolidate it. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: rework the backlight control to be an asic callbackAlex Deucher2012-09-20
| | | | | | This cleans up the interface a bit as well. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: add initial support for ATCS ACPI methodsAlex Deucher2012-09-20
| | | | | | | Just verify the interface and track what functions are supported. Not actually used yet. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: document radeon_atpx_handler.c (v2)Alex Deucher2012-09-20
| | | | | | v2: rebase updates Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: reorganize ATPX support (v2)Alex Deucher2012-09-20
| | | | | | | | | - rework the acpi execute code - User proper parameters for ATPX functions v2: rebase fixes Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: update ATPX verify interface handling (v2)Alex Deucher2012-09-20
| | | | | | | | | Verify the ATPX interface and track what ATPX functions are available for future use. v2: rework due to tree changes Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: document radeon_acpi.cAlex Deucher2012-09-20
| | | | Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
* drm/radeon: block the keypress on ATIF eventsLuca Tettamanti2012-09-20
| | | | | | | | | The AMD ACPI interface may use ACPI_VIDEO_NOTIFY_PROBE to signal SBIOS requests; block the keypress in this case since the user did not actually press the mode switch key. Signed-off-by: Luca Tettamanti <kronos.it@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>