213 Commits

Author SHA1 Message Date
Ahmed Ammar
b9fa2ad162 vpu: fix bitwork buffer segment location 2013-06-26 18:35:39 +02:00
Ahmed Ammar
3a6ceacb2b vpu: reserve memory for gpu to reduce load on dma_alloc 2013-06-25 19:20:22 +02:00
Matt Sealey
00c1f3f149 amd-gpu: correct sharedmem allocation
Merge/tree mishap caused this code to go missing.

Signed-off-by: Matt Sealey <matt@genesi-usa.com>
2013-06-06 11:56:18 -05:00
Matt Sealey
7115396a0f amd-gpu: remove aperture concept from the memory manager
Now everything is one big memarena instead of a separate PHYS and EMEM,
and instead of having to micromanage the split between Z160 (always PHYS
here) and GPU (99% of it's allocations come out of EMEM), we give blocks
from the same memory pool.

This should effect some more efficient allocation strategies and allow
Xorg acceleration to proceed with much less movement of data (when it
evicts for low memory in PHYS, it moves it to userspace and uses pixman
to render everything, which is CPU intensive) at the potential cost of
leaving slightly less memory around for the 3D GPU, but userspace apps
using the GPU should be doing better with texture management so as not
to soak up >32MiB of reserved GPU memory needlessly.

Moving away from gsl_memmgr to genalloc is not desirable right now since
the driver requires multiple allocation alignment orders and genalloc can
only really guarantee a minimum alignment (i.e. size of allocation
represented by each bit in the allocation bitmap).

Moving to a dma_alloc_coherent/writecombine-only model also poses a
problem since significant amounts of code expects to be able to find the
"base" GPU memory address and with individual allocations instead of a
pooled area, there is no such thing.

Signed-off-by: Matt Sealey <matt@genesi-usa.com>
2013-06-06 10:38:12 -05:00
Ahmed Ammar
8451d8d6b6 amd-gpu: rework apertures
* increase from 64MB to 96MB total memory
* after some testing it seems that PHYS can be quite small compared
  to EMEM, therefore make the aperture split 16MB/80MB
2013-05-21 18:04:56 +02:00
Ahmed Ammar
1c537cf431 amd-gpu: increase MEM1 area some more for latest eglsink
- fixes crashes with full-screen 720p eglsink
2013-05-05 15:58:11 -05:00
Ahmed Ammar
c532e3bcc9 amd-gpu: increase MEM1 area
- fixes issue where allocations fail after compiz started.
2013-01-20 05:07:04 -06:00
Ahmed Ammar
87baf958d0 Merge branch 'amd-gpu' of git://github.com/genesi/linux-legacy
Conflicts:
	arch/arm/configs/mx51_efikamx_defconfig
	drivers/mxc/amd-gpu/gsl_hal.c
2013-01-20 04:03:20 -06:00
Richard Zhao
927c89c489 ENGR00162464 update pm4 microcode: pm4_microcode_r18_20111020.a.inl.rel
It fix gpu hang.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
2012-12-10 21:04:18 -06:00
Matt Sealey
63f040b7ad amd-gpu: use kzalloc instead of kmalloc/memset 2012-12-10 20:43:42 -06:00
Xinyu Chen
4c741b2e31 ENGR00160722 amd gpu: add best fit algorithm to memory manager
The AMD gpu driver memory manager is stupid to allocating
a memory block from the first free block. Neither check the
best fit free block. Here just add a little codes to
let allocation to find a best size fitted free block.
To avoid memory fragement.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2012-12-10 20:42:50 -06:00
Richard Liu
f7501b49b9 ENGR00162193 amd gpu: fixed random gsl_kmod failure
increase max process number to fix gsl_kmod open issue

Signed-off-by: xianzhong <b07117@freescale.com>
Signed-off-by: Richard Liu <r66033@freescale.com>

Conflicts:

	drivers/mxc/amd-gpu/include/gsl_buildconfig.h
2012-12-10 20:42:17 -06:00
Matt Sealey
102933f39b amd-gpu: ensure timestamp read posted to CPU before returning 2012-12-10 19:36:19 -06:00
Matt Sealey
7b5ab2e982 amd-gpu: more sane way of doing an RB write 2012-12-10 19:36:18 -06:00
Matt Sealey
e98a2a565a amd-gpu: memory barrier additions in MMU code to ensure pagetables are posted 2012-12-10 19:36:18 -06:00
Matt Sealey
fbbe86a046 amd-gpu: ringbuffer polling/timestamp buffer alignment fix
According to Qualcomm it can be at a 4-byte boundary, but for using MMU
it needs to be at a page boundary
2012-12-10 19:36:17 -06:00
Matt Sealey
5395604743 amd-gpu: alignment for MMU page tables should be page-aligned 2012-12-10 19:36:16 -06:00
Matt Sealey
3b58ae2463 amd-gpu: don't use writecombining for remapping the sharedmem space even with MMU 2012-12-10 18:38:04 -06:00
Matt Sealey
be53471e10 amd-gpu: barriers in ringbuffer submit to ensure that the buffer is posted first 2012-12-10 18:36:59 -06:00
Matt Sealey
0c0087fe73 amd-gpu: memory barrier after waittimestamp ioctl to ensure buffers posted 2012-12-10 18:33:41 -06:00
Matt Sealey
287a1576a6 amd-gpu: memory barrier for safety after issueibcmds sync mem
Makes sense (and is from Qualcomm's driver) since we cannot guarantee
the memory writes have finished posting before we submit them to the
GPU.
2012-12-10 18:22:37 -06:00
Matt Sealey
f1ccc6aab6 amd-gpu: remove unused, non-kernelish debug_pm4 module
This is just causing some messy code.
2012-12-10 18:14:48 -06:00
Matt Sealey
95b52ba9b3 amd-gpu: remove device_clock ioctl
No userspace users except a reference in libkgsl.so which is never called.

kgsl_device_clock() is left in (but preprocessed out) since it has a fairly
interesting behavior in turning the autogating on and off which is not the
same as turning the actual clocks on and off and could be useful with
modification for further refinement of power management at a later date.
2012-12-10 18:11:27 -06:00
Matt Sealey
d09ae76082 amd-gpu: remove add_timestamp ioctl
No userspace activity on this ioctl means it needn't be implemented.
2012-12-10 18:00:59 -06:00
Matt Sealey
3b59a26f78 amd-gpu: remove regwrite ioctl and associated infrastructure
kgsl_device_regwrite() still exists as it is used for a single point in
the driver (reading timestamp for Z430 ringbuffer) dependent on a build
flag. This flag is not enabled but it is not within the scope of this
patch to actually change this (if it is ever enabled it will be quite
obvious what to do - use kgsl_yamato_regwrite directly as it is entirely
Z430-specific)
2012-12-10 16:25:50 -06:00
Matt Sealey
16d6513c0b amd-gpu: remove unused waitirq ioctl and associated infrastructure
This is implemented in the "current" userspace libkgsl.so but in fact
since the ioctl is deprecated, there are no users for it and no evidence
of it ever being used in real life can be presented. Therefore we can
just take out the few things it does and it's single-use dependencies.
2012-12-10 16:13:52 -06:00
Matt Sealey
9b0b2333c8 amd-gpu: remove unused files and logging infrastructure which was never enabled 2012-12-10 16:09:51 -06:00
Matt Sealey
c0489d5cdc amd-gpu: remove unneeded barriers on hardware access
matches Freescale 2.6.38 kernel (ENGR00171209)
2012-11-19 21:32:45 +00:00
Matt Sealey
42f79c36bf amd-gpu: cleaned/added extra debug, plus use kzalloc instead of kmalloc/memset
Adds similar functionality as the following Freescale patch:

ENGR00142591 GPU: add some print message to help debug
2012-11-19 21:20:43 +00:00
Xinyu Chen
210b9c4040 ENGR00160722 amd gpu: add best fit algorithm to memory manager
The AMD gpu driver memory manager is stupid to allocating
a memory block from the first free block. Neither check the
best fit free block. Here just add a little codes to
let allocation to find a best size fitted free block.
To avoid memory fragement.

Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
2012-11-19 11:52:31 -06:00
Richard Zhao
1cae50aa16 ENGR00162464 update pm4 microcode: pm4_microcode_r18_20111020.a.inl.rel
It fix gpu hang.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
2012-11-19 11:41:33 -06:00
Richard Liu
8482a4dae7 ENGR00162193 amd gpu: fixed random gsl_kmod failure
increase max process number to fix gsl_kmod open issue

Signed-off-by: xianzhong <b07117@freescale.com>
Signed-off-by: Richard Liu <r66033@freescale.com>

Conflicts:

	drivers/mxc/amd-gpu/include/gsl_buildconfig.h
2012-11-19 11:41:03 -06:00
Matt Sealey
89813bb753 gpu: fix the weird gpummu/nogpummu memory reservation/allocation mess, and disable the gpummu again for maximum stability 2012-05-16 07:09:18 -05:00
Matt Sealey
a460028c64 ipu: backport of IPU clock handling
* improve clock accuracy check from 1/16 to 1/200 of intended clock rate
* properly round pixel clock to the parent and not against a hardcoded 150MHz max rate
* properly fix di external clock divisor to a maximum of 8
2012-02-20 09:29:48 -06:00
Matt Sealey
ded72a8511 gsl: fix typo in error message 2011-12-19 12:37:28 -06:00
Matt Sealey
f8f8789037 whitespace cleanups? 2011-12-15 13:38:28 -06:00
Matt Sealey
fe21c0fe94 gsl: add/improve ioctl entry/exit debugging, but disable it. 2011-12-15 13:37:26 -06:00
Matt Sealey
3635f6cf83 vpu: bump driver as close to 11.08 as possible without breaking anything 2011-09-15 23:39:51 -05:00
Matt Sealey
e5fe366470 gpu: maximum apertures = 2 now. clarify flags debug (multiple ways -> %x) 2011-09-05 12:11:03 -05:00
Matt Sealey
ef06068ea1 gpu: correct varargs debug (memdesc is a pointer NOT static!) to fix ridiculous sizes reported for sizebytes/offsetbytes in read/write operations.
Also add scatterlist and gsl_property_t debugging so the thing is more readable as a whole..
2011-09-04 15:02:04 -05:00
Matt Sealey
2c2be6f567 gpu: move files out of common/ since there's no need for a seperate directory. This also means we can make drivers/mxc/amd-gpu/gsl_*.i to see preprocessed output and get hints as to what is being compiled in and what the final code is like
additional minor changes:
 * rename PAGE_SIZE register MH_PAGE_SIZE in yamato/22/yamato_genreg.h (although this is an unused debug file so far)
 * remove references to stdio files in gsl_debug_pm4.c (will come in handy later)
2011-08-31 11:22:26 -05:00
Matt Sealey
13678b44c9 gpu: disabling the clip mask should improve performance but it actually causes the depth buffer to act weird because I don't think our userspace/kernel combination handles it properly.. 2011-08-30 15:27:37 -05:00
Matt Sealey
bc30f49241 gpu: don't clear the Z160 global on context destroy, do it on device close instead (this is part of a Freescale patch ENGR00142363 for WindowsCE but makes a hell of a lot o srense for Linux too) 2011-08-30 13:33:11 -05:00
Matt Sealey
c9f5504a1a gpu: enable HAL debug
gpu: pull in some command stream differences from Qualcomm's MSM kernel (might fix some intermittent GPU hangs)
display: enable quick testing of non-mmu operation (hangs X right now)
2011-08-30 12:38:48 -05:00
Matt Sealey
cdd8d1a03b gpu: move hal abstraction to the same place as the other files 2011-08-30 08:15:24 -05:00
Matt Sealey
aac2fc75d3 gpu driver: remove most of the remaining "abstraction" for OS mutex and so on
* mutex, events, sleeps, process id unabstracted
 * defines for function types (inline, extern) unabstracted
 * defines for debug assert change name (KOS_ASSERT -> DEBUG_ASSERT) and left disabled
 * driver now warns, if logging is enabled, that interruptible mutex locks are interrupted (which never happens in reality but it fixes a warning)
 * remove fine grained locking "feature" since it's not enabled (and Qualcomm's public driver does not even implement it)
 * refine mutex initialization where it's still present - don't try and allocate mutex structures where they're always used, just make them parts of the structure (struct mutex * -> struct mutex)
 * whitespace police
2011-08-29 14:55:29 -05:00
Matt Sealey
63da19a022 gpu os abstraction: more unused functions for memory leak checking now gone 2011-08-26 13:02:03 -05:00
Matt Sealey
9d43088ce9 gpu os abstraction: kos_malloc/kos_free -> kmalloc/kfree. Remove SYMBIAN and WIN32 code 2011-08-26 12:58:10 -05:00
Matt Sealey
f1a9436eac gpu os abstraction: remove _LINUX switches and all other OS code 2011-08-26 12:02:51 -05:00
Matt Sealey
8aff22cac1 gpu os abstraction: remove some wince/symbian/brew stuff and atoi/strtoul abstractions (unused) 2011-08-26 11:16:25 -05:00