Commit c347855f authored by arnavpuranik's avatar arnavpuranik
Browse files

Merge tag 'LA.UM.8.2.r2-04900-sdm660.0' of...

Merge tag 'LA.UM.8.2.r2-04900-sdm660.0' of https://source.codeaurora.org/quic/la/kernel/msm-4.4 into serum

"LA.UM.8.2.r2-04900-sdm660.0"
parents ea8381a1 70aeacd3
/* Copyright (c) 2016-2017,2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2016-2017,2019,2021, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
......@@ -585,6 +585,7 @@ static void add_profiling_buffer(struct kgsl_device *device,
{
struct kgsl_mem_entry *entry;
struct kgsl_drawobj *drawobj = DRAWOBJ(cmdobj);
u64 start;
if (!(drawobj->flags & KGSL_DRAWOBJ_PROFILING))
return;
......@@ -601,7 +602,14 @@ static void add_profiling_buffer(struct kgsl_device *device,
gpuaddr);
if (entry != NULL) {
if (!kgsl_gpuaddr_in_memdesc(&entry->memdesc, gpuaddr, size)) {
start = id ? (entry->memdesc.gpuaddr + offset) : gpuaddr;
/*
* Make sure there is enough room in the object to store the
* entire profiling buffer object
*/
if (!kgsl_gpuaddr_in_memdesc(&entry->memdesc, gpuaddr, size) ||
!kgsl_gpuaddr_in_memdesc(&entry->memdesc, start,
sizeof(struct kgsl_drawobj_profiling_buffer))) {
kgsl_mem_entry_put(entry);
entry = NULL;
}
......@@ -614,28 +622,7 @@ static void add_profiling_buffer(struct kgsl_device *device,
return;
}
if (!id) {
cmdobj->profiling_buffer_gpuaddr = gpuaddr;
} else {
u64 off = offset + sizeof(struct kgsl_drawobj_profiling_buffer);
/*
* Make sure there is enough room in the object to store the
* entire profiling buffer object
*/
if (off < offset || off >= entry->memdesc.size) {
dev_err(device->dev,
"ignore invalid profile offset ctxt %d id %d offset %lld gpuaddr %llx size %lld\n",
drawobj->context->id, id, offset, gpuaddr, size);
kgsl_mem_entry_put(entry);
return;
}
cmdobj->profiling_buffer_gpuaddr =
entry->memdesc.gpuaddr + offset;
}
cmdobj->profiling_buffer_gpuaddr = start;
cmdobj->profiling_buf_entry = entry;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment