- 16 Aug, 2014 1 commit
-
-
Shrenuj Bansal authored
When creating a context, we add the event group much before initializing the memstore for that context. Between these events, its possible that events are registered and retired and the timestamp read in retire_events() gets us the last timestamp of the last destroyed context. This results in the processed timestamp to be greater than the actual retired timestamp in the memstore which is very problematic for us. CRs-Fixed: 640550 Change-Id: I2ace6d99e2ce417ba38f6bbbeeb787478eb4e372 Signed-off-by:
Shrenuj Bansal <shrenujb@codeaurora.org>
-
- 18 Jul, 2014 1 commit
-
-
Jeff Boody authored
Over time chery-picks for KGSL have been skipped or have been resolved differently between branches. As a result, this branch of KGSL has become increasingly difficult to maintain due to merge conflicts. With a few exceptions KGSL should match the msm-3.4 mainline exactly. To rectify the situation, this change brings KGSL up-to-date with the msm-3.4 mainline as a bulk change because cherry-picks are not practical. Change-Id: I53f9f7fbf4942e147dea486ff5dbf179af75ea8c Signed-off-by:
Jeff Boody <jboody@codeaurora.org>
-
- 24 Jun, 2014 2 commits
-
-
Suman Tatiraju authored
Add an interface to hint the user specified power constraint. User can specify a particular GPU power level or a bandwidth vote. The power constraints are per context or command batch. Power constraints are only for hinting and should be used judiciously. Change-Id: Ic10a5fff4abc88c51cd45a7d7ac58c0d4e5dcb25 Signed-off-by:
Suman Tatiraju <sumant@codeaurora.org> Signed-off-by:
Lucille Sylvester <lsylvest@codeaurora.org>
-
Jeremy Gebben authored
There is a possible race condition where the process can be going away while its debugfs 'mem' file is being read, which could cause memory corruption. CRs-Fixed: 627780 Change-Id: I697486faeb3f186fd1220d0acc1e449a4f7b77b0 Signed-off-by:
Jeremy Gebben <jgebben@codeaurora.org>
-
- 10 Mar, 2014 2 commits
-
-
Prabhat Awasthi authored
If kgsl_get_process_private() returns NULL, it goes to err_stop with result = -ENOMEM. If open_count is 0, adreno_stop() overwrites the result variable with 0. This leads to kgsl_open() to be successful while it shouldn't. Change-Id: Ic12d92a099280e4d958fa192fa5128211120d361 Signed-off-by:
Prabhat Awasthi <pawasthi@codeaurora.org>
-
Jordan Crouse authored
Restrict the maximum number of memory entries that can be specified to a single bulk cache sync call to PAGE_SIZE / sizeof(unsigned int) so that the allocation can always fit within one page. CRs-fixed: 578062 Change-Id: Ic0dedbad07e1986cd6ccc5b260ffef82b5adb6d3 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
-
- 08 Nov, 2013 3 commits
-
-
Jeff Boody authored
A race condition existed for setting the event->handle since the async event can signal at any time after it has been registered. When the event signals the reference count for the synclist and the async callback are decremented causing the event to be freed. The kgsl_cmdbatch_add_sync_fence function needs to take another reference to ensure that the handle can be set before the event is freed. Change-Id: I0d8a02246e42dce014661d6f14c685415f1704cd Signed-off-by:
Jeff Boody <jboody@codeaurora.org>
-
Jeff Boody authored
Replace the event spinlock with krefs to avoid the possiblity of calling a sleeping function while holding the spinlock and to generally make the whole cmdbatch cancel loop a lot more stable. Change-Id: I08ba54fa4c5a11c05e3503dfc6a4ee040733e5a6 Signed-off-by:
Jeff Boody <jboody@codeaurora.org> Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
-
Jeff Boody authored
The kgsl_cmdbatch_destroy function is outdated with the tip and the difference patch cannot be cherry-picked easily. Signed-off-by:
Jeff Boody <jboody@codeaurora.org>
-
- 05 Nov, 2013 6 commits
-
-
Jeremy Gebben authored
Adreno context destruction never needs the hardware on to destroy the current context. For z180, always take an active count while destroying. Since this is the last ioctl to use KGSL_IOCTL_WAKE, remove it entirely. Change-Id: I97368c7f3c28f16538cc5f48b802b681d7af96ef Signed-off-by:
Jeremy Gebben <jgebben@codeaurora.org>
-
Jeremy Gebben authored
Most of the adreno specific ioctls do not need the hardware on. The few that do are perfcounter related, it may be better at some point to optimize them further to shadow the counters when the hardware is not on rather than forcing the power on. Change-Id: I9ea83106e0aaf3d3ac8d261bdec4e4c2e21c4659 Signed-off-by:
Jeremy Gebben <jgebben@codeaurora.org>
-
Jeremy Gebben authored
Getting an active count can fail if the hardware doesn't actually wake up. Make active count get functions __mustcheck to remind people of this and fix existing calls to handle the error. Change-Id: I5a0202c824ac7e436b9061da6d8f638e44e8b7f6 Signed-off-by:
Jeremy Gebben <jgebben@codeaurora.org>
-
Jordan Crouse authored
In the mists of time it was nessesary to take an active count for waittimestamp and events because we did not want to run the risk of suspending while the GPU was active. Now that we have the dispatcher we have much better control over the GPU so the original risk is diminished. The problem is that holding active_cnt prevents us from going into nap and suspend and with server-side-sync a lot of the events we are waiting for might take a very long time before they even get dispatched on the GPU so we are essentially keeping the clocks on waiting for other people. z180 must take active count on its own. Change-Id: Ic0dedbadcb608115938b198faebe333d19c6a8f6 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
-
Jordan Crouse authored
There are situations where a submitting thread may wish to create a syncpoint on an already issued timestamp to pause a context until a previous command has been retired. Relax the restriction against submitting a sync point against one's own context and only check to make sure the user isn't submitting a syncpoint against a future timestamp (which would be an certain deadlock). Change-Id: Ic0dedbad883fc228da0d94c8416a88504f5d1377 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
-
Carter Cooper authored
Refresh the dispatcher/server-side sync code with some general fixes to functionality, stability and fault tolerance. Change-Id: Ic0dedbad48161513a2670d3949fccbdbf14b8dff Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
- 17 Oct, 2013 1 commit
-
-
Jordan Crouse authored
kgsl_active_count_wait() returns an error on failure and if it does that is a great indication that we probably don't want to go to suspend right now. Pay attention to what the function returns and do what it says. Change-Id: Ic0dedbad44cd009e5318eccc567b0c3002e88bb3 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
-
- 16 Oct, 2013 2 commits
-
-
Carter Cooper authored
If active_count_get fails, then calling active_count_put will cause the active count to become unbalanced. Fix the case in the kgsl ioctl control code that was causing in inbalance. Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Any call of kgsl_ioctl_timestamp_event wakes up gpu. In some cases (like retired timestamp) it's not necessary. Wake up gpu only if it's necessary. Change-Id: I845faf6e9c6e4c9882a68489b64223919be3d21c Signed-off-by:
Vladimir Razgulin <vrazguli@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
- 08 Oct, 2013 1 commit
-
-
Harsh Vardhan Dwivedi authored
When using MAP_FIXED flags, detect collisions with previous gpu memory entries. Fail mmap() if previous gpu entries exist. Change-Id: I09f456677e7fc81b8bdf1b2f5724569220c7e897 Signed-off-by:
Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
-
- 04 Oct, 2013 1 commit
-
-
Jordan Crouse authored
The dispatcher is put into pause during suspend to avoid commands coming in during suspend. Unfortunately the dispatcher never has a chance to unpause itself on resume so new commands sit there waiting for the GPU to turn on. Change-Id: Ic0dedbad6c9744b47fa1ae711d1b04735fa2f083 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
-
- 20 Sep, 2013 1 commit
-
-
Jordan Crouse authored
If kgsl_setup_ion() fails for whatever reason entry->priv_data may either be NULL or pointing to freed memory. In either case, this is a disaster when kgsl_destroy_ion() tries to use the unvalidated pointer. Check for NULL in kgsl_destroy_ion() and make sure that the entry->priv_data pointer is cleared on error in kgsl_setup_ion. Change-Id: Ic0dedbad6a13e2d8e15982144102517bc8f4e2e8 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org>
-
- 12 Sep, 2013 19 commits
-
-
Carter Cooper authored
Use the right length of allocation from the aligned base address of CPU virtual map to look for collision in the GPU vitual map. This prevents discarding of usable address ranges due to false collision hits. CRs-Fixed: 492041 Change-Id: I370e6a31f98803e8ca6858a5562f47afeeaa157e Signed-off-by:
Shubhraprakash Das <sadas@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Store the process private pointer in context. Earlier the process private pointer was referenced through the dev_priv pointer in the context, but the dev_priv pointer can be destroyed before the context process private so store this pointer locally. Change-Id: Ic07680b79db55d6306306bd61bda5a1288813914 Signed-off-by:
Shubhraprakash Das <sadas@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
When a context is created hold a reference to the process private structure which is referenced from within the context. The process private structure can be destroyed while some threads still have a reference to the context, this can lead to a situation where the process private pointer inside the context pointer becomes invalid. Avoid this by holding a reference to the process private structure as long as the context is around. Change-Id: Ia35629e5d027a383ed4c1378316633b4923372f7 Signed-off-by:
Shubhraprakash Das <sadas@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Check the value returned by _kgsl_context_get() and fail if appropriate. This prevents us from accidently increasing the ref count on a destroyed context. Change-Id: Ic0dedbad891842a73b1b87eb6671f9a39a275dd4 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Fix a race condition which can occur if a thread tries to acquire a reference to a mem_entry or context while another thread has already decremented the refcount to 0 and is in the process of destroying said mem_entry or context. Change-Id: I6be64ca75f9cb12b03e870b9ca83588197c64e5e Signed-off-by:
Shrenuj Bansal <shrenujb@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
There are situations where a submitting thread may wish to create a syncpoint on an already issued timestamp to pause a context until a previous command has been retired. Relax the restriction against submitting a sync point against one's own context and only check to make sure the user isn't submitting a syncpoint against a future timestamp (which would be an certain deadlock). Change-Id: Ic0dedbad883fc228da0d94c8416a88504f5d1377 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
It isn't possible to use rcu_read_lock() sections to guard access to a data structure that is refcounted with a kref. Rather than creating RCU-aware refcounts for kgsl_mem_entry as described in Documentation/RCU/rcuref.txt, just use the mem_lock to guard lookups in the idr. Change-Id: Ia0733b156fc7a9b446cb8221b9172ce9faf111e7 Signed-off-by:
Jeremy Gebben <jgebben@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
If the device is still in INIT state there are no open instances of it running. Resume calls should be no-ops. Do not attempt to start the device at this point. Change-Id: I1cb6d60581b0b5b0a2ab1b13418adc4ae3983c5e Signed-off-by:
Lucille Sylvester <lsylvest@codeaurora.org> Signed-off-by:
Ajay Dudani <adudani@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
It is possible that a context can be successfully destroyed and kgsl_release() called by an exiting application before the kernel threads have released all the users of the active count. Instead of immediately calling BUG_ON() in kgsl_release() when the active count is unexpected, wait a second to give the others time to finish up. If after a second the active count still hasn't gone where we need it to then we can assume driver error and BUG_ON(). To accomplish this, remodel kgsl_active_count_wait() to take a active_count value to "wait" for. Change-Id: Ic0dedbadcc7d0714ea14f25e2a43715e2e12c041 Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Having a separate allocated struct for the device specific context makes ownership unclear, which could lead to reference counting problems or invalid pointers. Also, duplicate members were starting to appear in adreno_context because there wasn't a safe way to reach the kgsl_context from some parts of the adreno code. This can now be done via container_of(). This change alters the lifecycle of the context->id, which is now freed when the context reference count hits zero rather than in kgsl_context_detach(). It also changes the context creation and destruction sequence. The device specific code must allocate a structure containing a struct kgsl_context and passes a pointer it to kgsl_init_context() before doing any device specific initialization. There is also a separate drawctxt_detach() callback for doing device specific cleanup. This is separate from freeing memory, which is done by the drawctxt_destroy() callback. Change-Id: I7d238476a3bfec98fd8dbc28971cf3187a81dac2 Signed-off-by:
Jeremy Gebben <jgebben@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Future chipsets may not define phys_addr_t to 32 bits hence convert all physical address variables to this type. Change-Id: I4ac5bd1aabda455456ff867c973a264f68992404 Signed-off-by:
Shubhraprakash Das <sadas@codeaurora.org> Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Make CFF capture a device specific property. This allows the control of CFF for a particular device without CFF interferance from another device. This will be useful when we have a virtual device and need to only capture CFF for the virtual device. CFF capture can only be turned on for one device at a time. Change-Id: I14c5a4442ad05327de1413d98bf795dbd196119d Signed-off-by:
Shubhraprakash Das <sadas@codeaurora.org> Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
Allow NAP on all targets. The splitting of the clock enable and disable calls into enable/prepare and disable/unprepare allows us to safely make this change for all targets. Change-Id: I03d909b86aef33631a887d159cf0a807a6d0ae75 Signed-off-by:
Lucille Sylvester <lsylvest@codeaurora.org> Signed-off-by:
Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org> Signed-off-by:
Iliyan Malchev <malchev@google.com>
-
Carter Cooper authored
Make sure we resume the GPU regardless of its current state. If the device is not in suspend state restart the device and print an error message. Change-Id: I9e71cbe27d360dc06513c54f3a734aaea5b10d2b Signed-off-by:
Suman Tatiraju <sumant@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
While creating a new process struct for kgsl, clean up resources and bail if sysfs or debugfs initialization fails. This prevents errors further down the line. CRs-fixed: 509931 Change-Id: If0857628a56eecf4855013aaf313de28ac9ad108 Signed-off-by:
Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
The earlysuspend API is gone now that proper wakelocks are upstream. Remove earlysuspend code from the kgsl driver. Change-Id: I8d264beb63b9ac92de2b25fa77916278d8882c6d Signed-off-by:
Stephen Boyd <sboyd@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
When CFF is running we cannot restart the device. This is because the simulator cannot handle device restarts in playback. Get an active count when CFF is enabled so that device is always up. Change-Id: I3214237e165e0cc23ada12f8a52361155b3c3ec1 Signed-off-by:
Shubhraprakash Das <sadas@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
This allows address space and pagetable configuration to be set from data in the mmu, such as devtree settings. Change-Id: I811b2d8bbac2613a0ea51795f7cd4b121ec203da Signed-off-by:
Jeremy Gebben <jgebben@codeaurora.org> Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-
Carter Cooper authored
In case of an error, copy back any data that KGSL might have changed on purpose. This is to prevent the user from ignoring the error and using the values that were passed in. This means that in error cases, KGSL needs to be mindful and reset certain values (such as a buffer size to 0) before returning the error to the user Change-Id: I9201ce4361c9fd1d6477f18c67f5c651e8408bd2 Signed-off-by:
Carter Cooper <ccooper@codeaurora.org>
-