Commit Graph

5163 Commits

Author SHA1 Message Date
Lucille Sylvester
d40c340622 msm: kgsl: Make TZ usage depend on general SCM availability
SECURE_IO was an 8660 dependency, not a multi-platform feature.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:19:51 -07:00
Jeremy Gebben
eebc461898 msm: kgsl: clean up adreno220 registers
There's not enough of these to justify a separate header.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:19:39 -07:00
Jordan Crouse
fd97843e7e msm: kgsl: Fix an over greedy CONFIG_ANDROID_PMEM ifdef
kgsl_get_phys_file is used for both PMEM and the framebuffer,
so adjust the #ifdef CONFIG_ANDROID_PMEM to only omit the
PMEM specific parts.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:19:07 -07:00
Jordan Crouse
976cf0e965 msm: kgsl: Avoid a possible variable dereference in kgsl_mmap
There was a possiblity that a variable would be dereferenced
in a loop, so use a temporary holder to avoid any corner
case problems.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:19:06 -07:00
Lucille Sylvester
cd42c82b23 msm: kgsl: Clocks should be set to the active level during NAP
Fix a bug in the interaction between NAP and GPU DCVS.  Without
this change the clock freq recommended by DCVS might or might
not have been used.  Power levels should be stabilized for test
cases now.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:18:37 -07:00
Ranjhith Kalisamy
22d15a73ac msm: kgsl: Use ringbuffer WPTR drop prevention workaround only for a20x GPU
The workaround added to prevent the writes to ringbuffer WPTR from being
dropped does not work on a22x GPU. So, restrict this workaround only for
a20x GPU.

Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:18:25 -07:00
Lucille Sylvester
578091cf38 msm: kgsl: Enable TZ GPU DCVS for 8960
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:18:25 -07:00
Jeremy Gebben
aafef44e41 msm: kgsl: force 8960 v1 & v2 to use adreno220
Currently v2 works better if we pretend it is
adreno220 instead of adreno225.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:18:17 -07:00
Lucille Sylvester
1e99fcb8cd msm: kgsl: fix gpu_busy variable
Fix for pwrscale policies without both a busy & idle func.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:18:10 -07:00
Ranjhith Kalisamy
8b636956ba msm: kgsl: Add proper device lock/unlock for early suspend driver
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:18:03 -07:00
Ranjhith Kalisamy
3fcdb3301f msm: kgsl: Prevent writes to ringbuffer WPTR from being dropped
Sometimes, the writes to ringbuffer WPTR register are dropped. This will
make the GPU to go to idle before completing all the commands that it is
submitted with. This workaround prevents the writes from being dropped.

CRs-Fixed: 302173
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:17:54 -07:00
Ranjhith Kalisamy
bd5297fc43 msm: kgsl: Fix bug in postmortem dump register decode
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-03 16:17:50 -07:00
Laura Abbott
894fd58ea8 gpu: ion: Add support for cached and uncached mappings
Add explicit support for cached and uncached mappings. Functions
now describe whether mappings will be cached or uncached.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:17:38 -07:00
Lucille Sylvester
591ea03860 msm: kgsl: Add idle_stats based pwrscale policy
Add a pwrscale policy to transmit idle statistics
to userspace via the MSM idle_stats_device core.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:17:25 -07:00
Laura Abbott
a2e9363f06 gpu: ion: Add support for carveout heaps on msm targets
Add infrastructure for supporting ion carveout heaps.
The memory type should be specified in the board file using
mach/ion.h. The ion platform driver will be responsible for
allocating the correct memory.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:17:21 -07:00
Laura Abbott
302911d5ba gpu: ion: Add platform driver for msm ion
Add platform driver for msm specific ion devices

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:17:20 -07:00
Lucille Sylvester
844b1c8713 msm: kgsl: IRQ must be off after _stop is called
ringbuffer_stop & mmu_stop will turn on the IRQ handler.
Turn it off after they are called.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:17:17 -07:00
Sushmita Susheelendra
f389606af7 msm: kgsl: Record missing memory writes to the cff dump
The buffers memstore and dummyspace were being memset
before memory for them was allocated and mapped.
kgsl_cff_parse_ibs should record the write instead
of returning upon encoutering a hostaddr with no
physical addr.
Writes to GMEM were not being recorded. Adding
the mem syncs for that

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:17:07 -07:00
Sushmita Susheelendra
41f8fa3306 msm: kgsl: Add CFF user event ioctl to write data to cff dumps
Add the ioctl IOCTL_KGSL_CFF_USER_EVENT to write data to cff dump.
Define a new CFF packet cff_op_user_event for this generic user
event.
Write the surface parameter data packet and verify mem file
packet to cff dumps

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:17:02 -07:00
Jeremy Gebben
2f789d14b8 msm: kgsl: stop forcing hw patchid to 0 for 8x60 and 8960
This field of the chip_id was forced to 0 because userspace
got confused when it was a different value. Userspace has
been corrected to deal with the correct patch ids.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:16:54 -07:00
Sushmita Susheelendra
fbb46aabd3 msm: kgsl: Fix ringbuffer command names
The prefix PM4_ was changed to CP_.

Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:16:53 -07:00
Jeremy Gebben
6061bc76ed msm: kgsl: add MEMORY_BASE and HANG packets
These are changes to the cffdump output format.
MEMORY_BASE reports the address range we're using at the start
of the dump, which helps the postprocessors validate memory
writes.

HANG is emitted at the start of kgsl_postmortem_dump(), and can
be used by the postprocessors to stop when the hang occurs.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:16:26 -07:00
Jeremy Gebben
a7423e433e msm: kgsl: cffdump syncmem ioctl
This ioctl is needed to track memory writes done from userspace
so that this data is correctly captured in the dump.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:16:26 -07:00
Suman Tatiraju
7fe62a3d10 msm: kgsl: add gpu busy stats to sysfs
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2011-10-03 16:15:57 -07:00
Tarun Karra
9b92ccd290 msm: kgsl: Changed variable type from unsigned int to long
Changed variable "result" type from unsigned int to long
to accurately reflect the result of macro wait_event_interruptible_timeout

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2011-10-03 16:15:40 -07:00
Tarun Karra
44cbeb74ac msm: kgsl: changed strncat to strlcat
Changed strncat to strlcat to pervent buffer overflow.

Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2011-10-03 16:15:32 -07:00
Lucille Sylvester
28e99c8edb msm: kgsl: Use the first command to initiate busy
There may be multiple command submissions per-frame.  Start your
busy count only on the first one.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:15:32 -07:00
Lucille Sylvester
622927ad37 msm: kgsl: Update pwrlevel_change
Previously only supported fabric votes, now supporting AXI as well.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:14:29 -07:00
Sushmita Susheelendra
22d87177a2 msm: kgsl: Fix build errors when CONFIG_MSM_KGSL_CFF_DUMP is on
Signed-off-by: Sushmita Susheelendra <ssusheel@codeaurora.org>
2011-10-03 16:14:28 -07:00
Laura Abbott
b1b7b43a64 gpu: ion: check return value from gen_pool_add
Check the return value from gen_pool_add and handle
any error gracefully.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-03 16:14:18 -07:00
Jeremy Gebben
79acee6f01 msm: kgsl: fix possible memory leak in firmware loading
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:14 -07:00
Jeremy Gebben
3c127f589a msm: kgsl: fix parameter checking in adreno_ringbuffer_issueibcmds
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:14 -07:00
Jeremy Gebben
690f9d172f msm: kgsl: fix error handling in kgsl_ioct_sharedmem_flush_cache
For some error conditions it was possible to exit this function
without unlocking the spinlock.

Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:13 -07:00
Jordan Crouse
6c2992ac90 msm: kgsl: Check for NULL from kgsl_get_device_from_dev
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:14:12 -07:00
Jordan Crouse
2db0af97c8 msm: kgsl: Don't lookup the device with inodep if we don't have to
kgsl_open does a fine job of setting the private members of
struct file so use that in the other fops functions rather then
looking up the device via the inode minor every time.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 16:14:12 -07:00
Jeremy Gebben
a87bb86117 msm: kgsl: switch sprintf calls to snprintf
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:14:11 -07:00
Dave Airlie
549c431cbd Revert "drm/radeon/kms: fix typo in r100_blit_copy"
commit d9ad77ebfd3a304306f9f18ff3f9e522da075e27 upstream.

This reverts commit 18b4fada275dd2b6dd9db904ddf70fe39e272222.

This code was correct, apologies to anyone who noticed things broke.

revert contents are different due to another commit in between.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 13:25:13 -07:00
Alex Deucher
b5fa99b753 drm/radeon/kms: fix DDIA enable on some rs690 systems
commit fdfc61594e6de21c23f955818ef78bcab9bafe40 upstream.

DVOOutputControl checks the value of of bios scratch reg 3
on some tables and assumes the encoder is already enabled
if the DFP2_ACTIVE bit is set.  Clear that bit so the table
sets the DDIA enable bit properly.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:41:03 -07:00
Alex Deucher
06b995be61 drm/radeon/kms: Make GPU/CPU page size handling consistent in blit code (v2)
commit 003cefe0c238e683a29d2207dba945b508cd45b7 upstream.

The BO blit code inconsistenly handled the page size.  This wasn't
an issue on system with 4k pages since the GPU's page size is 4k as
well.  Switch the driver blit callbacks to take num pages in GPU
page units.

Fixes lemote mipsel systems using AMD rs780/rs880 chipsets.

v2: incorporate suggestions from Michel.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:33 -07:00
Michel Dänzer
a4f5172f4f drm/radeon: Don't read from CP ring write pointer registers.
commit 87463ff83bcda210d8f0ae440bd64d1548f852e7 upstream.

Apparently this doesn't always work reliably, e.g. at resume time.

Just initialize to 0, so the ring is considered empty.

Tested with hibernation on Sumo and Cayman cards.

Should fix https://bugs.launchpad.net/ubuntu/+source/linux/+bug/820746/ .

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:29 -07:00
Marcin Slusarz
045451f9de drm/nouveau: properly handle allocation failure in nouveau_sgdma_populate
commit 17c8b960930da3599e47801a54ac0ea1070545d2 upstream.

Not cleaning after alloc failure would result in crash on destroy,
because nouveau_sgdma_clear assumes "ttm_alloced" to be not null when
"pages" is not null.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:14 -07:00
Alex Deucher
10927d967a drm/radeon/kms: make sure pci max read request size is valid on evergreen+ (v2)
commit d054ac16eeb658bccadb06b12c39cee22243b10f upstream.

If the bios or OS sets the pci max read request size to 0 or an
invalid value (6,7), it can result in a hang or slowdown.  Check
and set it to something sane if it's invalid.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=42162

v2: use pci reg defines from include/linux/pci_regs.h

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:04 -07:00
Dave Airlie
34b6443513 drm/radeon/kms: set a default max_pixel_clock
commit 9adceaa5b3d2480e2252c4a7f9c4bd7d66b8c4a2 upstream.

On some Power rv100 cards, we have no ATY OF table, but we have
no combios table either, and hence we refuse all modes on VGA-0
since we end up with a 0 max pixel clock.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:03 -07:00
Jerome Glisse
5297aef4dd drm/radeon/kms: evergreen & ni reset SPI block on CP resume
commit a49a50dad48586d42ebac1a6730c3a3cd5603421 upstream.

For some reason SPI block is in broken state after module
unloading. This lead to broken rendering after reloading
module. Fix this by reseting SPI block in CP resume function

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:02 -07:00
Alex Deucher
795464a57a drm/radeon/kms: add s/r quirk for Compaq Presario V5245EU
commit 302a8e8b06d312dcb3b718dfeb42aa912b5f426b upstream.

Fixes resume on Compaq Presario V5245EU.

Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=41642

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-03 11:40:02 -07:00
Jordan Crouse
b58e61b2fa msm: kgsl: Avoid a deadlock in the IRQ handler
If a major GPU fault occurs, interrupts should be turned off to
avoid a storm.  Calling disable_irq from within the IRQ handler,
however has deadlock problems.  Call disable_irq_nosync in an
interrupt context instead.

CRs-fixed: 299686
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:57 -07:00
Jordan Crouse
505df9cb23 msm: kgsl: Consolidate all GPU information in one spot
We are starting to accumulate a lot GPU specific information,
and it is handy to keep it all in one place where new core IDs,
firmware and device functions can be easily added.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:36 -07:00
Jordan Crouse
084427d2c2 msm: kgsl: Rename PM4 to CP to better align with A3XX code
The A3XX code likes to use CP_ as a prefix for ringbuffer
commands rather then the legacy PM4 prefix.  Since it is more
correct, switch the A2XX code over now to make it easier to
integrate A3XX into the mix.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:35 -07:00
Jordan Crouse
2c542b697e msm: kgsl: Don't make assumptions about VMA regions
We cannot assume that a VMA region created as a result of an mmap
belongs exclusively to us.  Allow the user to pass the size of
the vmalloc region through the 'gpuaddr' member of the ioctl
struct and do strict checking on the returned vma to make sure
it is valid.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:34 -07:00
Jordan Crouse
0e0486f251 msm: kgsl: Rearrange some drawctxt functions
Move some of the drawctxt functions that are common
to A2XX and A3XX back to the generic drawctxt code
and headers.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-03 10:28:29 -07:00