graphics/omap5-sgx-ddk-linux.git
5 years agokm: Fix array-OOB issue in create_gem_wrapper master glsdk_7.01.00.03
Subhajit Paul [Tue, 23 Jun 2015 10:25:21 +0000 (15:55 +0530)]
km: Fix array-OOB issue in create_gem_wrapper

The number of pages allocated at NewAllocPagesLinuxMemArea
[eurasia_km/services4/srvkm/env/linux/mm.c] is stored in
psLinuxMemArea->ui32ByteSize.
However, the number of pages required is not at times the
same as calculated in BM_GetVirtualSize.

Its ok to allocate a bigger array of pages, but let's not
try to access the source array beyond the array bounds.

Signed-off-by: Subhajit Paul <a0132170@ti.com>
5 years agoTruncate the SGX HW recovery traces
Anand Balagopalakrishnan [Mon, 8 Jun 2015 08:33:34 +0000 (14:03 +0530)]
Truncate the SGX HW recovery traces

SGX HW recovery indicates that GPU has undergone an error in its operations and
has recovered through reset. The traces printed during HW recovery slows down
the system and is required only for in-depth debugging.

By default, disable the dumping of HW recovery traces.

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agoEnable voluntary kernel preemption option in the SGX driver
Anand Balagopalakrishnan [Mon, 23 Mar 2015 07:37:02 +0000 (13:07 +0530)]
Enable voluntary kernel preemption option in the SGX driver

SGX driver uses work queues which requires full kernel preemption. Allow SGX
driver to be built with voluntary kernel preemption.

Note that kernel scheduling  with voluntary preemption is substantially
different from full kernel preemption. Selection of preemption mode must be
done by the system integrator based on the required use cases.

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agokm: fix GEM handle memory leak glsdk_7.00.00.04
Anand Balagopalakrishnan [Tue, 10 Feb 2015 12:31:31 +0000 (18:01 +0530)]
km: fix GEM handle memory leak

When memory handles are mapped, a dummy GEM handle is created so that it can be
accepted by DRM. However, when the memory handle is unmaped, there is no
corresponding delete of  the GEM handle.

Given that each GEM handle is 4K bytes, this will result in a memory leak that
will result in application crash over time. This is not catastrophic to the
system since DRM/GEM core will cleanup the GEM handles allocated as part of the
proces when it exit.

This patch addresses the GEM handle leak in SGX driver.

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agokm: removed extra character from trace message
Anand Balagopalakrishnan [Mon, 8 Dec 2014 09:25:32 +0000 (14:55 +0530)]
km: removed extra character from trace message

This string concatenation caused compilation errors when trace was enabled.

Change-Id: I1de6870a22fe223496483e3e8b7281cf1dbeb7a2
Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agoK3.14: Changed compatibility to omap4-gpu as per the new DT
Anand Balagopalakrishnan [Sun, 7 Dec 2014 11:46:38 +0000 (17:16 +0530)]
K3.14: Changed compatibility to omap4-gpu as per the new DT

Change-Id: If81be34700c99ce938eb9ad4c440b075403bfd4c
Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agoUse omap_gem APIs for accessing private data
Anand Balagopalakrishnan [Sun, 7 Dec 2014 08:52:31 +0000 (14:22 +0530)]
Use omap_gem APIs for accessing private data

The current code accesses the private buffer from DRM object directly. Instead,
use the APIs defined in omap_gem to access the private data.

Change-Id: Ibd6c0bd9c4dfe7df4926e55ca0f28b917cbc262d
Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agoK3.14: API changes for ioremap
Anand Balagopalakrishnan [Sun, 7 Dec 2014 08:43:16 +0000 (14:13 +0530)]
K3.14: API changes for ioremap

ioremap_cached is redefined as ioremap_cache in k3.14

Change-Id: Ie539ef5da4109e1bd2d5cc589c026d833858c849
Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agoRevert "Add support for a segmented register memory map for SGX"
Anand Balagopalakrishnan [Sun, 7 Dec 2014 06:44:38 +0000 (12:14 +0530)]
Revert "Add support for a segmented register memory map for SGX"

This reverts commit 70bbb856e74feba2007ba0645ca975730afc9bd6.

Anand: K3.14 DTS file has the SGX register map defined as a single continuous
region. For K3.8/K3.12, the register map was broken down for individual
submodules of SGX

6 years agoK3.12 mmap support for sync data glsdk_6.10.00.02
Subhajit Paul [Fri, 1 Aug 2014 12:17:52 +0000 (17:47 +0530)]
K3.12 mmap support for sync data

mmap support by creating in-kernel private handles was
incorporated in a previous patch. However, handles were
created only for memory allocated inside the mmap function.

If the mmap request is made on an existing memory, create a
handle as well.

Change-Id: I3a44db65700bc0f8e08ddc438d305bf2911817fb
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
6 years agoK3.12 create a dummy gem handle for every gem allocation
Subhajit Paul [Sun, 29 Jun 2014 15:35:17 +0000 (21:05 +0530)]
K3.12 create a dummy gem handle for every gem allocation

K3.12 GEM vma features ensure that mmap on a gem is called
only if a handle is created for it. This serves the purpose
of authentication.

Since SGX creates GEM areas in KM using omap_gem_new_ext and
therefore no handles are created, mmap fails.

Lets just create a dummy handle for each gem object. Dont
bother to free it. drm_release will take care if it.

Change-Id: I2415a9a8aaf4001e558b824821a05904a2934005
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
6 years agoK3.12 fix for SGX modifying return value after gem_new
Subhajit Paul [Sun, 29 Jun 2014 14:51:26 +0000 (20:21 +0530)]
K3.12 fix for SGX modifying return value after gem_new

SGX modifies the value of buffer size after gem is created
to align it to page size. In 3.12 kernel, if gem allocation
size and vaddr start and end do not match, a mmap cannot
be done.

So why not determine how much will be the return size and
allocate a big enough gem area. Makes both parties happy.

Change-Id: I5fb99d7a479f53048ddb77bda001bf516bec5d06
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
6 years agoK3.12 update DRM_IOCTLs to reflect argument size
Subhajit Paul [Fri, 27 Jun 2014 12:12:00 +0000 (17:42 +0530)]
K3.12 update DRM_IOCTLs to reflect argument size

In the 3.12 kernel, the ioctls expect the argument size
to be present in the ioctl definition.

Change-Id: I74d0d3ecb4207f17031d5bb0636513affc036803
Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
6 years agoK3.12: Disable the warning for missing prototypes glsdk_6.10.00.01 ti_imgddk_1.9.1.0
Anand Balagopalakrishnan [Mon, 9 Jun 2014 09:38:03 +0000 (15:08 +0530)]
K3.12: Disable the warning for missing prototypes

* In K3.12, missing-prototypes warning causes compilation errors for NOP cache
* operations.
* Disable this warning

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agoK3.12: Update the driver for changes in ProcFS APIs
Anand Balagopalakrishnan [Mon, 9 Jun 2014 09:36:40 +0000 (15:06 +0530)]
K3.12: Update the driver for changes in ProcFS APIs

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
6 years agoChanged the DT compatibility to omap5 instead of omap4
Anand Balagopalakrishnan [Fri, 6 Jun 2014 06:21:16 +0000 (11:51 +0530)]
Changed the DT compatibility to omap5 instead of omap4

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agomemory leak fix for external GEM buffers dra7/k3.8 glsdk_6.04.00.02
Subhajit Paul [Tue, 11 Mar 2014 06:31:07 +0000 (12:01 +0530)]
memory leak fix for external GEM buffers

The drm_gem_objects mmaped should be dereferenced by the
respective vm_close function.

Since the DRM GEM core is not responsible for freeing up any
memory attached to the external GEM buffers, the pages array
needs to be freed up in the PVR core, after the GEM object
has been released.

Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
7 years agoDDK changes for GLSDK 6.02 ti_imgddk_1.9.0.11 ti_imgddk_1.9.0.12
Anand Balagopalakrishnan [Fri, 4 Oct 2013 13:40:40 +0000 (19:10 +0530)]
DDK changes for GLSDK 6.02

* Add the paths for omapdrm header files in Kbuild
* Add support for a segmented register memory map for SGX
* Change the module from platform driver model to DT model

Signed-off by: Subhajit Paul <subhajit_paul@ti.com>
Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoReversing the K3.8 patch
Anand Balagopalakrishnan [Fri, 4 Oct 2013 12:02:45 +0000 (17:32 +0530)]
Reversing the K3.8 patch

* this commit has gone through review comments and needs to be updated

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoUpdated README with build instructions and version information
Anand Balagopalakrishnan [Fri, 4 Oct 2013 11:57:57 +0000 (17:27 +0530)]
Updated README with build instructions and version information

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoMerge branch 'master' of git.ti.com:graphics/omap5-sgx-ddk-linux
Anand Balagopalakrishnan [Fri, 4 Oct 2013 11:48:15 +0000 (17:18 +0530)]
Merge branch 'master' of git.ti.com:graphics/omap5-sgx-ddk-linux

7 years agoAdded an eurasia_km directory to maintain the directory structure
Anand Balagopalakrishnan [Fri, 4 Oct 2013 11:46:58 +0000 (17:16 +0530)]
Added an eurasia_km directory to maintain the directory structure

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoporting to Linux-3.8.y
Subhajit Paul [Tue, 6 Aug 2013 07:22:42 +0000 (12:52 +0530)]
porting to Linux-3.8.y

Linux upstream has stopped supporting platform data
In this case, the platform driver calls probe if a
compatible platform driver is found.

This patch modifies the driver to be based entirely
on DT.

Signed-off-by: Subhajit Paul <subhajit_paul@ti.com>
7 years agoInstallation for kernel modules TI_LINUX_OMAP_SGX_DDK_1.9_2253347
Anand Balagopalakrishnan [Thu, 27 Jun 2013 15:11:23 +0000 (20:41 +0530)]
Installation for kernel modules

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoEnsure that Linux kernel has been built with preemptible kernel
Anand Balagopalakrishnan [Thu, 27 Jun 2013 14:40:16 +0000 (20:10 +0530)]
Ensure that Linux kernel has been built with preemptible kernel

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoUpdated readme to reflect OMAP5 build steps
Anand Balagopalakrishnan [Thu, 27 Jun 2013 14:39:10 +0000 (20:09 +0530)]
Updated readme to reflect OMAP5 build steps

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoAdded a git ignore
Anand Balagopalakrishnan [Thu, 27 Jun 2013 14:32:37 +0000 (20:02 +0530)]
Added a git ignore

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>
7 years agoDDK 1.9 kernel module
Anand Balagopalakrishnan [Thu, 27 Jun 2013 14:12:38 +0000 (19:42 +0530)]
DDK 1.9 kernel module

Signed-off-by: Anand Balagopalakrishnan <anandb@ti.com>