Commit Graph

5163 Commits

Author SHA1 Message Date
Shubhraprakash Das
08894b9698 msm: kgsl: Use scatter gather list to map memory to IOMMU
Use the scatter gather list for mapping memory to the IOMMU
page table. This results in much better performance as compared
to mapping single pages to the IOMMU table

Change-Id: Id78da19c8fcb7726f24dfdfb15fb9f9a16b7a185
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2011-10-25 12:26:24 -06:00
Laura Abbott
cbaa6687c5 gpu: ion: Do the cache op when the buffer is cached
Only do the cache operation when the buffer is cached.
If the buffer is uncached, just return. Fixes a bug
where the cache was only being flushed when the buffer
was uncached instead of cached.

Change-Id: Ib1fa01168de79d5627b11d07c5313d19b3049145
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-25 10:06:44 -07:00
Ben Skeggs
726e2766e0 drm/ttm: unbind ttm before destroying node in accel move cleanup
commit eac2095398668f989a3dd8d00be1b87850d78c01 upstream.

Nouveau makes the assumption that if a TTM is bound there will be a mm_node
around for it and the backwards ordering here resulted in a use-after-free
on some eviction paths.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25 07:10:15 +02:00
Ben Skeggs
379791a666 drm/ttm: ensure ttm for new node is bound before calling move_notify()
commit 8d3bb23609d4ae22803a15d232289fc09a7b61c4 upstream.

This was true for new TTM_PL_SYSTEM and new TTM_PL_TT cases, but wasn't
the case on TTM_PL_SYSTEM<->TTM_PL_TT moves, which causes trouble on some
paths as nouveau's move_notify() hook requires that the dma addresses be
valid at this point.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25 07:10:15 +02:00
Alex Deucher
f62f4cad50 drm/radeon/kms/atom: fix handling of FB scratch indices
commit 5a6e8482a16e61250a9121fc9ec719ab0529e760 upstream.

FB scratch indices are dword indices, but we were treating
them as byte indices.  As such, we were getting the wrong
FB scratch data for non-0 indices.  Fix the indices and
guard the indexing against indices larger than the scratch
allocation.

Fixes memory corruption on some boards if data was written
past the end of the FB scratch array.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-25 07:10:14 +02:00
Linux Build Service Account
fd1d4e01d3 Merge "msm: kgsl: Remove unused ib1_wq from struct adreno_device" into msm-3.0 2011-10-24 17:10:20 -07:00
Jordan Crouse
d17e9aa8d5 msm: kgsl: Create scatter gather lists for memory objects
Create and use scatter-gather lists for memory objects, which
avoids dynamically figuring the physical addresses of pages for
MMU mapping and cache operations.

Change-Id: Ic0dedbad9b973ecce4ae773b6bd682ba01010e5b
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-21 10:32:26 -06:00
Carter Cooper
8dd17ef145 msm: kgsl: Remove unused ib1_wq from struct adreno_device
Change-Id: Ibb37c225cbcafdb33f9ef483df54ccc26f48f7e1
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2011-10-21 09:02:49 -06:00
Linux Build Service Account
79b6b4ff20 Merge "msm: kgsl: Calculate the CPU busy during each GPU idle period" into msm-3.0 2011-10-20 15:27:45 -07:00
Dominic Binks
417877fdd3 Revert "msm: kgsl: suspend device when the display does off"
This reverts commit 3b7ad9c576.

Change-Id: Ie54ad7e14fc297a1275e50957023bf6c614b1e5e
Signed-off-by: Dominic Binks <dbinks@codeaurora.org>
2011-10-20 13:04:34 -07:00
Linux Build Service Account
456ddadcb1 Merge "msm: kgsl: suspend device when the display does off" into msm-3.0 2011-10-20 01:47:14 -07:00
Shubhraprakash Das
d9c90fa863 msm: kgsl: Force rb, and ib dumps
Force the dump of IB1, and IB2 in postmortem even if their sizes
in the registers are 0. Also, make sure that the ringbuffer size
is correct and print 100 dwords of ringbuffer history instead
of 64

Change-Id: Icbbef62cafc59338c979a34d1590362f7c1d5de0
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2011-10-19 15:41:24 -06:00
Lucille Sylvester
b0568f40d0 msm: kgsl: Always go to max clock rate on a pwrscale policy change
Especially when setting the policy to "none" we want to end up at the
highest frequency, rather than a random frequency.

Change-Id: I845a205be04482099ae3dafd13fdc55c63b7d952
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-19 14:54:01 -06:00
Lucille Sylvester
3f2661fbb1 msm: kgsl: Calculate the CPU busy during each GPU idle period
Gather more stats data for the analyzing daemons.

Change-Id: I9ffcfc76c0bd5f27ebf50d3f97e169662697fd12
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-18 10:24:57 -06:00
Suman Tatiraju
3b7ad9c576 msm: kgsl: suspend device when the display does off
This change saves leakage current when the display is
off. In scenerios where a user is listening to an mp3
this feature stops the GPU as soon as the display goes
off. The GPU is started again when the display comes
back. The feature also avoids the GPU resuming when a
email sync happens while the device is suspended.

Change-Id: I6f42aefec72848fc49cf4c71433d95a01fa3094d
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
2011-10-17 10:36:11 -07:00
Carter Cooper
6dd94c888d msm: kgsl: Cleanup function returns
Change-Id: Ic683e34cbde40b77475bc5fe98d958f364f9ae7b
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
2011-10-17 10:57:12 -06:00
Alex Deucher
00b8e8ceec drm/radeon/kms: use hardcoded dig encoder to transmitter mapping for DCE4.1
commit cb7cf41961fe10773c491c75ae73539ad4bbed66 upstream.

The encoders are supposedly fully routeable, but changing the mapping
doesn't always seem to take.  Using a hardcoded mapping is much more
reliable.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41366

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-16 14:14:54 -07:00
Alex Deucher
3450eab782 drm/radeon/kms: retry aux transactions if there are status flags
commit 4f332844cc87c5f99c5300f788abbe8a8c731390 upstream.

If there are error flags in the aux status, retry the transaction.
This makes aux much more reliable, especially on llano systems.

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-16 14:14:54 -07:00
Alex Deucher
416a1b0477 drm/radeon/kms: fix channel_remap setup (v2)
commit 12d5180bd7e683a4ae80830b82ba67e7b7fac7b2 upstream.

Most asics just use the hw default value which requires
no explicit programming.  For those that need a different
value, the vbios will program it properly.  As such,
there's no need to program these registers explicitly
in the driver.  Changing MC_SHARED_CHREMAP requires a reload
of all data in vram otherwise its contents will be scambled.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=40103

v2: drop now unused channel_remap functions.

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-16 14:14:52 -07:00
Alex Deucher
c6e2e6abef drm/radeon/kms: add retry limits for native DP aux defer
commit 6375bda073724ead7df08746866b724b1799a295 upstream.

The previous code could potentially loop forever.  Limit
the number of DP aux defer retries to 4 for native aux
transactions, same as i2c over aux transactions.

Noticed by: Brad Campbell <lists2009@fnarfbargle.com>

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Brad Campbell <lists2009@fnarfbargle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-16 14:14:52 -07:00
Alex Deucher
290771305e drm/radeon/kms: fix regression in DP aux defer handling
commit 109bc10d30f33e84f1d7289f0039e0c858ade82f upstream.

An incorrect ordering in the error checking code lead
to DP aux defer being skipped in the aux native write
path.  Move the bytes transferred check (ret == 0)
below the defer check.

Tracked down by: Brad Campbell <brad@fnarfbargle.com>

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41121

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Brad Campbell <brad@fnarfbargle.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-16 14:14:52 -07:00
Alex Deucher
23882c85d9 drm/radeon/kms: Fix logic error in DP HPD handler
commit 5ba7ddf81634bfdf32d09261d2959e3f5b7c4263 upstream.

Only disable the pipe if the monitor is physically
disconnected.  The previous logic also disabled the
pipe if the link was trained.

Fixes:
https://bugs.freedesktop.org/show_bug.cgi?id=41248

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-16 14:14:52 -07:00
Michel Dänzer
1a795f752c drm/radeon: Update AVIVO cursor coordinate origin before x/yorigin calculation.
commit b8aee294d89502469f2d80ae6afb93398d8227e0 upstream.

Fixes cursor disappearing prematurely when moving off a top/left edge which
is not located at the desktop top/left edge.

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-16 14:14:52 -07:00
Linux Build Service Account
0b38f4c377 Merge "gpu: ion: Actually return aligned memory" into msm-3.0 2011-10-15 12:53:35 -07:00
Laura Abbott
5ee3921e4c gpu: ion: Actually return aligned memory
Currently, the ion allocation API takes an alignment
argument. This alignment argument is currently ignored
everywhere. The system heaps cannot support the alignment
argument, but carveout heaps can. Add support for carveout
heaps to give back aligned memory.

Change-Id: Ic4cff37a7de51e1c85e273c2589958f7f13c33c9
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-15 11:59:11 -07:00
Jeremy Gebben
b46f4157ba msm: kgsl: fix 2d kgsl_pwrctrl_irq() call
The call to turn on the 2d irq from z180_start() would have
no effect because it was using the wrong flag. The offending flags,
which should only be used from within kgsl_pwrctrl.c for setting bits
in struct kgsl_pwrctrl.power_flags are also moved to the .c file
to avoid problems like this in the future.

Change-Id: Ied48c5f3b4860d55b2c0b7019ba50ed22d7f6bc1
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-15 00:19:20 -06:00
Linux Build Service Account
2ea4f046c5 Merge "msm: kgsl: Add idlestats sleep event notification" into msm-3.0 2011-10-14 23:04:38 -07:00
Lucille Sylvester
3b46d001e2 msm: kgsl: Add idlestats sleep event notification
Change-Id: Ie632d3f44661575ad8c7b41f064eff5f3b068f62
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-13 15:57:20 -06:00
Lucille Sylvester
2cbd1ffea5 msm: kgsl: Make sure we are idle before calling pwrscale_idle
Change-Id: Id56d94a1be345c72fa11b1029411d9cb73279729
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-13 14:57:50 -06:00
Jordan Crouse
1bf80aa867 msm: kgsl: Add a work item for processing expired timestamps
Add a work item to be triggered following a RB complete interrupt
signifying that a timestamp has been processed and retired on
the GPU. To kick things off, this work item is the the new home
for flushing expired memory objects allowing us to get rid of
kgsl_memqueue_drain and its various offspring.

Change-Id: Ic0dedbad853291ae5d05247241f449a7b523e318
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-12 17:09:20 -06:00
Laura Abbott
abcb6f740e gpu: ion: Add cache flushing APIs
Add ioctl to support flushing the caches of ion
buffers from userspace.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-11 09:59:30 -07:00
Laura Abbott
354120303a gpu: ion: Add IS_CACHED macro
Add a proper IS_CACHED macro for detecting whether or not
flags indicated a cached mapping.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-11 09:59:25 -07:00
Ranjhith Kalisamy
823c14810e msm: kgsl: Debugfs knob to configure wait timeout of adreno device
There are times when the adreno device is heavily loaded. Here, a
predetermined wait timeout value will not be useful. The configurability
introduced with this change will help in understanding the behaviour and
to tune the value. Will also be helpful in quickly identifying problems
that arise when the irqs don't fire.

Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-11 09:59:23 -07:00
Jeremy Gebben
671e5941f5 Revert "msm: kgsl: force 8960 v1 & v2 to use adreno220"
This reverts commit 8ad6fed70fbd18f4a061be2b3d749d3692dd7f86.

This is no longer needed now that workaround firmware for
8960v2 is available.

Change-Id: I212b7a7e4ef086b25d01d546df63a64505d8d374
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-06 09:26:24 -07:00
Jeremy Gebben
e2e61d4667 msm: kgsl: load workaround firmware for 8960v2
Change-Id: I3729b4d6f981e9b6202183a1e4614d57a5148062
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-06 09:26:20 -07:00
Ranjhith Kalisamy
f81dcd0e75 msm: kgsl: Remove WPTR drop prevention workaround
The WPTR drop prevention workaround added earlier is seen to cause
vague GPU hangs while running 3DMM06 app. So removing it.

CRs-Fixed: 309787
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
2011-10-05 10:37:26 -07:00
Jordan Crouse
d8f1c6b7fa msm: kgsl: Cleanup virtual files on module exit
Make sure that all sysfs and debugfs entries
are cleaned up when the driver exits.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-05 10:27:42 -07:00
Shubhraprakash Das
767fdda6e1 msm: kgsl: Introduce Iommu Code
kgsl now supports the use of 2 types of MMU. One is
the GPU's internal MMU and the other is IOMMU. Both
MMU cannot be active at the same time. The MMU type
can be selected at compile time via config option.
A boot command line parameter can be used to override
the type of MMU selected at compile time.

Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
2011-10-04 17:14:34 -07:00
Laura Abbott
f4c973de77 gpu: ion: Move initialization earlier
Ion needs to be initialized before most other subsystems.
Move the call to be earlier to ensure drivers that need to
allocate memory at bootup can.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-04 17:14:31 -07:00
Laura Abbott
4b5d048a1e gpu: ion: Add O_DSYNC flag to generated file
Ion uses the O_DSYNC flag of a file to indicate an uncached mapping.
When generating a file for mmaping, the new file needs to have the
same O_DSYNC flag as the parent (the file of the ioctl open call)
to indicate if the mapping should be cached or uncached.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-04 17:14:25 -07:00
Laura Abbott
e8f280253c gpu: ion: Fix cached and uncached mapping in carveout heap
When the cached flag is set, ioremap_cached should be called.
When the cache flag is not set, ioremap should be called.

Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
2011-10-04 17:14:24 -07:00
Lucille Sylvester
2c704c926f msm: kgsl: Add a periodic check to turn the TZ algorithm on
In use cases with very high graphics for some time followed by
low constant usage, the power level is never dropped.  Periodically
allow the TZ algorithm to run to see if any change in the external
conditions has occured.

CRs-fixed: 309131
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-04 17:14:10 -07:00
Jordan Crouse
4283e1715b msm: kgsl: Properly handle double mmapped memory
In some situations, the same block of memory is
mapped multiple times.  Properly refcount that mapping
otherwise we could get into a situation where the mem
entry is completely dereferenced before its time.

CRs-fixed: 306942
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2011-10-04 09:52:01 -07:00
Tarun Karra
96a12670fe msm: kgsl: for 8960 turn of clk gating for SX_clk_0
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
2011-10-03 16:21:30 -07:00
Lucille Sylvester
02e4629720 msm: kgsl: Don't count io busy at the lowest power level
If the GPU is running as slowly as possible, it is adding
lots of io busy to the CPU.  This causes the CPU ondemand
algorithm to unneccessarily increase CPU frequency.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:21:03 -07:00
Lynus Vaz
5a641cc260 msm: kgsl: Add AXI rate request on wakeup
Actually vote for AXI rate. If gpuclk sysfs file is changed
during device sleep, the previous AXI rate was retained instead
of the new AXI rate.

Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
2011-10-03 16:20:57 -07:00
Lucille Sylvester
20ec38a9ae msm: idle_stats: Make idle_stats_device.h userspace accessable
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:20:28 -07:00
Matt Wagantall
9dc0163652 msm: kgsl: Use device names to distinguish between graphics clocks
Distinguish between similar clocks on different cores using the
device struct passed to clk_get(). This allows for a common
clock naming convention that spans across targets.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
2011-10-03 16:20:23 -07:00
Lucille Sylvester
958dc94f21 msm: kgsl: Call pwrscale busy only when the GPU is definitely busy.
Original call placement could happen without actually starting
the GPU's workload.

Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
2011-10-03 16:20:12 -07:00
Jeremy Gebben
99105cb536 msm: kgsl: add new adreno225 registers to context switching
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
2011-10-03 16:19:59 -07:00