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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>