Imre Deak [Tue, 29 Mar 2011 17:25:08 +0000 (20:25 +0300)]
gpu: pvr: fix error path in PVRSRVOpenDCDeviceKM
Add missing free.
Reported-by: Coverity
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Imre Deak [Tue, 29 Mar 2011 17:25:08 +0000 (20:25 +0300)]
gpu: pvr: refactor error path in PVRSRVOpenDCDeviceKM
Needed by the next patch fixing the error path.
No functional change.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Imre Deak [Wed, 30 Mar 2011 12:37:04 +0000 (15:37 +0300)]
gpu: pvr: fix error path in PVRSRVOpenBCDeviceKM
Add missing frees / ref count rollback.
Reported-by: Coverity
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Imre Deak [Wed, 30 Mar 2011 12:45:07 +0000 (15:45 +0300)]
gpu: pvr: fix incorrect free size in PVRSRVOpenBCDeviceKM
Also remove the always true condition.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Imre Deak [Wed, 30 Mar 2011 12:13:08 +0000 (15:13 +0300)]
gpu: pvr: refactor error path in PVRSRVOpenBCDeviceKM
Needed by the next 2 patches fixing the error path.
No functional change.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Imre Deak [Tue, 29 Mar 2011 17:18:27 +0000 (20:18 +0300)]
gpu: pvr: fix error path in PVRSRVRegisterBCDeviceKM
Fixing a free with incorrect size and converting another one to use
free(p, sizeof(*p)) instead of free(p, sizeof(typeof(*p)).
Reported-by: Coverity
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Imre Deak [Tue, 22 Mar 2011 14:57:04 +0000 (16:57 +0200)]
gpu: pvr: reinstate dumping EDM trace to syslog
Since at the moment we don't have any other means to get the EDM trace
for core-matic reports, dump the trace to syslog, which will be picked
up by the core-matic report generating tool.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 22 Mar 2011 14:18:20 +0000 (16:18 +0200)]
gpu: pvr: change snprintf to scnprintf
snprintf returns how many characters _would_ have been written if there
had been enough space, whereas scnprintf returns the actual numer of
written characters. The latter fits better our use case.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:55 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: fix for imgtec simulator
When full dumping is enabled through init, the simulator throws in the
towel on the dumped CCB wait at the end of initialisation.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:54 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: add stream_frames debugfs entry
A mechanism to read out this data reliably is put in place. And data
is only lost when the stream is no longer being read or when a hard
limit of 1024 frames has been reached when the stream is still open.
In case of missing data, the buffer is padded with "..." to make
up for the missing bytes and to clear mark them.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:53 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: add stream offset tracking
Track the size of the stored data, this is split in start and end,
so that the next commit can use the start and end to read out the
stream correctly, even with vanishing frames (where the missing
data can be clearly marked).
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:52 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: add debugfs entries for the current frame
We keep another pointer to the current_frame around, so that the
data in our debugfs files is predictable.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:51 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: add initial frame handling and debugfs support
This adds the separate handling of the initial frame, and adds
debugfs support for this initial frame.
The initial frame is the frame started when the driver is initialised.
Once userspace flags the first frame, the initial frame is ended, and
a new frame started, but the initial frame is not part of the stream
list. The initial frame therefor does not get culled as part of
standard frame culling and is kept around for the life of the driver.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:50 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: start storing pdump data
Page based allocation, with built in copy_from_user to minimise buffer
copies. Up to 2040 pages of data are kept per frame, if this amount is
exceeded, an error message is printed, and a new frame is created
automatically.
Parameter data is stored inside the same stream as script data, but
is encapsulated in "BIN %08X:"..."-- BIN END".
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:49 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: make frame_count_max configurable
Both through a Kconfig option and through debugfs.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:48 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: add frame struct and initial frame handling code
Now we are tracking frames correctly, but we are not accepting any data
yet. frame_current is the last of frame_stream, and the frame that we
would be writing to.
New frames are created when userspace flags the start of a new frame
with PDumpSetFrameKM. This is also where we deliberately change the
pdump content by adding two comments. One for flagging the end of the
previous frame, one for the start of the new frame.
We keep at most frame_count_max frames around, older frames will be
removed by frame_cull() which gets called when a new frame gets
created.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:47 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: add Kconfig and debugfs pdump mode handling
This adds the pvr/pdump debugfs subdirectory, and adds two files there:
mode and modes_possible. The modes_possible file is read-only and
lists the different modes (disabled, standard, full). The mode file
is where we read and set the current mode.
Kconfig now provides an option to select the initial mode pdump
is in.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:46 +0000 (15:02 +0100)]
gpu: pvr: pdumpfs: add pdumpfs_mutex
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:45 +0000 (15:02 +0100)]
gpu: pvr: pdump: move empty back-end into pvr_pdumpfs.[ch]
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:44 +0000 (15:02 +0100)]
gpu: pvr: pdump: silence sparse warnings in sgx_bridge pdump code
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:43 +0000 (15:02 +0100)]
gpu: pvr: pdump: rename PDumpMem2KM to PDumpPageTableKM
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:42 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove unused arguments
The eDeviceType passed to SysCpuPAddrToDevPAddr is not used by
SysCpuPAddrToDevPAddr at all. So stop passing eDeviceType to pdump
functions.
In the other cases, hUniqueTag is very unique indeed.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:41 +0000 (15:02 +0100)]
gpu: pvr: pdump: move pdump.c and pdump_km.h to pvr_pdump.[ch]
Also make pvr_pdump.c build fully conditional.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:40 +0000 (15:02 +0100)]
gpu: pvr: pdump: rewrite PDumpMemUM()
Now that we have cleared up the streams, we can delay the copy_from_user()
until copying into the streams. This makes PDumpMemUM highly similar to
PDumpMemKM.
So, split out the printing part from PDumpMemKM, and handle parameter
stream dumping separately for PDumpMemKM and PDumpMemUM.
In turn, this allows the removal of the separate buffer which was the
heart of pdump_common.c, which is removed as well.
No functional change.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:39 +0000 (15:02 +0100)]
gpu: pvr: pdump: sanitise stream handling
Upper level pdump calls now have pdump_print and pdump_dump to their
disposal. The former dumps strings, the second dumps raw data to
the pdump stream.
This commit also sanitises debug mode handling to have disabled,
standard and full modes only.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:38 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove page offset juggling
The offset from the start of the page never changes when changing
address spaces, just the page address changes.
If an out of place assert is removed, (as all it could change is
the address printed in an error message), then BM_GetPhysPageAddr()
takes any address, and returns the physical address of the page.
It can deal with an offset, and will return the page address
without offset.
These two facts were used to reduce the address wrangling logic even
further.
An obviously wrong masking was fixed in PDumpMem2KM.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:37 +0000 (15:02 +0100)]
gpu: pvr: pdump: clean up logic across pdump.c
This patch is the least obvious of the set. It removes useless
variables, superfluous calculations, cleans up loops, and makes a few
functions wrap others instead of copying them.
Should be no functional change, but as said, very non-obvious.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:36 +0000 (15:02 +0100)]
gpu: pvr: pdump: assume that SGX_MMU_PAGE_SIZE equals PAGE_SIZE
This way, the address mangling code becomes a lot clearer.
The following changes are made:
SGX_MMU_PAGE_SIZE -> PAGE_SIZE.
SGX_MMU_PDE_ADDR_MASK -> PAGE_MASK
~(PAGE_SIZE - 1) -> PAGE_MASK
(Address >> SGX_MMU_PAGE_SHIFT) * PAGE_SIZE -> Address & PAGE_MASK
A few functions which get SGX_MMU_PAGE_SIZE passed lose this
argument and use PAGE_SIZE internally.
No functional changes on machines where PAGE_SIZE is the same for
the host as for the sgx.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:35 +0000 (15:02 +0100)]
gpu: pvr: pdump: review use of PDumpSuspended
PDumpSuspended is handled by pdump_write() now.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:34 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove param offset handling
Currently, we are not storing any data, but in future, we will be
storing both script and param to the same stream. This removes the
need to reference the param stream from the script stream, and the
logical issues that arise from this, especially in light of frame
based storage, with frame culling happening.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:33 +0000 (15:02 +0100)]
gpu: pvr: pdump: rewrite PDumpCommentKM
And turn some standard printing where the strings starts with "--"
into comments.
No functional change.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:32 +0000 (15:02 +0100)]
gpu: pvr: pdump: rewrite PDumpWriteString2() to pdump_print()
Making pdump_print accept variable arguments directly significantly
simplifies string printing to script, throughout the whole of pdump.c
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:31 +0000 (15:02 +0100)]
gpu: pvr: pdump: reduce error propagation from pdump to userspace
When pdump logging fails, the driver should, as much as possible,
continue working. Bad arguments should however be flagged.
This allows for a rewrite of DbgWrite()/PdumpWriteILock() to pdump_write().
Also remove the parameter write in PDumpPDDevPAddrKM, this parameter data
is simply not referenced and the data sent to the script anyway.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:30 +0000 (15:02 +0100)]
gpu: pvr: pdump: move functions around to better reflect dependencies
This way, no prototypes have to be provided, and the use of PDUMP
macros is also avoided.
No functional changes.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:29 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove pdump marker code
This was used to signal to the userspace tool that the parameter stream
has grown beyond 1GB. We can handle files bigger than that in our world.
No functional change, as far as the services module is concerned.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:28 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove wrapping of globals in pdump.c
The gsDBGPdumpState struct just clutters up the place.
No functional change.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:27 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove dbgdrv
Remove now unused dbgdrv files, and set the pdump Kconfig option to bool.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:26 +0000 (15:02 +0100)]
gpu: pvr: pdump: stop depending on dbgdrvif.h
Stop including dbgdrvif.h in pdump.c and add empty skeleton for
former dbgdrv functionality.
So replace the pointer with callbacks with locally defined, mostly
empty, functions. Provide stripped down struct DBG_STREAM and define
the still referenced flags inside pdump.c.
Only functional change is that the dbgdrv module and the pdump
userspace utility are now completely useless.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:25 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove lastframe support
Userspace does not use this, so no functional change.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:24 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove unused pdump functions
Checked symbols and defines in pdump_km.h, and removed them when unused.
sparse then flagged the unused functions in pdump.c and pdump_common.c
No functional change.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:23 +0000 (15:02 +0100)]
gpu: pvr: pdump: remove unused bridge calls
Userspace never calls _PDUMP_DRIVERINFO, _PDUMP_DUMPREADREG,
_PDUMP_STARTINITPHASE, or _PDUMP_STOPINITPHASE. So remove the
respective handlers and the pdump code.
No functional change.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:22 +0000 (15:02 +0100)]
gpu: pvr: pdump: consolidate some code inside PDUMP defines
No functional changes.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Fri, 11 Mar 2011 14:02:21 +0000 (15:02 +0100)]
gpu: pvr: pdump: SYS_DATA::bPowerUpPDumped is unused
Nothing in the graphics stack uses this.
Signed-off-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Tue, 22 Mar 2011 11:38:38 +0000 (12:38 +0100)]
gpu: pvr: debugfs: add hwrec status buffer dumping
Move code over from sgxinit.c, and dump status buffers in binary format
to a debugfs file instead of sending it as %08X's to syslog.
Shares process info from the top level now, instead of acquiring this
information several times. This now also prints the caller of the
HWRecovery routine.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Tue, 22 Mar 2011 11:38:37 +0000 (12:38 +0100)]
gpu: pvr: debugfs: add hwrec edm trace
And move all edm trace printing code to pvr_debugfs.c; since now only
debugfs/pvr/edm_trace and debugfs/pvr/hwrec_edm use it.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Tue, 22 Mar 2011 11:38:36 +0000 (12:38 +0100)]
gpu: pvr: debugfs: add hwrec context dump
A full context is now provided through hwrec_mem. This includes
page directory, page tables and all mapped pages.
This code is only built when debugfs is enabled, and when build type
is "Debug".
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Tue, 22 Mar 2011 11:38:35 +0000 (12:38 +0100)]
gpu: pvr: debugfs: add hwrec register dump
Full register dump available after hwrec event in the file hwrec_regs.
The full register page is read out, except [0xA08,0xA50] as this range
results in a SIGBUS.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Tue, 22 Mar 2011 11:38:34 +0000 (12:38 +0100)]
gpu: pvr: debugfs: add initial hwrec dumping infrastructure
Currently contains hwrec_event and hwrec_time.
hwrec_event blocks the reader until a hwrec event happens. This allows
a simple shell application to sleep until a hwrec happens.
hwrec_time contains a timestamp to enable a simple shell application
to create unique dumps.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Tue, 22 Mar 2011 11:38:33 +0000 (12:38 +0100)]
gpu: pvr: move debugfs infrastructure to its own files
pvr_debug.* originally only provided some contrived code (which needs
sanitation) to do debug printing.
Future HW Recovery code will also be using debugfs and it makes sense
to lump all of them together in pvr_debugfs.*
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Mon, 14 Mar 2011 16:12:24 +0000 (18:12 +0200)]
gpu: pvr: fix error path during SGX device initialization
This also fixes some coverity reports.
Fixes: NB#233667 - Dereferencing possibly NULL pointer in sgxinit.c
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Alex Crowther [Mon, 7 Mar 2011 13:14:06 +0000 (13:14 +0000)]
gpu: pvr: disable sgx active power management while pvrtune is running
Disable sgx active power management while sgxPerfServer is running.
This enables pvrtune to run correctly without data loss.
Signed-off-by: Alex Crowther <alex.crowther@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Luc Verhaegen [Mon, 21 Feb 2011 12:07:26 +0000 (13:07 +0100)]
gpu: pvr: improve per process procfs entry/dir handling
When building with full debug, a lot of "Resource Arena" (ra) data is
being made available in the rather painful procfs, including per process
ra info, kept in process specific subdirectories.
Adding and removing process specific entries from procfs took the PID of
the currently running process; which sometimes failed during cleanup,
when the current process might no longer be anything tracked by the
driver. This then resulted in some strange behaviour, where it was
impossible to cleanup a process specific procfs directory, resulting
in an endless loop.
Since process specific procfs entries are only created in the RA code,
we now track the pid in the RA struct. When we pass this pid to
both the procfs entry creation and removal functions, we now do
reliably clean up the procfs entries.
Signed-off-by: Luc Verhaegen <libv@codethink.co.uk>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Wed, 9 Feb 2011 15:17:55 +0000 (17:17 +0200)]
gpu: pvr: dump render status buffers during SGX HW recovery
To aid debugging, dump any status buffers that are provided by the
ogles user space library for the rendering context that was active
at the time of recovery. At the moment the USSE final patched
versions of vertex and fragment shaders that were bound within the
frame causing the HWRec are provided, but later on more types can be
added.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Wed, 9 Feb 2011 07:58:13 +0000 (09:58 +0200)]
gpu: pvr: refactor dump_process_info
Split out from the function the part getting the process data based on
the current SHX HW memory context. This functionality will be needed by
an upcoming patch.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Wed, 9 Feb 2011 23:50:49 +0000 (01:50 +0200)]
gpu: pvr: remove ABI compatibility hack from SGXKick IOCTL
By now everyone should have a recent enough kernel/user space library,
so this isn't needed.
This will revert the compatibility fixup parts of the following commit:
99baad807: Increase the max number of 3D TA status vals in kick reque
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Wed, 9 Feb 2011 23:43:50 +0000 (01:43 +0200)]
gpu: pvr: remove ABI compatibility hack from SGXInitPart2 IOCTL
By now everyone should have a recent enough kernel/user space library,
so this isn't needed.
This reverts commit
743ccd092b08b1e033c0a95648033afa057887d8.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Mon, 13 Dec 2010 17:40:38 +0000 (19:40 +0200)]
gpu: pvr: print some init failure messages in release mode too
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 14 Dec 2010 00:54:24 +0000 (02:54 +0200)]
gpu: pvr: add debugfs entry to read the EDM trace
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 14 Dec 2010 00:48:37 +0000 (02:48 +0200)]
gpu: pvr: add snprint_edm_trace
Needed by an upcoming patch adding a debugfs entry to dump the trace.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Mon, 13 Dec 2010 17:40:00 +0000 (19:40 +0200)]
gpu: pvr: make debugfs available in release build too
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 14 Dec 2010 01:42:39 +0000 (03:42 +0200)]
gpu: pvr: move debugfs entries under a new pvr dir
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 14 Dec 2010 01:08:12 +0000 (03:08 +0200)]
gpu: pvr: remove runtime dependency on the EDM trace option
So that we can use the same kernel driver with user space having the
option either configured or not.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 14 Dec 2010 02:58:43 +0000 (04:58 +0200)]
gpu: pvr: fix Kconfig description for EDM tracing
We don't have a dependency on user space configuration any more, so
fix the description accordingly.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 14 Dec 2010 01:04:33 +0000 (03:04 +0200)]
gpu: pvr: make the IOCTL i/f compatible for old ABI users
The previous patch breaks the IOCTL i/f for current user space code.
This change will notice such calls based on the IOCTL parameter size and
fix up the param struct accordingly.
This patch can be reverted once applications are converted to use the new
ABI.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 14 Dec 2010 01:00:35 +0000 (03:00 +0200)]
gpu: pvr: remove build time ABI dependency on the EDM trace option
So that we can build user / kernel space independently on the EDM
tracing option being configured or not.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Carsten Valdemar Munk [Wed, 15 Dec 2010 18:57:52 +0000 (13:57 -0500)]
gpu: pvr: add slab.h include in order to make driver build on 2.6.35.3
Forward port to 2.6.35.3
Signed-off-by: Carsten Munk <carsten@maemo.org>
Ville Syrjälä [Fri, 5 Nov 2010 18:45:55 +0000 (20:45 +0200)]
gpu: pvr: Snapshot pending write ops during event request
The render sync event should only wait until write operations
that are pending when the event is requested have completed.
New operations started after requesting the event should not
delay the event delivery, nor should any read operations.
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Pauli Nieminen [Tue, 2 Nov 2010 08:40:10 +0000 (10:40 +0200)]
gpu: pvr: Expose new display events to user space
This exposes the new dss event that can be used for more fine grained
synchronization with display updates.
This change is backward compatible with old user space.
Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Fri, 15 Oct 2010 17:25:43 +0000 (20:25 +0300)]
gpu: pvr: wire in the dynamic power-down delay calculation
Support for this was added in the previous patch.
We're considering only the TA/3D and 2D blit commands to be part of a
command burst. The rest of the commands are power management related and
we can ignore them when detecting repeated burst patterns.
Fixes: NB#195379 - SGX sleep causes performance penalty
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Imre Deak [Fri, 15 Oct 2010 14:25:33 +0000 (17:25 +0300)]
gpu: pvr: add support for dynamic timing of SGX HW power down
This is needed by the next patch, which actually enables the support.
Currently the driver implements an aggressive power management policy
and powers down the HW very shortly (1 ms) after each completed command.
The resulting power-down and -up sequence between commands are relatively
long (~250usec), causing a delayed command execution and unnecessary CPU
load.
There is a deadline at the end of each display Vsync period, by which
all commands for the next frame must be completed. If the deadline is
missed FPS goes down. To increase the chance that we meet the deadline
we want to cut down on the above overhead.
One way to reduce the overhead is to get rid of the power-down/up
sequences between commands. The downside is the possibly higher power
consumption, so a solution has to minimize this side effect. Simply
increasing the power-down delay would result in a constant power
consumption increase. To see this let's consider the following two
cases given a 16 ms Vsync period.
Case a:
1. SGX command#1 for frame#N - 3 ms
2. SGX idle - 3 ms
3. SGX command#2 for frame#N - 3 ms
4. SGX idle - 3 ms
5. SGX command#3 for frame#N - 3 ms
6. SGX idle - 1 ms
7. Vsync
8. SGX command#1 for frame#N+1 - 3 ms
9. SGX idle - 3 ms
10. SGX command#2 for frame#N+1 - 3 ms
11. SGX idle - 3 ms
12. SGX command#3 for frame#N+1 - 3 ms
13. SGX idle - 1 ms
14. Vsync
... same pattern repeating for several frames
Here we need to increase the power-down delay to 4 ms, to avoid the
overhead at 2.,4.,9.,11. and to increase the chance to meet the deadlines
at 7. and 14.
Case b:
1. SGX command#1 for frame#N - 1 ms
2. SGX idle - 1 ms
3. SGX command#2 for frame#N - 1 ms
4. SGX idle - 1 ms
5. SGX command#3 for frame#N - 1 ms
6. SGX idle - 11 ms
7. Vsync
8. SGX command#1 for frame#N+1 - 1 ms
9. SGX idle - 1 ms
10. SGX command#2 for frame#N+1 - 1 ms
11. SGX idle - 1 ms
12. SGX command#3 for frame#N+1 - 1 ms
13. SGX idle - 11 ms
14. Vsync
... same pattern repeating for several frames
Here we don't have a risk of missing the deadlines, so we could
power-down immediately after 5. and 12. but we will delay the power-down
by 4 ms due to the constraint in case a. This energy waste will be
incured in each of the following frames having a similar command
scheduling pattern.
The solution in the following patch minimizes the energy waste while
achieving the original goal, by tracking "command bursts". In a burst
command execution periods are separated by idle periods of less than a
fixed amount of time (3 ms). Power-down is avoided between commands
within one burst, but it's performed immediately after the last command
of the burst. For example all commands in case a constitute one burst,
so we won't have any power-down there. In case b we have two bursts:
first burst consisting of 1.,3.,5. second burst consisting of 8.,10.,12.,
so we will power down immediately after 5. and 12.
In cases where commands are interleaved (well behaving applications)
we'll see power consumption decreasing due to the immediate power down
vs. the current 1ms delay. For other cases we might see a slight
increase in power consumption due to not powering down between commands,
but these are the very cases where we have a risk of not meeting the frame
deadlines, so the compromise looks like justified.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Imre Deak [Mon, 18 Oct 2010 17:14:25 +0000 (20:14 +0300)]
gpu: pvr: fix SysGetSGXTimingInformation for cases when the HW is off
This function doesn't do anything that requires the HW to be on, so
remove the assert about it. This will be needed by an upcoming patch,
requiring this information with HW off.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Imre Deak [Mon, 18 Oct 2010 17:14:05 +0000 (20:14 +0300)]
gpu: pvr: split out setting power down delay into its own function
This will be needed by an upcoming patch setting the power-down delay
dynamically.
No functional change.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Reviewed-by: Luc Verhaegen <Luc.Verhaegen@basyskom.de>
Imre Deak [Thu, 14 Oct 2010 12:00:04 +0000 (15:00 +0300)]
gpu: pvr: fix typo in SGXDoKickBW
This leads to the IOCTL failing in case the new structure format is used
with it. Also fixes bounds checking for the old format.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Mon, 4 Oct 2010 13:36:52 +0000 (16:36 +0300)]
gpu: pvr: remove unnecessary udelay from the HW poll loop
At the moment the HW polling loop does a 50 usec delay between
each reading of the HW flag in question. Since this delay is no
worse than just reading the HW flag continuously, get rid of it.
This will reduce the wait time from 50 usec to 25 usec in the
general case.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Thu, 30 Sep 2010 09:36:15 +0000 (12:36 +0300)]
gpu: pvr: fix locking on the HW recovery reset error path
pvr_dev_lock is unbalanced on the code path where HW recovery reset
fails.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Wed, 11 Aug 2010 13:00:12 +0000 (15:00 +0200)]
gpu: pvr: Fixed error path in cache flush function.
PVRSRVCacheFlushDRIBW returns in the error path without releasing
current->mm->mmap_sem semaphore.
The client application stalls forever and cannot be killed.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Wed, 15 Sep 2010 10:54:29 +0000 (13:54 +0300)]
gpu: pvr: Increase the max number of 3D TA status vals in kick requests
This is needed to support the to-be-added fence sync mechanism in
the user space part. The change involves an ABI change, to make
the transition smooth keep support for the old format as well.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Wed, 15 Sep 2010 10:52:32 +0000 (13:52 +0300)]
gpu: pvr: pass IOCTL in param size to dispatch func
This is needed by an upcoming patch that differentiates between
IOCTL parameter format based on it's size.
Also some ws change to silence checkpatch.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:23:36 +0000 (13:23 +0200)]
gpu: pvr: Check SysAcquireData return value.
SysAcquireData() could theoretically fail.
This patch adds missing return value check in SGXReadDiffCountersKM().
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:23:25 +0000 (13:23 +0200)]
gpu: pvr: Remove SysAcquireData call in pvr_cleanup.
Remove obsolete SysAcquireData() call.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:23:16 +0000 (13:23 +0200)]
gpu: pvr: Check OSAllocMem return value.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:23:07 +0000 (13:23 +0200)]
gpu: pvr: Check OSAllocMem return value.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:22:59 +0000 (13:22 +0200)]
gpu: pvr: Check OSAllocMem return value.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:22:50 +0000 (13:22 +0200)]
gpu: pvr: Removed needless NULL check in MMU_BIFResetPDAlloc.
pui8MemBlock cannot be NULL, so remove the check.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:22:42 +0000 (13:22 +0200)]
gpu: pvr: Remove FIRST_PHYSICAL_PFN define.
The unsigned comparison pfn >= 0 is always true.
Removed FIRST_PHYSICAL_PFN define and simplified the condition.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:22:22 +0000 (13:22 +0200)]
gpu: pvr: Check OSAllocMem return value.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:22:13 +0000 (13:22 +0200)]
gpu: pvr: Check OSAllocMem return value.
Check OSAllocMem() return value instead of checking the pointer returned
as a positional parameter.
This change makes static analysis tool happy.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:22:04 +0000 (13:22 +0200)]
gpu: pvr: Changed ReallocMem.
A static analysis tool showed a possible defect in ReallocMem() -
derefencing a null pointer. It was a false positive.
This patch slightly modifies ReallocMem() to avoid this warning.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:21:47 +0000 (13:21 +0200)]
gpu: pvr: Changed error-path condtion.
Changed the condition to equivalent but less confusing one.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:21:36 +0000 (13:21 +0200)]
gpu: pvr: Remove needless NULL check in PVRSRVWrapExtMemoryKM.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:21:27 +0000 (13:21 +0200)]
gpu: pvr: Remove needless NULL check in BM_CreateHeap.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:21:19 +0000 (13:21 +0200)]
gpu: pvr: Remove needless NULL check in WrapMemory.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:21:08 +0000 (13:21 +0200)]
gpu: pvr: Fixed formatting in buffer_manager.c
Fixed indentation and mixed code and declarations.
No functional change.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:20:52 +0000 (13:20 +0200)]
gpu: pvr: Remove needless NULL check in BM_DestroyHeap.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Janusz Sobczak [Mon, 9 Aug 2010 11:20:44 +0000 (13:20 +0200)]
gpu: pvr: Remove needless NULL check in BM_ImportMemory.
Signed-off-by: Janusz Sobczak <janusz.sobczak@imgtec.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Tue, 3 Aug 2010 10:40:32 +0000 (13:40 +0300)]
gpu: pvr: fix locking around HWRecoveryResetSGX
On the MISR / HW recovery path the pvr_dev_lock was taken twice
leading to a dead-lock. This regression was introduced by commit
ec53aaa940a4e40786eb7512b6a46ce347c95303.
Spotted-by: Luc Verhaegen <luc.verhaegen@basyskom.de>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Mon, 26 Jul 2010 19:22:07 +0000 (22:22 +0300)]
gpu: pvr: rename pvr_dvfs_lock to pvr_dev_lock
The new name better reflects what is actually protected.
No fuctional change.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Mon, 26 Jul 2010 19:22:07 +0000 (22:22 +0300)]
gpu: pvr: add dvfs lock
We need to protect the SGX HW access with a separate lock as the
pvr_lock. This is to overcome a lockdep issue between the clock
change notification lock and pvr_lock.
Fixes: NB#181087 - pvrsrvkm: possible circular locking dependency detected
Signed-off-by: Imre Deak <imre.deak@gmail.com>
Imre Deak [Tue, 27 Jul 2010 13:24:56 +0000 (16:24 +0300)]
gpu: pvr: add SGXScheduleProcessQueues to prepare for pvr_dev_lock
This will be needed to do things done in SGXScheduleProcessQueuesKM
locklessly when pvr_dev_lock is added.
No functional change.
Signed-off-by: Imre Deak <imre.deak@nokia.com>
Imre Deak [Thu, 22 Jul 2010 11:00:12 +0000 (14:00 +0300)]
gpu: pvr: omaplfb: remove unnecessary fb unblanking
This is unnecessary and is causing a lockdep problem with the DSS
driver.
Signed-off-by: Imre Deak <imre.deak@nokia.com>