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>
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>
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>
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>
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>
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>
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>
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>
Gather more stats data for the analyzing daemons.
Change-Id: I9ffcfc76c0bd5f27ebf50d3f97e169662697fd12
Signed-off-by: Lucille Sylvester <lsylvest@codeaurora.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>