The driver already frees the memory in vcd_ddl.c at ddl_close(). No
need to prematurely free the memory here.
Signed-off-by: Deva Ramasubramanian <dramasub@codeaurora.org>
Disable download mode on crashes and keep system to continue
booting for better user experience. Download mode is useful for
collecting ramdump for furhter analysis during stability test.
To enable, type next line in the adb shell before stability test
echo 1 > /sys/module/restart/parameters/download_mode
Change-Id: I08c02dfd42cf28803b78385916f50ea3e42eb7ae
Signed-off-by: paris_yeh <paris_yeh@asus.com>
1.Fix the Sensitivity Problem That Suspend and Wake up When Charging.
2.Modification for Algorithm, and Digital Parameters for ER Module.
a.Improve "double fat finger (22 phi copper)" performance when charging.
Change-Id: I1f2f5697dd5587243dc77003672c9658213db4b0
Signed-off-by: mars_kao <mars_kao@asus.com>
Even if the event code specifies a dummy interupt it might still
get wrapped with the conditional check. Make sure that all forced
interrupts from the event code get fired.
Change-Id: Ic0dedbadc4599efcbca65ad93cc27943bad2ca79
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Print more IOMMU registers when a IOMMU pagefault happens which
report whether the pagefault is a read or write fault.
Change-Id: I27acafa9dcfd0c7de9056151ed1baef7dd2346df
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Lock ringbuffer virtual address translation in TLB of IOMMU. This
is required to prevent a hardware table walk from happening when
GPU executes commands that program the IOMMU registers. If a hardware
table walk happens when GPU is programming IOMMU register then it
can cause a deadlock on the bus.
Change-Id: I99428be7879a5210ba816f5f96864f94714649d7
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Update all the required timestamps when submitting commands to the
GPU ringbuffer for execution. The global timestamp was not being
updated in all the required cases. Now the global timestamp and
per context timestamp are updated if following conditions are met:
1. A valid non global context is passed
2. The context passed supports per context timestamps
3. The command submission is not from kgsl
If 3 conditions above are not met then only the global timestamp is
updated.
Change-Id: Ib4fe6fbd2ac57fbc5306377f09072f9e4c09d442
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
A kgsl user can free up an allocation of GPU memory with
kgsl_ioctl_sharedmem_free() function, but the GPU address
might still be in use resulting in a GPU page fault.
A bug of this kind is hard to find because the driver keeps
no trace of kgsl_ioctl_sharedmem_free calls.
This change implements a "memfree history" debug feture that
allows to see an information about a last couple of hundred
memory free calls in kernel/debug/kgsl/kgsl-3d0/memfree_history
file.
Change-Id: I12e0e3702db56d99d5de644739b364dea4cc37b1
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Add a type parameter to event callbacks to give tasks a way to
communicate error conditions to the callback. Current type values
are KGSL_EVENT_TIMESTAMP_RETIRED for normal timestamp expiry and
KGSL_EVENT_CANCELLED if the event is cancelled prematurely.
Change-Id: Ic0dedbad9907cd50642a604a3af562e01a4b4a3b
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Store the timestamps inside the context rather than in a
list stored in the ringbuffer. This allows for easier
maintanability as well as keeping all context data
centralized.
Change-Id: I0467d07be6c8bb9f062a81a40629c0288be7e868
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Get rid of kgsl_find_context. Use instead kgsl_context_get that does
correct RCU read locking around the itr_find and increases the
reference count on the context before returning it. This eliminates
the chance that a context will be destroyed while somebody is still
using it. Of course increased use of kgsl_context_get is accompanied
by kgsl_context_put in all the right places.
Change-Id: Ic0dedbad73d497fd9b451aefad8e5b28d33b829d
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Allow the user space to pass in a type field to indicate the
type of upper level library that owns the context. The type
field is added to all the appropriate ftrace output for easier
debugging.
Change-Id: Ic0dedbadd42fc5ccfffd89738affd4794a6ab85e
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Normally kgsl_create_context() returns a pointer to a new context.
In case of errors it just returns NULL pointer, and that doesn't allow
to propagate the right error code back to the user via
kgsl_ioctl_drawctxt_create()
This fix modifies kgsl_create_context to use ERR_PTR macro for passing
error codes to its caller.
Change-Id: I447c1765828912b0994bcae67a73864e62eef9b6
Signed-off-by: Vladimir Razgulin <vrazguli@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Before we started using tracepoints this log message was used for
debugging the critical loop. Now that we are smarter remove the
unneeded log message.
Change-Id: Ic0dedbad57d97294cf2cb3865cf25f698aaea778
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Keep track of the number of times the GPU power rails have been
cycled and provide said number to the user in the device sysfs
directory.
Change-Id: Ic0dedbad4489524a98e52b9993131257068ae2ef
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Make sure that the context is freed only after the event is deleted
from the list to avoid accessing invalid list pointers. This makes
sure that the context memory is not accessed after being freed.
Change-Id: I9196219f1472396c0063dbeaa5351f66e6e5648f
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Add tracepoints for tracking the lifespan of GPU events.
Change-Id: Ic0dedbadf99b1efcb650608c6ac664d3c4ddafd5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
It is interesting to know when and how we program the hardware so
add a tracepoint to monitor register writes. Register reads are
not traced since they are done much more frequently and are somewhat
less interesting from a debug perspective.
Change-Id: Ic0dedbad8ee85f154b9ba8731fe2c14603351243
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
In the GPU interrupt handler we attempt to clear the ts_cmp_enable
for the active context so that future interrupts are skipped until
someone needs one again. If for some reason the interrupt handler
is delayed then there is a possiblity that the "current" context in
the GPU isn't the one that fired the interrupt. In that case we
could be accidently clearing a ts_cmp_enable for a context that
needs it. Instead of clearing in the interrupt handler clear it
from the GPU so we can be sure we got the right context.
As a bonus pushing this logic to the GPU side lets us get rid of
some extra register reads/writes in the interrupt handlers.
Change-Id: Ic0dedbadbf350f7c4866092fa0686f9b42f3cd33
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Sometimes the core will go idle before the interrupt can be handled on
the GPU. If that happens then we could go to a lower power state before
cleaning up the pending interrupt and various entities that might be
waiting for it. Consider the current interrupt status when checking
for idle.
CRS-fixed: 449813
Change-Id: Ic0dedbadfd2d40e4411cf3b05e1eb4c4eecf7841
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Indirect buffers to be executed will not be (and cannot be) zero length.
Check and reject.
Change-Id: Ic0dedbadea429c4f7bd386c5e64603b51ea8af61
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
adreno_readtimestamp() would return a register value when asked to
get the KGSL_TIMESTAMP_CONSUMED value. With per-context timestamps
this no longer holds valid since the value in the register could
correspond to a different contexts timestamp. Return the start of
packet timestamp for the specified context now that the start of
timestamp values are correctly submitted.
CRs-fixed: 382888
Change-Id: Iad56d07eb4a2973a5906d989c96dd117ff902cea
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
HW workaround to resolve MMU pagefault caused by memory
freeing early before GPU completes it.
This is race condition where timestamp is getting updated
and the event handler runs before the GPU actually got done
with the timestamp, hence freeing the buffer early while GPU
still not completed with it.
Change-Id: I6d338d7dca680f57f2c39ed5a14381b261bf8bce
Signed-off-by: Anshuman Dani <adani@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Add an identifier to label internal commands being sent to the
ringbuffer. This will be used to further enable debugging
and hang recovery.
Change-Id: I4b3c10f0c3d290ae092182cbb450abe65e9dda80
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
Knowing the retired timestamp on wake-up is useful to debug hangs that
are caused due to clock instability. When we request for clock ON, the
clock may/may-not be turned ON, but we go ahead assuming it is ON. This
can be caught by printing the timestamp on wake. The timestamp we print,
can be compared against the timestamp in postmortem dump (assuming a
hang happens).
If there is a difference, we can say that GPU has run for sometime after
wake. So, we needn't suspect clocks.
If there is no difference, we can say that GPU has hung immediately after
wake. So, we can positively suspect the clocks.
Change-Id: Iedf49977adbb0e61a9b71bbe23acc81f2a75162d
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
The instruction store on A3XX GPU cores isn't really an instruction store
as on A2XX and it doesn't give us any debugging value. On top of all
that it can be unstable to read in some situations. Since it is of
questionable value and questionable stability pull it from the snapshot
for all A3XX cores and move the functionality to the A2XX specific code.
Change-Id: Ic0dedbada32d8b6b9b93768d148c2624faf3ef30
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Sakshi Agrawal <sakshia@codeaurora.org>
USB controller may access the dTD one more time after clearing the active
bit in token field. There is a possibility of software freeing it in this
window. When this happens, USB controller may access incorrect memory and
leads to system level issues.
dTDs are freed when requests are freed by function drivers during
disconnect or unbind. The above race condition will come into effect only
for zero length packets. dTDs are dynamically created for sending zero
length packets on IN endpoints. These dTDs are immediately freed after
active bit is cleared. Defer this to next dTD completion. It is safe to
assume that hardware will no longer access the previous dTD when the next
dTD is completed.
Don't allocate/free setup status phase and GET_STATUS data phase requests
dynamically. Use one request for both cases and allocate it during bind.
CRs-Fixed: 474557
Change-Id: I5d41c310e1bb35d93b5af7d90a24ce5aab24f5f9
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
On flo hardware revision C, micbias1 is not grounded with external
capacity, so it should set micbias1 capless setting as 1
(no external bypass capacity) to avoid noise.
Bug:8611206
Change-Id: I82644a9123d092490ccc0acf6cdfa68964ef9c22
Signed-off-by: sam_chen <sam_chen@asus.com>
LVS4 supplies vddio to all sensors.
set LVS4 always on per EE's request.
enable ldo17 on flo and ldo9 on deb.
Change-Id: I26825c637087aaad99a7a8c9ac673558df45d7c2
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/73528
Reviewed-by: Sam hblee <Sam_hblee@asus.com>
Tested-by: Sam hblee <Sam_hblee@asus.com>
Signed-off-by: hsuan-chih_chen <hsuan-chih_chen@asus.com>
1. CABC level 3 is the most power saving level
2. level 3 for all cases (UI and video)
buganizer number: 8514498
Change-Id: I78930ff326410ba922ec565234dde387c670967b
Signed-off-by: yetta_wu <yetta_wu@asus.com>
To restart the individual module when crash occurs
instead of whole system panic.
Change-Id: I3e2374d9a89d4778b0811457042720478aa8683e
Signed-off-by: tzuhsuan_chen <tzuhsuan_chen@asus.com>
This patch corrects a buffer overflow in kernels from 3.0 to 3.4 when calling
log_prefix() function from call_console_drivers().
This bug existed in previous releases but has been revealed with commit
162a7e7500 (2.6.39 => 3.0) that made changes
about how to allocate memory for early printk buffer (use of memblock_alloc).
It disappears with commit 7ff9554bb5 (3.4 => 3.5)
that does a refactoring of printk buffer management.
In log_prefix(), the access to "p[0]", "p[1]", "p[2]" or
"simple_strtoul(&p[1], &endp, 10)" may cause a buffer overflow as this
function is called from call_console_drivers by passing "&LOG_BUF(cur_index)"
where the index must be masked to do not exceed the buffer's boundary.
The trick is to prepare in call_console_drivers() a buffer with the necessary
data (PRI field of syslog message) to be safely evaluated in log_prefix().
This patch can be applied to stable kernel branches 3.0.y, 3.2.y and 3.4.y.
Without this patch, one can freeze a server running this loop from shell :
$ export DUMMY=`cat /dev/urandom | tr -dc '12345AZERTYUIOPQSDFGHJKLMWXCVBNazertyuiopqsdfghjklmwxcvbn' | head -c255`
$ while true do ; echo $DUMMY > /dev/kmsg ; done
The "server freeze" depends on where memblock_alloc does allocate printk buffer :
if the buffer overflow is inside another kernel allocation the problem may not
be revealed, else the server may hangs up.
Signed-off-by: Alexandre SIMON <Alexandre.Simon@univ-lorraine.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
No need to control the PMIC L17 and S4 after SR1 device.
Change-Id: Iad65971f227afb471c829c070aea5da46ed44e38
Signed-off-by: mars_kao <mars_kao@asus.com>
If connect slimport and boot device, the screen would not show because
slimport detect pin is 1 already. No interrupt to trigger slimport
detect and show.
Change-Id: Id53d23d7ae71588d5679ee87c560442d49468e00
Signed-off-by: yetta_wu <yetta_wu@asus.com>
1. Remove the gpio 26 config in board-flo-pmic.c
since this gpio is already config as PWM function in LK.
2. Add pwm_init function implementation.
3. Config backlight level in pm8xxx_led_probe(), and remove the
pwm_request() part in panel probe function.
Change-Id: I3ce71a9c792ce155bebabd80a24a8ff8fc361ae9
Signed-off-by: yetta_wu <yetta_wu@asus.com>
1. use mipi command backlight after ER2 hw_id=(1,1)
2. also port cabc, but not turn on yet
3. separate command and backlight "first" parameter
Change-Id: Ie9a2d2d87ab75c2c710c47cf17b7ed1550431e76
Signed-off-by: yetta_wu <yetta_wu@asus.com>
If there had no any pipe blending stage changes, then do not
call belnding set up to avoid unnecessary warning messges.
CRs-fixed: 467556
Change-Id: I07520b3b0917375c41405e736dcb9eb8a3daddc1
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Clean up the blending rule to follow blend_op set from hwc.
Use modulate alpha for plane alpha when it is not 0xff.
Keep backward compatibility if blend_op is not set.
Change-Id: I02fd3c3c7b5ace2e6eec22b2db0284161404a0fc
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Send request to a work queue and return right away.
Work queue will go through the commit queue to do the
rotation. wait_for_finish can be set to true to make
rotation go back to blocking.
Change-Id: Ifc2e36bd24d9681d42105f4ccbb62a8777af2a6c
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Add MSM_ROTATOR_IOCTL_BUFFER_SYNC ioctl interface.
Rotator will create a timeline for each session at START, wait for
input fence and create released fence in this ioctl call,
signal the timeline after rotation is done.
Change-Id: I3738f8287d804ccd94e0a16ac0afb8b41b299c75
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
When rotator session reach maximum, it should exit without calling
put_img since no get_img had been called.
CRs-fixed: 466462
Change-Id: I951570227ebd81da6dad19c1b897cde84f8d0451
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Currently, if framework is rebooted while in suspend mode, borderfill
is not unset due to which MDP composition can not be enabled. This patch
fixes the issue.
Change-Id: I8b671eccedebf2bb08724cf2d284d4ab27a71360
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
Conflicts:
drivers/video/msm/msm_fb.c
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Currently when 2/3/4 layer bypass is enabled, doing a adb shell
stop/start is failing overlay and composition happens through
GPU. Fix this issue by proper overlay configuration during this
scenario.
Change-Id: Ia04f1839bf80ed552671e48445af63a4dcd6bdfd
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
initialize pinmux setup for keypad pins on all hardware revisions
Change-Id: I788f8cf5731da085abf2c5242f9eb580cca4778a
Signed-off-by: paris_yeh <paris_yeh@asus.com>
A011 is the lastest touch firmware and used for factory image.
firmware update history:
A009:
Update boot-code Ver: 60.47 (Do not turn off WDT in IAP process).
Add Self Check Mechanism to enter suspend mode.
Modification Algorithm, and Digital Parameters for ER Module.
a. Improve "double fat finger (22 phi copper)" performance.
b. Improve "fast drawing straight line" performance.
c. Improve "multi-finger in co-axis (8 phi copper)" performance.
d. Improve "under table lamp" performance.
A010:
Modify Calibration Mechanism.
A011:
Modify Open/Short Calibration Mechanism for ESD problem.
Improve Stylus Performance
Change-Id: I4e87e9cc69d81872106c7f7bd95b76dd1f1811c1
Signed-off-by: mars_kao <mars_kao@asus.com>