38 Commits

Author SHA1 Message Date
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 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
7b5ab2e982 amd-gpu: more sane way of doing an RB write 2012-12-10 19:36:18 -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
c0489d5cdc amd-gpu: remove unneeded barriers on hardware access
matches Freescale 2.6.38 kernel (ENGR00171209)
2012-11-19 21:32:45 +00: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
e5fe366470 gpu: maximum apertures = 2 now. clarify flags debug (multiple ways -> %x) 2011-09-05 12:11:03 -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
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
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
a0adc5279b __int64 custom typedef --> standard __s64 linux/type.h 2011-08-26 11:01:22 -05:00
Matt Sealey
b9cf657c71 gpu: logging abstraction cleanups. don't re-use PAGE_SIZE in mmu block definition (rename to MH_PAGE_SIZE) 2011-08-25 13:09:21 -05:00
Matt Sealey
2b537c8496 amd-gpu: extremely chatty logging, add CONFIG_MXC_AMD_GPU_LOGGING=y to config to enable. 2011-08-24 17:30:20 -05:00
Matt Sealey
a0ae9134ba Reduce number of apertures needed for GPU memory access by refining aperture setup to use PHYS and MMU/EMEM
apertures instead of PHYS and EMEM1/MMU and EMEM2. Modify setup to utilize all of reserved memory for PHYS
aperture instead of splitting. Now, a 32MB (in platform fixup, mx51_efikamx.c) reserved block is utilized as
the PHYS, or an 8MB chunk is carved out of coherent memory space (DMA allocation) if reservation is disabled.
Normal memory usage for a desktop with browser, office and media player is well over 64MB but the Xorg driver
will evict unused pixmaps where necessary to keep the current performance pixmaps in place.
2011-08-11 09:22:55 -05:00
Matt Sealey
c5de0bc6cf refine GSL memory sizes in reserved region to 24MB for physical and 8MB other 2011-08-04 16:17:02 -05:00
Matt Sealey
a940a406a3 Reinstate the 32MB reserved area for GPU since DMA allocations of large sizes just don't work.
Correct EMEM2 and PHYS area sizes for GPU to 16MB each (may need refinement)
Bump max zone order anyway
2011-08-02 17:08:32 -05:00
Zhou, Jie
e26d3e911c ENGR00143019-2 GPU: enable MMU
With MMU enabled, there is no need to reserve memory for GPU
at boot time

Signed-off-by: Zhou, Jie <b30303@freescale.com>
(cherry picked from commit 326da1d885108399f4e22d10a8fe341a7a110ffc)
2011-06-28 12:47:06 -05:00
Zhou, Jie
99f16398f4 ENGR00141400 GPU: Improve GPU clock gating
seperate interrupt handling and clk_enable for Z160 and Z430

Signed-off-by: Zhou, Jie <b30303@freescale.com>
(cherry picked from commit 7da21af984a50ffb166ab1a088cd2c5d4313537b)
2011-06-28 12:42:22 -05:00
Matt Sealey
5898cfa2ad amd-gpu: enable limiting of in-flight AXI transactions for Z160 GPU 2011-03-06 16:52:35 -06:00
Jie Zhou
95ee853082 ENGR00134150 GPU: destroy device in workqueue for error interrupts
If GPU error interrupt detected, related device will be destroyed.
In the destory function, device_idle and mutex_lock may cause sleep,
which may cause kernel crash, so delay the device destroy to the
workqueue to avoid this.

Signed-off-by: Jie Zhou <b30303@freescale.com>
2011-01-18 09:37:34 -06:00
Matt Sealey
26a3feaa56 AMD GPU update 2010-11-13 10:32:27 -06:00
Jie Zhou
73685d49b8 ENGR00126565-2 GPU: Provide z160 precision info to user space libraries
MX50 Z160 has higher gradient/texture precision than MX51/53.

Signed-off-by: Jie Zhou <b30303@freescale.com>
2010-11-13 10:10:00 -06:00
Jie Zhou
ef5ea51ba2 ENGR00126064 GPU: disable mmu to pass OpenVG CTS
If enabled MMU, there is AXI read/write error on MX508 when run
OpenVG CTS.

Besides, change EMEM1 size to 10MB by default to make gpu driver
work on MX50_ARM2 board with 128MB memory installed.

Signed-off-by: Jie Zhou <b30303@freescale.com>
2010-11-13 10:09:43 -06:00
Jie Zhou
90875b3f6c ENGR00125984 GPU: enable MMU for MX508 and MX35
Remove GSL_MMU_TRANSLATION_ENABLED macro originally used for conditional
compile, and replace it with runtime check to support one mx5x image

Signed-off-by: Jie Zhou <b30303@freescale.com>
2010-11-13 10:09:41 -06:00
Jie Zhou
dd4baeffab ENGR00125615 GPU: disable z160 in gsl when X-Accel enabled
When X-accel is enabled, uio driver is used for X server to access
z160 device, so in gsl, we should not operate z160 to avoid conflicts

Signed-off-by: Jie Zhou <b30303@freescale.com>
2010-11-13 10:08:00 -06:00
Jie Zhou
373272e191 ENGR00125729-2 GPU: merge hal for MX35/MX50 and MX51/MX53
Add MX508 support, and adapt the gpu driver to one image

Signed-off-by: Jie Zhou <b30303@freescale.com>
2010-11-13 10:07:57 -06:00
r80085
b8ed88ab15 ENGR00125256 Integrate AMD Rc16/EA VG/GL fix to GPU kernel module
Fix the VG/GL issue in GPU kernel module when running VG/GL at the same time

Signed-off-by: Gene Chouiniere <Gene.Chouiniere@amd.com>
Signed-off-by: r80085 <thomas.peng@freescale.com>
Acked-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:51:57 -05:00
Gene Chouiniere
da25d30bfa ENGR00125010-1 gpu: add gpu driver support
Migrate from RC14 with freescale changes.

Signed-off-by: Gene Chouiniere <Gene.Chouiniere@amd.com>
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Acked-by: Rob Herring <r.herring@freescale.com>
2010-08-10 11:51:46 -05:00