Commit Graph

15 Commits

Author SHA1 Message Date
Matt Sealey
76e264f5ed amd-gpu: huge commit with many, many changes
Just to save work and get it up online. Current status;

GL not working as per usual

VG works - but closing Z160 device locks the driver (seems to be that
device_idle is called after the device is closed and there may be a
driver lock contention going on here).

imxng graphics driver works first run (same as above) but there are
some strange graphical glitches on smaller blits and rectangle fills,
which may be down to some kind of cache coherency problem.

Real (platform device) MMU enable causes the whole thing to explode,
since none of this got updated properly.

Tasks done:
* remove per-process support
* clean up use of device_id -> device since passing the id is a mess
  for some reason 3D device isn't inited properly and some parts of
  the driver call 3D device functions (notably on closing everything)
  possibly because of some off-by-ones
* more global driver locking per qualcomm and to allow below fix
* clean up sharedmem and other APIs which used such semantics e.g.
    kgsl_sharedmem_read -> lock, call kgsl_sharedmem_read0, unlock
  to just use kgsl_sharedmem_read with manual locks before the call
  where required, cleaning up the API a lot
* ditched the requirement for a device argument to sharedmem_alloc
  since it never allocated from a per-device pool anyway. This is
  a weird hack since the MMU setup needs a real device to set up
  on.. Qualcomm's has a much better system and that will be in place
  soon
* fixed the cmdstream_issueibcmds wrapper crap
* added kgsl_ringbuffer_issueibcmds to CMDSTREAM_ISSUEIBCMDS ioctl
  again (no real effect)
* put kgsl_device_active in kgsl_g12_issueibcmds rather than calling
  it manually before executing the function (ensures the autogating
  is turned off before telling the Z160 to run a stream) from ioctl
* lots of ioctl debugging code (mostly commented out)
* function renames everywhere
* locks around suspend/resume
* removed a lot of the finegrained locking stuff as qualcomm doesn't
  use it. That said, cmdwindow needs some locking (qcom uses a
  spinlock) - will be added later
* LOTS of code cleanups/lint/checkpatch fixing
* removed interrupt handler abstraction
* Z160 idle timer update
* move more HAL stuff into the right places to remove the HAL more
* MMU handling cleanups (not complete, lots of it is disabled)
* NOTE: must re-add runpending to sharedmem_alloc? May not be required
  when moving to new sharedmem API
* NOTE: check 3D interrupt enables
2012-12-07 09:44:13 -06:00
Matt Sealey
8bf5b2d48f amd-gpu: move cleanup functions into main module
includes kgsl_kmod.c -> kgsl.c and copying all the cleanup stuff in,
will rename it to qualcomm names during further cleanup of cleanup
stuff if necessary.

Missing fix for dst->src in kgsl_sharedmem_write (stashing issue,
sorry)

rename gsl_linux_map_find -> kgsl_sharedmem_find - note, qcom uses
"kgsl_mem_entry" here which is telling.

gsl_linux_map_alloc no longer maps writecombine
we no longer ioremap_wc our memory area (and split some code out)

also refine kgsl_mmap to be more like Qualcomm's (same functionality,
remove writecombining setting, remove a few vars mis/unused)
2012-12-03 14:47:58 -06:00
Matt Sealey
68cd01d084 amd-gpu: kgsl_cmdwindow.[ch] -> kgsl_g12_cmdwindow.[ch] 2012-12-02 14:54:38 -06:00
Matt Sealey
90fc28dc4f amd-gpu: Z160 context rework
* gsl_drawctxt_t -> kgsl_drawctxt (this touches some Z430 stuff too)
* gsl_z1xx_t et al -> kgsl_z1xx
* move some defines to includes
* use symbolic values in addmarker/beginpacket
* remove kgsl_context and opencode it's usage in ioctls etc.
* rename context_* ftbl functions to device_context_* like Qualcomm .35
* add kgsl_g12_cmdstream.c and kgsl_g12_drawctxt.c like Qualcomms .32
  but retain functionality from our versions of these functions

behavior change:

* under fbdev, tiger and es11ex work fine most of the time
  - es11ex will soft-lockup occasionally
* under imxng, tiger locks occasionally when moving the mouse pointer
  - I thought this bug was fixed
* under imxng, es11ex locks after good 30 seconds
  - but does NOT hang the system anymore (strange)

Since some gsl_driver.lock usage was moved I wonder if this is the
source of our race condition?
2012-11-30 13:16:24 -06:00
Matt Sealey
3f4491d9b6 amd-gpu: refine logging
* remove dumpx stuff which was kind of file based
* remove tbdump stuff which was kind of file based
* gsl_driver_t -> struct kgsl_driver since we touched a member
* kgsl_log_write -> KGSL_*_VDBG

This is not identical to the one Qualcomm uses but it's based on
it (include side at least) - debugfs not there, and no proper
setup so in actual fact no debug ever gets printed.

It is also fairly clumsily ported in (kgsl_log_write replacement)
so is just there to keep it compiling and remove some extra code
definitions which were either unused. Refining it will come as
Qualcomm code is ported in.

No side-effects noticed that weren't previously present - the
tiger apps run fine on imxng (which also works fine) and es11ex
still crashes after some frames.
2012-11-29 15:36:16 -08:00
Matt Sealey
692028e921 amd-gpu: rename module again to mxc_kgsl and remove extra cflags
This means we can unify the kgsl_kmod, kgsl_device, etc. as kgsl.o
just like Qualcomm does without stepping on the module object.
2012-11-29 05:56:50 -08:00
Matt Sealey
ad604e630a amd-gpu: rename module from "gpu" to "kgsl" partially to prevent loading
Some of our userspace scripts autoload gpu on boot and rather than mess
with those, it seems prudent to rename the module to kgsl instead.

This will go awry if we get too close to Qualcomm's code, since they
have a kgsl.c which compiles to kgsl.o which may conflict with the
intermediate module object. Be warned :)

Also makes several changes to the GPU config names to match those in
Qualcomm's driver and remove such config options from gsl_buildconfig.h
which is an obtuse way to configure the driver in the Linux kernel..

Logging is disabled until it can be tested.

Please don't enable per process page tables or mmu page fault stuff since
it will go absolutely batshit.
2012-11-26 17:22:44 -06:00
Matt Sealey
380e0fcdf2 renames to be closer to the qualcomm source file names for diffing purposes 2012-11-25 10:16:42 -06: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
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
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
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
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