replace common qcom sources with samsung ones
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022-2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
@@ -463,18 +463,11 @@ static int sendcmd(struct adreno_device *adreno_dev,
|
||||
unsigned long nsecs = 0;
|
||||
int ret;
|
||||
struct submission_info info = {0};
|
||||
int is_current_rt = rt_task(current);
|
||||
int nice = task_nice(current);
|
||||
|
||||
mutex_lock(&device->mutex);
|
||||
|
||||
/* Elevating thread’s priority to avoid context switch with holding device mutex */
|
||||
if (!is_current_rt)
|
||||
sched_set_fifo(current);
|
||||
|
||||
if (adreno_gpu_halt(adreno_dev) != 0) {
|
||||
ret = -EBUSY;
|
||||
goto err;
|
||||
mutex_unlock(&device->mutex);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
memset(&time, 0x0, sizeof(time));
|
||||
@@ -489,7 +482,8 @@ static int sendcmd(struct adreno_device *adreno_dev,
|
||||
if (ret) {
|
||||
dispatcher->inflight--;
|
||||
dispatch_q->inflight--;
|
||||
goto err;
|
||||
mutex_unlock(&device->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
set_bit(ADRENO_DISPATCHER_POWER, &dispatcher->priv);
|
||||
@@ -530,6 +524,8 @@ static int sendcmd(struct adreno_device *adreno_dev,
|
||||
|
||||
process_rt_bus_hint(device, false);
|
||||
|
||||
mutex_unlock(&device->mutex);
|
||||
|
||||
/*
|
||||
* Don't log a message in case of:
|
||||
* -ENOENT means that the context was detached before the
|
||||
@@ -543,7 +539,7 @@ static int sendcmd(struct adreno_device *adreno_dev,
|
||||
dev_err(device->dev,
|
||||
"Unable to submit command to the ringbuffer %d\n",
|
||||
ret);
|
||||
goto err;
|
||||
return ret;
|
||||
}
|
||||
|
||||
secs = time.ktime;
|
||||
@@ -578,9 +574,6 @@ static int sendcmd(struct adreno_device *adreno_dev,
|
||||
log_kgsl_cmdbatch_submitted_event(context->id, drawobj->timestamp,
|
||||
context->priority, drawobj->flags);
|
||||
|
||||
if (!is_current_rt)
|
||||
sched_set_normal(current, nice);
|
||||
|
||||
mutex_unlock(&device->mutex);
|
||||
|
||||
cmdobj->submit_ticks = time.ticks;
|
||||
@@ -607,11 +600,6 @@ static int sendcmd(struct adreno_device *adreno_dev,
|
||||
if (gpudev->preemption_schedule)
|
||||
gpudev->preemption_schedule(adreno_dev);
|
||||
return 0;
|
||||
err:
|
||||
if (!is_current_rt)
|
||||
sched_set_normal(current, nice);
|
||||
mutex_unlock(&device->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1953,7 +1941,7 @@ static int dispatcher_do_fault(struct adreno_device *adreno_dev)
|
||||
* proceed if the fault handler has already run in the IRQ thread,
|
||||
* else return early to give the fault handler a chance to run.
|
||||
*/
|
||||
if (!(fault & ADRENO_IOMMU_STALL_ON_PAGE_FAULT) && gx_on) {
|
||||
if (!(fault & ADRENO_IOMMU_PAGE_FAULT) && gx_on) {
|
||||
if (adreno_smmu_is_stalled(adreno_dev)) {
|
||||
mutex_unlock(&device->mutex);
|
||||
mutex_unlock(&adreno_dev->fault_recovery_mutex);
|
||||
@@ -2031,7 +2019,7 @@ static int dispatcher_do_fault(struct adreno_device *adreno_dev)
|
||||
gpudev->gpu_keepalive(adreno_dev, false);
|
||||
|
||||
/* Terminate the stalled transaction and resume the IOMMU */
|
||||
if (fault & ADRENO_IOMMU_STALL_ON_PAGE_FAULT)
|
||||
if (fault & ADRENO_IOMMU_PAGE_FAULT)
|
||||
kgsl_mmu_pagefault_resume(&device->mmu, true);
|
||||
|
||||
/* Reset the dispatcher queue */
|
||||
@@ -2262,6 +2250,7 @@ static void _adreno_dispatch_check_timeout(struct adreno_device *adreno_dev,
|
||||
if (drawobj->context->flags & KGSL_CONTEXT_NO_FAULT_TOLERANCE)
|
||||
return;
|
||||
|
||||
atomic_inc(&device->gpu_exception_count[GPU_TIMEOUT]);
|
||||
pr_context(device, drawobj->context, "gpu timeout ctx %u ts %u\n",
|
||||
drawobj->context->id, drawobj->timestamp);
|
||||
|
||||
@@ -2824,4 +2813,4 @@ int adreno_dispatcher_idle(struct adreno_device *adreno_dev)
|
||||
*/
|
||||
adreno_scheduler_queue(adreno_dev);
|
||||
return ret;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user