diff options
author | Roman Shaposhnikov | 2013-01-17 06:55:09 -0600 |
---|---|---|
committer | Vishal Mahaveer | 2013-02-11 09:33:27 -0600 |
commit | 010b8fc6a94a523cb1e3ba3bf0b11c11fa3b90ac (patch) | |
tree | e195d0d7718e51c43560a7b58a246570d287ac50 | |
parent | bf6979b46758018f267e8b8d6cd372b03d91823f (diff) | |
download | device-ti-proprietary-open-010b8fc6a94a523cb1e3ba3bf0b11c11fa3b90ac.tar.gz device-ti-proprietary-open-010b8fc6a94a523cb1e3ba3bf0b11c11fa3b90ac.tar.xz device-ti-proprietary-open-010b8fc6a94a523cb1e3ba3bf0b11c11fa3b90ac.zip |
SGX: Kernel side DDK source code for OMAP5
Kernel side source code for release 1.9IMG2166536_TI.0004
Change-Id: Ic84f2ac388a243d209f5395c21b8cf191ea5a775
Signed-off-by: Roman Shaposhnikov <x0166637@ti.com>
7 files changed, 39 insertions, 77 deletions
diff --git a/omap5/sgx/Android.mk b/omap5/sgx/Android.mk index 867c3b8..3cf4f59 100644 --- a/omap5/sgx/Android.mk +++ b/omap5/sgx/Android.mk | |||
@@ -94,28 +94,28 @@ $$(LOCAL_BUILT_MODULE) : $$(img-sgx.untarred_timestamp) | $$(ACP) | |||
94 | endef | 94 | endef |
95 | 95 | ||
96 | prebuilt_sgx_vendor_libs := \ | 96 | prebuilt_sgx_vendor_libs := \ |
97 | lib/libIMGegl_SGX544_105.so \ | 97 | lib/libIMGegl_SGX544_116.so \ |
98 | lib/libglslcompiler_SGX544_105.so \ | 98 | lib/libglslcompiler_SGX544_116.so \ |
99 | lib/libusc_SGX544_105.so \ | 99 | lib/libusc_SGX544_116.so \ |
100 | lib/libPVRScopeServices_SGX544_105.so \ | 100 | lib/libPVRScopeServices_SGX544_116.so \ |
101 | lib/libsrv_um_SGX544_105.so \ | 101 | lib/libsrv_um_SGX544_116.so \ |
102 | lib/hw/gralloc.omap5.so \ | 102 | lib/hw/gralloc.omap5.so \ |
103 | lib/libpvrANDROID_WSEGL_SGX544_105.so \ | 103 | lib/libpvrANDROID_WSEGL_SGX544_116.so \ |
104 | lib/libpvr2d_SGX544_105.so \ | 104 | lib/libpvr2d_SGX544_116.so \ |
105 | lib/libsrv_init_SGX544_105.so \ | 105 | lib/libsrv_init_SGX544_116.so \ |
106 | lib/egl/libGLESv1_CM_POWERVR_SGX544_105.so \ | 106 | lib/egl/libGLESv1_CM_POWERVR_SGX544_116.so \ |
107 | lib/egl/libGLESv2_POWERVR_SGX544_105.so \ | 107 | lib/egl/libGLESv2_POWERVR_SGX544_116.so \ |
108 | lib/egl/libEGL_POWERVR_SGX544_105.so | 108 | lib/egl/libEGL_POWERVR_SGX544_116.so |
109 | 109 | ||
110 | prebuilt_sgx_vendor_bins := \ | 110 | prebuilt_sgx_vendor_bins := \ |
111 | bin/pvrsrvinit \ | 111 | bin/pvrsrvinit \ |
112 | bin/pvrsrvctl_SGX544_105 | 112 | bin/pvrsrvctl_SGX544_116 |
113 | 113 | ||
114 | prebuilt_sgx_vendor_etc := \ | 114 | prebuilt_sgx_vendor_etc := \ |
115 | etc/powervr.ini | 115 | etc/powervr.ini |
116 | 116 | ||
117 | prebuilt_sgx_vendor_km := \ | 117 | prebuilt_sgx_vendor_km := \ |
118 | modules/pvrsrvkm_sgx544_105.ko | 118 | modules/pvrsrvkm_sgx544_116.ko |
119 | 119 | ||
120 | prebuilt_sgx_modules := \ | 120 | prebuilt_sgx_modules := \ |
121 | $(foreach _file,$(prebuilt_sgx_vendor_libs) $(prebuilt_sgx_vendor_bins) $(prebuilt_sgx_vendor_etc) $(prebuilt_sgx_vendor_km),\ | 121 | $(foreach _file,$(prebuilt_sgx_vendor_libs) $(prebuilt_sgx_vendor_bins) $(prebuilt_sgx_vendor_etc) $(prebuilt_sgx_vendor_km),\ |
diff --git a/omap5/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile b/omap5/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile index b034ea0..2b37cb3 100644 --- a/omap5/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile +++ b/omap5/sgx_src/eurasia_km/eurasiacon/build/linux2/omap4430_android/Makefile | |||
@@ -52,6 +52,13 @@ else ifeq ($(TARGET_SGX),544) | |||
52 | SGX_FEATURE_MP := 1 | 52 | SGX_FEATURE_MP := 1 |
53 | SGX_FEATURE_SYSTEM_CACHE := 1 | 53 | SGX_FEATURE_SYSTEM_CACHE := 1 |
54 | SGX_FEATURE_MP_CORE_COUNT := 2 | 54 | SGX_FEATURE_MP_CORE_COUNT := 2 |
55 | else ifeq ($(TARGET_SGX),544es2) | ||
56 | SGXCORE := 544 | ||
57 | SGX_CORE_REV := 116 | ||
58 | HAL_VARIANT := omap5 | ||
59 | SGX_FEATURE_MP := 1 | ||
60 | SGX_FEATURE_SYSTEM_CACHE := 1 | ||
61 | SGX_FEATURE_MP_CORE_COUNT := 2 | ||
55 | else | 62 | else |
56 | #default config | 63 | #default config |
57 | SGXCORE := 540 | 64 | SGXCORE := 540 |
diff --git a/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c b/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c index 2acd28d..dae4946 100644 --- a/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c +++ b/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxpower.c | |||
@@ -359,7 +359,11 @@ PVRSRV_ERROR SGXPrePowerState (IMG_HANDLE hDevHandle, | |||
359 | } | 359 | } |
360 | #endif /* NO_HARDWARE */ | 360 | #endif /* NO_HARDWARE */ |
361 | 361 | ||
362 | psDevInfo->bSGXIdle = IMG_TRUE; | 362 | if (psDevInfo->bSGXIdle == IMG_FALSE) |
363 | { | ||
364 | psDevInfo->bSGXIdle = IMG_TRUE; | ||
365 | SysSGXIdleEntered(); | ||
366 | } | ||
363 | 367 | ||
364 | #if defined(PDUMP) | 368 | #if defined(PDUMP) |
365 | PDUMPCOMMENT("TA/3D CCB Control - Wait for power event on uKernel."); | 369 | PDUMPCOMMENT("TA/3D CCB Control - Wait for power event on uKernel."); |
diff --git a/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c b/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c index 227675d..d5cb3c1 100644 --- a/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c +++ b/omap5/sgx_src/eurasia_km/services4/srvkm/devices/sgx/sgxutils.c | |||
@@ -172,9 +172,11 @@ IMG_VOID SGXTestActivePowerEvent (PVRSRV_DEVICE_NODE *psDeviceNode, | |||
172 | ((psSGXHostCtl->ui32InterruptFlags & PVRSRV_USSE_EDM_INTERRUPT_IDLE) != 0)) | 172 | ((psSGXHostCtl->ui32InterruptFlags & PVRSRV_USSE_EDM_INTERRUPT_IDLE) != 0)) |
173 | { | 173 | { |
174 | psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_IDLE; | 174 | psSGXHostCtl->ui32InterruptClearFlags |= PVRSRV_USSE_EDM_INTERRUPT_IDLE; |
175 | psDevInfo->bSGXIdle = IMG_TRUE; | 175 | if (psDevInfo->bSGXIdle == IMG_FALSE) |
176 | 176 | { | |
177 | SysSGXIdleEntered(); | 177 | psDevInfo->bSGXIdle = IMG_TRUE; |
178 | SysSGXIdleEntered(); | ||
179 | } | ||
178 | } | 180 | } |
179 | 181 | ||
180 | /* | 182 | /* |
@@ -709,9 +711,6 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE *psDeviceNode, | |||
709 | /* Note that a power-up has been dumped in the init phase. */ | 711 | /* Note that a power-up has been dumped in the init phase. */ |
710 | PDUMPSUSPEND(); | 712 | PDUMPSUSPEND(); |
711 | 713 | ||
712 | SysSGXCommandPending(psDevInfo->bSGXIdle); | ||
713 | psDevInfo->bSGXIdle = IMG_FALSE; | ||
714 | |||
715 | /* Ensure that SGX is powered up before kicking the ukernel. */ | 714 | /* Ensure that SGX is powered up before kicking the ukernel. */ |
716 | eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.ui32DeviceIndex, | 715 | eError = PVRSRVSetDevicePowerStateKM(psDeviceNode->sDevId.ui32DeviceIndex, |
717 | PVRSRV_DEV_POWER_STATE_ON); | 716 | PVRSRV_DEV_POWER_STATE_ON); |
@@ -729,6 +728,9 @@ PVRSRV_ERROR SGXScheduleCCBCommandKM(PVRSRV_DEVICE_NODE *psDeviceNode, | |||
729 | return eError; | 728 | return eError; |
730 | } | 729 | } |
731 | 730 | ||
731 | SysSGXCommandPending(psDevInfo->bSGXIdle); | ||
732 | psDevInfo->bSGXIdle = IMG_FALSE; | ||
733 | |||
732 | eError = SGXScheduleCCBCommand(psDeviceNode, eCmdType, psCommandData, ui32CallerID, ui32PDumpFlags, hDevMemContext, bLastInScene); | 734 | eError = SGXScheduleCCBCommand(psDeviceNode, eCmdType, psCommandData, ui32CallerID, ui32PDumpFlags, hDevMemContext, bLastInScene); |
733 | 735 | ||
734 | PVRSRVPowerUnlock(ui32CallerID); | 736 | PVRSRVPowerUnlock(ui32CallerID); |
diff --git a/omap5/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_userspace.c b/omap5/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_userspace.c index 5ff0dd0..aff6087 100644 --- a/omap5/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_userspace.c +++ b/omap5/sgx_src/eurasia_km/services4/system/omap4/sgxfreq_userspace.c | |||
@@ -20,26 +20,17 @@ | |||
20 | 20 | ||
21 | static int userspace_start(struct sgxfreq_sgx_data *data); | 21 | static int userspace_start(struct sgxfreq_sgx_data *data); |
22 | static void userspace_stop(void); | 22 | static void userspace_stop(void); |
23 | static void userspace_sgx_clk_on(void); | ||
24 | static void userspace_sgx_clk_off(void); | ||
25 | static void userspace_sgx_active(void); | ||
26 | static void userspace_sgx_idle(void); | ||
27 | 23 | ||
28 | 24 | ||
29 | static struct sgxfreq_governor userspace_gov = { | 25 | static struct sgxfreq_governor userspace_gov = { |
30 | .name = "userspace", | 26 | .name = "userspace", |
31 | .gov_start = userspace_start, | 27 | .gov_start = userspace_start, |
32 | .gov_stop = userspace_stop, | 28 | .gov_stop = userspace_stop, |
33 | .sgx_clk_on = userspace_sgx_clk_on, | ||
34 | .sgx_clk_off = userspace_sgx_clk_off, | ||
35 | .sgx_active = userspace_sgx_active, | ||
36 | .sgx_idle = userspace_sgx_idle, | ||
37 | }; | 29 | }; |
38 | 30 | ||
39 | 31 | ||
40 | static struct userspace_data { | 32 | static struct userspace_data { |
41 | unsigned long freq_user; /* in KHz */ | 33 | unsigned long freq_user; /* in Hz */ |
42 | struct mutex mutex; | ||
43 | } usd; | 34 | } usd; |
44 | 35 | ||
45 | 36 | ||
@@ -65,15 +56,11 @@ static ssize_t store_frequency_set(struct device *dev, | |||
65 | if (ret != 1) | 56 | if (ret != 1) |
66 | return -EINVAL; | 57 | return -EINVAL; |
67 | 58 | ||
68 | mutex_lock(&odd.mutex); | ||
69 | |||
70 | if (freq > sgxfreq_get_freq_max()) | 59 | if (freq > sgxfreq_get_freq_max()) |
71 | freq = sgxfreq_get_freq_max(); | 60 | freq = sgxfreq_get_freq_max(); |
72 | usd.freq_user = sgxfreq_set_freq_request(freq); | 61 | usd.freq_user = sgxfreq_set_freq_request(freq); |
73 | trace_printk("USERSPACE: new freq=%luHz.\n", usd.freq_user); | 62 | trace_printk("USERSPACE: new freq=%luHz.\n", usd.freq_user); |
74 | 63 | ||
75 | mutex_unlock(&odd.mutex); | ||
76 | |||
77 | return count; | 64 | return count; |
78 | } | 65 | } |
79 | 66 | ||
@@ -100,8 +87,6 @@ int userspace_init(void) | |||
100 | { | 87 | { |
101 | int ret; | 88 | int ret; |
102 | 89 | ||
103 | mutex_init(&odd.mutex); | ||
104 | |||
105 | ret = sgxfreq_register_governor(&userspace_gov); | 90 | ret = sgxfreq_register_governor(&userspace_gov); |
106 | if (ret) | 91 | if (ret) |
107 | return ret; | 92 | return ret; |
@@ -133,48 +118,7 @@ static int userspace_start(struct sgxfreq_sgx_data *data) | |||
133 | 118 | ||
134 | static void userspace_stop(void) | 119 | static void userspace_stop(void) |
135 | { | 120 | { |
136 | usd.freq_user = sgxfreq_set_freq_request(sgxfreq_get_freq_min()); | ||
137 | sysfs_remove_group(sgxfreq_kobj, &userspace_attr_group); | 121 | sysfs_remove_group(sgxfreq_kobj, &userspace_attr_group); |
138 | 122 | ||
139 | trace_printk("USERSPACE: stopped.\n"); | 123 | trace_printk("USERSPACE: stopped.\n"); |
140 | } | 124 | } |
141 | |||
142 | |||
143 | static void userspace_sgx_clk_on(void) | ||
144 | { | ||
145 | mutex_lock(&ood.mutex); | ||
146 | |||
147 | sgxfreq_set_freq_request(usd.freq_user); | ||
148 | |||
149 | mutex_unlock(&ood.mutex); | ||
150 | } | ||
151 | |||
152 | |||
153 | static void userspace_sgx_clk_off(void) | ||
154 | { | ||
155 | mutex_lock(&ood.mutex); | ||
156 | |||
157 | sgxfreq_set_freq_request(sgxfreq_get_freq_min()); | ||
158 | |||
159 | mutex_unlock(&ood.mutex); | ||
160 | } | ||
161 | |||
162 | |||
163 | static void userspace_sgx_active(void) | ||
164 | { | ||
165 | mutex_lock(&aid.mutex); | ||
166 | |||
167 | sgxfreq_set_freq_request(usd.freq_user); | ||
168 | |||
169 | mutex_unlock(&aid.mutex); | ||
170 | } | ||
171 | |||
172 | |||
173 | static void userspace_sgx_idle(void) | ||
174 | { | ||
175 | mutex_lock(&aid.mutex); | ||
176 | |||
177 | sgxfreq_set_freq_request(sgxfreq_get_freq_min()); | ||
178 | |||
179 | mutex_unlock(&aid.mutex); | ||
180 | } | ||
diff --git a/omap5/sgx_src/eurasia_km/services4/system/omap4/sysconfig.c b/omap5/sgx_src/eurasia_km/services4/system/omap4/sysconfig.c index e9fd069..175252d 100644 --- a/omap5/sgx_src/eurasia_km/services4/system/omap4/sysconfig.c +++ b/omap5/sgx_src/eurasia_km/services4/system/omap4/sysconfig.c | |||
@@ -50,7 +50,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
50 | 50 | ||
51 | #include "ocpdefs.h" | 51 | #include "ocpdefs.h" |
52 | 52 | ||
53 | #if (SGX_CORE_REV == 105) | ||
53 | #define OMAP5430_CORE_REV 0x10005 | 54 | #define OMAP5430_CORE_REV 0x10005 |
55 | #elif (SGX_CORE_REV == 116) | ||
56 | #define OMAP5430_CORE_REV 0x10106 | ||
57 | #endif | ||
54 | 58 | ||
55 | /* top level system data anchor point*/ | 59 | /* top level system data anchor point*/ |
56 | SYS_DATA* gpsSysData = (SYS_DATA*)IMG_NULL; | 60 | SYS_DATA* gpsSysData = (SYS_DATA*)IMG_NULL; |
diff --git a/omap5/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c b/omap5/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c index 1bef2ee..bae1048 100644 --- a/omap5/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c +++ b/omap5/sgx_src/eurasia_km/services4/system/omap4/sysutils_linux.c | |||
@@ -738,6 +738,7 @@ IMG_VOID SysSGXIdleEntered(IMG_VOID) | |||
738 | IMG_VOID SysSGXCommandPending(IMG_BOOL bSGXIdle) | 738 | IMG_VOID SysSGXCommandPending(IMG_BOOL bSGXIdle) |
739 | { | 739 | { |
740 | #if defined(SYS_OMAP4_HAS_DVFS_FRAMEWORK) | 740 | #if defined(SYS_OMAP4_HAS_DVFS_FRAMEWORK) |
741 | if (bSGXIdle) | ||
741 | sgxfreq_notif_sgx_active(); | 742 | sgxfreq_notif_sgx_active(); |
742 | #else | 743 | #else |
743 | PVR_UNREFERENCED_PARAMETER(bSGXIdle); | 744 | PVR_UNREFERENCED_PARAMETER(bSGXIdle); |